File tree Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
6
6
" %PYTHON% " setup.py clean --all
7
7
set " SKBUILD_ARGS = -G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx"
8
8
9
- FOR %%V IN (14.0.0 15.0.0 16.0.0) DO @ (
9
+ FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 ) DO @ (
10
10
REM set DIR_HINT if directory exists
11
11
IF EXIST " %BUILD_PREFIX% \Library\lib\clang\%%V \" (
12
12
SET " SYCL_INCLUDE_DIR_HINT = %BUILD_PREFIX% \Library\lib\clang\%%V "
@@ -18,11 +18,13 @@ set "FN=Windows-IntelLLVM.cmake"
18
18
19
19
rem Save the original file, and copy patched file to
20
20
rem fix the issue with IntelLLVM integration with cmake on Windows
21
- dir " %PLATFORM_DIR% \%FN% "
22
- copy /Y " %PLATFORM_DIR% \%FN% " .
23
- if errorlevel 1 exit 1
24
- copy /Y .github\workflows\Windows-IntelLLVM.cmake " %PLATFORM_DIR% "
25
- if errorlevel 1 exit 1
21
+ if EXIST " %PLATFORM_DIR% " (
22
+ dir " %PLATFORM_DIR% \%FN% "
23
+ copy /Y " %PLATFORM_DIR% \%FN% " .
24
+ if errorlevel 1 exit 1
25
+ copy /Y .github\workflows\Windows-IntelLLVM.cmake " %PLATFORM_DIR% "
26
+ if errorlevel 1 exit 1
27
+ )
26
28
27
29
if NOT " %WHEELS_OUTPUT_FOLDER% " == " " (
28
30
rem Install and assemble wheel package from the build bits
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ if(WIN32)
23
23
set (CMAKE_CXX_FLAGS_DEBUG
24
24
"${CMAKE_CXX_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -g1 -DDEBUG"
25
25
)
26
- set (DPCTL_LDFLAGS "/link / NXCompat /DynamicBase" )
26
+ set (DPCTL_LDFLAGS "/NXCompat; /DynamicBase" )
27
27
elseif (UNIX )
28
28
string (CONCAT WARNING_FLAGS
29
29
"-Wall "
@@ -140,7 +140,8 @@ function(build_dpctl_ext _trgt _src _dest)
140
140
target_compile_options (${_trgt} PRIVATE -fno-sycl-use-footer )
141
141
endif ()
142
142
target_link_libraries (${_trgt} DPCTLSyclInterface )
143
- target_link_options (${_trgt} PRIVATE "LINKER:${DPCTL_LDFLAGS} " )
143
+ set (_linker_options "LINKER:${DPCTL_LDFLAGS} " )
144
+ target_link_options (${_trgt} PRIVATE ${_linker_options} )
144
145
python_extension_module (${_trgt} )
145
146
get_filename_component (_name_wle ${_generated_src} NAME_WLE )
146
147
get_filename_component (_generated_src_dir ${_generated_src} DIRECTORY )
Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ add_custom_target(_dpctl4pybind11_deps
15
15
_sycl_event_copy_capi_include
16
16
)
17
17
18
+ if (WIN32 )
19
+ if (${CMAKE_VERSION} VERSION_LESS "3.23" )
20
+ # this is a work-around for target_link_options inserting option after -link option, cause
21
+ # linker to ignore it.
22
+ set (CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -fsycl-device-code-split=per_kernel" )
23
+ endif ()
24
+ endif ()
25
+
18
26
set (python_module_name _tensor_impl )
19
27
pybind11_add_module (${python_module_name} MODULE
20
28
${CMAKE_CURRENT_SOURCE_DIR} /libtensor/source/tensor_py.cpp
@@ -29,7 +37,10 @@ pybind11_add_module(${python_module_name} MODULE
29
37
${CMAKE_CURRENT_SOURCE_DIR} /libtensor/source/device_support_queries.cpp
30
38
)
31
39
target_link_options (${python_module_name} PRIVATE -fsycl-device-code-split=per_kernel )
32
- target_link_options (${python_module_name} PRIVATE -fsycl-link-huge-device-code )
40
+ if (UNIX )
41
+ # this option is support on Linux only
42
+ target_link_options (${python_module_name} PRIVATE -fsycl-link-huge-device-code )
43
+ endif ()
33
44
target_include_directories (${python_module_name}
34
45
PRIVATE
35
46
${CMAKE_CURRENT_SOURCE_DIR} /../include
You can’t perform that action at this time.
0 commit comments