Skip to content

Commit

Permalink
fixup firstTouch
Browse files Browse the repository at this point in the history
  • Loading branch information
pvelesko committed Jun 19, 2024
1 parent 17d9606 commit 84100df
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/backend/Level0/CHIPBackendLevel0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1153,21 +1153,16 @@ CHIPQueueLevel0::launchImpl(chipstar::ExecItem *ExecItem) {
auto Y = ExecItem->getGrid().y;
auto Z = ExecItem->getGrid().z;
ze_group_count_t LaunchArgs = {X, Y, Z};
// if using immediate command lists, lock the mutex
LOCK(CommandListMtx); // TODO this is probably not needed when using RCL
LOCK(CommandListMtx);
auto CommandList = this->getCmdListImm();

// Do we need to annotate indirect buffer accesses?
auto *LzDev = static_cast<CHIPDeviceLevel0 *>(getDevice());
if (true /* !LzDev->hasOnDemandPaging() */) {
// The baseline answer is yes (unless we would know that the
// kernel won't access buffers indirectly).
auto Status = zeKernelSetIndirectAccess(
KernelZe, ZE_KERNEL_INDIRECT_ACCESS_FLAG_DEVICE |
ZE_KERNEL_INDIRECT_ACCESS_FLAG_HOST);
CHIPERR_CHECK_LOG_AND_THROW(Status, ZE_RESULT_SUCCESS,
hipErrorInitializationError);
}
// annotate the kernel for indirect access to handle the case where the kernel
// argument is SoA
auto Status = zeKernelSetIndirectAccess(
KernelZe, ZE_KERNEL_INDIRECT_ACCESS_FLAG_DEVICE |
ZE_KERNEL_INDIRECT_ACCESS_FLAG_HOST);
CHIPERR_CHECK_LOG_AND_THROW(Status, ZE_RESULT_SUCCESS,
hipErrorInitializationError);

// This function may not be called from simultaneous threads with the same
// command list handle.
Expand Down

0 comments on commit 84100df

Please sign in to comment.