blob: 439dcd3b7e89486b8b69ed9408187b4d88650594 [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
Viet-Hoa Doc8e16172023-06-27 14:09:46 +010037 src/KernelArgument.cpp
Viet-Hoa Doce3c48c2023-07-03 13:44:43 +010038)
39
40target_compile_options(ckw_prototype
41 PUBLIC
42 ${CKW_CXX_FLAGS}
43 "$<$<CXX_COMPILER_ID:GNU>:${GNU_WARNINGS}>"
44 "$<$<CONFIG:Debug>:${CKW_ASSERTS_OPTS}>"
ramy.elgammal@arm.coma04ae3e2023-07-27 18:23:17 +010045 "$<$<BOOL:${CKW_ENABLE_ASSERTS}>:${CKW_ASSERTS_OPTS}>"
Viet-Hoa Doce3c48c2023-07-03 13:44:43 +010046 ${CMAKE_CXX_FLAGS}
Jakub Sujake86f9922023-07-05 17:30:02 +010047 PRIVATE
48 $<$<CONFIG:Release>:-Os>
Viet-Hoa Doce3c48c2023-07-03 13:44:43 +010049)
50
51target_compile_definitions(ckw_prototype PUBLIC
52 $<$<CONFIG:Debug>:COMPUTE_KERNEL_WRITER_DEBUG_ENABLED>
53 $<$<CONFIG:Debug>:COMPUTE_KERNEL_WRITER_ASSERTS_ENABLED>
ramy.elgammal@arm.coma04ae3e2023-07-27 18:23:17 +010054 $<$<BOOL:${CKW_ENABLE_ASSERTS}>:COMPUTE_KERNEL_WRITER_ASSERTS_ENABLED>
Viet-Hoa Doce3c48c2023-07-03 13:44:43 +010055 $<$<BOOL:${CKW_ENABLE_OPENCL}>:COMPUTE_KERNEL_WRITER_OPENCL_ENABLED>
56)
57
58target_include_directories(ckw_prototype
59 PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include
60 PRIVATE ${CMAKE_CURRENT_LIST_DIR}
61)
62
63#---------------------------------------------------------------------
64# Examples
65
66add_library(ckw_prototype_examples_common
67 examples/common/ExampleKernelWriter.cpp
68 examples/common/ExampleScopedKernelWriter.cpp
69 examples/common/ExampleComponentArgument.cpp
70)
71
72target_link_libraries(ckw_prototype_examples_common PUBLIC ckw_prototype)
73
74add_executable(ckw_prototype_examples_add_exp_store examples/add_exp_store.cpp)
75target_link_libraries(ckw_prototype_examples_add_exp_store PUBLIC ckw_prototype_examples_common)
Nikolaj Jensenfab6c212023-06-27 14:13:24 +010076
77add_executable(writer_helper examples/writer_helper.cpp)
78target_link_libraries(writer_helper PUBLIC ckw_prototype)