forked from codeplaysoftware/portBLAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
64 lines (58 loc) · 2.27 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#/***************************************************************************
# *
# * @license
# * Copyright (C) Codeplay Software Limited
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * For your convenience, a copy of the License has been included in this
# * repository.
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *
# * portBLAS: BLAS implementation using SYCL
# *
# * @filename CMakeLists.txt
# *
# **************************************************************************/
cmake_minimum_required(VERSION 3.4.3)
project(portBLASSample LANGUAGES CXX)
set(PORTBLAS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../include)
set(PORTBLAS_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/..)
include(ConfigurePORTBLAS)
include(SYCL)
find_package(PORTBLAS REQUIRED)
set(SAMPLES_LIST
gemv.cpp
gemm.cpp
symm.cpp
)
foreach(src_file ${SAMPLES_LIST})
get_filename_component(sample_exec ${src_file} NAME_WE)
set(sample_exec "sample_${sample_exec}")
add_executable(${sample_exec} ${src_file})
if(is_adaptivecpp OR is_dpcpp)
set_target_properties(${sample_exec} PROPERTIES CXX_STANDARD 17)
else()
set_target_properties(${sample_exec} PROPERTIES CXX_STANDARD 14)
endif()
target_compile_definitions(${sample_exec} PRIVATE -D${TUNING_TARGET})
target_compile_definitions(${sample_exec} PUBLIC GEMM_VECTORIZATION_SUPPORT=1)
add_sycl_to_target(
TARGET ${sample_exec}
SOURCES ${src_file}
)
target_link_libraries(${sample_exec} PRIVATE PORTBLAS::PORTBLAS)
install(TARGETS ${sample_exec} RUNTIME DESTINATION bin)
endforeach()
include_directories(${PORTBLAS_INCLUDE} ${SYCL_INCLUDE_DIRS} ${THIRD_PARTIES_INCLUDE})