SWDEV-491252 - Add stream capture testcases to host allocation APIs (#590)
* SWDEV-491252 - Add stream capture testcases to host allocation APIs * SWDEV-491252 - Add stream capture behavior testcase for hipFreeHost * SWDEV-491252 - Refactor capture testcases * SWDEV-491252 - Run clang-format --------- Co-authored-by: Marko Arandjelovic <Marko.Arandjelovic@amd.com>
Цей коміт міститься в:
зафіксовано
GitHub
джерело
0468340d03
коміт
bfbb005c42
@@ -71,3 +71,20 @@ TEST_CASE("Unit_hipMallocHost_Negative") {
|
||||
HIP_CHECK_ERROR(hipMallocHost(reinterpret_cast<void**>(&host_memory), -1), hipErrorOutOfMemory);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hipMallocHost_Capture") {
|
||||
int* host_memory = nullptr;
|
||||
|
||||
hipError_t capture_error = hipSuccess;
|
||||
constexpr bool kRelaxedModeAllowed = true;
|
||||
|
||||
BEGIN_CAPTURE_SYNC(capture_error, kRelaxedModeAllowed);
|
||||
HIP_CHECK_ERROR(hipMallocHost(reinterpret_cast<void**>(&host_memory), sizeof(int)),
|
||||
capture_error);
|
||||
END_CAPTURE_SYNC(capture_error);
|
||||
|
||||
if (capture_error == hipSuccess) {
|
||||
REQUIRE(host_memory != nullptr);
|
||||
HIP_CHECK(hipHostFree(host_memory));
|
||||
}
|
||||
}
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача