Skip to content

Commit

Permalink
Fix more compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
r-devulap committed Sep 6, 2023
1 parent 77c8f1e commit 441eb5a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/avx512-common-qsort.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
#ifdef _MSC_VER
#define X86_SIMD_SORT_INLINE static inline
#define X86_SIMD_SORT_FINLINE static __forceinline
#define LIKELY(x)
#define UNLIKELY(x)
#define LIKELY(x) (x)
#define UNLIKELY(x) (x)
#elif defined(__CYGWIN__)
/*
* Force inline in cygwin to work around a compiler bug. See
Expand All @@ -90,8 +90,8 @@
#else
#define X86_SIMD_SORT_INLINE static
#define X86_SIMD_SORT_FINLINE static
#define LIKELY(x)
#define UNLIKELY(x)
#define LIKELY(x) (x)
#define UNLIKELY(x) (x)
#endif

#if __GNUC__ >= 8
Expand Down
10 changes: 5 additions & 5 deletions tests/test-qsortfp16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TEST(avx512_qsort_float16, test_arrsizes)

for (size_t ii = 0; ii < arrsizes.size(); ++ii) {
/* Random array */
for (size_t jj = 0; jj < arrsizes[ii]; ++jj) {
for (auto jj = 0; jj < arrsizes[ii]; ++jj) {
_Float16 temp = (float)rand() / (float)(RAND_MAX);
arr.push_back(temp);
sortedarr.push_back(temp);
Expand Down Expand Up @@ -86,7 +86,7 @@ TEST(avx512_qselect_float16, test_arrsizes)

for (size_t ii = 0; ii < arrsizes.size(); ++ii) {
/* Random array */
for (size_t jj = 0; jj < arrsizes[ii]; ++jj) {
for (auto jj = 0; jj < arrsizes[ii]; ++jj) {
_Float16 temp = (float)rand() / (float)(RAND_MAX);
arr.push_back(temp);
sortedarr.push_back(temp);
Expand Down Expand Up @@ -129,23 +129,23 @@ TEST(avx512_partial_qsort_float16, test_ranges)
std::vector<_Float16> psortedarr;

/* Random array */
for (size_t ii = 0; ii < arrsize; ++ii) {
for (auto ii = 0; ii < arrsize; ++ii) {
_Float16 temp = (float)rand() / (float)(RAND_MAX);
arr.push_back(temp);
sortedarr.push_back(temp);
}
/* Sort with std::sort for comparison */
std::sort(sortedarr.begin(), sortedarr.end());

for (size_t ii = 0; ii < nranges; ++ii) {
for (auto ii = 0; ii < nranges; ++ii) {
psortedarr = arr;

int k = get_uniform_rand_array<int64_t>(1, arrsize, 1).front();

/* Sort the range and verify all the required elements match the presorted set */
avx512_partial_qsort<_Float16>(
psortedarr.data(), k, psortedarr.size());
for (size_t jj = 0; jj < k; jj++) {
for (auto jj = 0; jj < k; jj++) {
ASSERT_EQ(sortedarr[jj], psortedarr[jj]);
}

Expand Down

0 comments on commit 441eb5a

Please sign in to comment.