43
43
44
44
#include " pi_esimd_emulator.hpp"
45
45
46
+ #define ARG_UNUSED (x ) (void )x
47
+
46
48
namespace {
47
49
48
50
// Helper functions for unified 'Return' type declaration - imported
@@ -67,6 +69,7 @@ template <typename T>
67
69
pi_result getInfo (size_t ParamValueSize, void *ParamValue,
68
70
size_t *ParamValueSizeRet, T Value) {
69
71
auto assignment = [](void *ParamValue, T Value, size_t ValueSize) {
72
+ ARG_UNUSED (ValueSize);
70
73
*static_cast <T *>(ParamValue) = Value;
71
74
};
72
75
return getInfoImpl (ParamValueSize, ParamValue, ParamValueSizeRet, Value,
@@ -808,6 +811,10 @@ pi_result piContextCreate(const pi_context_properties *Properties,
808
811
const void *PrivateInfo, size_t CB,
809
812
void *UserData),
810
813
void *UserData, pi_context *RetContext) {
814
+ ARG_UNUSED (Properties);
815
+ ARG_UNUSED (PFnNotify);
816
+ ARG_UNUSED (UserData);
817
+
811
818
if (NumDevices != 1 ) {
812
819
return PI_INVALID_VALUE;
813
820
}
@@ -903,6 +910,8 @@ bool _pi_context::checkSurfaceArgument(pi_mem_flags Flags, void *HostPtr) {
903
910
904
911
pi_result piQueueCreate (pi_context Context, pi_device Device,
905
912
pi_queue_properties Properties, pi_queue *Queue) {
913
+ ARG_UNUSED (Device);
914
+
906
915
if (Properties & PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) {
907
916
// TODO : Support Out-of-order Queue
908
917
*Queue = nullptr ;
@@ -979,6 +988,8 @@ pi_result piextQueueCreateWithNativeHandle(pi_native_handle, pi_context,
979
988
pi_result piMemBufferCreate (pi_context Context, pi_mem_flags Flags, size_t Size,
980
989
void *HostPtr, pi_mem *RetMem,
981
990
const pi_mem_properties *properties) {
991
+ ARG_UNUSED (properties);
992
+
982
993
if ((Flags & PI_MEM_FLAGS_ACCESS_RW) == 0 ) {
983
994
if (PrintPiTrace) {
984
995
std::cerr << " Invalid memory attribute for piMemBufferCreate"
@@ -1378,6 +1389,12 @@ pi_result piEventGetInfo(pi_event, pi_event_info, size_t, void *, size_t *) {
1378
1389
pi_result piEventGetProfilingInfo (pi_event Event, pi_profiling_info ParamName,
1379
1390
size_t ParamValueSize, void *ParamValue,
1380
1391
size_t *ParamValueSizeRet) {
1392
+ ARG_UNUSED (Event);
1393
+ ARG_UNUSED (ParamName);
1394
+ ARG_UNUSED (ParamValueSize);
1395
+ ARG_UNUSED (ParamValue);
1396
+ ARG_UNUSED (ParamValueSizeRet);
1397
+
1381
1398
if (PrintPiTrace) {
1382
1399
std::cerr << " Warning : Profiling Not supported under PI_ESIMD_EMULATOR"
1383
1400
<< std::endl;
@@ -1479,11 +1496,18 @@ pi_result piEnqueueMemBufferRead(pi_queue Queue, pi_mem Src,
1479
1496
pi_uint32 NumEventsInWaitList,
1480
1497
const pi_event *EventWaitList,
1481
1498
pi_event *Event) {
1499
+ ARG_UNUSED (Queue);
1500
+ ARG_UNUSED (EventWaitList);
1501
+
1482
1502
// / TODO : Support Blocked read, 'Queue' handling
1483
1503
if (BlockingRead) {
1484
1504
assert (false &&
1485
1505
" ESIMD_EMULATOR support for blocking piEnqueueMemBufferRead is NYI" );
1486
1506
}
1507
+
1508
+ assert (Offset == 0 &&
1509
+ " ESIMD_EMULATOR does not support buffer reading with offsets" );
1510
+
1487
1511
if (NumEventsInWaitList != 0 ) {
1488
1512
return PI_INVALID_EVENT_WAIT_LIST;
1489
1513
}
@@ -1566,6 +1590,11 @@ pi_result piEnqueueMemBufferMap(pi_queue Queue, pi_mem MemObj,
1566
1590
pi_uint32 NumEventsInWaitList,
1567
1591
const pi_event *EventWaitList, pi_event *Event,
1568
1592
void **RetMap) {
1593
+ ARG_UNUSED (Queue);
1594
+ ARG_UNUSED (BlockingMap);
1595
+ ARG_UNUSED (MapFlags);
1596
+ ARG_UNUSED (NumEventsInWaitList);
1597
+ ARG_UNUSED (EventWaitList);
1569
1598
1570
1599
std::unique_ptr<_pi_event> RetEv{nullptr };
1571
1600
pi_result ret = PI_SUCCESS;
@@ -1604,6 +1633,10 @@ pi_result piEnqueueMemBufferMap(pi_queue Queue, pi_mem MemObj,
1604
1633
pi_result piEnqueueMemUnmap (pi_queue Queue, pi_mem MemObj, void *MappedPtr,
1605
1634
pi_uint32 NumEventsInWaitList,
1606
1635
const pi_event *EventWaitList, pi_event *Event) {
1636
+ ARG_UNUSED (Queue);
1637
+ ARG_UNUSED (NumEventsInWaitList);
1638
+ ARG_UNUSED (EventWaitList);
1639
+
1607
1640
std::unique_ptr<_pi_event> RetEv{nullptr };
1608
1641
pi_result ret = PI_SUCCESS;
1609
1642
@@ -1646,6 +1679,10 @@ pi_result piEnqueueMemImageRead(pi_queue CommandQueue, pi_mem Image,
1646
1679
pi_uint32 NumEventsInWaitList,
1647
1680
const pi_event *EventWaitList,
1648
1681
pi_event *Event) {
1682
+ ARG_UNUSED (CommandQueue);
1683
+ ARG_UNUSED (NumEventsInWaitList);
1684
+ ARG_UNUSED (EventWaitList);
1685
+
1649
1686
// / TODO : Support Blocked read, 'Queue' handling
1650
1687
if (BlockingRead) {
1651
1688
assert (false && " ESIMD_EMULATOR does not support Blocking Read" );
@@ -1720,6 +1757,9 @@ piEnqueueKernelLaunch(pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim,
1720
1757
const size_t *GlobalWorkSize, const size_t *LocalWorkSize,
1721
1758
pi_uint32 NumEventsInWaitList,
1722
1759
const pi_event *EventWaitList, pi_event *Event) {
1760
+ ARG_UNUSED (Queue);
1761
+ ARG_UNUSED (NumEventsInWaitList);
1762
+ ARG_UNUSED (EventWaitList);
1723
1763
1724
1764
const size_t LocalWorkSz[] = {1 , 1 , 1 };
1725
1765
@@ -1807,6 +1847,9 @@ pi_result piextUSMSharedAlloc(void **ResultPtr, pi_context Context,
1807
1847
pi_device Device,
1808
1848
pi_usm_mem_properties *Properties, size_t Size,
1809
1849
pi_uint32 Alignment) {
1850
+ ARG_UNUSED (Properties);
1851
+ ARG_UNUSED (Alignment);
1852
+
1810
1853
if (Context == nullptr || (Device != Context->Device )) {
1811
1854
return PI_INVALID_CONTEXT;
1812
1855
}
0 commit comments