Skip to content

Commit 5a2fd81

Browse files
[SYCL] Fix warnings in configuration and compilation (#5034)
Make SYCL headers warning free
1 parent c290f3c commit 5a2fd81

File tree

10 files changed

+12
-14
lines changed

10 files changed

+12
-14
lines changed

opencl/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ cmake_minimum_required(VERSION 3.14)
22

33
include(FetchContent)
44

5+
# Suppress warnings related to dependencies
6+
if (MSVC)
7+
add_definitions(
8+
-wd4133 # Suppress ''function': incompatible types - from 'char [9]' to 'LPCWSTR''
9+
-wd4152 # Suppress 'nonstandard extension, function/data pointer conversion in expression'
10+
-wd4201 # Suppress 'nonstandard extension used: nameless struct/union'
11+
)
12+
endif()
13+
514
# Repo URLs
615

716
set(OCL_HEADERS_REPO

sycl/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ if(MSVC)
4848
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
4949
# Skip asynchronous C++ exceptions catching and assume "extern C" functions
5050
# never throw C++ exceptions.
51+
set(LLVM_REQUIRES_EH ON)
5152
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
5253

5354
# Add PDB debug information

sycl/cmake/modules/AddSYCLUnitTest.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# Produces a binary names `basename(test_dirname)`.
55
macro(add_sycl_unittest test_dirname link_variant)
66
# Enable exception handling for these unit tests
7-
set(LLVM_REQUIRES_EH 1)
7+
set(LLVM_REQUIRES_EH ON)
8+
set(LLVM_REQUIRES_RTTI ON)
89

910
string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower)
1011
if (MSVC AND build_type_lower MATCHES "debug")

sycl/unittests/Extensions/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
set(CMAKE_CXX_EXTENSIONS OFF)
22

3-
# Enable exception handling for these unit tests
4-
set(LLVM_REQUIRES_EH 1)
53
add_sycl_unittest(ExtensionsTests OBJECT
64
DefaultContext.cpp
75
)

sycl/unittests/SYCL2020/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
set(CMAKE_CXX_EXTENSIONS OFF)
22

3-
# Enable exception handling for these unit tests
4-
set(LLVM_REQUIRES_EH 1)
53
add_sycl_unittest(SYCL2020Tests OBJECT
64
GetNativeOpenCL.cpp
75
SpecializationConstant.cpp

sycl/unittests/allowlist/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
set(CMAKE_CXX_EXTENSIONS OFF)
22

3-
# Enable exception handling for these unit tests
4-
set(LLVM_REQUIRES_EH 1)
53
add_sycl_unittest(AllowListTests OBJECT
64
ParseAllowList.cpp
75
DeviceIsAllowed.cpp

sycl/unittests/config/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
set(CMAKE_CXX_EXTENSIONS OFF)
22

3-
# Enable exception handling for these unit tests
4-
set(LLVM_REQUIRES_EH 1)
53
add_sycl_unittest(ConfigTests OBJECT
64
ConfigTests.cpp
75
)

sycl/unittests/pi/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
set(CMAKE_CXX_EXTENSIONS OFF)
22

3-
# Enable exception handling for these unit tests
4-
set(LLVM_REQUIRES_EH 1)
53
add_sycl_unittest(PiTests OBJECT
64
EnqueueMemTest.cpp
75
PiMock.cpp

sycl/unittests/pi/cuda/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
set(LLVM_REQUIRES_EH 1)
21
add_sycl_unittest(PiCudaTests OBJECT
32
test_base_objects.cpp
43
test_commands.cpp

sycl/unittests/program_manager/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
set(CMAKE_CXX_EXTENSIONS OFF)
22

3-
# Enable exception handling for these unit tests
4-
set(LLVM_REQUIRES_EH 1)
53
add_sycl_unittest(ProgramManagerTests OBJECT
64
EliminatedArgMask.cpp
75
itt_annotations.cpp

0 commit comments

Comments
 (0)