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
Dieser Commit ist enthalten in:
Mirza Halilčević verfasst und GitHub committed 2022-11-04 19:24:58 +05:30
1 Ursprung 72ab04d18d
Commit a6bbefbd95
4 Dateien geändert
+24 -3

Keine Dateien entsprechen Ihrer Suche

+19
Datei anzeigen
@@ -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));
}