Files
rocm-systems/projects/hip-tests/catch/unit/memory/malloc.cc
T
cjatin 3d223b1631 SWDEV-289409 - Add first batch of device tests, add new exe, helper functions and update test Guidelines
Change-Id: I71929caf44725ba2cab7a6f0224bc37b9d04bcbb


[ROCm/hip-tests commit: 068e1f5043]
2021-06-23 00:51:50 -07:00

18 righe
400 B
C++

#include <hip_test_common.hh>
TEST_CASE("Unit_hipHostMalloc_4bytes") {
int* d_a;
auto res = hipHostMalloc(&d_a, sizeof(int), 0);
REQUIRE(res == hipSuccess);
res = hipHostFree(d_a);
REQUIRE(res == hipSuccess);
}
TEST_CASE("Unit_hipMalloc_4bytes") {
int* d_a;
auto res = hipMalloc(&d_a, sizeof(int));
REQUIRE(res == hipSuccess);
res = hipFree(d_a);
REQUIRE(res == hipSuccess);
}