Files
rocm-systems/tests/catch/unit/memory/malloc.cc
T
2021-05-19 00:47:00 -04:00

18 строки
381 B
C++

#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);
}