Skip to content

Commit f806f2b

Browse files
author
Raghuveer Devulapalli
committed
Fix more compiler warnings
1 parent 27e0f2f commit f806f2b

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
@@ -71,8 +71,8 @@
7171
#ifdef _MSC_VER
7272
#define X86_SIMD_SORT_INLINE static inline
7373
#define X86_SIMD_SORT_FINLINE static __forceinline
74-
#define LIKELY(x)
75-
#define UNLIKELY(x)
74+
#define LIKELY(x) (x)
75+
#define UNLIKELY(x) (x)
7676
#elif defined(__CYGWIN__)
7777
/*
7878
* Force inline in cygwin to work around a compiler bug. See
@@ -88,8 +88,8 @@
8888
#else
8989
#define X86_SIMD_SORT_INLINE static
9090
#define X86_SIMD_SORT_FINLINE static
91-
#define LIKELY(x)
92-
#define UNLIKELY(x)
91+
#define LIKELY(x) (x)
92+
#define UNLIKELY(x) (x)
9393
#endif
9494

9595
#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)