Skip to content

Commit 76b6e28

Browse files
author
Hammond, Jeff R
committed
silence compiler issues on Windows
Signed-off-by: Hammond, Jeff R <jeff.r.hammond@intel.com>
1 parent 95c3fb5 commit 76b6e28

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

sycl/source/detail/platform_util.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@
1010
#include <CL/sycl/exception.hpp>
1111
#include <detail/platform_util.hpp>
1212

13-
#if defined(__x86_64__) || defined(__i386__)
1413
#if defined(SYCL_RT_OS_LINUX)
14+
#include <errno.h>
15+
#include <unistd.h>
16+
#if defined(__x86_64__) || defined(__i386__)
1517
#include <cpuid.h>
18+
#endif
1619
#elif defined(SYCL_RT_OS_WINDOWS)
1720
#include <intrin.h>
1821
#endif
19-
#endif
20-
21-
#if defined(SYCL_RT_OS_LINUX)
22-
#include <errno.h>
23-
#include <unistd.h>
24-
#endif
2522

2623
__SYCL_INLINE_NAMESPACE(cl) {
2724
namespace sycl {
@@ -106,9 +103,9 @@ uint64_t PlatformUtil::getMemCacheSize() {
106103

107104
uint32_t PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex TIndex) {
108105

106+
#if defined(__x86_64__) || defined(__i386__)
109107
uint32_t Index = static_cast<uint32_t>(TIndex);
110108

111-
#if defined(__x86_64__) || defined(__i386__)
112109
// SSE4.2 has 16 byte (XMM) registers
113110
static constexpr uint32_t VECTOR_WIDTH_SSE42[] = {16, 8, 4, 2, 4, 2, 0};
114111
// AVX supports 32 byte (YMM) registers only for floats and doubles
@@ -151,6 +148,8 @@ uint32_t PlatformUtil::getNativeVectorWidth(PlatformUtil::TypeIndex TIndex) {
151148
return VECTOR_WIDTH_SSE42[Index];
152149

153150
#elif defined(__ARM_NEON)
151+
uint32_t Index = static_cast<uint32_t>(TIndex);
152+
154153
// NEON has 16 byte registers
155154
static constexpr uint32_t VECTOR_WIDTH_NEON[] = {16, 8, 4, 2, 4, 2, 0};
156155
return VECTOR_WIDTH_NEON[Index];

0 commit comments

Comments
 (0)