Download programs/pointer_chase.c from callensxavier/v10c-dqn-compiler-optimization: direct link, hf CLI and curl.
- Browser
- Download file 299 Bytes
-
https://huggingface.co/callensxavier/v10c-dqn-compiler-optimization/resolve/main/programs/pointer_chase.c
- Command line
-
hf download hf://callensxavier/v10c-dqn-compiler-optimization/programs/pointer_chase.c
-
curl -L -o pointer_chase.c https://huggingface.co/callensxavier/v10c-dqn-compiler-optimization/resolve/main/programs/pointer_chase.c
299 Bytes
| int main() { | |
| int *arr = malloc(10000000 * sizeof(int)); | |
| for (int i = 0; i < 10000000; i++) arr[i] = rand(); | |
| int sum = 0; | |
| for (int i = 0; i < 10000000; i++) sum += arr[arr[i] % 10000000]; | |
| printf("%d\n", sum); | |
| free(arr); | |
| return 0; | |
| } | |