|
10 | 10 | #include <CL/sycl/exception.hpp>
|
11 | 11 | #include <detail/platform_util.hpp>
|
12 | 12 |
|
13 |
| -#if defined(__x86_64__) || defined(__i386__) |
14 | 13 | #if defined(SYCL_RT_OS_LINUX)
|
| 14 | +#include <errno.h> |
| 15 | +#include <unistd.h> |
| 16 | +#if defined(__x86_64__) || defined(__i386__) |
15 | 17 | #include <cpuid.h>
|
| 18 | +#endif |
16 | 19 | #elif defined(SYCL_RT_OS_WINDOWS)
|
17 | 20 | #include <intrin.h>
|
18 | 21 | #endif
|
19 |
| -#endif |
20 |
| - |
21 |
| -#if defined(SYCL_RT_OS_LINUX) |
22 |
| -#include <errno.h> |
23 |
| -#include <unistd.h> |
24 |
| -#endif |
25 | 22 |
|
26 | 23 | __SYCL_INLINE_NAMESPACE(cl) {
|
27 | 24 | namespace sycl {
|
@@ -106,9 +103,9 @@ uint64_t PlatformUtil::getMemCacheSize() {
|
106 | 103 |
|
107 | 104 | uint32_t PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex TIndex) {
|
108 | 105 |
|
| 106 | +#if defined(__x86_64__) || defined(__i386__) |
109 | 107 | uint32_t Index = static_cast<uint32_t>(TIndex);
|
110 | 108 |
|
111 |
| -#if defined(__x86_64__) || defined(__i386__) |
112 | 109 | // SSE4.2 has 16 byte (XMM) registers
|
113 | 110 | static constexpr uint32_t VECTOR_WIDTH_SSE42[] = {16, 8, 4, 2, 4, 2, 0};
|
114 | 111 | // AVX supports 32 byte (YMM) registers only for floats and doubles
|
@@ -151,6 +148,8 @@ uint32_t PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex TIndex) {
|
151 | 148 | return VECTOR_WIDTH_SSE42[Index];
|
152 | 149 |
|
153 | 150 | #elif defined(__ARM_NEON)
|
| 151 | + uint32_t Index = static_cast<uint32_t>(TIndex); |
| 152 | + |
154 | 153 | // NEON has 16 byte registers
|
155 | 154 | static constexpr uint32_t VECTOR_WIDTH_NEON[] = {16, 8, 4, 2, 4, 2, 0};
|
156 | 155 | return VECTOR_WIDTH_NEON[Index];
|
|
0 commit comments