This repository was archived by the owner on Jan 13, 2025. It is now read-only.
File tree 2 files changed +21
-15
lines changed
2 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -150,14 +150,17 @@ if (INSTALL_HEADER_ONLY)
150
150
check_cxx_compiler_flag("-fsycl" is_dpcpp)
151
151
if (is_dpcpp)
152
152
target_compile_definitions (portblas INTERFACE "SB_ENABLE_USM" )
153
- if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM"
154
- AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2024.1)
155
- OR NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM" )
156
- # Apply only for oneAPI releases >= 2024.1 OR for intel/llvm.
157
- target_link_options (portblas INTERFACE "-mllvm=-enable-global-offset=false" )
158
- target_compile_options (portblas INTERFACE "-mllvm=-enable-global-offset=false" )
159
- message (STATUS "Adding -mllvm=-enable-global-offset=false to portblas" )
160
- endif ()
153
+ check_cxx_compiler_flag("-mllvm=-enable-global-offset=false" support_disable_global_offset)
154
+ if (${support_disable_global_offset} )
155
+ if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM"
156
+ AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2024.1)
157
+ OR NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM" )
158
+ # Apply only for oneAPI releases >= 2024.1 OR for intel/llvm.
159
+ target_link_options (portblas INTERFACE "-mllvm=-enable-global-offset=false" )
160
+ target_compile_options (portblas INTERFACE "-mllvm=-enable-global-offset=false" )
161
+ message (STATUS "Adding -mllvm=-enable-global-offset=false to portblas" )
162
+ endif ()
163
+ endif ()
161
164
endif ()
162
165
if (${BLAS_ENABLE_COMPLEX} )
163
166
target_compile_definitions (portblas INTERFACE "BLAS_ENABLE_COMPLEX" )
Original file line number Diff line number Diff line change @@ -105,13 +105,16 @@ function(add_sycl_to_target)
105
105
target_link_options (${SB_ADD_SYCL_TARGET} PRIVATE -mllvm=-loopopt=0)
106
106
message (STATUS "Adding -fno-fast-math -mllvm=-loopopt=0 to target ${SB_ADD_SYCL_TARGET} " )
107
107
endif ()
108
- if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM"
109
- AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2024.1)
110
- OR NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM" )
111
- # Apply only for oneAPI releases >= 2024.1 OR for intel/llvm.
112
- target_link_options (${SB_ADD_SYCL_TARGET} PRIVATE "-mllvm=-enable-global-offset=false" )
113
- target_compile_options (${SB_ADD_SYCL_TARGET} PRIVATE "-mllvm=-enable-global-offset=false" )
114
- message (STATUS "Adding -mllvm=-enable-global-offset=false to target ${SB_ADD_SYCL_TARGET} " )
108
+ if (${DPCPP_SYCL_TARGET} MATCHES "nvidia" OR ${DPCPP_SYCL_TARGET} MATCHES "amd" )
109
+ # Apply only in case of NVIDIA_GPU and AMD_GPU targets.
110
+ if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM"
111
+ AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 2024.1)
112
+ OR NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM" )
113
+ # Apply only for oneAPI releases >= 2024.1 OR for intel/llvm.
114
+ target_link_options (${SB_ADD_SYCL_TARGET} PRIVATE "-mllvm=-enable-global-offset=false" )
115
+ target_compile_options (${SB_ADD_SYCL_TARGET} PRIVATE "-mllvm=-enable-global-offset=false" )
116
+ message (STATUS "Adding -mllvm=-enable-global-offset=false to target ${SB_ADD_SYCL_TARGET} " )
117
+ endif ()
115
118
endif ()
116
119
target_compile_options (${SB_ADD_SYCL_TARGET} PUBLIC ${DPCPP_FLAGS} )
117
120
get_target_property (target_type ${SB_ADD_SYCL_TARGET} TYPE )
You can’t perform that action at this time.
0 commit comments