Viet-Hoa Do | ce3c48c | 2023-07-03 13:44:43 +0100 | [diff] [blame] | 1 | # 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 | |
| 23 | cmake_minimum_required(VERSION 3.14 FATAL_ERROR) |
| 24 | |
| 25 | #--------------------------------------------------------------------- |
| 26 | # Prototype |
| 27 | |
| 28 | add_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 Do | c8e1617 | 2023-06-27 14:09:46 +0100 | [diff] [blame] | 37 | src/KernelArgument.cpp |
Viet-Hoa Do | ce3c48c | 2023-07-03 13:44:43 +0100 | [diff] [blame] | 38 | ) |
| 39 | |
| 40 | target_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.com | a04ae3e | 2023-07-27 18:23:17 +0100 | [diff] [blame] | 45 | "$<$<BOOL:${CKW_ENABLE_ASSERTS}>:${CKW_ASSERTS_OPTS}>" |
Viet-Hoa Do | ce3c48c | 2023-07-03 13:44:43 +0100 | [diff] [blame] | 46 | ${CMAKE_CXX_FLAGS} |
Jakub Sujak | e86f992 | 2023-07-05 17:30:02 +0100 | [diff] [blame] | 47 | PRIVATE |
| 48 | $<$<CONFIG:Release>:-Os> |
Viet-Hoa Do | ce3c48c | 2023-07-03 13:44:43 +0100 | [diff] [blame] | 49 | ) |
| 50 | |
| 51 | target_compile_definitions(ckw_prototype PUBLIC |
| 52 | $<$<CONFIG:Debug>:COMPUTE_KERNEL_WRITER_DEBUG_ENABLED> |
| 53 | $<$<CONFIG:Debug>:COMPUTE_KERNEL_WRITER_ASSERTS_ENABLED> |
ramy.elgammal@arm.com | a04ae3e | 2023-07-27 18:23:17 +0100 | [diff] [blame] | 54 | $<$<BOOL:${CKW_ENABLE_ASSERTS}>:COMPUTE_KERNEL_WRITER_ASSERTS_ENABLED> |
Viet-Hoa Do | ce3c48c | 2023-07-03 13:44:43 +0100 | [diff] [blame] | 55 | $<$<BOOL:${CKW_ENABLE_OPENCL}>:COMPUTE_KERNEL_WRITER_OPENCL_ENABLED> |
| 56 | ) |
| 57 | |
| 58 | target_include_directories(ckw_prototype |
| 59 | PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include |
| 60 | PRIVATE ${CMAKE_CURRENT_LIST_DIR} |
| 61 | ) |
| 62 | |
| 63 | #--------------------------------------------------------------------- |
| 64 | # Examples |
| 65 | |
| 66 | add_library(ckw_prototype_examples_common |
| 67 | examples/common/ExampleKernelWriter.cpp |
| 68 | examples/common/ExampleScopedKernelWriter.cpp |
| 69 | examples/common/ExampleComponentArgument.cpp |
| 70 | ) |
| 71 | |
| 72 | target_link_libraries(ckw_prototype_examples_common PUBLIC ckw_prototype) |
| 73 | |
| 74 | add_executable(ckw_prototype_examples_add_exp_store examples/add_exp_store.cpp) |
| 75 | target_link_libraries(ckw_prototype_examples_add_exp_store PUBLIC ckw_prototype_examples_common) |
Nikolaj Jensen | fab6c21 | 2023-06-27 14:13:24 +0100 | [diff] [blame] | 76 | |
| 77 | add_executable(writer_helper examples/writer_helper.cpp) |
| 78 | target_link_libraries(writer_helper PUBLIC ckw_prototype) |