Skip to content

[SYCL][NFC] Unify setting kernel arguments #1379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 26, 2020
Merged
Changes from 1 commit
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
12 changes: 5 additions & 7 deletions sycl/source/detail/scheduler/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1639,16 +1639,14 @@ cl_int ExecCGCommand::enqueueImp() {
case kernel_param_kind_t::kind_accessor: {
Requirement *Req = (Requirement *)(Arg.MPtr);
AllocaCommandBase *AllocaCmd = getAllocaForReq(Req);
#if USE_PI_CUDA
pi_mem MemArg = (pi_mem)AllocaCmd->getMemAllocation();
Plugin.call<PiApiKind::piextKernelSetArgMemObj>(Kernel, Arg.MIndex, &MemArg);
#else
RT::PiMem MemArg = (RT::PiMem)AllocaCmd->getMemAllocation();
if (!RT::useBackend(pi::Backend::SYCL_BE_PI_OPENCL)) {
Plugin.call<PiApiKind::piextKernelSetArgMemObj>(Kernel, Arg.MIndex,
&MemArg);
break;
}
Plugin.call<PiApiKind::piKernelSetArg>(Kernel, Arg.MIndex,
sizeof(RT::PiMem), &MemArg);
Plugin.call<PiApiKind::piKernelSetArg>(Kernel, Arg.MIndex,
sizeof(RT::PiMem), &MemArg);
#endif
break;
}
case kernel_param_kind_t::kind_std_layout: {
Expand Down