Skip to content

[SYCL][NFC] Fix compilation warnings #1364

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 1 commit into from
Mar 22, 2020

Conversation

fwyzard
Copy link
Contributor

@fwyzard fwyzard commented Mar 20, 2020

Fix two compilation warnings:

.../sycl/plugins/cuda/pi_cuda.cpp: In function 'pi_result piPluginInit(pi_plugin*)':
.../sycl/plugins/cuda/pi_cuda.cpp:3491:73: error: cast between incompatible function types from 'pi_result (*)(pi_device, pi_device_binary_struct**, pi_uint32, pi_device_binary_struct**)' {aka '_pi_result (*)(_pi_device*, pi_device_binary_struct**, unsigned int, pi_device_binary_struct**)'} to 'pi_result (*)(pi_device, pi_program, const char*, pi_uint64*)' {aka '_pi_result (*)(_pi_device*, _pi_program*, const char*, long unsigned int*)'} [-Werror=cast-function-type]
   (PluginInit->PiFunctionTable).pi_api = (decltype(&::pi_api))(&cuda_api);
                                                                         ^
.../sycl/plugins/cuda/pi_cuda.cpp:3504:3: note: in expansion of macro '_PI_CL'
   _PI_CL(piextGetDeviceFunctionPointer, cuda_piextGetDeviceFunctionPointer)
   ^~~~~~

and

.../sycl/plugins/opencl/pi_opencl.cpp: In function 'pi_result piPluginInit(pi_plugin*)':
.../sycl/plugins/opencl/pi_opencl.cpp:1028:72: error: cast between incompatible function types from 'pi_result (*)(pi_queue, pi_bool, void*, const void*, pi_int32, pi_uint32, _pi_event* const*, _pi_event**)' {aka '_pi_result (*)(_pi_queue*, unsigned int, void*, const void*, int, unsigned int, _pi_event* const*, _pi_event**)'} to 'pi_result (*)(pi_queue, pi_bool, void*, const void*, size_t, pi_uint32, _pi_event* const*, _pi_event**)' {aka '_pi_result (*)(_pi_queue*, unsigned int, void*, const void*, long unsigned int, unsigned int, _pi_event* const*, _pi_event**)'} [-Werror=cast-function-type]
   (PluginInit->PiFunctionTable).pi_api = (decltype(&::pi_api))(&ocl_api);
                                                                        ^
.../sycl/plugins/opencl/pi_opencl.cpp:1120:3: note: in expansion of macro '_PI_CL'
   _PI_CL(piextUSMEnqueueMemcpy, OCL(piextUSMEnqueueMemcpy))
   ^~~~~~

@fwyzard
Copy link
Contributor Author

fwyzard commented Mar 20, 2020

The first is for a non-implemented function (piextGetDeviceFunctionPointer) whose prototype seems to have gotten out of sync.

The second is an inconsistency between pi_int32 (i.e. int) and size_t (i.e. unsigned long int).

@fwyzard fwyzard force-pushed the SYCL_fix_compilation_warnings branch from b632162 to e35c4dd Compare March 21, 2020 00:03
fwyzard added a commit to cms-patatrack/llvm that referenced this pull request Mar 21, 2020
@bader bader merged commit a00416b into intel:sycl Mar 22, 2020
@fwyzard fwyzard deleted the SYCL_fix_compilation_warnings branch May 2, 2020 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants