Skip to content

Commit 28b2b5b

Browse files
committed
Add some fixes relevant to adapters second bump
1 parent 3aa5d07 commit 28b2b5b

File tree

4 files changed

+23
-28
lines changed

4 files changed

+23
-28
lines changed

sycl/doc/design/CommandGraph.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ with the following entry-points:
3636
| `urCommandBufferReleaseExp` | Decrementing reference count of command-buffer. |
3737
| `urCommandBufferFinalizeExp` | No more commands can be appended, makes command-buffer ready to enqueue on a command-queue. |
3838
| `urCommandBufferAppendKernelLaunchExp` | Append a kernel execution command to command-buffer. |
39-
| `urCommandBufferAppendMemcpyUSMExp` | Append a USM memcpy command to the command-buffer. |
40-
| `urCommandBufferAppendMembufferCopyExp` | Append a mem buffer copy command to the command-buffer. |
41-
| `urCommandBufferAppendMembufferWriteExp` | Append a memory write command to a command-buffer object. |
42-
| `urCommandBufferAppendMembufferReadExp` | Append a memory read command to a command-buffer object. |
43-
| `urCommandBufferAppendMembufferCopyRectExp` | Append a rectangular memory copy command to a command-buffer object. |
44-
| `urCommandBufferAppendMembufferWriteRectExp` | Append a rectangular memory write command to a command-buffer object. |
45-
| `urCommandBufferAppendMembufferReadRectExp` | Append a rectangular memory read command to a command-buffer object. |
39+
| `urCommandBufferAppendUSMMemcpyExp` | Append a USM memcpy command to the command-buffer. |
40+
| `urCommandBufferAppendMemBufferCopyExp` | Append a mem buffer copy command to the command-buffer. |
41+
| `urCommandBufferAppendMemBufferWriteExp` | Append a memory write command to a command-buffer object. |
42+
| `urCommandBufferAppendMemBufferReadExp` | Append a memory read command to a command-buffer object. |
43+
| `urCommandBufferAppendMemBufferCopyRectExp` | Append a rectangular memory copy command to a command-buffer object. |
44+
| `urCommandBufferAppendMemBufferWriteRectExp` | Append a rectangular memory write command to a command-buffer object. |
45+
| `urCommandBufferAppendMemBufferReadRectExp` | Append a rectangular memory read command to a command-buffer object. |
4646
| `urCommandBufferEnqueueExp` | Submit command-buffer to a command-queue for execution. |
4747

4848
See the [UR EXP-COMMAND-BUFFER](https://oneapi-src.github.io/unified-runtime/core/EXP-COMMAND-BUFFER.html)

sycl/plugins/unified_runtime/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ endif()
5555
if(SYCL_PI_UR_USE_FETCH_CONTENT)
5656
include(FetchContent)
5757

58-
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
59-
# commit 659d3f469faa99a886fa680a3d6d20449b109578
60-
# Merge: 192e9404 f94550b4
58+
set(UNIFIED_RUNTIME_REPO "https://github.com/omarahmed1111/unified-runtime.git")
59+
60+
# commit be53fb3ba5bf1ac33051456d72c61b6a01d94a72
6161
# Author: Kenneth Benzie (Benie) <[email protected]>
62-
# Date: Tue Nov 14 16:45:24 2023 +0000
63-
# Merge pull request #1059 from martygrant/martin/moveNativeCPUAdapterToUR
64-
# [NATIVECPU] Move Native CPU adapter to UR.
65-
set(UNIFIED_RUNTIME_TAG 659d3f469faa99a886fa680a3d6d20449b109578)
62+
# Date: Tue Oct 31 13:22:52 2023 +0000
63+
# - Merge pull request #932 from Bensuo/cuda-cmd-buffers
64+
# - [CUDA][EXP] CUDA adapter support for command buffers
65+
set(UNIFIED_RUNTIME_TAG dad65343c75c3a98728facb66b2c6d7425990729)
6666

6767
if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
6868
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")

sycl/plugins/unified_runtime/pi2ur.hpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -787,10 +787,6 @@ inline pi_result piTearDown(void *PluginParameter) {
787787
});
788788
HANDLE_ERRORS(Ret);
789789

790-
// TODO: Dont check for errors in urTearDown, since
791-
// when using Level Zero plugin, the second urTearDown
792-
// will fail as ur_loader.so has already been unloaded,
793-
urTearDown(nullptr);
794790
return PI_SUCCESS;
795791
}
796792

@@ -799,7 +795,6 @@ inline pi_result piTearDown(void *PluginParameter) {
799795
inline pi_result piPlatformsGet(pi_uint32 NumEntries, pi_platform *Platforms,
800796
pi_uint32 *NumPlatforms) {
801797

802-
urInit(0, nullptr);
803798
// We're not going through the UR loader so we're guaranteed to have exactly
804799
// one adapter (whichever is statically linked). The PI plugin for UR has its
805800
// own implementation of piPlatformsGet.
@@ -4354,7 +4349,7 @@ inline pi_result piextCommandBufferMemcpyUSM(
43544349
ur_exp_command_buffer_handle_t UrCommandBuffer =
43554350
reinterpret_cast<ur_exp_command_buffer_handle_t>(CommandBuffer);
43564351

4357-
HANDLE_ERRORS(urCommandBufferAppendMemcpyUSMExp(
4352+
HANDLE_ERRORS(urCommandBufferAppendUSMMemcpyExp(
43584353
UrCommandBuffer, DstPtr, SrcPtr, Size, NumSyncPointsInWaitList,
43594354
SyncPointWaitList, SyncPoint));
43604355

@@ -4372,7 +4367,7 @@ inline pi_result piextCommandBufferMemBufferCopy(
43724367
ur_mem_handle_t UrSrcMem = reinterpret_cast<ur_mem_handle_t>(SrcMem);
43734368
ur_mem_handle_t UrDstMem = reinterpret_cast<ur_mem_handle_t>(DstMem);
43744369

4375-
HANDLE_ERRORS(urCommandBufferAppendMembufferCopyExp(
4370+
HANDLE_ERRORS(urCommandBufferAppendMemBufferCopyExp(
43764371
UrCommandBuffer, UrSrcMem, UrDstMem, SrcOffset, DstOffset, Size,
43774372
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint));
43784373

@@ -4400,7 +4395,7 @@ inline pi_result piextCommandBufferMemBufferCopyRect(
44004395
UrRegion.height = Region->height_scalar;
44014396
UrRegion.width = Region->width_bytes;
44024397

4403-
HANDLE_ERRORS(urCommandBufferAppendMembufferCopyRectExp(
4398+
HANDLE_ERRORS(urCommandBufferAppendMemBufferCopyRectExp(
44044399
UrCommandBuffer, UrSrcMem, UrDstMem, UrSrcOrigin, UrDstOrigin, UrRegion,
44054400
SrcRowPitch, SrcSlicePitch, DstRowPitch, DstSlicePitch,
44064401
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint));
@@ -4430,7 +4425,7 @@ inline pi_result piextCommandBufferMemBufferReadRect(
44304425
UrRegion.height = Region->height_scalar;
44314426
UrRegion.width = Region->width_bytes;
44324427

4433-
HANDLE_ERRORS(urCommandBufferAppendMembufferReadRectExp(
4428+
HANDLE_ERRORS(urCommandBufferAppendMemBufferReadRectExp(
44344429
UrCommandBuffer, UrBuffer, UrBufferOffset, UrHostOffset, UrRegion,
44354430
BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch, Ptr,
44364431
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint));
@@ -4448,7 +4443,7 @@ inline pi_result piextCommandBufferMemBufferRead(
44484443
reinterpret_cast<ur_exp_command_buffer_handle_t>(CommandBuffer);
44494444
ur_mem_handle_t UrBuffer = reinterpret_cast<ur_mem_handle_t>(Src);
44504445

4451-
HANDLE_ERRORS(urCommandBufferAppendMembufferReadExp(
4446+
HANDLE_ERRORS(urCommandBufferAppendMemBufferReadExp(
44524447
UrCommandBuffer, UrBuffer, Offset, Size, Dst, NumSyncPointsInWaitList,
44534448
SyncPointWaitList, SyncPoint));
44544449

@@ -4477,7 +4472,7 @@ inline pi_result piextCommandBufferMemBufferWriteRect(
44774472
UrRegion.height = Region->height_scalar;
44784473
UrRegion.width = Region->width_bytes;
44794474

4480-
HANDLE_ERRORS(urCommandBufferAppendMembufferWriteRectExp(
4475+
HANDLE_ERRORS(urCommandBufferAppendMemBufferWriteRectExp(
44814476
UrCommandBuffer, UrBuffer, UrBufferOffset, UrHostOffset, UrRegion,
44824477
BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch,
44834478
const_cast<void *>(Ptr), NumSyncPointsInWaitList, SyncPointWaitList,
@@ -4497,7 +4492,7 @@ inline pi_result piextCommandBufferMemBufferWrite(
44974492
reinterpret_cast<ur_exp_command_buffer_handle_t>(CommandBuffer);
44984493
ur_mem_handle_t UrBuffer = reinterpret_cast<ur_mem_handle_t>(Buffer);
44994494

4500-
HANDLE_ERRORS(urCommandBufferAppendMembufferWriteExp(
4495+
HANDLE_ERRORS(urCommandBufferAppendMemBufferWriteExp(
45014496
UrCommandBuffer, UrBuffer, Offset, Size, const_cast<void *>(Ptr),
45024497
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint));
45034498

sycl/plugins/unified_runtime/pi_unified_runtime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static void releaseAdapters(std::vector<ur_adapter_handle_t> &Vec) {
2525
for (auto Adapter : Vec) {
2626
urAdapterRelease(Adapter);
2727
}
28-
urTearDown(nullptr);
28+
urLoaderTearDown();
2929
});
3030
}
3131

@@ -1302,7 +1302,7 @@ __SYCL_EXPORT pi_result piPluginInit(pi_plugin *PluginInit) {
13021302
strncpy(PluginInit->PluginVersion, SupportedVersion, PluginVersionSize);
13031303

13041304
// Initialize UR and discover adapters
1305-
HANDLE_ERRORS(urInit(0, nullptr));
1305+
HANDLE_ERRORS(urLoaderInit(0, nullptr));
13061306
uint32_t NumAdapters;
13071307
HANDLE_ERRORS(urAdapterGet(0, nullptr, &NumAdapters));
13081308
if (NumAdapters > 0) {

0 commit comments

Comments
 (0)