Skip to content
Closed
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
2 changes: 1 addition & 1 deletion devops/scripts/benchmarks/benches/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def bin_args(self) -> list[str]:
"--iterations=100000",
"--Profiling=0",
"--NumKernels=10",
"--KernelExecTime=1",
"--KernelExecTime=20",
f"--UseEvents={self.UseEvents}",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ if(UR_BUILD_ADAPTER_L0_V2)
${CMAKE_CURRENT_SOURCE_DIR}/v2/queue_api.cpp
${CMAKE_CURRENT_SOURCE_DIR}/v2/queue_create.cpp
${CMAKE_CURRENT_SOURCE_DIR}/v2/queue_immediate_in_order.cpp
${CMAKE_CURRENT_SOURCE_DIR}/v2/queue_immediate_out_of_order.cpp
${CMAKE_CURRENT_SOURCE_DIR}/v2/usm.cpp
)
install_ur_library(ur_adapter_level_zero_v2)
Expand Down
41 changes: 20 additions & 21 deletions unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ ur_exp_command_buffer_handle_t_::ur_exp_command_buffer_handle_t_(
const ur_exp_command_buffer_desc_t *desc)
: commandListManager(
context, device,
std::forward<v2::raii::command_list_unique_handle>(commandList),
v2::EVENT_FLAGS_COUNTER, nullptr),
std::forward<v2::raii::command_list_unique_handle>(commandList)),
isUpdatable(desc ? desc->isUpdatable : false), context(context),
device(device) {}

Expand Down Expand Up @@ -246,7 +245,7 @@ ur_result_t urCommandBufferAppendKernelLaunchExp(
commandListLocked, hKernel, workDim, pGlobalWorkSize,
numKernelAlternatives, kernelAlternatives, command));
}
UR_CALL(commandListLocked->appendKernelLaunch(
UR_CALL(commandListLocked->enqueueKernelLaunch(
hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, pLocalWorkSize, 0,
nullptr, nullptr));
return UR_RESULT_SUCCESS;
Expand All @@ -266,8 +265,8 @@ ur_result_t urCommandBufferAppendUSMMemcpyExp(

// Responsibility of UMD to offload to copy engine
auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendUSMMemcpy(false, pDst, pSrc, size, 0,
nullptr, nullptr));
UR_CALL(commandListLocked->enqueueUSMMemcpy(false, pDst, pSrc, size, 0,
nullptr, nullptr));

return UR_RESULT_SUCCESS;
} catch (...) {
Expand All @@ -289,7 +288,7 @@ ur_result_t urCommandBufferAppendMemBufferCopyExp(
// sync mechanic can be ignored, because all lists are in-order
// Responsibility of UMD to offload to copy engine
auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendMemBufferCopy(
UR_CALL(commandListLocked->enqueueMemBufferCopy(
hSrcMem, hDstMem, srcOffset, dstOffset, size, 0, nullptr, nullptr));

return UR_RESULT_SUCCESS;
Expand All @@ -312,8 +311,8 @@ ur_result_t urCommandBufferAppendMemBufferWriteExp(
// sync mechanic can be ignored, because all lists are in-order
// Responsibility of UMD to offload to copy engine
auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendMemBufferWrite(hBuffer, false, offset, size,
pSrc, 0, nullptr, nullptr));
UR_CALL(commandListLocked->enqueueMemBufferWrite(hBuffer, false, offset, size,
pSrc, 0, nullptr, nullptr));

return UR_RESULT_SUCCESS;
} catch (...) {
Expand All @@ -334,8 +333,8 @@ ur_result_t urCommandBufferAppendMemBufferReadExp(
// the same issue as in urCommandBufferAppendKernelLaunchExp
// Responsibility of UMD to offload to copy engine
auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendMemBufferRead(hBuffer, false, offset, size,
pDst, 0, nullptr, nullptr));
UR_CALL(commandListLocked->enqueueMemBufferRead(hBuffer, false, offset, size,
pDst, 0, nullptr, nullptr));

return UR_RESULT_SUCCESS;
} catch (...) {
Expand All @@ -359,7 +358,7 @@ ur_result_t urCommandBufferAppendMemBufferCopyRectExp(
// sync mechanic can be ignored, because all lists are in-order
// Responsibility of UMD to offload to copy engine
auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendMemBufferCopyRect(
UR_CALL(commandListLocked->enqueueMemBufferCopyRect(
hSrcMem, hDstMem, srcOrigin, dstOrigin, region, srcRowPitch,
srcSlicePitch, dstRowPitch, dstSlicePitch, 0, nullptr, nullptr));

Expand All @@ -385,7 +384,7 @@ ur_result_t urCommandBufferAppendMemBufferWriteRectExp(

// Responsibility of UMD to offload to copy engine
auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendMemBufferWriteRect(
UR_CALL(commandListLocked->enqueueMemBufferWriteRect(
hBuffer, false, bufferOffset, hostOffset, region, bufferRowPitch,
bufferSlicePitch, hostRowPitch, hostSlicePitch, pSrc, 0, nullptr,
nullptr));
Expand All @@ -412,7 +411,7 @@ ur_result_t urCommandBufferAppendMemBufferReadRectExp(

// Responsibility of UMD to offload to copy engine
auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendMemBufferReadRect(
UR_CALL(commandListLocked->enqueueMemBufferReadRect(
hBuffer, false, bufferOffset, hostOffset, region, bufferRowPitch,
bufferSlicePitch, hostRowPitch, hostSlicePitch, pDst, 0, nullptr,
nullptr));
Expand All @@ -434,8 +433,8 @@ ur_result_t urCommandBufferAppendUSMFillExp(
ur_exp_command_buffer_command_handle_t * /*phCommand*/) try {

auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendUSMFill(pMemory, patternSize, pPattern, size,
0, nullptr, nullptr));
UR_CALL(commandListLocked->enqueueUSMFill(pMemory, patternSize, pPattern,
size, 0, nullptr, nullptr));
return UR_RESULT_SUCCESS;
} catch (...) {
return exceptionToResult(std::current_exception());
Expand All @@ -454,7 +453,7 @@ ur_result_t urCommandBufferAppendMemBufferFillExp(

// the same issue as in urCommandBufferAppendKernelLaunchExp
auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendMemBufferFill(
UR_CALL(commandListLocked->enqueueMemBufferFill(
hBuffer, pPattern, patternSize, offset, size, 0, nullptr, nullptr));
return UR_RESULT_SUCCESS;
} catch (...) {
Expand All @@ -475,8 +474,8 @@ ur_result_t urCommandBufferAppendUSMPrefetchExp(
// the same issue as in urCommandBufferAppendKernelLaunchExp

auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendUSMPrefetch(pMemory, size, flags, 0, nullptr,
nullptr));
UR_CALL(commandListLocked->enqueueUSMPrefetch(pMemory, size, flags, 0,
nullptr, nullptr));

return UR_RESULT_SUCCESS;
} catch (...) {
Expand All @@ -496,7 +495,7 @@ ur_result_t urCommandBufferAppendUSMAdviseExp(
// the same issue as in urCommandBufferAppendKernelLaunchExp

auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendUSMAdvise(pMemory, size, advice, nullptr));
UR_CALL(commandListLocked->enqueueUSMAdvise(pMemory, size, advice, nullptr));

return UR_RESULT_SUCCESS;
} catch (...) {
Expand Down Expand Up @@ -546,13 +545,13 @@ ur_result_t urCommandBufferAppendNativeCommandExp(
// Barrier on all commands before user defined commands.

auto commandListLocked = hCommandBuffer->commandListManager.lock();
UR_CALL(commandListLocked->appendBarrier(0, nullptr, nullptr));
UR_CALL(commandListLocked->enqueueEventsWaitWithBarrier(0, nullptr, nullptr));

// Call user-defined function immediately
pfnNativeCommand(pData);

// Barrier on all commands after user defined commands.
UR_CALL(commandListLocked->appendBarrier(0, nullptr, nullptr));
UR_CALL(commandListLocked->enqueueEventsWaitWithBarrier(0, nullptr, nullptr));

return UR_RESULT_SUCCESS;
}
Expand Down
Loading
Loading