Skip to content

Commit 4d10153

Browse files
committed
[SYCL] Removes any knowledge of specific memory advices from PI API.
Signed-off-by: Sergey V Maslov <[email protected]>
1 parent c81828e commit 4d10153

File tree

2 files changed

+2
-52
lines changed

2 files changed

+2
-52
lines changed

sycl/include/CL/sycl/detail/pi.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -388,27 +388,6 @@ typedef enum {
388388
PI_MEM_TYPE_IMAGE1D_BUFFER = CL_MEM_OBJECT_IMAGE1D_BUFFER
389389
} _pi_mem_type;
390390

391-
typedef enum {
392-
PI_MEM_ADVICE_SET_READ_MOSTLY = 0, ///< hints that memory will be read from
393-
///< frequently and written to rarely
394-
PI_MEM_ADVICE_CLEAR_READ_MOSTLY, ///< removes the affect of
395-
///< PI_MEM_ADVICE_SET_READ_MOSTLY
396-
PI_MEM_ADVICE_SET_PREFERRED_LOCATION, ///< hints that the preferred memory
397-
///< location is the specified device
398-
PI_MEM_ADVICE_CLEAR_PREFERRED_LOCATION, ///< removes the affect of
399-
///< PI_MEM_ADVICE_SET_PREFERRED_LOCATION
400-
PI_MEM_ADVICE_SET_ACCESSED_BY, ///< hints that memory will be accessed by the
401-
///< specified device
402-
PI_MEM_ADVICE_CLEAR_ACCESSED_BY, ///< removes the affect of
403-
///< PI_MEM_ADVICE_SET_ACCESSED_BY
404-
PI_MEM_ADVICE_SET_NON_ATOMIC_MOSTLY, ///< hints that memory will mostly be
405-
///< accessed non-atomically
406-
PI_MEM_ADVICE_CLEAR_NON_ATOMIC_MOSTLY, ///< removes the affect of
407-
///< PI_MEM_ADVICE_SET_NON_ATOMIC_MOSTLY
408-
PI_MEM_ADVICE_BIAS_CACHED, ///< hints that memory should be cached
409-
PI_MEM_ADVICE_BIAS_UNCACHED ///< hints that memory should not be cached
410-
} _pi_mem_advice;
411-
412391
typedef enum {
413392
PI_IMAGE_CHANNEL_ORDER_A = CL_A,
414393
PI_IMAGE_CHANNEL_ORDER_R = CL_R,
@@ -538,7 +517,7 @@ using pi_fp_capabilities = _pi_fp_capabilities;
538517
using pi_event_info = _pi_event_info;
539518
using pi_command_type = _pi_command_type;
540519
using pi_mem_type = _pi_mem_type;
541-
using pi_mem_advice = _pi_mem_advice;
520+
using pi_mem_advice = pi_int32;
542521
using pi_image_channel_order = _pi_image_channel_order;
543522
using pi_image_channel_type = _pi_image_channel_type;
544523
using pi_buffer_create_type = _pi_buffer_create_type;

sycl/plugins/level_zero/pi_level_zero.cpp

100644100755
Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4686,36 +4686,7 @@ pi_result piextUSMEnqueueMemAdvise(pi_queue Queue, const void *Ptr,
46864686
// Lock automatically releases when this goes out of scope.
46874687
std::lock_guard<std::mutex> lock(Queue->PiQueueMutex);
46884688

4689-
ze_memory_advice_t ZeAdvice = {};
4690-
switch (Advice) {
4691-
case PI_MEM_ADVICE_SET_READ_MOSTLY:
4692-
ZeAdvice = ZE_MEMORY_ADVICE_SET_READ_MOSTLY;
4693-
break;
4694-
case PI_MEM_ADVICE_CLEAR_READ_MOSTLY:
4695-
ZeAdvice = ZE_MEMORY_ADVICE_CLEAR_READ_MOSTLY;
4696-
break;
4697-
case PI_MEM_ADVICE_SET_PREFERRED_LOCATION:
4698-
ZeAdvice = ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION;
4699-
break;
4700-
case PI_MEM_ADVICE_CLEAR_PREFERRED_LOCATION:
4701-
ZeAdvice = ZE_MEMORY_ADVICE_CLEAR_PREFERRED_LOCATION;
4702-
break;
4703-
case PI_MEM_ADVICE_SET_NON_ATOMIC_MOSTLY:
4704-
ZeAdvice = ZE_MEMORY_ADVICE_SET_NON_ATOMIC_MOSTLY;
4705-
break;
4706-
case PI_MEM_ADVICE_CLEAR_NON_ATOMIC_MOSTLY:
4707-
ZeAdvice = ZE_MEMORY_ADVICE_CLEAR_NON_ATOMIC_MOSTLY;
4708-
break;
4709-
case PI_MEM_ADVICE_BIAS_CACHED:
4710-
ZeAdvice = ZE_MEMORY_ADVICE_BIAS_CACHED;
4711-
break;
4712-
case PI_MEM_ADVICE_BIAS_UNCACHED:
4713-
ZeAdvice = ZE_MEMORY_ADVICE_BIAS_UNCACHED;
4714-
break;
4715-
default:
4716-
zePrint("piextUSMEnqueueMemAdvise: unexpected memory advise\n");
4717-
return PI_INVALID_VALUE;
4718-
}
4689+
auto ZeAdvice = pi_cast<ze_memory_advice_t>(Advice);
47194690

47204691
// Get a new command list to be used on this call
47214692
ze_command_list_handle_t ZeCommandList = nullptr;

0 commit comments

Comments
 (0)