Skip to content

Commit 441eb5a

Browse files
author
Raghuveer Devulapalli
committed
Fix more compiler warnings
1 parent 77c8f1e commit 441eb5a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/avx512-common-qsort.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
#ifdef _MSC_VER
7474
#define X86_SIMD_SORT_INLINE static inline
7575
#define X86_SIMD_SORT_FINLINE static __forceinline
76-
#define LIKELY(x)
77-
#define UNLIKELY(x)
76+
#define LIKELY(x) (x)
77+
#define UNLIKELY(x) (x)
7878
#elif defined(__CYGWIN__)
7979
/*
8080
* Force inline in cygwin to work around a compiler bug. See
@@ -90,8 +90,8 @@
9090
#else
9191
#define X86_SIMD_SORT_INLINE static
9292
#define X86_SIMD_SORT_FINLINE static
93-
#define LIKELY(x)
94-
#define UNLIKELY(x)
93+
#define LIKELY(x) (x)
94+
#define UNLIKELY(x) (x)
9595
#endif
9696

9797
#if __GNUC__ >= 8

tests/test-qsortfp16.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ TEST(avx512_qsort_float16, test_arrsizes)
2121

2222
for (size_t ii = 0; ii < arrsizes.size(); ++ii) {
2323
/* Random array */
24-
for (size_t jj = 0; jj < arrsizes[ii]; ++jj) {
24+
for (auto jj = 0; jj < arrsizes[ii]; ++jj) {
2525
_Float16 temp = (float)rand() / (float)(RAND_MAX);
2626
arr.push_back(temp);
2727
sortedarr.push_back(temp);
@@ -86,7 +86,7 @@ TEST(avx512_qselect_float16, test_arrsizes)
8686

8787
for (size_t ii = 0; ii < arrsizes.size(); ++ii) {
8888
/* Random array */
89-
for (size_t jj = 0; jj < arrsizes[ii]; ++jj) {
89+
for (auto jj = 0; jj < arrsizes[ii]; ++jj) {
9090
_Float16 temp = (float)rand() / (float)(RAND_MAX);
9191
arr.push_back(temp);
9292
sortedarr.push_back(temp);
@@ -129,23 +129,23 @@ TEST(avx512_partial_qsort_float16, test_ranges)
129129
std::vector<_Float16> psortedarr;
130130

131131
/* Random array */
132-
for (size_t ii = 0; ii < arrsize; ++ii) {
132+
for (auto ii = 0; ii < arrsize; ++ii) {
133133
_Float16 temp = (float)rand() / (float)(RAND_MAX);
134134
arr.push_back(temp);
135135
sortedarr.push_back(temp);
136136
}
137137
/* Sort with std::sort for comparison */
138138
std::sort(sortedarr.begin(), sortedarr.end());
139139

140-
for (size_t ii = 0; ii < nranges; ++ii) {
140+
for (auto ii = 0; ii < nranges; ++ii) {
141141
psortedarr = arr;
142142

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

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

0 commit comments

Comments
 (0)