Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions cmake/BuildFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -D__INTEL_LLVM_COMPILER_VERSION=${__INTEL_LLVM_COMPILER})

CHECK_SYCL_FLAG("-fsycl-fp64-conv-emu" SUPPORTS_FP64_CONV_EMU)
if(SUPPORTS_FP64_CONV_EMU)
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -fsycl-fp64-conv-emu)
else()
if(NOT SUPPORTS_FP64_CONV_EMU)
message(WARNING "The compiler does not support the '-fsycl-fp64-conv-emu' flag, \
will disable it. On some platforms that don't support FP64, \
running operations with the FP64 datatype will raise a Runtime error: Required aspect fp64 is not supported on the device \
Expand All @@ -130,7 +128,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"
set(SYCL_OFFLINE_COMPILER_CG_OPTIONS "${SYCL_OFFLINE_COMPILER_CG_OPTIONS} -options -cl-fp32-correctly-rounded-divide-sqrt")
set(SYCL_OFFLINE_COMPILER_CG_OPTIONS "${SYCL_OFFLINE_COMPILER_CG_OPTIONS} -options -cl-intel-greater-than-4GB-buffer-required")


if(WIN32)
set(AOT_TARGETS "mtl,mtl-h,bmg,dg2,arl-h,lnl-m")
else()
Expand All @@ -142,6 +139,14 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"
if(AOT_TARGETS STREQUAL "none")
set(TORCH_XPU_ARCH_LIST "" PARENT_SCOPE)
else()
# Enable FP64 conversion emulation for DG2 / ATS-M targets
if(SUPPORTS_FP64_CONV_EMU)
string(FIND "${AOT_TARGETS}" "dg2" _dg2_index)
string(FIND "${AOT_TARGETS}" "ats-m" _atsm_index)
if(_dg2_index GREATER_EQUAL 0 OR _atsm_index GREATER_EQUAL 0)
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -fsycl-fp64-conv-emu)
endif()
endif()
set(SYCL_TARGETS_OPTION -fsycl-targets=spir64_gen,spir64)
set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} ${SYCL_TARGETS_OPTION})
set(SYCL_DEVICE_LINK_FLAGS ${SYCL_DEVICE_LINK_FLAGS} ${SYCL_TARGETS_OPTION})
Expand Down
Loading