Skip to content

Not working on ARM 32 bit #5

Description

@VincentSC

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions