Skip to content
Closed
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
40 changes: 15 additions & 25 deletions unified-runtime/source/adapters/opencl/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
cl_command_properties_khr *Properties =
hCommandBuffer->IsUpdatable ? UpdateProperties : nullptr;

const bool IsInOrder = hCommandBuffer->IsInOrder;
cl_sync_point_khr *RetSyncPoint = IsInOrder ? nullptr : pSyncPoint;
const cl_sync_point_khr *SyncPointWaitList =
IsInOrder ? nullptr : pSyncPointWaitList;
uint32_t WaitListSize = IsInOrder ? 0 : numSyncPointsInWaitList;
cl_sync_point_khr *RetSyncPoint = pSyncPoint;
const cl_sync_point_khr *SyncPointWaitList = pSyncPointWaitList;
uint32_t WaitListSize = numSyncPointsInWaitList;
CL_RETURN_ON_FAILURE(clCommandNDRangeKernelKHR(
hCommandBuffer->CLCommandBuffer, nullptr, Properties, hKernel->CLKernel,
workDim, pGlobalWorkOffset, pGlobalWorkSize, pLocalWorkSize, WaitListSize,
Expand Down Expand Up @@ -246,11 +244,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp(
CLContext, ur::cl::getAdapter()->fnCache.clCommandCopyBufferKHRCache,
cl_ext::CommandCopyBufferName, &clCommandCopyBufferKHR));

const bool IsInOrder = hCommandBuffer->IsInOrder;
cl_sync_point_khr *RetSyncPoint = IsInOrder ? nullptr : pSyncPoint;
const cl_sync_point_khr *SyncPointWaitList =
IsInOrder ? nullptr : pSyncPointWaitList;
uint32_t WaitListSize = IsInOrder ? 0 : numSyncPointsInWaitList;
cl_sync_point_khr *RetSyncPoint = pSyncPoint;
const cl_sync_point_khr *SyncPointWaitList = pSyncPointWaitList;
uint32_t WaitListSize = numSyncPointsInWaitList;
CL_RETURN_ON_FAILURE(clCommandCopyBufferKHR(
hCommandBuffer->CLCommandBuffer, nullptr, nullptr, hSrcMem->CLMemory,
hDstMem->CLMemory, srcOffset, dstOffset, size, WaitListSize,
Expand Down Expand Up @@ -289,11 +285,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp(
ur::cl::getAdapter()->fnCache.clCommandCopyBufferRectKHRCache,
cl_ext::CommandCopyBufferRectName, &clCommandCopyBufferRectKHR));

const bool IsInOrder = hCommandBuffer->IsInOrder;
cl_sync_point_khr *RetSyncPoint = IsInOrder ? nullptr : pSyncPoint;
const cl_sync_point_khr *SyncPointWaitList =
IsInOrder ? nullptr : pSyncPointWaitList;
uint32_t WaitListSize = IsInOrder ? 0 : numSyncPointsInWaitList;
cl_sync_point_khr *RetSyncPoint = pSyncPoint;
const cl_sync_point_khr *SyncPointWaitList = pSyncPointWaitList;
uint32_t WaitListSize = numSyncPointsInWaitList;
CL_RETURN_ON_FAILURE(clCommandCopyBufferRectKHR(
hCommandBuffer->CLCommandBuffer, nullptr, nullptr, hSrcMem->CLMemory,
hDstMem->CLMemory, OpenCLOriginRect, OpenCLDstRect, OpenCLRegion,
Expand Down Expand Up @@ -397,11 +391,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp(
CLContext, ur::cl::getAdapter()->fnCache.clCommandFillBufferKHRCache,
cl_ext::CommandFillBufferName, &clCommandFillBufferKHR));

const bool IsInOrder = hCommandBuffer->IsInOrder;
cl_sync_point_khr *RetSyncPoint = IsInOrder ? nullptr : pSyncPoint;
const cl_sync_point_khr *SyncPointWaitList =
IsInOrder ? nullptr : pSyncPointWaitList;
uint32_t WaitListSize = IsInOrder ? 0 : numSyncPointsInWaitList;
cl_sync_point_khr *RetSyncPoint = pSyncPoint;
const cl_sync_point_khr *SyncPointWaitList = pSyncPointWaitList;
uint32_t WaitListSize = numSyncPointsInWaitList;
CL_RETURN_ON_FAILURE(clCommandFillBufferKHR(
hCommandBuffer->CLCommandBuffer, nullptr, nullptr, hBuffer->CLMemory,
pPattern, patternSize, offset, size, WaitListSize, SyncPointWaitList,
Expand Down Expand Up @@ -766,11 +758,9 @@ ur_result_t UR_APICALL urCommandBufferAppendNativeCommandExp(
cl_ext::CommandBarrierWithWaitListName,
&clCommandBarrierWithWaitListKHR));

const bool IsInOrder = hCommandBuffer->IsInOrder;
cl_sync_point_khr *RetSyncPoint = IsInOrder ? nullptr : pSyncPoint;
const cl_sync_point_khr *SyncPointWaitList =
IsInOrder ? nullptr : pSyncPointWaitList;
uint32_t WaitListSize = IsInOrder ? 0 : numSyncPointsInWaitList;
cl_sync_point_khr *RetSyncPoint = pSyncPoint;
const cl_sync_point_khr *SyncPointWaitList = pSyncPointWaitList;
uint32_t WaitListSize = numSyncPointsInWaitList;
CL_RETURN_ON_FAILURE(clCommandBarrierWithWaitListKHR(
hCommandBuffer->CLCommandBuffer, nullptr, nullptr, WaitListSize,
SyncPointWaitList, nullptr, nullptr));
Expand Down
Loading