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%"
66" %PYTHON% " setup.py clean --all
77set " SKBUILD_ARGS = -G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx"
88
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 @ (
1010 REM set DIR_HINT if directory exists
1111 IF EXIST " %BUILD_PREFIX% \Library\lib\clang\%%V \" (
1212 SET " SYCL_INCLUDE_DIR_HINT = %BUILD_PREFIX% \Library\lib\clang\%%V "
@@ -18,11 +18,13 @@ set "FN=Windows-IntelLLVM.cmake"
1818
1919rem Save the original file, and copy patched file to
2020rem 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+ )
2628
2729if NOT " %WHEELS_OUTPUT_FOLDER% " == " " (
2830 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)
2323 set (CMAKE_CXX_FLAGS_DEBUG
2424 "${CMAKE_CXX_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -g1 -DDEBUG"
2525 )
26- set (DPCTL_LDFLAGS "/link / NXCompat /DynamicBase" )
26+ set (DPCTL_LDFLAGS "/NXCompat; /DynamicBase" )
2727elseif (UNIX )
2828 string (CONCAT WARNING_FLAGS
2929 "-Wall "
@@ -140,7 +140,8 @@ function(build_dpctl_ext _trgt _src _dest)
140140 target_compile_options (${_trgt} PRIVATE -fno-sycl-use-footer)
141141 endif ()
142142 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} )
144145 python_extension_module(${_trgt} )
145146 get_filename_component (_name_wle ${_generated_src} NAME_WLE)
146147 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
1515 _sycl_event_copy_capi_include
1616)
1717
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+
1826set (python_module_name _tensor_impl)
1927pybind11_add_module(${python_module_name} MODULE
2028 ${CMAKE_CURRENT_SOURCE_DIR} /libtensor/source /tensor_py.cpp
@@ -29,7 +37,10 @@ pybind11_add_module(${python_module_name} MODULE
2937 ${CMAKE_CURRENT_SOURCE_DIR} /libtensor/source /device_support_queries.cpp
3038)
3139target_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 ()
3344target_include_directories (${python_module_name}
3445 PRIVATE
3546 ${CMAKE_CURRENT_SOURCE_DIR} /../include
You can’t perform that action at this time.
0 commit comments