SWDEV-277697 - Adding Infra and dependent libs: Catch2 and json parser, for new HIP Testing framework

Change-Id: Iedfa041ec9acc13eeb631ff67e1677e2fe29463d
Este commit está contenido en:
cjatin
2021-04-08 14:09:19 +05:30
cometido por Maneesh Gupta
padre 871c167fd0
commit 8084df7b49
Se han modificado 34 ficheros con 20953 adiciones y 8 borrados
+11
Ver fichero
@@ -0,0 +1,11 @@
# Common Tests - Test independent of all platforms
set(TEST_SRC
memset.cc
malloc.cc
)
# Create shared lib of all tests
add_library(MemoryTest SHARED EXCLUDE_FROM_ALL ${TEST_SRC})
# Add dependency on build_tests to build it on this custom target
add_dependencies(build_tests MemoryTest)
+17
Ver fichero
@@ -0,0 +1,17 @@
#include <hip_test_common.hh>
TEST_CASE("HostAllocBasic") {
int* d_a;
auto res = hipHostMalloc(&d_a, sizeof(int), 0);
REQUIRE(res == hipSuccess);
res = hipHostFree(d_a);
REQUIRE(res == hipSuccess);
}
TEST_CASE("AllocateBasic") {
int* d_a;
auto res = hipMalloc(&d_a, sizeof(int));
REQUIRE(res == hipSuccess);
res = hipFree(d_a);
REQUIRE(res == hipSuccess);
}
+19
Ver fichero
@@ -0,0 +1,19 @@
#include <hip_test_common.hh>
TEST_CASE("MemsetBasic") {
int* d_a;
auto res = hipMalloc(&d_a, sizeof(int));
REQUIRE(res == hipSuccess);
res = hipMemset(d_a, 0, sizeof(int));
REQUIRE(res == hipSuccess);
hipFree(d_a);
}
TEST_CASE("HostMemsetBasic") {
int* d_a;
auto res = hipHostMalloc(&d_a, sizeof(int), 0);
REQUIRE(res == hipSuccess);
res = hipMemset(d_a, 0, sizeof(int));
REQUIRE(res == hipSuccess);
hipHostFree(d_a);
}