Skip to content

Commit 868696d

Browse files
author
Raghuveer Devulapalli
authored
Merge pull request #124 from r-devulap/avx2-macos
Add avx2_vector defintion for size_t on macOS
2 parents d3c2169 + c0d9e6d commit 868696d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/avx2-64bit-qsort.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,19 @@ struct avx2_vector<uint64_t> {
379379
return v;
380380
}
381381
};
382+
383+
/*
384+
* workaround on 64-bit macOS which defines size_t as unsigned long and defines
385+
* uint64_t as unsigned long long, both of which are 8 bytes
386+
*/
387+
#if defined(__APPLE__) && defined(__x86_64__)
388+
static_assert(sizeof(size_t) == sizeof(uint64_t),
389+
"Size of size_t and uint64_t are not the same");
390+
template <>
391+
struct avx2_vector<size_t> : public avx2_vector<uint64_t> {
392+
};
393+
#endif
394+
382395
template <>
383396
struct avx2_vector<double> {
384397
using type_t = double;

0 commit comments

Comments
 (0)