Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
# torch_xpu_ops
# -- Static archive library target

cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
cmake_minimum_required(VERSION 3.27 FATAL_ERROR)

set(PROJECT_NAME "torch-xpu-ops")
set(PROJECT_VERSION "2.3.0")
# Avoid SYCL compiler error
if(NOT WIN32)
string(APPEND CMAKE_CXX_FLAGS " -Wno-error")
Expand All @@ -30,8 +28,7 @@ if(NOT WIN32)
endif()
endif()

cmake_policy(SET CMP0048 NEW)
project(${PROJECT_NAME} VERSION "${PROJECT_VERSION}" LANGUAGES C CXX)
project(torch-xpu-ops VERSION 2.10.0 LANGUAGES C CXX)

set(TORCH_XPU_OPS_FOUND FALSE)

Expand Down
11 changes: 6 additions & 5 deletions cmake/Modules/FindONEMKL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,18 @@ find_file(

if((ONEMKL_INCLUDE_DIR STREQUAL "ONEMKL_INCLUDE_DIR-NOTFOUND")
OR(ONEMKL_LIB_DIR STREQUAL "ONEMKL_LIB_DIR-NOTFOUND"))
message(WARNING "oneMKL sdk is incomplete!!")
message(WARNING "oneMKL SDK is incomplete!!")
return()
endif()

set(MKL_LIB_NAMES "mkl_sycl_blas" "mkl_sycl_dft" "mkl_sycl_lapack"
"mkl_intel_lp64" "mkl_core")

if(WIN32)
set(MKL_LIB_NAMES "mkl_sycl_blas" "mkl_sycl_dft" "mkl_sycl_lapack"
"mkl_intel_lp64" "mkl_intel_thread" "mkl_core")
list(APPEND MKL_LIB_NAMES "mkl_intel_thread")
list(TRANSFORM MKL_LIB_NAMES APPEND "_dll.lib")
else()
set(MKL_LIB_NAMES "mkl_sycl_blas" "mkl_sycl_dft" "mkl_sycl_lapack"
"mkl_intel_lp64" "mkl_gnu_thread" "mkl_core")
list(APPEND MKL_LIB_NAMES "mkl_gnu_thread")
list(TRANSFORM MKL_LIB_NAMES PREPEND "lib")
list(TRANSFORM MKL_LIB_NAMES APPEND ".so")
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/FindSYCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ macro(SYCL_INCLUDE_DEPENDENCIES dependency_file)

if(SYCL_DEPEND_REGENERATE)
set(SYCL_DEPEND ${dependency_file})
file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n")
file(WRITE ${dependency_file} "#FindSYCL.cmake generated file. Do not edit.\n")
endif()
endmacro()

Expand Down
32 changes: 16 additions & 16 deletions src/ATen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# ATen XPU sources

file(GLOB xpu_cpp "xpu/*.cpp")
file(GLOB xpu_mkl "native/xpu/mkl/*.cpp")
file(GLOB xpu_native_cpp "native/xpu/*.cpp" "native/sparse/*.cpp" "native/sparse/xpu/*.cpp" "native/nested/*.cpp" "native/nested/xpu/*.cpp" "native/transformers/*.cpp" "native/quantized/*.cpp")
file(GLOB xpu_sycl "native/xpu/sycl/*.cpp" "native/sparse/xpu/sycl/*.cpp" "native/nested/xpu/sycl/*.cpp" "native/transformers/sycl/*.cpp" "native/quantized/sycl/*.cpp")

list(APPEND ATen_XPU_CPP_SRCS ${xpu_cpp})
if(USE_ONEMKL_XPU)
file(GLOB xpu_mkl "native/xpu/mkl/*.cpp")
list(APPEND ATen_XPU_MKL_SRCS ${xpu_mkl})
endif()
list(APPEND ATen_XPU_NATIVE_CPP_SRCS ${xpu_native_cpp})
Expand All @@ -19,25 +19,25 @@ set(ATen_XPU_SYCL_SRCS ${ATen_XPU_SYCL_SRCS} PARENT_SCOPE)

# ATen XPU headers

macro(install_xpu_headers glob_pattern dest_subdir)
file(GLOB headers ${glob_pattern})
macro(install_xpu_headers subdir)
file(GLOB headers CONFIGURE_DEPENDS "${subdir}/*.h")
if(headers)
install(FILES ${headers} DESTINATION "${AT_INSTALL_INCLUDE_DIR}/${dest_subdir}")
install(FILES ${headers} DESTINATION "${AT_INSTALL_INCLUDE_DIR}/ATen/${subdir}")
endif()
endmacro()

install_xpu_headers("xpu/*.h" "ATen/xpu")
install_xpu_headers("native/xpu/*.h" "ATen/native/xpu")
install_xpu_headers("native/xpu/sycl/*.h" "ATen/native/xpu/sycl")
install_xpu_headers("native/xpu/mkl/*.h" "ATen/native/xpu/mkl")
install_xpu_headers("native/nested/xpu/*.h" "ATen/native/nested/xpu")
install_xpu_headers("native/nested/xpu/sycl/*.h" "ATen/native/nested/xpu/sycl")
install_xpu_headers("native/quantized/*.h" "ATen/native/quantized/xpu")
install_xpu_headers("native/quantized/sycl/*.h" "ATen/native/quantized/xpu/sycl")
install_xpu_headers("native/sparse/xpu/*.h" "ATen/native/sparse/xpu")
install_xpu_headers("native/sparse/xpu/sycl/*.h" "ATen/native/sparse/xpu/sycl")
install_xpu_headers("native/transformers/*.h" "ATen/native/transformers/xpu")
install_xpu_headers("native/transformers/sycl/*.h" "ATen/native/transformers/xpu/sycl")
install_xpu_headers("xpu")
install_xpu_headers("native/xpu")
install_xpu_headers("native/xpu/sycl")
install_xpu_headers("native/xpu/mkl")
install_xpu_headers("native/nested/xpu")
install_xpu_headers("native/nested/xpu/sycl")
install_xpu_headers("native/quantized/xpu")
install_xpu_headers("native/quantized/xpu/sycl")
install_xpu_headers("native/sparse/xpu")
install_xpu_headers("native/sparse/xpu/sycl")
install_xpu_headers("native/transformers/xpu")
install_xpu_headers("native/transformers/xpu/sycl")

if(xpu_ops_generated_headers)
install(FILES ${xpu_ops_generated_headers} DESTINATION ${AT_INSTALL_INCLUDE_DIR}/ATen/ops)
Expand Down
Loading