Skip to content

Commit fb5000a

Browse files
committed
Don't compile AVX2 functions when building without AVX2 support
1 parent 82bb648 commit fb5000a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

exllamav2/exllamav2_ext/cpp/sampling_avx2.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
#include <chrono>
1010
#include <map>
1111
#include "avx2_target.h"
12-
#include "avx_mathfun.h"
1312
#include "profiling.h"
1413

14+
#ifdef USE_AVX2
15+
#include "avx_mathfun.h"
16+
#endif
17+
1518
AVX2_TARGET
1619
int softmax_cpu_avx2
1720
(
@@ -23,6 +26,10 @@ int softmax_cpu_avx2
2326
float* output
2427
)
2528
{
29+
#ifndef USE_AVX2
30+
return 0;
31+
#else
32+
2633
profile_start("softmax_cpu (AVX2)");
2734

2835
int vocab_size_aligned = ((vocab_size + 31) / 32) * 32;
@@ -141,4 +148,5 @@ int softmax_cpu_avx2
141148
// }
142149
// printf("sum: %f\n\n", summ);
143150
return maxi;
151+
#endif
144152
}

0 commit comments

Comments
 (0)