Skip to content

Commit 1558efa

Browse files
author
Raghuveer Devulapalli
committed
Define zmm_vector<size_t> on macOS
1 parent ee072b4 commit 1558efa

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

src/avx512-64bit-common.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,19 @@ struct zmm_vector<uint64_t> {
912912
left_addr, right_addr, k, reg);
913913
}
914914
};
915+
916+
/*
917+
* workaround on 64-bit macOS which defines size_t as unsigned long and defines
918+
* uint64_t as unsigned long long, both of which are 8 bytes
919+
*/
920+
#if defined(__APPLE__) && defined(__x86_64__)
921+
static_assert(sizeof(size_t) == sizeof(uint64_t),
922+
"Size of size_t and uint64_t are not the same");
923+
template <>
924+
struct zmm_vector<size_t> : public zmm_vector<uint64_t> {
925+
};
926+
#endif
927+
915928
template <>
916929
struct zmm_vector<double> {
917930
using type_t = double;

src/xss-common-includes.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,7 @@ constexpr bool always_false = false;
9090
#define NETWORK_32BIT_6 11, 10, 9, 8, 15, 14, 13, 12, 3, 2, 1, 0, 7, 6, 5, 4
9191
#define NETWORK_32BIT_7 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8
9292

93-
/*
94-
* workaround on 64-bit macOS which defines size_t as unsigned long and defines
95-
* uint64_t as unsigned long long, both of which are 8 bytes
96-
*/
97-
#if defined(__APPLE__) && defined(__x86_64__)
98-
typedef uint64_t arrsize_t;
99-
#else
10093
typedef size_t arrsize_t;
101-
#endif
10294

10395
template <typename type>
10496
struct zmm_vector;

0 commit comments

Comments
 (0)