Commit 69bfcfb8 authored by Paul's avatar Paul
Browse files

Add header tests for cpu and gpu targets as well

parent 58681660
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_KERNELS_HPP #ifndef MIGRAPH_GUARD_MIGRAPHLIB_KERNELS_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_KERNELS_HPP #define MIGRAPH_GUARD_MIGRAPHLIB_KERNELS_HPP
#include <migraph/argument.hpp>
namespace migraph { namespace migraph {
namespace gpu { namespace gpu {
void hip_contiguous(migraph::shape output_shape, migraph::argument arg, migraph::argument result); void hip_contiguous(shape output_shape, argument arg, argument result);
} // namespace gpu } // namespace gpu
......
...@@ -131,9 +131,30 @@ function(test_header NAME HEADER) ...@@ -131,9 +131,30 @@ function(test_header NAME HEADER)
) )
endfunction() endfunction()
file(GLOB HEADERS ${CMAKE_SOURCE_DIR}/src/include/migraph/*.hpp) function(test_headers PREFIX)
file(GLOB HEADERS ${ARGN})
foreach(HEADER ${HEADERS})
file(RELATIVE_PATH HEADER_REL ${CMAKE_SOURCE_DIR} ${HEADER})
string(MAKE_C_IDENTIFIER ${HEADER_REL} TEST_NAME)
get_filename_component(BASE_NAME ${HEADER} NAME_WE)
test_header(header_${TEST_NAME} ${PREFIX}/${BASE_NAME}.hpp)
if(MIGRAPH_ENABLE_GPU)
target_link_libraries(header_${TEST_NAME} migraph_gpu)
endif()
endforeach()
endfunction()
foreach(HEADER ${HEADERS}) test_headers(migraph ${CMAKE_SOURCE_DIR}/src/include/migraph/*.hpp)
get_filename_component(BASE_NAME ${HEADER} NAME_WE) test_headers(migraph/cpu ${CMAKE_SOURCE_DIR}/src/targets/cpu/include/migraph/cpu/*.hpp)
test_header(header_${BASE_NAME} migraph/${BASE_NAME}.hpp) if(MIGRAPH_ENABLE_GPU)
endforeach() test_headers(migraph/gpu ${CMAKE_SOURCE_DIR}/src/targets/gpu/include/migraph/gpu/*.hpp)
endif()
# file(GLOB HEADERS ${CMAKE_SOURCE_DIR}/src/include/migraph/*.hpp)
# file(GLOB HEADERS ${CMAKE_SOURCE_DIR}/src/targets/cpu/include/migraph/cpu/*.hpp)
# foreach(HEADER ${HEADERS})
# get_filename_component(BASE_NAME ${HEADER} NAME_WE)
# test_header(header_${BASE_NAME} migraph/${BASE_NAME}.hpp)
# endforeach()
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