Skip to content

Commit

Permalink
[SYCL][HIP] Implemented supported make_* interop functions. (#10526)
Browse files Browse the repository at this point in the history
This PR adds missing functions in the hip backend to allow for
interoperability in programs that create sycl objects from native hip
objects. The new function implementations are:

- `make_device`
- `make_queue`
- `make_event`

Note that it would really make sense for
intel/llvm#10491 to be merged first because this
PR makes the same code change in pi2ur, for a fix that is attributed to
#10491.

---------

Signed-off-by: Jack Kirk <[email protected]>
  • Loading branch information
JackAKirk authored and omarahmed1111 committed Oct 23, 2023
1 parent 8c387ac commit da47450
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreateWithNativeHandle(
ur_native_handle_t hNativeQueue, ur_context_handle_t hContext,
ur_device_handle_t hDevice, const ur_queue_native_properties_t *pProperties,
ur_queue_handle_t *phQueue) {
(void)pProperties;
(void)hDevice;

unsigned int CuFlags;
Expand All @@ -263,13 +262,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreateWithNativeHandle(

// Create queue and set num_compute_streams to 1, as computeCuStreams has
// valid stream
*phQueue = new ur_queue_handle_t_{std::move(ComputeCuStreams),
std::move(TransferCuStreams),
hContext,
hContext->getDevice(),
CuFlags,
Flags,
/*backend_owns*/ false};
*phQueue =
new ur_queue_handle_t_{std::move(ComputeCuStreams),
std::move(TransferCuStreams),
hContext,
hContext->getDevice(),
CuFlags,
Flags,
/*backend_owns*/ pProperties->isNativeHandleOwned};
(*phQueue)->NumComputeStreams = 1;

return Return;
Expand Down

0 comments on commit da47450

Please sign in to comment.