diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ce0bcfd4..277f1f067 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,9 @@ endif() # Only for debugging. Save building time by shrinking translation unit scope. set(BUILD_SEPARATE_OPS $ENV{BUILD_SEPARATE_OPS}) +if(CMAKE_BUILD_TYPE MATCHES "(Debug|RelWithDebInfo)") + set(BUILD_SEPARATE_OPS TRUE) +endif() set(BUILD_SPLIT_KERNEL_LIB $ENV{BUILD_SPLIT_KERNEL_LIB}) add_subdirectory(${TORCH_XPU_OPS_ROOT}/src) diff --git a/cmake/BuildFlags.cmake b/cmake/BuildFlags.cmake index 181d737ac..ec9aaccb2 100644 --- a/cmake/BuildFlags.cmake +++ b/cmake/BuildFlags.cmake @@ -43,10 +43,10 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" endif() if(CMAKE_BUILD_TYPE MATCHES Debug) - list(APPEND SYCL_HOST_FLAGS -g) - list(APPEND SYCL_HOST_FLAGS -O0) - endif(CMAKE_BUILD_TYPE MATCHES Debug) - + list(APPEND SYCL_HOST_FLAGS -g -fno-omit-frame-pointer -O0) + elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) + list(APPEND SYCL_HOST_FLAGS -g -O2) + endif() if(USE_PER_OPERATOR_HEADERS) list(APPEND SYCL_HOST_FLAGS -DAT_PER_OPERATOR_HEADERS) endif() @@ -84,6 +84,13 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -Wno-absolute-value) set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -no-ftz) endif() + + if(CMAKE_BUILD_TYPE MATCHES Debug) + set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -g -O0 -Rno-debug-disables-optimization) + elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo) + set(SYCL_KERNEL_OPTIONS ${SYCL_KERNEL_OPTIONS} -gline-tables-only -O2) + endif() + 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) diff --git a/test/xpu/extended/skip_list_win.py b/test/xpu/extended/skip_list_win.py index 657092382..4595f8019 100644 --- a/test/xpu/extended/skip_list_win.py +++ b/test/xpu/extended/skip_list_win.py @@ -1,5 +1,6 @@ skip_dict = { "test_ops_xpu.py": ( "test_compare_cpu_pow_xpu_bfloat16", # https://github.com/intel/torch-xpu-ops/pull/764 + "test_compare_cpu_argmin_xpu_int", ), } diff --git a/test/xpu/skip_list_common.py b/test/xpu/skip_list_common.py index 1dc2f7268..7bb33c4aa 100644 --- a/test/xpu/skip_list_common.py +++ b/test/xpu/skip_list_common.py @@ -2296,6 +2296,8 @@ # randomly fails "test_parity__foreach_div_fastpath_inplace_xpu_complex128", "test_parity__foreach_div_fastpath_outplace_xpu_complex128", + "test_parity__foreach_addcdiv_fastpath_inplace_xpu_complex128", + "test_parity__foreach_addcdiv_fastpath_outplace_xpu_complex128", ), "nn/test_convolution_xpu.py": ( # Summary: all of them are oneDNN related issues