Skip to content

Commit df6e9d2

Browse files
Georgi Mirazchiyskiomarahmed1111
authored andcommitted
Fix the Cuda adapter specific GetQueueFromEventCreatedWithNativeHandle event test
1 parent 3e16283 commit df6e9d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/adapters/cuda/event_tests.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// See LICENSE.TXT
44
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
#include "device.hpp"
67
#include "event.hpp"
78
#include "fixtures.h"
89
#include "raii.h"
@@ -15,7 +16,10 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(cudaEventTest);
1516
// initialized. In the Cuda adapter, an event can have nullptr command queue
1617
// because the interop API does not associate a UR-owned queue with the event.
1718
TEST_P(cudaEventTest, GetQueueFromEventCreatedWithNativeHandle) {
19+
CUcontext cuda_ctx = device->getNativeContext();
20+
EXPECT_NE(cuda_ctx, nullptr);
1821
RAIICUevent cuda_event;
22+
ASSERT_SUCCESS_CUDA(cuCtxSetCurrent(cuda_ctx));
1923
ASSERT_SUCCESS_CUDA(cuEventCreate(cuda_event.ptr(), CU_EVENT_DEFAULT));
2024

2125
auto native_event = reinterpret_cast<ur_native_handle_t>(cuda_event.get());

0 commit comments

Comments
 (0)