Skip to content

Commit 150f10d

Browse files
[SYCL][ESIMD][EMU] Clearing unused function arguments in PI module (#6033)
* [SYCL][ESIMD][EMU] Clearing unused function arguments in PI module
1 parent 273034a commit 150f10d

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

sycl/plugins/esimd_emulator/pi_esimd_emulator.cpp

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343

4444
#include "pi_esimd_emulator.hpp"
4545

46+
#define ARG_UNUSED(x) (void)x
47+
4648
namespace {
4749

4850
// Helper functions for unified 'Return' type declaration - imported
@@ -67,6 +69,7 @@ template <typename T>
6769
pi_result getInfo(size_t ParamValueSize, void *ParamValue,
6870
size_t *ParamValueSizeRet, T Value) {
6971
auto assignment = [](void *ParamValue, T Value, size_t ValueSize) {
72+
ARG_UNUSED(ValueSize);
7073
*static_cast<T *>(ParamValue) = Value;
7174
};
7275
return getInfoImpl(ParamValueSize, ParamValue, ParamValueSizeRet, Value,
@@ -808,6 +811,10 @@ pi_result piContextCreate(const pi_context_properties *Properties,
808811
const void *PrivateInfo, size_t CB,
809812
void *UserData),
810813
void *UserData, pi_context *RetContext) {
814+
ARG_UNUSED(Properties);
815+
ARG_UNUSED(PFnNotify);
816+
ARG_UNUSED(UserData);
817+
811818
if (NumDevices != 1) {
812819
return PI_INVALID_VALUE;
813820
}
@@ -903,6 +910,8 @@ bool _pi_context::checkSurfaceArgument(pi_mem_flags Flags, void *HostPtr) {
903910

904911
pi_result piQueueCreate(pi_context Context, pi_device Device,
905912
pi_queue_properties Properties, pi_queue *Queue) {
913+
ARG_UNUSED(Device);
914+
906915
if (Properties & PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) {
907916
// TODO : Support Out-of-order Queue
908917
*Queue = nullptr;
@@ -979,6 +988,8 @@ pi_result piextQueueCreateWithNativeHandle(pi_native_handle, pi_context,
979988
pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
980989
void *HostPtr, pi_mem *RetMem,
981990
const pi_mem_properties *properties) {
991+
ARG_UNUSED(properties);
992+
982993
if ((Flags & PI_MEM_FLAGS_ACCESS_RW) == 0) {
983994
if (PrintPiTrace) {
984995
std::cerr << "Invalid memory attribute for piMemBufferCreate"
@@ -1378,6 +1389,12 @@ pi_result piEventGetInfo(pi_event, pi_event_info, size_t, void *, size_t *) {
13781389
pi_result piEventGetProfilingInfo(pi_event Event, pi_profiling_info ParamName,
13791390
size_t ParamValueSize, void *ParamValue,
13801391
size_t *ParamValueSizeRet) {
1392+
ARG_UNUSED(Event);
1393+
ARG_UNUSED(ParamName);
1394+
ARG_UNUSED(ParamValueSize);
1395+
ARG_UNUSED(ParamValue);
1396+
ARG_UNUSED(ParamValueSizeRet);
1397+
13811398
if (PrintPiTrace) {
13821399
std::cerr << "Warning : Profiling Not supported under PI_ESIMD_EMULATOR"
13831400
<< std::endl;
@@ -1479,11 +1496,18 @@ pi_result piEnqueueMemBufferRead(pi_queue Queue, pi_mem Src,
14791496
pi_uint32 NumEventsInWaitList,
14801497
const pi_event *EventWaitList,
14811498
pi_event *Event) {
1499+
ARG_UNUSED(Queue);
1500+
ARG_UNUSED(EventWaitList);
1501+
14821502
/// TODO : Support Blocked read, 'Queue' handling
14831503
if (BlockingRead) {
14841504
assert(false &&
14851505
"ESIMD_EMULATOR support for blocking piEnqueueMemBufferRead is NYI");
14861506
}
1507+
1508+
assert(Offset == 0 &&
1509+
"ESIMD_EMULATOR does not support buffer reading with offsets");
1510+
14871511
if (NumEventsInWaitList != 0) {
14881512
return PI_INVALID_EVENT_WAIT_LIST;
14891513
}
@@ -1566,6 +1590,11 @@ pi_result piEnqueueMemBufferMap(pi_queue Queue, pi_mem MemObj,
15661590
pi_uint32 NumEventsInWaitList,
15671591
const pi_event *EventWaitList, pi_event *Event,
15681592
void **RetMap) {
1593+
ARG_UNUSED(Queue);
1594+
ARG_UNUSED(BlockingMap);
1595+
ARG_UNUSED(MapFlags);
1596+
ARG_UNUSED(NumEventsInWaitList);
1597+
ARG_UNUSED(EventWaitList);
15691598

15701599
std::unique_ptr<_pi_event> RetEv{nullptr};
15711600
pi_result ret = PI_SUCCESS;
@@ -1604,6 +1633,10 @@ pi_result piEnqueueMemBufferMap(pi_queue Queue, pi_mem MemObj,
16041633
pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem MemObj, void *MappedPtr,
16051634
pi_uint32 NumEventsInWaitList,
16061635
const pi_event *EventWaitList, pi_event *Event) {
1636+
ARG_UNUSED(Queue);
1637+
ARG_UNUSED(NumEventsInWaitList);
1638+
ARG_UNUSED(EventWaitList);
1639+
16071640
std::unique_ptr<_pi_event> RetEv{nullptr};
16081641
pi_result ret = PI_SUCCESS;
16091642

@@ -1646,6 +1679,10 @@ pi_result piEnqueueMemImageRead(pi_queue CommandQueue, pi_mem Image,
16461679
pi_uint32 NumEventsInWaitList,
16471680
const pi_event *EventWaitList,
16481681
pi_event *Event) {
1682+
ARG_UNUSED(CommandQueue);
1683+
ARG_UNUSED(NumEventsInWaitList);
1684+
ARG_UNUSED(EventWaitList);
1685+
16491686
/// TODO : Support Blocked read, 'Queue' handling
16501687
if (BlockingRead) {
16511688
assert(false && "ESIMD_EMULATOR does not support Blocking Read");
@@ -1720,6 +1757,9 @@ piEnqueueKernelLaunch(pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim,
17201757
const size_t *GlobalWorkSize, const size_t *LocalWorkSize,
17211758
pi_uint32 NumEventsInWaitList,
17221759
const pi_event *EventWaitList, pi_event *Event) {
1760+
ARG_UNUSED(Queue);
1761+
ARG_UNUSED(NumEventsInWaitList);
1762+
ARG_UNUSED(EventWaitList);
17231763

17241764
const size_t LocalWorkSz[] = {1, 1, 1};
17251765

@@ -1807,6 +1847,9 @@ pi_result piextUSMSharedAlloc(void **ResultPtr, pi_context Context,
18071847
pi_device Device,
18081848
pi_usm_mem_properties *Properties, size_t Size,
18091849
pi_uint32 Alignment) {
1850+
ARG_UNUSED(Properties);
1851+
ARG_UNUSED(Alignment);
1852+
18101853
if (Context == nullptr || (Device != Context->Device)) {
18111854
return PI_INVALID_CONTEXT;
18121855
}

0 commit comments

Comments
 (0)