Skip to content

Commit 2f397e4

Browse files
author
Raghuveer Devulapalli
committed
Add avx2 to examples
1 parent 3a3baae commit 2f397e4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

examples/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CXX ?= g++-12
22
CFLAGS = -I../src -std=c++17 -O3
3-
EXE = argsort kvsort qsortfp16 qsort16 qsort32 qsort64
3+
EXE = qsort32avx2 argsort kvsort qsortfp16 qsort16 qsort32 qsort64
44

55
default: all
66
all : $(EXE)
@@ -14,6 +14,9 @@ qsort16: avx512-16bit-qsort.cpp
1414
qsort32: avx512-32bit-qsort.cpp
1515
$(CXX) -o qsort32 -march=skylake-avx512 $(CFLAGS) avx512-32bit-qsort.cpp
1616

17+
qsort32avx2: avx2-32bit-qsort.cpp
18+
$(CXX) -o qsort32avx2 -march=haswell $(CFLAGS) avx2-32bit-qsort.cpp
19+
1720
qsort64: avx512-64bit-qsort.cpp
1821
$(CXX) -o qsort64 -march=skylake-avx512 $(CFLAGS) avx512-64bit-qsort.cpp
1922

examples/avx2-32bit-qsort.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "avx2-32bit-qsort.hpp"
2+
3+
int main() {
4+
const int size = 1000;
5+
float arr[size];
6+
avx2_qsort(arr, size);
7+
avx2_qselect(arr, 10, size);
8+
avx2_partial_qsort(arr, 10, size);
9+
return 0;
10+
}

0 commit comments

Comments
 (0)