OpenCL-CTS icon indicating copy to clipboard operation
OpenCL-CTS copied to clipboard

Fix incompatiable pointer type warning for device_execution test

Open vangthao95 opened this issue 2 months ago • 1 comments

There are multiple incompatiable pointer types warnings when compiling the device_execution test with clang. There was an upstream llvm patch that will turn these warnings into an error https://github.com/llvm/llvm-project/pull/157364.

To not encounter this issue in the future, fix these warnings by changing the parameter types.

warning: incompatible pointer types passing '__global ulong (*)[512]' (aka '__global unsigned long (*)[512]') to parameter of type 'const __generic ulong *' (aka 'const __generic unsigned long *') [-Wincompatible-pointer-types]
   37 |         void (^checkBlock) (void) = ^{ check_res(tid, &value, res); };
      |                                                       ^~~~~~
note: passing argument to parameter 'value' here
--
warning: incompatible pointer types passing '__global int *const __private' to parameter of type '__global atomic_uint *' (aka '__global _Atomic(unsigned int) *') [-Wincompatible-pointer-types]
   10 |   void (^kernelBlock)(void) = ^{ block_fn(len, val); };
      |                                                ^~~
note: passing argument to parameter 'val' here
--
warning: incompatible pointer types passing '__global int *const __private' to parameter of type '__global atomic_uint *' (aka '__global _Atomic(unsigned int) *') [-Wincompatible-pointer-types]
   10 |   void (^kernelBlock)(void) = ^{ block_fn(len, val); };
      |                                                ^~~
note: passing argument to parameter 'val' here
--
warning: incompatible pointer types passing '__global int *const __private' to parameter of type '__global atomic_uint *' (aka '__global _Atomic(unsigned int) *') [-Wincompatible-pointer-types]
   10 |   void (^kernelBlock)(void) = ^{ block_fn(len, val); };
      |                                                ^~~
note: passing argument to parameter 'val' here
--
warning: incompatible pointer types passing '__global int *const __private' to parameter of type '__global atomic_uint *' (aka '__global _Atomic(unsigned int) *') [-Wincompatible-pointer-types]
   10 |   void (^kernelBlock)(void) = ^{ block_fn(len, val); };
      |                                                ^~~
note: passing argument to parameter 'val' here
--
warning: incompatible pointer types passing '__global int *const __private' to parameter of type '__global atomic_uint *' (aka '__global _Atomic(unsigned int) *') [-Wincompatible-pointer-types]
   10 |   void (^kernelBlock)(void) = ^{ block_fn(len, val); };
      |                                                ^~~
note: passing argument to parameter 'val' here
--
warning: incompatible pointer types passing '__global int *const __private' to parameter of type '__global atomic_uint *' (aka '__global _Atomic(unsigned int) *') [-Wincompatible-pointer-types]
   10 |   void (^kernelBlock)(void) = ^{ block_fn(len, val); };
      |                                                ^~~
note: passing argument to parameter 'val' here

vangthao95 avatar Oct 25 '25 07:10 vangthao95

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 25 '25 07:10 CLAassistant

Hi @bashbaug,

This is my first PR here so I am not sure who to add as a reviewer but I see that you are a frequent reviewer. Can you help to review or address this issue?

vangthao95 avatar Nov 04 '25 18:11 vangthao95

@bashbaug @paulfradgley any ideas who can help review this one? Thanks

lamb-j avatar Nov 12 '25 15:11 lamb-j

@bashbaug @vangthao95 : Are we now good to merge this patch?

saipoorna avatar Nov 20 '25 12:11 saipoorna

I added focused review. I hope we can land this soon.

b-sumner avatar Nov 20 '25 17:11 b-sumner

Merging as discussed over email.

bashbaug avatar Nov 27 '25 00:11 bashbaug