Dosyalar
ROCm CI Service Account ee95d39a40 SWDEV-361383 - Fixing compilation issue for stress test files under catch2 framework (#2998)
Change-Id: I4253a6cdb2c10bcb0021f869b7b3c4f1acd28787

[ROCm/hip-tests commit: 339a51dcaf]
2022-10-19 16:52:24 +05:30

35 satır
853 B
C++

#include <hip_test_common.hh>
TEST_CASE("Stress_hipMalloc", "DifferentSizes") {
int* d_a = nullptr;
SECTION("Size 10") {
auto res = hipMalloc(&d_a, sizeof(10));
REQUIRE(res == hipSuccess);
HIP_CHECK(hipFree(d_a));
d_a = nullptr;
}
SECTION("Size 100") {
auto res = hipMalloc(&d_a, sizeof(100));
REQUIRE(res == hipSuccess);
HIP_CHECK(hipFree(d_a));
d_a = nullptr;
}
SECTION("Size 1000") {
auto res = hipMalloc(&d_a, sizeof(1000));
REQUIRE(res == hipSuccess);
HIP_CHECK(hipFree(d_a));
d_a = nullptr;
}
SECTION("Size 10000") {
auto res = hipMalloc(&d_a, sizeof(10000));
REQUIRE(res == hipSuccess);
HIP_CHECK(hipFree(d_a));
d_a = nullptr;
}
SECTION("Size MAX") {
auto res = hipMalloc(&d_a, ~(size_t)0);
REQUIRE(res == hipErrorOutOfMemory);
d_a = nullptr;
}
}