Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
69bfcfb8
Commit
69bfcfb8
authored
Aug 23, 2018
by
Paul
Browse files
Add header tests for cpu and gpu targets as well
parent
58681660
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
src/targets/gpu/include/migraph/gpu/kernels.hpp
src/targets/gpu/include/migraph/gpu/kernels.hpp
+4
-1
test/CMakeLists.txt
test/CMakeLists.txt
+26
-5
No files found.
src/targets/gpu/include/migraph/gpu/kernels.hpp
View file @
69bfcfb8
#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
...
...
test/CMakeLists.txt
View file @
69bfcfb8
...
@@ -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
}
)
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
)
get_filename_component
(
BASE_NAME
${
HEADER
}
NAME_WE
)
test_header
(
header_
${
BASE_NAME
}
migraph/
${
BASE_NAME
}
.hpp
)
test_header
(
header_
${
TEST_NAME
}
${
PREFIX
}
/
${
BASE_NAME
}
.hpp
)
endforeach
()
if
(
MIGRAPH_ENABLE_GPU
)
target_link_libraries
(
header_
${
TEST_NAME
}
migraph_gpu
)
endif
()
endforeach
()
endfunction
()
test_headers
(
migraph
${
CMAKE_SOURCE_DIR
}
/src/include/migraph/*.hpp
)
test_headers
(
migraph/cpu
${
CMAKE_SOURCE_DIR
}
/src/targets/cpu/include/migraph/cpu/*.hpp
)
if
(
MIGRAPH_ENABLE_GPU
)
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()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment