Results 1 to 3 of 3

Thread: clGetPlatformIDs returns 4294967266, not expected

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    3

    clGetPlatformIDs returns 4294967266, not expected

    I was expecting some kind of error code, like the ones in this file: http://www.khronos.org/registry/cl/api/1.0/cl.h

    I should get 0 right? This would be a CL_SUCCESS. All the other error codes appear to be negative. Since I got a positive number, is that also a CL_SUCCESS?

    Just in case anyone is curious, here is my code below:

    Code :
    // Obtain the platform IDs and initialize the context properties
    cl_uint error; //reusable variable for determining if an OpenCL function returns successfully or not
     
    cl_platform_id *platforms;
    cl_uint *num_platforms;
     
    error = clGetPlatformIDs(1, platforms, num_platforms);
    cout << error << endl;
    return 0;

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: clGetPlatformIDs returns 4294967266, not expected

    Error codes are signed integers. You have declared variable "error" as an unsigned integer.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: clGetPlatformIDs returns 4294967266, not expected

    FWIW, the number you gave us translates into -30 when interpreted as a signed integer, which corresponds to CL_INVALID_VALUE.

    In addition to that your code is incorrect. You should be doing something like this:

    // Obtain the platform IDs and initialize the context properties
    cl_int error; //reusable variable for determining if an OpenCL function returns successfully or not

    cl_platform_id platforms;
    cl_uint num_platforms;

    error = clGetPlatformIDs(1, &platforms, &num_platforms);
    cout << error << endl;
    return 0;
    I would recommend refreshing your C skills for a while before attempting to tackle OpenCL.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

Similar Threads

  1. What is the expected performance?
    By tranders in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 04-16-2004, 06:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •