Skip to content

[SYCL][ESIMD][EMU] Clearing unused function arguments in PI module #6033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions sycl/plugins/esimd_emulator/pi_esimd_emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@

#include "pi_esimd_emulator.hpp"

#define ARG_UNUSED(x) (void)x

namespace {

// Helper functions for unified 'Return' type declaration - imported
Expand All @@ -67,6 +69,7 @@ template <typename T>
pi_result getInfo(size_t ParamValueSize, void *ParamValue,
size_t *ParamValueSizeRet, T Value) {
auto assignment = [](void *ParamValue, T Value, size_t ValueSize) {
ARG_UNUSED(ValueSize);
*static_cast<T *>(ParamValue) = Value;
};
return getInfoImpl(ParamValueSize, ParamValue, ParamValueSizeRet, Value,
Expand Down Expand Up @@ -808,6 +811,10 @@ pi_result piContextCreate(const pi_context_properties *Properties,
const void *PrivateInfo, size_t CB,
void *UserData),
void *UserData, pi_context *RetContext) {
ARG_UNUSED(Properties);
ARG_UNUSED(PFnNotify);
ARG_UNUSED(UserData);

if (NumDevices != 1) {
return PI_INVALID_VALUE;
}
Expand Down Expand Up @@ -903,6 +910,8 @@ bool _pi_context::checkSurfaceArgument(pi_mem_flags Flags, void *HostPtr) {

pi_result piQueueCreate(pi_context Context, pi_device Device,
pi_queue_properties Properties, pi_queue *Queue) {
ARG_UNUSED(Device);

if (Properties & PI_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) {
// TODO : Support Out-of-order Queue
*Queue = nullptr;
Expand Down Expand Up @@ -979,6 +988,8 @@ pi_result piextQueueCreateWithNativeHandle(pi_native_handle, pi_context,
pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
void *HostPtr, pi_mem *RetMem,
const pi_mem_properties *properties) {
ARG_UNUSED(properties);

if ((Flags & PI_MEM_FLAGS_ACCESS_RW) == 0) {
if (PrintPiTrace) {
std::cerr << "Invalid memory attribute for piMemBufferCreate"
Expand Down Expand Up @@ -1378,6 +1389,12 @@ pi_result piEventGetInfo(pi_event, pi_event_info, size_t, void *, size_t *) {
pi_result piEventGetProfilingInfo(pi_event Event, pi_profiling_info ParamName,
size_t ParamValueSize, void *ParamValue,
size_t *ParamValueSizeRet) {
ARG_UNUSED(Event);
ARG_UNUSED(ParamName);
ARG_UNUSED(ParamValueSize);
ARG_UNUSED(ParamValue);
ARG_UNUSED(ParamValueSizeRet);

if (PrintPiTrace) {
std::cerr << "Warning : Profiling Not supported under PI_ESIMD_EMULATOR"
<< std::endl;
Expand Down Expand Up @@ -1479,11 +1496,18 @@ pi_result piEnqueueMemBufferRead(pi_queue Queue, pi_mem Src,
pi_uint32 NumEventsInWaitList,
const pi_event *EventWaitList,
pi_event *Event) {
ARG_UNUSED(Queue);
ARG_UNUSED(EventWaitList);

/// TODO : Support Blocked read, 'Queue' handling
if (BlockingRead) {
assert(false &&
"ESIMD_EMULATOR support for blocking piEnqueueMemBufferRead is NYI");
}

assert(Offset == 0 &&
"ESIMD_EMULATOR does not support buffer reading with offsets");

if (NumEventsInWaitList != 0) {
return PI_INVALID_EVENT_WAIT_LIST;
}
Expand Down Expand Up @@ -1566,6 +1590,11 @@ pi_result piEnqueueMemBufferMap(pi_queue Queue, pi_mem MemObj,
pi_uint32 NumEventsInWaitList,
const pi_event *EventWaitList, pi_event *Event,
void **RetMap) {
ARG_UNUSED(Queue);
ARG_UNUSED(BlockingMap);
ARG_UNUSED(MapFlags);
ARG_UNUSED(NumEventsInWaitList);
ARG_UNUSED(EventWaitList);

std::unique_ptr<_pi_event> RetEv{nullptr};
pi_result ret = PI_SUCCESS;
Expand Down Expand Up @@ -1604,6 +1633,10 @@ pi_result piEnqueueMemBufferMap(pi_queue Queue, pi_mem MemObj,
pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem MemObj, void *MappedPtr,
pi_uint32 NumEventsInWaitList,
const pi_event *EventWaitList, pi_event *Event) {
ARG_UNUSED(Queue);
ARG_UNUSED(NumEventsInWaitList);
ARG_UNUSED(EventWaitList);

std::unique_ptr<_pi_event> RetEv{nullptr};
pi_result ret = PI_SUCCESS;

Expand Down Expand Up @@ -1646,6 +1679,10 @@ pi_result piEnqueueMemImageRead(pi_queue CommandQueue, pi_mem Image,
pi_uint32 NumEventsInWaitList,
const pi_event *EventWaitList,
pi_event *Event) {
ARG_UNUSED(CommandQueue);
ARG_UNUSED(NumEventsInWaitList);
ARG_UNUSED(EventWaitList);

/// TODO : Support Blocked read, 'Queue' handling
if (BlockingRead) {
assert(false && "ESIMD_EMULATOR does not support Blocking Read");
Expand Down Expand Up @@ -1720,6 +1757,9 @@ piEnqueueKernelLaunch(pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim,
const size_t *GlobalWorkSize, const size_t *LocalWorkSize,
pi_uint32 NumEventsInWaitList,
const pi_event *EventWaitList, pi_event *Event) {
ARG_UNUSED(Queue);
ARG_UNUSED(NumEventsInWaitList);
ARG_UNUSED(EventWaitList);

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

Expand Down Expand Up @@ -1807,6 +1847,9 @@ pi_result piextUSMSharedAlloc(void **ResultPtr, pi_context Context,
pi_device Device,
pi_usm_mem_properties *Properties, size_t Size,
pi_uint32 Alignment) {
ARG_UNUSED(Properties);
ARG_UNUSED(Alignment);

if (Context == nullptr || (Device != Context->Device)) {
return PI_INVALID_CONTEXT;
}
Expand Down