You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using arm-linux-gnueabi-gcc as a compiler it does not do the implicit conversion from cl_uint to long and causes the comparison where -1 and variables of type cl_uint to go wrong. When casting num_platforms and num_devices to long, it works.
If you use gcc -Wall -Wextra clinfo.c -o clinfo-x64 -lOpenCL -lm, you get a list of conversions, but I found these far from complete. Going to test on the arm32-compiler later.
clinfo.c: In function ‘main’:
clinfo.c:476:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (specific_platform > -1 && i != specific_platform) continue;
^~
clinfo.c:545:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (specific_device > -1 && j != specific_device) continue;
Currently have done my edits on a local machine, so can't easily create a PR right now. I'm putting this issue so others know the code does not work correctly on some compilers, and I get remembered to make that PR when there is a reply on this.
The text was updated successfully, but these errors were encountered:
When using
arm-linux-gnueabi-gcc
as a compiler it does not do the implicit conversion from cl_uint to long and causes the comparison where-1
and variables of typecl_uint
to go wrong. When castingnum_platforms
andnum_devices
to long, it works.If you use
gcc -Wall -Wextra clinfo.c -o clinfo-x64 -lOpenCL -lm
, you get a list of conversions, but I found these far from complete. Going to test on the arm32-compiler later.Currently have done my edits on a local machine, so can't easily create a PR right now. I'm putting this issue so others know the code does not work correctly on some compilers, and I get remembered to make that PR when there is a reply on this.
The text was updated successfully, but these errors were encountered: