Skip to content

Commit 30f5fd1

Browse files
authored
Suppress the compiler warnings marking them as external (#2770)
On Linux, the DPC++ compiler headers are automatically treated as system headers. But it is not the case on Windows. Due to that, there is a ton of deprecation warnings generated inside the compiler headers when building dpnp extensions on Windows. This PR updates CMake files of the extensions to add include of DPC++ compiler headers explicitly and to mark the compiler and dpctl headers as system one to suppress the warning inside them.
1 parent c73e472 commit 30f5fd1

File tree

9 files changed

+39
-47
lines changed

9 files changed

+39
-47
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum
5151
* Extended `dpnp.nan_to_num` to support broadcasting of `nan`, `posinf`, and `neginf` keywords [#2754](https://github.com/IntelPython/dpnp/pull/2754)
5252
* Changed `dpnp.partition` implementation to reuse `dpnp.sort` where it brings the performance benefit [#2766](https://github.com/IntelPython/dpnp/pull/2766)
5353
* `dpnp` uses pybind11 3.0.2 [#27734](https://github.com/IntelPython/dpnp/pull/2773)
54+
* Modified CMake files for the extension to explicitly mark DPC++ compiler and dpctl headers as system ones and so to suppress the build warning generated inside them [#2770](https://github.com/IntelPython/dpnp/pull/2770)
5455

5556
### Deprecated
5657

dpnp/backend/extensions/blas/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ set_target_properties(
6565

6666
target_include_directories(
6767
${python_module_name}
68-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../
68+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
6969
)
70+
71+
# treat below headers as system to suppress the warnings there during the build
7072
target_include_directories(
7173
${python_module_name}
72-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
74+
SYSTEM
75+
PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
7376
)
7477

75-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_INCLUDE_DIRS})
76-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_TENSOR_INCLUDE_DIR})
77-
7878
if(WIN32)
7979
target_compile_options(
8080
${python_module_name}

dpnp/backend/extensions/fft/CMakeLists.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,12 @@ set_target_properties(
5757
PROPERTIES CMAKE_POSITION_INDEPENDENT_CODE ON
5858
)
5959

60+
# treat below headers as system to suppress the warnings there during the build
6061
target_include_directories(
6162
${python_module_name}
62-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../include
63+
SYSTEM
64+
PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
6365
)
64-
target_include_directories(
65-
${python_module_name}
66-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../src
67-
)
68-
69-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_INCLUDE_DIRS})
70-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_TENSOR_INCLUDE_DIR})
7166

7267
if(WIN32)
7368
target_compile_options(

dpnp/backend/extensions/indexing/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ set_target_properties(
6262

6363
target_include_directories(
6464
${python_module_name}
65-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../
65+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
6666
)
67+
68+
# treat below headers as system to suppress the warnings there during the build
6769
target_include_directories(
6870
${python_module_name}
69-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
71+
SYSTEM
72+
PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
7073
)
7174

72-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_INCLUDE_DIR})
73-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_TENSOR_INCLUDE_DIR})
74-
7575
if(WIN32)
7676
target_compile_options(
7777
${python_module_name}

dpnp/backend/extensions/lapack/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,16 @@ set_target_properties(
8282

8383
target_include_directories(
8484
${python_module_name}
85-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../
85+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
8686
)
87+
88+
# treat below headers as system to suppress the warnings there during the build
8789
target_include_directories(
8890
${python_module_name}
89-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
91+
SYSTEM
92+
PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
9093
)
9194

92-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_INCLUDE_DIR})
93-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_TENSOR_INCLUDE_DIR})
94-
9595
if(WIN32)
9696
target_compile_options(
9797
${python_module_name}

dpnp/backend/extensions/statistics/CMakeLists.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,16 @@ set_target_properties(
6767

6868
target_include_directories(
6969
${python_module_name}
70-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../include
71-
)
72-
target_include_directories(
73-
${python_module_name}
74-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../src
70+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
7571
)
72+
73+
# treat below headers as system to suppress the warnings there during the build
7674
target_include_directories(
7775
${python_module_name}
78-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
76+
SYSTEM
77+
PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
7978
)
8079

81-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_INCLUDE_DIR})
82-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_TENSOR_INCLUDE_DIR})
83-
8480
if(WIN32)
8581
target_compile_options(
8682
${python_module_name}

dpnp/backend/extensions/ufunc/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,16 @@ set_target_properties(
8484

8585
target_include_directories(
8686
${python_module_name}
87-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../
87+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../ ${CMAKE_CURRENT_SOURCE_DIR}/../common
8888
)
89+
90+
# treat below headers as system to suppress the warnings there during the build
8991
target_include_directories(
9092
${python_module_name}
91-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
93+
SYSTEM
94+
PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
9295
)
9396

94-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_INCLUDE_DIR})
95-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_TENSOR_INCLUDE_DIR})
96-
9797
if(_dpnp_sycl_targets)
9898
# make fat binary
9999
target_compile_options(

dpnp/backend/extensions/vm/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,16 @@ set_target_properties(
107107

108108
target_include_directories(
109109
${python_module_name}
110-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../
110+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
111111
)
112+
113+
# treat below headers as system to suppress the warnings there during the build
112114
target_include_directories(
113115
${python_module_name}
114-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
116+
SYSTEM
117+
PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
115118
)
116119

117-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_INCLUDE_DIR})
118-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_TENSOR_INCLUDE_DIR})
119-
120120
if(WIN32)
121121
target_compile_options(
122122
${python_module_name}

dpnp/backend/extensions/window/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ set_target_properties(
6262

6363
target_include_directories(
6464
${python_module_name}
65-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../
65+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../ ${CMAKE_CURRENT_SOURCE_DIR}/../common
6666
)
67+
68+
# treat below headers as system to suppress the warnings there during the build
6769
target_include_directories(
6870
${python_module_name}
69-
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../common
71+
SYSTEM
72+
PRIVATE ${SYCL_INCLUDE_DIR} ${Dpctl_INCLUDE_DIRS} ${Dpctl_TENSOR_INCLUDE_DIR}
7073
)
7174

72-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_INCLUDE_DIR})
73-
target_include_directories(${python_module_name} PUBLIC ${Dpctl_TENSOR_INCLUDE_DIR})
74-
7575
if(WIN32)
7676
target_compile_options(
7777
${python_module_name}

0 commit comments

Comments
 (0)