Download gemma.cpp/build/_deps/benchmark-src/cmake/pthread_affinity.cpp from ZeroWw/gemma-2-9b-SBS: direct link, hf CLI and curl.
- Browser
- Download file 389 Bytes
-
https://huggingface.co/ZeroWw/gemma-2-9b-SBS/resolve/main/gemma.cpp/build/_deps/benchmark-src/cmake/pthread_affinity.cpp
- Command line
-
hf download hf://ZeroWw/gemma-2-9b-SBS/gemma.cpp/build/_deps/benchmark-src/cmake/pthread_affinity.cpp
-
curl -L -o pthread_affinity.cpp https://huggingface.co/ZeroWw/gemma-2-9b-SBS/resolve/main/gemma.cpp/build/_deps/benchmark-src/cmake/pthread_affinity.cpp
389 Bytes
| int main() { | |
| cpu_set_t set; | |
| CPU_ZERO(&set); | |
| for (int i = 0; i < CPU_SETSIZE; ++i) { | |
| CPU_SET(i, &set); | |
| CPU_CLR(i, &set); | |
| } | |
| pthread_t self = pthread_self(); | |
| int ret; | |
| ret = pthread_getaffinity_np(self, sizeof(set), &set); | |
| if (ret != 0) return ret; | |
| ret = pthread_setaffinity_np(self, sizeof(set), &set); | |
| if (ret != 0) return ret; | |
| return 0; | |
| } | |