File size: 577 Bytes
97c3d9a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

echo "Compiling PRIME C Inference Kernel..."

# -O3: Maximum optimization
# -march=native: Enable architecture-specific instructions (AVX2/AVX-512)
# -fopenmp: Enable OpenMP parallelization loops
# -ffast-math: Allow aggressive math optimizations (safe for our simple MAC loop)

gcc -O3 -march=native -mavx512f -mavx512bw -mavx512dq -fopenmp -ffast-math prime_kernel.c test_prime_kernel.c -o prime_benchmark -lm

if [ $? -eq 0 ]; then
    echo "Compilation successful. Running benchmark..."
    echo ""
    ./prime_benchmark
else
    echo "Compilation failed."
fi