Skip to content

Commit

Permalink
[UR] Fix gcc diagnostic warning for deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Vesely committed Aug 14, 2023
1 parent fb46fd0 commit 5f1d231
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test/conformance/adapters/hip/test_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urHipContextTest);
constexpr int HIP_DRIVER_API_VERSION = 4;

TEST_P(urHipContextTest, ActiveContexts) {

ur_context_handle_t context = nullptr;
ASSERT_SUCCESS(urContextCreate(1, &device, nullptr, &context));
ASSERT_NE(context, nullptr);
Expand All @@ -29,7 +28,10 @@ TEST_P(urHipContextTest, ActiveContexts) {

// check that the current context is the active HIP context
hipCtx_t hipContext = nullptr;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
ASSERT_SUCCESS_HIP(hipCtxGetCurrent(&hipContext));
#pragma GCC diagnostic pop
ASSERT_NE(hipContext, nullptr);
ASSERT_EQ(hipContext, context->getDevice()->getNativeContext());

Expand Down Expand Up @@ -61,8 +63,11 @@ TEST_P(urHipContextTest, ActiveContextsThreads) {
// ensure queue has the correct context
ASSERT_EQ(queue->getContext(), context1);

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// check that the first context is now the active HIP context
ASSERT_SUCCESS_HIP(hipCtxGetCurrent(&current));
#pragma GCC diagnostic pop
ASSERT_EQ(current, context1->getDevice()->getNativeContext());

ASSERT_SUCCESS(urQueueRelease(queue));
Expand All @@ -88,8 +93,11 @@ TEST_P(urHipContextTest, ActiveContextsThreads) {
// ensure the queue has the correct context
ASSERT_EQ(queue->getContext(), context2);

// check that the second context is now the active HIP context
// check that the second context is now the active HIP context
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
ASSERT_SUCCESS_HIP(hipCtxGetCurrent(&current));
#pragma GCC diagnostic pop
ASSERT_EQ(current, context2->getDevice()->getNativeContext());

ASSERT_SUCCESS(urQueueRelease(queue));
Expand Down

0 comments on commit 5f1d231

Please sign in to comment.