diff --git a/sycl/plugins/CMakeLists.txt b/sycl/plugins/CMakeLists.txt index 700e09d1a0c1d..9d75457ef22b9 100644 --- a/sycl/plugins/CMakeLists.txt +++ b/sycl/plugins/CMakeLists.txt @@ -1,5 +1,9 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) +if(NOT MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-covered-switch-default") +endif() + if(SYCL_BUILD_PI_CUDA) add_subdirectory(cuda) endif() diff --git a/sycl/plugins/level_zero/pi_level_zero.cpp b/sycl/plugins/level_zero/pi_level_zero.cpp index 0c8bd14093957..835454a468d01 100644 --- a/sycl/plugins/level_zero/pi_level_zero.cpp +++ b/sycl/plugins/level_zero/pi_level_zero.cpp @@ -116,6 +116,7 @@ pi_result getInfo(size_t param_value_size, void *param_value, size_t *param_value_size_ret, T value) { auto assignment = [](void *param_value, T value, size_t value_size) { + (void)value_size; *static_cast(param_value) = value; }; @@ -954,8 +955,8 @@ pi_result piPlatformGetInfo(pi_platform Platform, pi_platform_info ParamName, // return ReturnValue(Platform->ZeDriverApiVersion.c_str()); default: - // TODO: implement other parameters - die("Unsupported ParamName in piPlatformGetInfo"); + zePrint("piPlatformGetInfo: unrecognized ParamName\n"); + return PI_INVALID_VALUE; } return PI_SUCCESS; @@ -1785,6 +1786,9 @@ pi_result piContextCreate(const pi_context_properties *Properties, const void *PrivateInfo, size_t CB, void *UserData), void *UserData, pi_context *RetContext) { + (void)Properties; + (void)PFnNotify; + (void)UserData; PI_ASSERT(Devices, PI_INVALID_DEVICE); PI_ASSERT(RetContext, PI_INVALID_VALUE); @@ -1831,6 +1835,9 @@ pi_result piContextGetInfo(pi_context Context, pi_context_info ParamName, pi_result piextContextSetExtendedDeleter(pi_context Context, pi_context_extended_deleter Function, void *UserData) { + (void)Context; + (void)Function; + (void)UserData; die("piextContextSetExtendedDeleter: not supported"); return PI_SUCCESS; } @@ -2143,6 +2150,11 @@ pi_result piMemGetInfo(pi_mem Mem, cl_mem_info ParamName, // TODO: untie from OpenCL size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet) { + (void)Mem; + (void)ParamName; + (void)ParamValueSize; + (void)ParamValue; + (void)ParamValueSizeRet; die("piMemGetInfo: not implemented"); return {}; } @@ -2345,12 +2357,16 @@ pi_result piMemImageCreate(pi_context Context, pi_mem_flags Flags, } pi_result piextMemGetNativeHandle(pi_mem Mem, pi_native_handle *NativeHandle) { + (void)Mem; + (void)NativeHandle; die("piextMemGetNativeHandle: not supported"); return PI_SUCCESS; } pi_result piextMemCreateWithNativeHandle(pi_native_handle NativeHandle, pi_mem *Mem) { + (void)NativeHandle; + (void)Mem; die("piextMemCreateWithNativeHandle: not supported"); return PI_SUCCESS; } @@ -2431,6 +2447,11 @@ pi_result piclProgramCreateWithSource(pi_context Context, pi_uint32 Count, const size_t *Lengths, pi_program *RetProgram) { + (void)Context; + (void)Count; + (void)Strings; + (void)Lengths; + (void)RetProgram; zePrint("piclProgramCreateWithSource: not supported in Level Zero\n"); return PI_INVALID_OPERATION; } @@ -2580,6 +2601,7 @@ pi_result piProgramLink(pi_context Context, pi_uint32 NumDevices, const pi_program *InputPrograms, void (*PFnNotify)(pi_program Program, void *UserData), void *UserData, pi_program *RetProgram) { + (void)Options; // We only support one device with Level Zero currently. pi_device Device = Context->Devices[0]; @@ -2694,6 +2716,9 @@ pi_result piProgramCompile( const char *Options, pi_uint32 NumInputHeaders, const pi_program *InputHeaders, const char **HeaderIncludeNames, void (*PFnNotify)(pi_program Program, void *UserData), void *UserData) { + (void)NumInputHeaders; + (void)InputHeaders; + (void)HeaderIncludeNames; // The OpenCL spec says this should return CL_INVALID_PROGRAM, but there is // no corresponding PI error code. @@ -2819,6 +2844,7 @@ pi_result piProgramGetBuildInfo(pi_program Program, pi_device Device, cl_program_build_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet) { + (void)Device; ReturnHelper ReturnValue(ParamValueSize, ParamValue, ParamValueSizeRet); if (ParamName == CL_PROGRAM_BINARY_TYPE) { @@ -3251,6 +3277,9 @@ pi_result piKernelGetSubGroupInfo(pi_kernel Kernel, pi_device Device, size_t InputValueSize, const void *InputValue, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet) { + (void)Device; + (void)InputValueSize; + (void)InputValue; ze_kernel_properties_t ZeKernelProperties; ZE_CALL(zeKernelGetProperties(Kernel->ZeKernel, &ZeKernelProperties)); @@ -3647,11 +3676,17 @@ pi_result piEventSetCallback(pi_event Event, pi_int32 CommandExecCallbackType, pi_int32 EventCommandStatus, void *UserData), void *UserData) { + (void)Event; + (void)CommandExecCallbackType; + (void)PFnNotify; + (void)UserData; die("piEventSetCallback: deprecated, to be removed"); return PI_SUCCESS; } pi_result piEventSetStatus(pi_event Event, pi_int32 ExecutionStatus) { + (void)Event; + (void)ExecutionStatus; die("piEventSetStatus: deprecated, to be removed"); return PI_SUCCESS; } @@ -3685,12 +3720,16 @@ pi_result piEventRelease(pi_event Event) { pi_result piextEventGetNativeHandle(pi_event Event, pi_native_handle *NativeHandle) { + (void)Event; + (void)NativeHandle; die("piextEventGetNativeHandle: not supported"); return PI_SUCCESS; } pi_result piextEventCreateWithNativeHandle(pi_native_handle NativeHandle, pi_event *Event) { + (void)NativeHandle; + (void)Event; die("piextEventCreateWithNativeHandle: not supported"); return PI_SUCCESS; } @@ -3817,6 +3856,11 @@ pi_result piSamplerCreate(pi_context Context, pi_result piSamplerGetInfo(pi_sampler Sampler, pi_sampler_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet) { + (void)Sampler; + (void)ParamName; + (void)ParamValueSize; + (void)ParamValue; + (void)ParamValueSizeRet; die("piSamplerGetInfo: not implemented"); return {}; @@ -3844,6 +3888,10 @@ pi_result piSamplerRelease(pi_sampler Sampler) { // pi_result piEnqueueEventsWait(pi_queue Queue, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event) { + (void)Queue; + (void)NumEventsInWaitList; + (void)EventWaitList; + (void)Event; die("piEnqueueEventsWait: not implemented"); return {}; @@ -4457,6 +4505,11 @@ pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem MemObj, void *MappedPtr, pi_result piMemImageGetInfo(pi_mem Image, pi_image_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet) { + (void)Image; + (void)ParamName; + (void)ParamValueSize; + (void)ParamValue; + (void)ParamValueSizeRet; die("piMemImageGetInfo: not implemented"); return {}; @@ -4712,6 +4765,13 @@ pi_result piEnqueueMemImageFill(pi_queue Queue, pi_mem Image, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event) { + (void)Image; + (void)FillColor; + (void)Origin; + (void)Region; + (void)NumEventsInWaitList; + (void)EventWaitList; + (void)Event; PI_ASSERT(Queue, PI_INVALID_QUEUE); @@ -4769,6 +4829,15 @@ pi_result piEnqueueNativeKernel(pi_queue Queue, void (*UserFunc)(void *), pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event) { + (void)UserFunc; + (void)Args; + (void)CbArgs; + (void)NumMemObjects; + (void)MemList; + (void)ArgsMemLoc; + (void)NumEventsInWaitList; + (void)EventWaitList; + (void)Event; PI_ASSERT(Queue, PI_INVALID_QUEUE); @@ -4783,6 +4852,7 @@ pi_result piEnqueueNativeKernel(pi_queue Queue, void (*UserFunc)(void *), pi_result piextGetDeviceFunctionPointer(pi_device Device, pi_program Program, const char *FunctionName, pi_uint64 *FunctionPointerRet) { + (void)Device; PI_ASSERT(Program, PI_INVALID_PROGRAM); if (Program->State != _pi_program::Exe && @@ -5216,7 +5286,7 @@ pi_result piextUSMEnqueueMemAdvise(pi_queue Queue, const void *Ptr, return PI_SUCCESS; } -/// API to query information about USM allocated pointers +/// API to query information about USM allocated pointers. /// Valid Queries: /// PI_MEM_ALLOC_TYPE returns host/device/shared pi_usm_type value /// PI_MEM_ALLOC_BASE_PTR returns the base ptr of an allocation if @@ -5294,6 +5364,7 @@ pi_result piextUSMGetMemAllocInfo(pi_context Context, const void *Ptr, pi_result piKernelSetExecInfo(pi_kernel Kernel, pi_kernel_exec_info ParamName, size_t ParamValueSize, const void *ParamValue) { + (void)ParamValueSize; PI_ASSERT(Kernel, PI_INVALID_KERNEL); PI_ASSERT(ParamValue, PI_INVALID_VALUE); diff --git a/sycl/plugins/opencl/pi_opencl.cpp b/sycl/plugins/opencl/pi_opencl.cpp index c84d1e2d1616d..61f4fdf770fe6 100644 --- a/sycl/plugins/opencl/pi_opencl.cpp +++ b/sycl/plugins/opencl/pi_opencl.cpp @@ -60,8 +60,8 @@ CONSTFIX char clCreateBufferWithPropertiesName[] = CONSTFIX char clSetKernelArgMemPointerName[] = "clSetKernelArgMemPointerINTEL"; CONSTFIX char clEnqueueMemsetName[] = "clEnqueueMemsetINTEL"; CONSTFIX char clEnqueueMemcpyName[] = "clEnqueueMemcpyINTEL"; -CONSTFIX char clEnqueueMigrateMemName[] = "clEnqueueMigrateMemINTEL"; -CONSTFIX char clEnqueueMemAdviseName[] = "clEnqueueMemAdviseINTEL"; +// CONSTFIX char clEnqueueMigrateMemName[] = "clEnqueueMigrateMemINTEL"; +// CONSTFIX char clEnqueueMemAdviseName[] = "clEnqueueMemAdviseINTEL"; CONSTFIX char clGetMemAllocInfoName[] = "clGetMemAllocInfoINTEL"; CONSTFIX char clSetProgramSpecializationConstantName[] = "clSetProgramSpecializationConstant"; @@ -539,6 +539,8 @@ pi_result piextContextCreateWithNativeHandle(pi_native_handle nativeHandle, pi_uint32 num_devices, const pi_device *devices, pi_context *piContext) { + (void)num_devices; + (void)devices; assert(piContext != nullptr); *piContext = reinterpret_cast(nativeHandle); return PI_SUCCESS; @@ -663,6 +665,7 @@ pi_result piKernelGetSubGroupInfo(pi_kernel kernel, pi_device device, const void *input_value, size_t param_value_size, void *param_value, size_t *param_value_size_ret) { + (void)param_value_size; size_t ret_val; cl_int ret_err; ret_err = cast(clGetKernelSubGroupInfo( @@ -847,6 +850,7 @@ pi_result piextUSMFree(pi_context context, void *ptr) { /// \param arg_value is the pointer argument pi_result piextKernelSetArgPointer(pi_kernel kernel, pi_uint32 arg_index, size_t arg_size, const void *arg_value) { + (void)arg_size; // Size is unused in CL as pointer args are passed by value. @@ -968,6 +972,9 @@ pi_result piextUSMEnqueuePrefetch(pi_queue queue, const void *ptr, size_t size, pi_uint32 num_events_in_waitlist, const pi_event *events_waitlist, pi_event *event) { + (void)ptr; + (void)size; + (void)flags; return cast(clEnqueueMarkerWithWaitList( cast(queue), num_events_in_waitlist, @@ -1010,6 +1017,9 @@ pi_result piextUSMEnqueuePrefetch(pi_queue queue, const void *ptr, size_t size, pi_result piextUSMEnqueueMemAdvise(pi_queue queue, const void *ptr, size_t length, pi_mem_advice advice, pi_event *event) { + (void)ptr; + (void)length; + (void)advice; return cast( clEnqueueMarkerWithWaitList(cast(queue), 0, nullptr,