EXSWHTEC-8 - Implement additional test for hipGetDeviceFlags (#2877)
- Validate that hipGetDeviceFlags returns flags with which the current context was created. - Disable Unit_hipGetDeviceFlags_Positive_Context on AMD
This commit is contained in:
@@ -145,3 +145,22 @@ TEST_CASE("Unit_hipGetSetDeviceFlags_Threaded") {
|
||||
test_thread.join();
|
||||
HIP_CHECK_THREAD_FINALIZE();
|
||||
}
|
||||
|
||||
TEST_CASE("Unit_hipGetDeviceFlags_Positive_Context") {
|
||||
auto validFlags = getValidFlags();
|
||||
const unsigned int flags =
|
||||
GENERATE_COPY(from_range(std::begin(validFlags), std::end(validFlags)));
|
||||
|
||||
HIP_CHECK(hipInit(0));
|
||||
|
||||
hipCtx_t ctx;
|
||||
HIP_CHECK(hipCtxCreate(&ctx, flags, 0));
|
||||
|
||||
unsigned int actual_flags;
|
||||
HIP_CHECK(hipGetDeviceFlags(&actual_flags));
|
||||
|
||||
REQUIRE(actual_flags == flags);
|
||||
|
||||
HIP_CHECK(hipCtxPopCurrent(&ctx));
|
||||
HIP_CHECK(hipCtxDestroy(ctx));
|
||||
}
|
||||
Reference in New Issue
Block a user