Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][CUDA] Pass device from context in create queue. #10491

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion sycl/plugins/unified_runtime/pi2ur.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,6 @@ inline pi_result piextQueueCreateWithNativeHandle(
PI_ASSERT(Context, PI_ERROR_INVALID_CONTEXT);
PI_ASSERT(NativeHandle, PI_ERROR_INVALID_VALUE);
PI_ASSERT(Queue, PI_ERROR_INVALID_QUEUE);
PI_ASSERT(Device, PI_ERROR_INVALID_DEVICE);

ur_context_handle_t UrContext =
reinterpret_cast<ur_context_handle_t>(Context);
Expand Down
4 changes: 2 additions & 2 deletions sycl/plugins/unified_runtime/ur/adapters/cuda/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreateWithNativeHandle(
ur_device_handle_t hDevice, const ur_queue_native_properties_t *pProperties,
ur_queue_handle_t *phQueue) {
(void)pProperties;
(void)hDevice;

unsigned int CuFlags;
CUstream CuStream = reinterpret_cast<CUstream>(hNativeQueue);
UR_ASSERT(hContext->getDevice() == hDevice, UR_RESULT_ERROR_INVALID_DEVICE);

auto Return = UR_CHECK_ERROR(cuStreamGetFlags(CuStream, &CuFlags));

Expand All @@ -266,7 +266,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreateWithNativeHandle(
*phQueue = new ur_queue_handle_t_{std::move(ComputeCuStreams),
std::move(TransferCuStreams),
hContext,
hDevice,
hContext->getDevice(),
CuFlags,
Flags,
/*backend_owns*/ false};
Expand Down