Skip to content

Commit

Permalink
[SYCL][L0] Add memory access hint to piKernelSetArgMemObj (#9752)
Browse files Browse the repository at this point in the history
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
  • Loading branch information
KseniyaTikhomirova authored and omarahmed1111 committed Oct 23, 2023
1 parent 87b10ab commit 15d6b32
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion ur_level_zero_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,25 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgMemObj(

ur_mem_handle_t_ *UrMem = ur_cast<ur_mem_handle_t_ *>(ArgValue);

ur_mem_handle_t_::access_mode_t UrAccessMode = ur_mem_handle_t_::read_write;
if (Properties) {
switch (Properties->memoryAccess) {
case UR_MEM_FLAG_READ_WRITE:
UrAccessMode = ur_mem_handle_t_::read_write;
break;
case UR_MEM_FLAG_WRITE_ONLY:
UrAccessMode = ur_mem_handle_t_::write_only;
break;
case UR_MEM_FLAG_READ_ONLY:
UrAccessMode = ur_mem_handle_t_::read_only;
break;
default:
return UR_RESULT_ERROR_INVALID_ARGUMENT;
}
}
auto Arg = UrMem ? UrMem : nullptr;
Kernel->PendingArguments.push_back(
{ArgIndex, sizeof(void *), Arg, ur_mem_handle_t_::read_write});
{ArgIndex, sizeof(void *), Arg, UrAccessMode});

return UR_RESULT_SUCCESS;
}
Expand Down

0 comments on commit 15d6b32

Please sign in to comment.