Skip to content

Commit

Permalink
[SYCL][NFC] Unify setting kernel arguments (#1379)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Sachkov <alexey.sachkov@intel.com>
  • Loading branch information
AlexeySachkov authored Mar 26, 2020
1 parent ce53521 commit 899600b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions sycl/source/detail/scheduler/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1649,16 +1649,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();
Plugin.call<PiApiKind::piKernelSetArg>(Kernel, Arg.MIndex,
sizeof(RT::PiMem), &MemArg);
Plugin.call<PiApiKind::piKernelSetArg>(Kernel, Arg.MIndex,
sizeof(RT::PiMem), &MemArg);
#endif
if (RT::useBackend(pi::Backend::SYCL_BE_PI_OPENCL)) {
Plugin.call<PiApiKind::piKernelSetArg>(Kernel, Arg.MIndex,
sizeof(RT::PiMem), &MemArg);
} else {
Plugin.call<PiApiKind::piextKernelSetArgMemObj>(Kernel, Arg.MIndex,
&MemArg);
}
break;
}
case kernel_param_kind_t::kind_std_layout: {
Expand Down

0 comments on commit 899600b

Please sign in to comment.