blob: 0def9eacf7bc35479836edc0b8d28fff29dd9abe [file] [log] [blame]
Viet-Hoa Doce3c48c2023-07-03 13:44:43 +01001# Copyright (c) 2023 Arm Limited.
2#
3# SPDX-License-Identifier: MIT
4#
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to
7# deal in the Software without restriction, including without limitation the
8# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9# sell copies of the Software, and to permit persons to whom the Software is
10# furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included in all
13# copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21# SOFTWARE.
22
23cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
24
25#---------------------------------------------------------------------
26# Prototype
27
28add_library(ckw_prototype
29 src/TileInfo.cpp
30 src/TensorInfo.cpp
31 src/Kernel.cpp
32 src/KernelWriter.cpp
33 src/OperandBase.cpp
34 src/TileOperand.cpp
35 src/TensorOperand.cpp
36 src/TensorTileSampler.cpp
37)
38
39target_compile_options(ckw_prototype
40 PUBLIC
41 ${CKW_CXX_FLAGS}
42 "$<$<CXX_COMPILER_ID:GNU>:${GNU_WARNINGS}>"
43 "$<$<CONFIG:Debug>:${CKW_ASSERTS_OPTS}>"
44 "$<$<BOOL:${CKW_ASSERTS}>:${CKW_ASSERTS_OPTS}>"
45 ${CMAKE_CXX_FLAGS}
Jakub Sujake86f9922023-07-05 17:30:02 +010046 PRIVATE
47 $<$<CONFIG:Release>:-Os>
Viet-Hoa Doce3c48c2023-07-03 13:44:43 +010048)
49
50target_compile_definitions(ckw_prototype PUBLIC
51 $<$<CONFIG:Debug>:COMPUTE_KERNEL_WRITER_DEBUG_ENABLED>
52 $<$<CONFIG:Debug>:COMPUTE_KERNEL_WRITER_ASSERTS_ENABLED>
53 $<$<BOOL:${CKW_ASSERTS}>:COMPUTE_KERNEL_WRITER_ASSERTS_ENABLED>
54 $<$<BOOL:${CKW_ENABLE_OPENCL}>:COMPUTE_KERNEL_WRITER_OPENCL_ENABLED>
55)
56
57target_include_directories(ckw_prototype
58 PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include
59 PRIVATE ${CMAKE_CURRENT_LIST_DIR}
60)
61
62#---------------------------------------------------------------------
63# Examples
64
65add_library(ckw_prototype_examples_common
66 examples/common/ExampleKernelWriter.cpp
67 examples/common/ExampleScopedKernelWriter.cpp
68 examples/common/ExampleComponentArgument.cpp
69)
70
71target_link_libraries(ckw_prototype_examples_common PUBLIC ckw_prototype)
72
73add_executable(ckw_prototype_examples_add_exp_store examples/add_exp_store.cpp)
74target_link_libraries(ckw_prototype_examples_add_exp_store PUBLIC ckw_prototype_examples_common)