2121# *
2222# **************************************************************************/
2323cmake_minimum_required (VERSION 3.4.3 )
24- project (blas VERSION 0.1 .0 LANGUAGES CXX )
24+ project (blas VERSION 0.2 .0 LANGUAGES CXX )
2525
2626if (POLICY CMP0074)
2727 cmake_policy (SET CMP0074 NEW )
@@ -63,14 +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
68- if (SYCL_COMPILER MATCHES "adaptivecpp" )
69+ if (SYCL_COMPILER MATCHES "adaptivecpp" OR ${CMAKE_CXX_COMPILER} MATCHES "acpp|syclcc" )
6970 if (BLAS_ENABLE_COMPLEX)
70- message (STATUS "SYCL Complex data is not supported on AdaptiveCpp/hipSYCL. Complex
71- data type is disabled" )
71+ message (STATUS "SYCL Complex data is not supported on AdaptiveCpp/hipSYCL. Complex data type is disabled" )
7272 set (BLAS_ENABLE_COMPLEX OFF )
7373 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 ()
7478endif ()
7579
7680add_library (onemath_sycl_blas INTERFACE )
@@ -79,7 +83,6 @@ set_target_properties(onemath_sycl_blas PROPERTIES
7983include (CheckCXXCompilerFlag )
8084check_cxx_compiler_flag ("-fsycl" is_dpcpp )
8185if (is_dpcpp)
82- target_compile_definitions (onemath_sycl_blas INTERFACE "SB_ENABLE_USM" )
8386 check_cxx_compiler_flag ("-mllvm=-enable-global-offset=false" support_disable_global_offset )
8487 if (${support_disable_global_offset} )
8588 if ((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM"
@@ -95,6 +98,9 @@ endif()
9598if (${BLAS_ENABLE_COMPLEX} )
9699 target_compile_definitions (onemath_sycl_blas INTERFACE "BLAS_ENABLE_COMPLEX" )
97100endif ()
101+ if (${BLAS_ENABLE_USM} )
102+ target_compile_definitions (onemath_sycl_blas INTERFACE "SB_ENABLE_USM" )
103+ endif ()
98104target_compile_definitions (onemath_sycl_blas INTERFACE ${TUNING_TARGET} )
99105target_compile_options (onemath_sycl_blas INTERFACE -Wno-deprecated-declarations )
100106target_compile_options (onemath_sycl_blas INTERFACE -Wno-deprecated-copy-with-user-provided-copy )
@@ -107,15 +113,24 @@ if((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM") AND NOT
107113endif ()
108114
109115include (CMakePackageConfigHelpers )
110- set (version_file "${CMAKE_CURRENT_BINARY_DIR} /cmake/onemath_sycl_blas-version.cmake" )
116+ set (version_file "${CMAKE_CURRENT_BINARY_DIR} /cmake/onemath_sycl_blas-config-version.cmake" )
117+ set (config_file "${CMAKE_CURRENT_BINARY_DIR} /cmake/onemath_sycl_blas-config.cmake" )
118+ set (targets_name "onemath_sycl_blas-targets" )
111119write_basic_package_version_file (${version_file}
112120 VERSION ${PROJECT_VERSION}
113121 COMPATIBILITY AnyNewerVersion
114122)
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} )
115130
116131include (GNUInstallDirs )
117132install (TARGETS onemath_sycl_blas
118- EXPORT onemath_sycl_blas
133+ EXPORT ${targets_name}
119134 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
120135 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
121136 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -132,16 +147,9 @@ install(DIRECTORY ${ONEMATH_SYCL_BLAS_INCLUDE}
132147 FILES_MATCHING PATTERN "*.hpp"
133148 )
134149
135- install (FILES ${version_file} DESTINATION ${CMAKE_INSTALL_PREFIX} )
136- install (EXPORT onemath_sycl_blas
150+ install (EXPORT ${targets_name}
137151 DESTINATION ${CMAKE_INSTALL_PREFIX}
138152 NAMESPACE ONEMATH_SYCL_BLAS::
139- FILE onemath_sycl_blas-config.cmake
140- )
141-
142- export (EXPORT onemath_sycl_blas
143- NAMESPACE ONEMATH_SYCL_BLAS::
144- FILE onemath_sycl_blas-config.cmake
145153)
146154
147155option (BLAS_ENABLE_CONST_INPUT "Whether to enable kernel instantiation with const input buffer" ON )
0 commit comments