"ts/nni_manager/git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "800c675fae715a3206795ac62ffef46cd846c7fc"
Commit 201dd395 authored by Artur Wojcik's avatar Artur Wojcik
Browse files

fix tests compilation without CK on Windows

parent 24175729
...@@ -164,28 +164,36 @@ int main() {}\n" ...@@ -164,28 +164,36 @@ int main() {}\n"
endfunction() endfunction()
function(test_headers PREFIX) function(test_headers PREFIX)
file(GLOB HEADERS CONFIGURE_DEPENDS ${ARGN}) cmake_parse_arguments(PARSE "" "" "HEADERS;DEPENDS" ${ARGN})
foreach(HEADER ${PARSE_HEADERS})
foreach(HEADER ${HEADERS})
file(RELATIVE_PATH HEADER_REL ${CMAKE_SOURCE_DIR} ${HEADER}) file(RELATIVE_PATH HEADER_REL ${CMAKE_SOURCE_DIR} ${HEADER})
string(MAKE_C_IDENTIFIER ${HEADER_REL} TEST_NAME) string(MAKE_C_IDENTIFIER ${HEADER_REL} TEST_NAME)
get_filename_component(BASE_NAME ${HEADER} NAME_WE) get_filename_component(BASE_NAME ${HEADER} NAME_WE)
test_header(header_${TEST_NAME} ${PREFIX}/${BASE_NAME}.hpp) test_header(header_${TEST_NAME} ${PREFIX}/${BASE_NAME}.hpp)
target_link_libraries(header_${TEST_NAME} migraphx migraphx_onnx migraphx_tf migraphx_all_targets) target_link_libraries(header_${TEST_NAME} migraphx migraphx_onnx migraphx_tf migraphx_all_targets ${PARSE_DEPENDS})
endforeach() endforeach()
endfunction() endfunction()
test_headers(migraphx ${CMAKE_SOURCE_DIR}/src/include/migraphx/*.hpp) file(GLOB HEADERS CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/src/include/migraphx/*.hpp)
test_headers(migraphx/ref ${CMAKE_SOURCE_DIR}/src/targets/ref/include/migraphx/ref/*.hpp) test_headers(migraphx HEADERS ${HEADERS})
file(GLOB HEADERS CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/src/targets/ref/include/migraphx/ref/*.hpp)
test_headers(migraphx/ref HEADERS ${HEADERS})
if(MIGRAPHX_ENABLE_GPU) if(MIGRAPHX_ENABLE_GPU)
test_headers(migraphx/gpu HEADERS ${CMAKE_SOURCE_DIR}/src/targets/gpu/include/migraphx/gpu/*.hpp DEPENDS migraphx_gpu) file(GLOB HEADERS CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/src/targets/gpu/include/migraphx/gpu/*.hpp)
if(NOT MIGRAPHX_USE_COMPOSABLEKERNEL)
list(REMOVE_ITEM HEADERS ${CMAKE_SOURCE_DIR}/src/targets/gpu/include/migraphx/gpu/ck.hpp)
endif()
test_headers(migraphx/gpu HEADERS ${HEADERS} DEPENDS migraphx_gpu)
endif() endif()
if(MIGRAPHX_ENABLE_CPU) if(MIGRAPHX_ENABLE_CPU)
test_headers(migraphx/cpu HEADERS ${CMAKE_SOURCE_DIR}/src/targets/cpu/include/migraphx/cpu/*.hpp migraphx_cpu) file(GLOB HEADERS CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/src/targets/gpu/include/migraphx/cpu/*.hpp)
test_headers(migraphx/cpu ${HEADERS} DEPENDS migraphx_cpu)
endif() endif()
if(MIGRAPHX_ENABLE_FPGA) if(MIGRAPHX_ENABLE_FPGA)
test_headers(migraphx/fpga HEADERS ${CMAKE_SOURCE_DIR}/src/targets/fpga/include/migraphx/fpga/*.hpp migraphx_fpga) file(GLOB HEADERS CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/src/targets/gpu/include/migraphx/fpga/*.hpp)
test_headers(migraphx/fpga HEADERS ${HEADERS} DEPENDS migraphx_fpga)
endif() endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment