diff --git a/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_common.json b/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_common.json index 8b8c42fcd4..d7440af317 100644 --- a/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_common.json +++ b/projects/hip-tests/catch/hipTestMain/config/config_amd_linux_common.json @@ -4,6 +4,7 @@ "Unit_hipStreamPerThread_DeviceReset_1", "Unit_hipMallocManaged_OverSubscription", "Unit_hipDeviceGetCacheConfig_Positive_Basic", - "Unit_hipDeviceGetCacheConfig_Positive_Threaded" + "Unit_hipDeviceGetCacheConfig_Positive_Threaded", + "Unit_hipGetDeviceFlags_Positive_Context" ] } diff --git a/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_MI2xx.json b/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_MI2xx.json index 013f7c67d8..6ee5669f0b 100644 --- a/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_MI2xx.json +++ b/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_MI2xx.json @@ -88,6 +88,6 @@ "Unit_hipStreamValue_Wait64_Blocking_NoMask_Gte", "Unit_hipStreamValue_Wait64_Blocking_NoMask_Eq", "Unit_hipStreamValue_Wait64_Blocking_NoMask_And", - "Unit_hipStreamValue_Wait64_Blocking_NoMask_Nor" + "Unit_hipStreamValue_Wait64_Blocking_NoMask_Nor" ] } diff --git a/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_common.json b/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_common.json index 2094761dc2..bd3105a537 100644 --- a/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_common.json +++ b/projects/hip-tests/catch/hipTestMain/config/config_amd_windows_common.json @@ -97,6 +97,7 @@ "Unit_hipStreamValue_Wait64_Blocking_NoMask_Gte", "Unit_hipStreamValue_Wait64_Blocking_NoMask_Eq", "Unit_hipStreamValue_Wait64_Blocking_NoMask_And", - "Unit_hipStreamValue_Wait64_Blocking_NoMask_Nor" + "Unit_hipStreamValue_Wait64_Blocking_NoMask_Nor", + "Unit_hipGetDeviceFlags_Positive_Context" ] } diff --git a/projects/hip-tests/catch/unit/device/hipGetSetDeviceFlags.cc b/projects/hip-tests/catch/unit/device/hipGetSetDeviceFlags.cc index c134a21ad0..c661f4e7ba 100644 --- a/projects/hip-tests/catch/unit/device/hipGetSetDeviceFlags.cc +++ b/projects/hip-tests/catch/unit/device/hipGetSetDeviceFlags.cc @@ -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)); +} \ No newline at end of file