@@ -63,13 +63,18 @@ set(ONEMATH_SYCL_BLAS_INSTALL_SRC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/
6363
6464option (BLAS_ENABLE_EXTENSIONS "Whether to enable BLAS extensions" ON )
6565option (BLAS_ENABLE_COMPLEX "Whether to enable complex data type for GEMM" ON )
66+ option (BLAS_ENABLE_USM "Whether to enable USM API" ON )
6667option (BLAS_ENABLE_HALF "Whether to enable sycl::half data type for supported operators" ON )
6768
6869if (SYCL_COMPILER MATCHES "adaptivecpp" OR ${CMAKE_CXX_COMPILER} MATCHES "acpp|syclcc" )
6970 if (BLAS_ENABLE_COMPLEX)
7071 message (STATUS "SYCL Complex data is not supported on AdaptiveCpp/hipSYCL. Complex data type is disabled" )
7172 set (BLAS_ENABLE_COMPLEX OFF )
7273 endif ()
74+ if (BLAS_ENABLE_USM)
75+ message (STATUS "USM API is not supported on AdaptiveCpp/hipSYCL. USM API is disabled" )
76+ set (BLAS_ENABLE_USM OFF )
77+ endif ()
7378endif ()
7479
7580add_library (onemath_sycl_blas INTERFACE )
@@ -78,7 +83,6 @@ set_target_properties(onemath_sycl_blas PROPERTIES
7883include (CheckCXXCompilerFlag )
7984check_cxx_compiler_flag ("-fsycl" is_dpcpp )
8085if (is_dpcpp)
81- target_compile_definitions (onemath_sycl_blas INTERFACE "SB_ENABLE_USM" )
8286 check_cxx_compiler_flag ("-mllvm=-enable-global-offset=false" support_disable_global_offset )
8387 if (${support_disable_global_offset} )
8488 if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM"
@@ -94,6 +98,9 @@ endif()
9498if (${BLAS_ENABLE_COMPLEX} )
9599 target_compile_definitions (onemath_sycl_blas INTERFACE "BLAS_ENABLE_COMPLEX" )
96100endif ()
101+ if (${BLAS_ENABLE_USM} )
102+ target_compile_definitions (onemath_sycl_blas INTERFACE "SB_ENABLE_USM" )
103+ endif ()
97104target_compile_definitions (onemath_sycl_blas INTERFACE ${TUNING_TARGET} )
98105target_compile_options (onemath_sycl_blas INTERFACE -Wno-deprecated-declarations )
99106target_compile_options (onemath_sycl_blas INTERFACE -Wno-deprecated-copy-with-user-provided-copy )
@@ -107,14 +114,23 @@ endif()
107114
108115include (CMakePackageConfigHelpers )
109116set (version_file "${CMAKE_CURRENT_BINARY_DIR} /cmake/onemath_sycl_blas-version.cmake" )
117+ set (config_file "${CMAKE_CURRENT_BINARY_DIR} /cmake/onemath_sycl_blas-config.cmake" )
118+ set (targets_name "onemath_sycl_blas-targets" )
110119write_basic_package_version_file (${version_file}
111120 VERSION ${PROJECT_VERSION}
112121 COMPATIBILITY AnyNewerVersion
113122)
123+ configure_package_config_file (
124+ cmake/config.cmake.in
125+ ${config_file}
126+ INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}
127+ )
128+ install (FILES ${version_file} ${config_file}
129+ DESTINATION ${CMAKE_INSTALL_PREFIX} )
114130
115131include (GNUInstallDirs )
116132install (TARGETS onemath_sycl_blas
117- EXPORT onemath_sycl_blas
133+ EXPORT ${targets_name}
118134 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
119135 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
120136 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -131,16 +147,9 @@ install(DIRECTORY ${ONEMATH_SYCL_BLAS_INCLUDE}
131147 FILES_MATCHING PATTERN "*.hpp"
132148 )
133149
134- install (FILES ${version_file} DESTINATION ${CMAKE_INSTALL_PREFIX} )
135- install (EXPORT onemath_sycl_blas
150+ install (EXPORT ${targets_name}
136151 DESTINATION ${CMAKE_INSTALL_PREFIX}
137152 NAMESPACE ONEMATH_SYCL_BLAS::
138- FILE onemath_sycl_blas-config.cmake
139- )
140-
141- export (EXPORT onemath_sycl_blas
142- NAMESPACE ONEMATH_SYCL_BLAS::
143- FILE onemath_sycl_blas-config.cmake
144153)
145154
146155option (BLAS_ENABLE_CONST_INPUT "Whether to enable kernel instantiation with const input buffer" ON )
0 commit comments