Skip to content

Commit

Permalink
[UR] Bump tag to 47af3ee2 (#11868)
Browse files Browse the repository at this point in the history
testing branch for
[PR](oneapi-src/unified-runtime#1072) and adding
necessary fixes for it.

Co-authored-by: omarahmed1111 <omar.ahmed@codeplay.com>
  • Loading branch information
omarahmed1111 and omarahmed1111 authored Dec 1, 2023
1 parent 646ab08 commit 2f644e3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
14 changes: 7 additions & 7 deletions sycl/doc/design/CommandGraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ with the following entry-points:
| `urCommandBufferReleaseExp` | Decrementing reference count of command-buffer. |
| `urCommandBufferFinalizeExp` | No more commands can be appended, makes command-buffer ready to enqueue on a command-queue. |
| `urCommandBufferAppendKernelLaunchExp` | Append a kernel execution command to command-buffer. |
| `urCommandBufferAppendMemcpyUSMExp` | Append a USM memcpy command to the command-buffer. |
| `urCommandBufferAppendMembufferCopyExp` | Append a mem buffer copy command to the command-buffer. |
| `urCommandBufferAppendMembufferWriteExp` | Append a memory write command to a command-buffer object. |
| `urCommandBufferAppendMembufferReadExp` | Append a memory read command to a command-buffer object. |
| `urCommandBufferAppendMembufferCopyRectExp` | Append a rectangular memory copy command to a command-buffer object. |
| `urCommandBufferAppendMembufferWriteRectExp` | Append a rectangular memory write command to a command-buffer object. |
| `urCommandBufferAppendMembufferReadRectExp` | Append a rectangular memory read command to a command-buffer object. |
| `urCommandBufferAppendUSMMemcpyExp` | Append a USM memcpy command to the command-buffer. |
| `urCommandBufferAppendMemBufferCopyExp` | Append a mem buffer copy command to the command-buffer. |
| `urCommandBufferAppendMemBufferWriteExp` | Append a memory write command to a command-buffer object. |
| `urCommandBufferAppendMemBufferReadExp` | Append a memory read command to a command-buffer object. |
| `urCommandBufferAppendMemBufferCopyRectExp` | Append a rectangular memory copy command to a command-buffer object. |
| `urCommandBufferAppendMemBufferWriteRectExp` | Append a rectangular memory write command to a command-buffer object. |
| `urCommandBufferAppendMemBufferReadRectExp` | Append a rectangular memory read command to a command-buffer object. |
| `urCommandBufferEnqueueExp` | Submit command-buffer to a command-queue for execution. |

See the [UR EXP-COMMAND-BUFFER](https://oneapi-src.github.io/unified-runtime/core/EXP-COMMAND-BUFFER.html)
Expand Down
12 changes: 7 additions & 5 deletions sycl/plugins/unified_runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
include(FetchContent)

set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
# commit b3de31844ca45d1815c54d85f248f13ad81b6755
# Author: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
# Date: Tue Nov 28 16:21:43 2023 +0000
# Set version to v0.8.1
set(UNIFIED_RUNTIME_TAG v0.8.1)
# commit 47af3ee296ae0517213114332ffd3ac54a456b16
# Merge: bd76c510 f2ca7a91
# Author: Omar Ahmed <30423288+omarahmed1111@users.noreply.github.com>
# Date: Thu Nov 30 16:11:56 2023 +0000
# - Merge pull request #1072 from omarahmed1111/merge-some-main-changes-into-adapters-third-patch
# - Merge main into adapters branch
set(UNIFIED_RUNTIME_TAG 47af3ee296ae0517213114332ffd3ac54a456b16)

if(SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO)
set(UNIFIED_RUNTIME_REPO "${SYCL_PI_UR_OVERRIDE_FETCH_CONTENT_REPO}")
Expand Down
19 changes: 7 additions & 12 deletions sycl/plugins/unified_runtime/pi2ur.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,6 @@ inline pi_result piTearDown(void *PluginParameter) {
});
HANDLE_ERRORS(Ret);

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

Expand All @@ -803,7 +799,6 @@ inline pi_result piTearDown(void *PluginParameter) {
inline pi_result piPlatformsGet(pi_uint32 NumEntries, pi_platform *Platforms,
pi_uint32 *NumPlatforms) {

urInit(0, nullptr);
// We're not going through the UR loader so we're guaranteed to have exactly
// one adapter (whichever is statically linked). The PI plugin for UR has its
// own implementation of piPlatformsGet.
Expand Down Expand Up @@ -4376,7 +4371,7 @@ inline pi_result piextCommandBufferMemcpyUSM(
ur_exp_command_buffer_handle_t UrCommandBuffer =
reinterpret_cast<ur_exp_command_buffer_handle_t>(CommandBuffer);

HANDLE_ERRORS(urCommandBufferAppendMemcpyUSMExp(
HANDLE_ERRORS(urCommandBufferAppendUSMMemcpyExp(
UrCommandBuffer, DstPtr, SrcPtr, Size, NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint));

Expand All @@ -4394,7 +4389,7 @@ inline pi_result piextCommandBufferMemBufferCopy(
ur_mem_handle_t UrSrcMem = reinterpret_cast<ur_mem_handle_t>(SrcMem);
ur_mem_handle_t UrDstMem = reinterpret_cast<ur_mem_handle_t>(DstMem);

HANDLE_ERRORS(urCommandBufferAppendMembufferCopyExp(
HANDLE_ERRORS(urCommandBufferAppendMemBufferCopyExp(
UrCommandBuffer, UrSrcMem, UrDstMem, SrcOffset, DstOffset, Size,
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint));

Expand Down Expand Up @@ -4422,7 +4417,7 @@ inline pi_result piextCommandBufferMemBufferCopyRect(
UrRegion.height = Region->height_scalar;
UrRegion.width = Region->width_bytes;

HANDLE_ERRORS(urCommandBufferAppendMembufferCopyRectExp(
HANDLE_ERRORS(urCommandBufferAppendMemBufferCopyRectExp(
UrCommandBuffer, UrSrcMem, UrDstMem, UrSrcOrigin, UrDstOrigin, UrRegion,
SrcRowPitch, SrcSlicePitch, DstRowPitch, DstSlicePitch,
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint));
Expand Down Expand Up @@ -4452,7 +4447,7 @@ inline pi_result piextCommandBufferMemBufferReadRect(
UrRegion.height = Region->height_scalar;
UrRegion.width = Region->width_bytes;

HANDLE_ERRORS(urCommandBufferAppendMembufferReadRectExp(
HANDLE_ERRORS(urCommandBufferAppendMemBufferReadRectExp(
UrCommandBuffer, UrBuffer, UrBufferOffset, UrHostOffset, UrRegion,
BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch, Ptr,
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint));
Expand All @@ -4470,7 +4465,7 @@ inline pi_result piextCommandBufferMemBufferRead(
reinterpret_cast<ur_exp_command_buffer_handle_t>(CommandBuffer);
ur_mem_handle_t UrBuffer = reinterpret_cast<ur_mem_handle_t>(Src);

HANDLE_ERRORS(urCommandBufferAppendMembufferReadExp(
HANDLE_ERRORS(urCommandBufferAppendMemBufferReadExp(
UrCommandBuffer, UrBuffer, Offset, Size, Dst, NumSyncPointsInWaitList,
SyncPointWaitList, SyncPoint));

Expand Down Expand Up @@ -4499,7 +4494,7 @@ inline pi_result piextCommandBufferMemBufferWriteRect(
UrRegion.height = Region->height_scalar;
UrRegion.width = Region->width_bytes;

HANDLE_ERRORS(urCommandBufferAppendMembufferWriteRectExp(
HANDLE_ERRORS(urCommandBufferAppendMemBufferWriteRectExp(
UrCommandBuffer, UrBuffer, UrBufferOffset, UrHostOffset, UrRegion,
BufferRowPitch, BufferSlicePitch, HostRowPitch, HostSlicePitch,
const_cast<void *>(Ptr), NumSyncPointsInWaitList, SyncPointWaitList,
Expand All @@ -4519,7 +4514,7 @@ inline pi_result piextCommandBufferMemBufferWrite(
reinterpret_cast<ur_exp_command_buffer_handle_t>(CommandBuffer);
ur_mem_handle_t UrBuffer = reinterpret_cast<ur_mem_handle_t>(Buffer);

HANDLE_ERRORS(urCommandBufferAppendMembufferWriteExp(
HANDLE_ERRORS(urCommandBufferAppendMemBufferWriteExp(
UrCommandBuffer, UrBuffer, Offset, Size, const_cast<void *>(Ptr),
NumSyncPointsInWaitList, SyncPointWaitList, SyncPoint));

Expand Down
4 changes: 2 additions & 2 deletions sycl/plugins/unified_runtime/pi_unified_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static void releaseAdapters(std::vector<ur_adapter_handle_t> &Vec) {
for (auto Adapter : Vec) {
urAdapterRelease(Adapter);
}
urTearDown(nullptr);
urLoaderTearDown();
});
}

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

// Initialize UR and discover adapters
HANDLE_ERRORS(urInit(0, nullptr));
HANDLE_ERRORS(urLoaderInit(0, nullptr));
uint32_t NumAdapters;
HANDLE_ERRORS(urAdapterGet(0, nullptr, &NumAdapters));
if (NumAdapters > 0) {
Expand Down

0 comments on commit 2f644e3

Please sign in to comment.