Skip to content

Commit 02df0cc

Browse files
committed
Fix broken tests.
1 parent e40aa08 commit 02df0cc

File tree

2 files changed

+3
-33
lines changed

2 files changed

+3
-33
lines changed

test/adapters/cuda/context_tests.cpp

-31
Original file line numberDiff line numberDiff line change
@@ -43,37 +43,6 @@ TEST_P(cudaUrContextCreateTest, CreateWithChildThread) {
4343
callContextFromOtherThread.join();
4444
}
4545

46-
TEST_P(cudaUrContextCreateTest, ActiveContext) {
47-
uur::raii::Context context = nullptr;
48-
ASSERT_SUCCESS(urContextCreate(1, &device, nullptr, context.ptr()));
49-
ASSERT_NE(context, nullptr);
50-
51-
uur::raii::Queue queue = nullptr;
52-
ur_queue_properties_t queue_props{UR_STRUCTURE_TYPE_QUEUE_PROPERTIES, nullptr,
53-
0};
54-
ASSERT_SUCCESS(urQueueCreate(context, device, &queue_props, queue.ptr()));
55-
ASSERT_NE(queue, nullptr);
56-
57-
// check that the queue has the correct context
58-
ASSERT_EQ(context, queue->getContext());
59-
60-
// create a buffer
61-
uur::raii::Mem buffer = nullptr;
62-
ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_WRITE, 1024,
63-
nullptr, buffer.ptr()));
64-
ASSERT_NE(buffer, nullptr);
65-
66-
// check that the context is now the active CUDA context
67-
CUcontext cudaCtx = nullptr;
68-
ASSERT_SUCCESS_CUDA(cuCtxGetCurrent(&cudaCtx));
69-
ASSERT_NE(cudaCtx, nullptr);
70-
71-
ur_native_handle_t native_context = 0;
72-
ASSERT_SUCCESS(urContextGetNativeHandle(context, &native_context));
73-
ASSERT_NE(reinterpret_cast<CUcontext>(native_context), nullptr);
74-
ASSERT_EQ(cudaCtx, reinterpret_cast<CUcontext>(native_context));
75-
}
76-
7746
TEST_P(cudaUrContextCreateTest, ContextLifetimeExisting) {
7847
// start by setting up a CUDA context on the thread
7948
CUcontext original;

test/adapters/cuda/memory_tests.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ TEST_P(cudaMemoryTest, urMemBufferNoActiveContext) {
1414
constexpr size_t memSize = 1024u;
1515

1616
CUcontext current = nullptr;
17-
do {
17+
ASSERT_SUCCESS_CUDA(cuCtxGetCurrent(&current));
18+
while (current != nullptr) {
1819
CUcontext oldContext = nullptr;
1920
ASSERT_SUCCESS_CUDA(cuCtxPopCurrent(&oldContext));
2021
ASSERT_SUCCESS_CUDA(cuCtxGetCurrent(&current));
21-
} while (current != nullptr);
22+
}
2223

2324
uur::raii::Mem mem;
2425
ASSERT_SUCCESS(urMemBufferCreate(context, UR_MEM_FLAG_READ_WRITE, memSize,

0 commit comments

Comments
 (0)