17
17
# * See the License for the specific language governing permissions and
18
18
# * limitations under the License.
19
19
# *
20
- # * SYCL-BLAS : BLAS implementation using SYCL
20
+ # * portBLAS : BLAS implementation using SYCL
21
21
# *
22
22
# * @filename CMakeLists.txt
23
23
# *
24
24
# **************************************************************************/
25
25
cmake_minimum_required (VERSION 3.4.3 )
26
- project (sycl-blas VERSION 0.1.0 LANGUAGES CXX )
26
+ project (portBLAS VERSION 0.1.0 LANGUAGES CXX )
27
27
28
28
if (POLICY CMP0074 )
29
29
cmake_policy (SET CMP0074 NEW )
@@ -36,7 +36,7 @@ if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
36
36
list (APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} )
37
37
endif ()
38
38
39
- option (INSTALL_HEADER_ONLY "Install SYCL-BLAS as a header only library" OFF )
39
+ option (INSTALL_HEADER_ONLY "Install portBLAS as a header only library" OFF )
40
40
41
41
set (BUILD_SHARED_LIBS ON CACHE BOOL "" )
42
42
set (CMAKE_CXX_STANDARD 14 )
@@ -58,27 +58,27 @@ list(APPEND CMAKE_MODULE_PATH
58
58
)
59
59
60
60
# This turns the long file names that are generated into short versions using a hash
61
- # This is required to build SYCL-BLAS on Windows and on WSL since Windows doesn't
61
+ # This is required to build portBLAS on Windows and on WSL since Windows doesn't
62
62
# have good support for long file names
63
- option (SYCLBLAS_USE_SHORT_NAMES "Whether to use short names for generated files" OFF )
63
+ option (PORTBLAS_USE_SHORT_NAMES "Whether to use short names for generated files" OFF )
64
64
if (WIN32 )
65
65
# On WIN32 we can force this option to be true, but when building on WSL this
66
66
# must be set in the command line
67
- set (SYCLBLAS_USE_SHORT_NAMES ON CACHE BOOL "Enable short names for generated files in Windows" FORCE )
67
+ set (PORTBLAS_USE_SHORT_NAMES ON CACHE BOOL "Enable short names for generated files in Windows" FORCE )
68
68
endif ()
69
69
70
70
# Setup datatypes, workgroup sizes and other options.
71
71
# NB: This has to be included before CmakeFunctionHelper as it declares various options.
72
72
if (NOT INSTALL_HEADER_ONLY )
73
- include (ConfigureSYCLBLAS )
73
+ include (ConfigurePORTBLAS )
74
74
include (SYCL )
75
75
find_package (PythonInterp 3 REQUIRED )
76
76
endif ()
77
77
78
78
if (MSVC )
79
79
# The device compiler needs C++14 to parse the Windows headers
80
80
set (BUILD_SHARED_LIBS FALSE CACHE BOOL
81
- "Force SYCL-BLAS to be built as a static library on Windows"
81
+ "Force portBLAS to be built as a static library on Windows"
82
82
FORCE
83
83
)
84
84
endif ()
@@ -91,12 +91,12 @@ option(GEMM_VECTORIZATION_SUPPORT "Whether to enable vectorization in Gemm kerne
91
91
add_definitions (-DCL_TARGET_OPENCL_VERSION=220 )
92
92
93
93
set (CBLAS_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR} /external/cblas/include )
94
- set (SYCLBLAS_GENERATED_SRC ${CMAKE_CURRENT_BINARY_DIR} /generated_src )
95
- set (SYCLBLAS_INCLUDE $< BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>
94
+ set (PORTBLAS_GENERATED_SRC ${CMAKE_CURRENT_BINARY_DIR} /generated_src )
95
+ set (PORTBLAS_INCLUDE $< BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>
96
96
$< INSTALL_INTERFACE:include> )
97
- set (SYCLBLAS_COMMON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} /common/include )
98
- set (SYCLBLAS_SRC ${CMAKE_CURRENT_SOURCE_DIR} /src )
99
- set (SYCLBLAS_SRC_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR} /python_generator )
97
+ set (PORTBLAS_COMMON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} /common/include )
98
+ set (PORTBLAS_SRC ${CMAKE_CURRENT_SOURCE_DIR} /src )
99
+ set (PORTBLAS_SRC_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR} /python_generator )
100
100
list (APPEND THIRD_PARTIES_INCLUDE ${CBLAS_INCLUDE} )
101
101
102
102
if (IMGDNN_DIR )
@@ -105,7 +105,7 @@ if(IMGDNN_DIR)
105
105
list (APPEND THIRD_PARTIES_INCLUDE ${IMGDNN_INCLUDE_DIRS} )
106
106
endif ()
107
107
108
- option (BLAS_ENABLE_EXTENSIONS "Whether to enable sycl-blas extensions" ON )
108
+ option (BLAS_ENABLE_EXTENSIONS "Whether to enable portBLAS extensions" ON )
109
109
110
110
# CmakeFunctionHelper has to be included after any options that it depends on are declared.
111
111
# These include:
@@ -118,91 +118,91 @@ option(BLAS_ENABLE_EXTENSIONS "Whether to enable sycl-blas extensions" ON)
118
118
include (CmakeFunctionHelper )
119
119
120
120
if (INSTALL_HEADER_ONLY )
121
- add_library (sycl_blas INTERFACE )
122
- set_target_properties (sycl_blas PROPERTIES
123
- INTERFACE_INCLUDE_DIRECTORIES "${SYCLBLAS_INCLUDE } ;$<INSTALL_INTERFACE:src>"
121
+ add_library (portblas INTERFACE )
122
+ set_target_properties (portblas PROPERTIES
123
+ INTERFACE_INCLUDE_DIRECTORIES "${PORTBLAS_INCLUDE } ;$<INSTALL_INTERFACE:src>"
124
124
)
125
125
else ()
126
126
add_subdirectory (src )
127
- build_library (sycl_blas ${BLAS_ENABLE_EXTENSIONS} )
127
+ build_library (portblas ${BLAS_ENABLE_EXTENSIONS} )
128
128
if (WIN32 )
129
129
# On Windows, all symbols must be resolved at link time for DLLs.
130
- # The sycl_blas target is just a collection of other objects so
130
+ # The portblas target is just a collection of other objects so
131
131
# the linked libraries are not going to be propagated to this target.
132
132
# This requires manual linking against SYCL on Windows.
133
133
if (is_computecpp )
134
- target_link_libraries (sycl_blas PUBLIC ComputeCpp::ComputeCpp )
134
+ target_link_libraries (portblas PUBLIC ComputeCpp::ComputeCpp )
135
135
elseif (is_dpcpp )
136
- target_link_libraries (sycl_blas PUBLIC DPCPP::DPCPP )
136
+ target_link_libraries (portblas PUBLIC DPCPP::DPCPP )
137
137
elseif (is_hipsycl )
138
- target_link_libraries (sycl_blas PUBLIC hipSYCL::hipSYCL-rt )
138
+ target_link_libraries (portblas PUBLIC hipSYCL::hipSYCL-rt )
139
139
endif ()
140
140
endif ()
141
141
if (is_computecpp )
142
142
set (sycl_impl ComputeCpp::ComputeCpp )
143
143
elseif (is_dpcpp )
144
144
set (sycl_impl DPCPP::DPCPP )
145
- add_sycl_to_target (TARGET sycl_blas SOURCES )
145
+ add_sycl_to_target (TARGET portblas SOURCES )
146
146
elseif (is_hipsycl )
147
147
set (sycl_impl hipSYCL::hipSYCL-rt )
148
- add_sycl_to_target (TARGET sycl_blas SOURCES )
148
+ add_sycl_to_target (TARGET portblas SOURCES )
149
149
endif ()
150
150
if (IMGDNN_DIR )
151
- target_link_libraries (sycl_blas PUBLIC IMGDNN::IMGDNN )
151
+ target_link_libraries (portblas PUBLIC IMGDNN::IMGDNN )
152
152
endif ()
153
- set_target_properties (sycl_blas PROPERTIES
153
+ set_target_properties (portblas PROPERTIES
154
154
INTERFACE_LINK_LIBRARIES ${sycl_impl}
155
- INTERFACE_INCLUDE_DIRECTORIES "${SYCLBLAS_INCLUDE } "
155
+ INTERFACE_INCLUDE_DIRECTORIES "${PORTBLAS_INCLUDE } "
156
156
)
157
- set_target_properties (sycl_blas PROPERTIES
157
+ set_target_properties (portblas PROPERTIES
158
158
VERSION ${PROJECT_VERSION}
159
159
)
160
160
endif ()
161
161
162
162
include (CMakePackageConfigHelpers )
163
- set (version_file "${CMAKE_CURRENT_BINARY_DIR} /cmake/sycl_blas -version.cmake" )
163
+ set (version_file "${CMAKE_CURRENT_BINARY_DIR} /cmake/portblas -version.cmake" )
164
164
write_basic_package_version_file (${version_file}
165
165
VERSION ${PROJECT_VERSION}
166
166
COMPATIBILITY AnyNewerVersion
167
167
)
168
168
169
169
include (GNUInstallDirs )
170
- install (TARGETS sycl_blas
171
- EXPORT sycl_blas
170
+ install (TARGETS portblas
171
+ EXPORT portblas
172
172
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
173
173
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
174
174
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
175
175
)
176
176
177
- install (DIRECTORY ${SYCLBLAS_INCLUDE }
177
+ install (DIRECTORY ${PORTBLAS_INCLUDE }
178
178
DESTINATION ${CMAKE_INSTALL_PREFIX}
179
- COMPONENT sycl_blas
179
+ COMPONENT portblas
180
180
FILES_MATCHING PATTERN "*.h"
181
181
)
182
182
if (INSTALL_HEADER_ONLY )
183
- install (DIRECTORY ${SYCLBLAS_SRC }
183
+ install (DIRECTORY ${PORTBLAS_SRC }
184
184
DESTINATION ${CMAKE_INSTALL_PREFIX}
185
- COMPONENT sycl_blas
185
+ COMPONENT portblas
186
186
FILES_MATCHING PATTERN "*.hpp"
187
187
)
188
188
endif ()
189
189
190
190
install (FILES ${version_file} DESTINATION ${CMAKE_INSTALL_PREFIX} )
191
- install (EXPORT sycl_blas
191
+ install (EXPORT portblas
192
192
DESTINATION ${CMAKE_INSTALL_PREFIX}
193
- NAMESPACE SYCL_BLAS ::
194
- FILE sycl_blas -config.cmake
193
+ NAMESPACE PORTBLAS ::
194
+ FILE portblas -config.cmake
195
195
)
196
196
197
- export (EXPORT sycl_blas
198
- NAMESPACE SYCL_BLAS ::
199
- FILE sycl_blas -config.cmake
197
+ export (EXPORT portblas
198
+ NAMESPACE PORTBLAS ::
199
+ FILE portblas -config.cmake
200
200
)
201
201
202
202
option (BLAS_ENABLE_TESTING "Whether to enable testing" ON )
203
203
option (ENABLE_EXPRESSION_TESTS "Whether to build expression tree fusion tests" OFF )
204
204
if (INSTALL_HEADER_ONLY AND BLAS_ENABLE_TESTING )
205
- message (STATUS "Tests are disabled when installing SYCL-BLAS in header only mode" )
205
+ message (STATUS "Tests are disabled when installing portBLAS in header only mode" )
206
206
set (BLAS_ENABLE_TESTING OFF )
207
207
endif ()
208
208
@@ -219,13 +219,13 @@ option(BUILD_CLBLAS_BENCHMARKS "Whether to build clBLAS benchmarks" OFF)
219
219
option (BUILD_CUBLAS_BENCHMARKS "Whether to build cuBLAS benchmarks" OFF )
220
220
option (BUILD_ROCBLAS_BENCHMARKS "Whether to build rocBLAS benchmarks" OFF )
221
221
option (BUILD_ACL_BENCHMARKS "Whether to build ARM Compute Library benchmarks" OFF )
222
- option (BLAS_BUILD_SAMPLES "Whether to build SYCL-BLAS samples" ON )
222
+ option (BLAS_BUILD_SAMPLES "Whether to build portBLAS samples" ON )
223
223
if (INSTALL_HEADER_ONLY AND BLAS_ENABLE_BENCHMARK )
224
- message (STATUS "Benchmarks are disabled when installing SYCL-BLAS in header only mode" )
224
+ message (STATUS "Benchmarks are disabled when installing portBLAS in header only mode" )
225
225
set (BLAS_ENABLE_BENCHMARK OFF )
226
226
endif ()
227
227
if (INSTALL_HEADER_ONLY AND BLAS_BUILD_SAMPLES )
228
- message (STATUS "Samples are disabled when installing SYCL-BLAS in header only mode" )
228
+ message (STATUS "Samples are disabled when installing portBLAS in header only mode" )
229
229
set (BLAS_BUILD_SAMPLES OFF )
230
230
endif ()
231
231
0 commit comments