Davide Grohmann | f036423 | 2022-06-16 17:42:58 +0200 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2022 Arm Limited. |
| 3 | # |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the License); you may |
| 7 | # not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| 14 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # |
| 18 | |
| 19 | set(CORE_PLATFORM_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../core_platform) |
| 20 | |
| 21 | file(GLOB models LIST_DIRECTORIES true "${CORE_PLATFORM_PATH}/applications/baremetal/models/${ETHOSU_TARGET_NPU_CONFIG}/*") |
| 22 | |
Davide Grohmann | 6d2e5b7 | 2022-08-24 17:01:40 +0200 | [diff] [blame^] | 23 | function(add_test_executable testname) |
| 24 | # Build executable |
| 25 | foreach(model ${models}) |
| 26 | get_filename_component(modelname ${model} NAME) |
Davide Grohmann | f036423 | 2022-06-16 17:42:58 +0200 | [diff] [blame] | 27 | |
Davide Grohmann | 6d2e5b7 | 2022-08-24 17:01:40 +0200 | [diff] [blame^] | 28 | add_executable(lds_${testname}_${modelname} ${testname}.cpp) |
Davide Grohmann | f036423 | 2022-06-16 17:42:58 +0200 | [diff] [blame] | 29 | |
Davide Grohmann | 6d2e5b7 | 2022-08-24 17:01:40 +0200 | [diff] [blame^] | 30 | target_include_directories(lds_${testname}_${modelname} PRIVATE |
| 31 | ${model}) |
Davide Grohmann | f036423 | 2022-06-16 17:42:58 +0200 | [diff] [blame] | 32 | |
Davide Grohmann | 6d2e5b7 | 2022-08-24 17:01:40 +0200 | [diff] [blame^] | 33 | # Link agains ethosu library |
| 34 | target_link_libraries(lds_${testname}_${modelname} PRIVATE ethosu) |
Davide Grohmann | f036423 | 2022-06-16 17:42:58 +0200 | [diff] [blame] | 35 | |
Davide Grohmann | 6d2e5b7 | 2022-08-24 17:01:40 +0200 | [diff] [blame^] | 36 | # Install target |
| 37 | install(TARGETS lds_${testname}_${modelname} DESTINATION "bin") |
| 38 | endforeach() |
| 39 | endfunction() |
| 40 | |
| 41 | add_test_executable(run_inference_test) |
| 42 | add_test_executable(cancel_inference_test) |