Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this file.

"files.associations": {
"*.tcc": "cpp",
"functional": "cpp",
"string_view": "cpp",
"random": "cpp",
"istream": "cpp",
"limits": "cpp",
"algorithm": "cpp",
"bit": "cpp",
"numeric": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"array": "cpp",
"atomic": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"optional": "cpp",
"string": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"new": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp",
"compare": "cpp",
"concepts": "cpp",
"numbers": "cpp",
"map": "cpp",
"set": "cpp"
}
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ LD_FLAGS = -L /usr/local/lib -l $(GTEST_LIB) -l pthread
all : test bench

$(TESTDIR)/%.o : $(TESTDIR)/%.cpp $(SRCS)
$(CXX) -march=icelake-client -O3 $(CXXFLAGS) -c $< -o $@
$(CXX) -march=icelake-client -O3 $(CXXFLAGS) -l $(GTEST_LIB) -c $< -o $@

test: $(TESTDIR)/main.cpp $(TESTOBJS) $(SRCS)
$(CXX) tests/main.cpp $(TESTOBJS) $(CXXFLAGS) $(LD_FLAGS) -o testexe
$(CXX) tests/main.cpp $(TESTOBJS) $(CXXFLAGS) $(LD_FLAGS) -o testexe

bench: $(BENCHDIR)/main.cpp $(SRCS)
$(CXX) $(BENCHDIR)/main.cpp $(CXXFLAGS) -march=icelake-client -O3 -o benchexe
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bench.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ std::tuple<uint64_t, uint64_t> bench_sort(const std::vector<T> arr,
uint64_t start(0), end(0);
for (uint64_t ii = 0; ii < iters; ++ii) {
start = cycles_start();
avx512_qsort<T>(arr_bckup.data(), arr_bckup.size());
avx512_qsort<T>(arr_bckup.data(), NULL, arr_bckup.size());
end = cycles_end();
runtimes1.emplace_back(end - start);
arr_bckup = arr;
Expand Down
4 changes: 2 additions & 2 deletions src/avx512-16bit-qsort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ qsort_16bit_(type_t *arr, int64_t left, int64_t right, int64_t max_iters)
}

template <>
void avx512_qsort(int16_t *arr, int64_t arrsize)
inline void avx512_qsort(int16_t *arr,uint64_t *indexes, int64_t arrsize)
{
if (arrsize > 1) {
qsort_16bit_<zmm_vector<int16_t>, int16_t>(
Expand All @@ -493,7 +493,7 @@ void avx512_qsort(int16_t *arr, int64_t arrsize)
}

template <>
void avx512_qsort(uint16_t *arr, int64_t arrsize)
inline void avx512_qsort(uint16_t *arr,uint64_t *indexes, int64_t arrsize)
{
if (arrsize > 1) {
qsort_16bit_<zmm_vector<uint16_t>, uint16_t>(
Expand Down
6 changes: 3 additions & 3 deletions src/avx512-32bit-qsort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ replace_inf_with_nan(float *arr, int64_t arrsize, int64_t nan_count)
}

template <>
void avx512_qsort<int32_t>(int32_t *arr, int64_t arrsize)
inline void avx512_qsort<int32_t>(int32_t *arr,uint64_t *indexes, int64_t arrsize)
{
if (arrsize > 1) {
qsort_32bit_<zmm_vector<int32_t>, int32_t>(
Expand All @@ -693,7 +693,7 @@ void avx512_qsort<int32_t>(int32_t *arr, int64_t arrsize)
}

template <>
void avx512_qsort<uint32_t>(uint32_t *arr, int64_t arrsize)
inline void avx512_qsort<uint32_t>(uint32_t *arr,uint64_t *indexes, int64_t arrsize)
{
if (arrsize > 1) {
qsort_32bit_<zmm_vector<uint32_t>, uint32_t>(
Expand All @@ -702,7 +702,7 @@ void avx512_qsort<uint32_t>(uint32_t *arr, int64_t arrsize)
}

template <>
void avx512_qsort<float>(float *arr, int64_t arrsize)
inline void avx512_qsort<float>(float *arr,uint64_t *indexes, int64_t arrsize)
{
if (arrsize > 1) {
int64_t nan_count = replace_nan_with_inf(arr, arrsize);
Expand Down
Loading