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
Tá an tiomantas seo le fáil i:
Mirza Halilčević údaraithe agus GitHub tiomanta 2022-11-04 19:24:58 +05:30
1 tuismitheoir 72ab04d18d
tiomantas a6bbefbd95
4 comhad athraithe
+24 -3

Níor tháinig aon chomhaid le do chuardach

+19
Féach ar an gComhad
@@ -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));
}