Results 1 to 2 of 2

Thread: clGetDeviceInfo returning large integers sometimes

  1. #1
    Newbie
    Join Date
    Jul 2017
    Posts
    2

    Question clGetDeviceInfo returning large integers sometimes

    I have the following code to get the address bits and size for the global work group.

    size_t size;
    size_t address_bits;
    clGetDeviceInfo(device_id, CL_DEVICE_ADDRESS_BITS, 0, NULL, &size);
    clGetDeviceInfo(device_id, CL_DEVICE_ADDRESS_BITS, size, (void *)&address_bits, NULL);

    Occasionally address_bits will set to some extremely large integer such as 139741055942720.000000, when it should be 64.

    Any idea what is causing this?

  2. #2
    Newbie
    Join Date
    Jul 2017
    Posts
    2
    Quote Originally Posted by Jayfire0 View Post
    I have the following code to get the address bits and size for the global work group.

    size_t size;
    size_t address_bits;
    clGetDeviceInfo(device_id, CL_DEVICE_ADDRESS_BITS, 0, NULL, &size);
    clGetDeviceInfo(device_id, CL_DEVICE_ADDRESS_BITS, size, (void *)&address_bits, NULL);

    Occasionally address_bits will set to some extremely large integer such as 139741055942720.000000, when it should be 64.

    Any idea what is causing this?


    Update: Figured it out. It had to do with the casting on address_bits. Address_bits had to be of type cl_uint for the getInfo calls. The before I called clEnqueueNDRangeKernel, I did:

    size_t temp = address_bits;
    and then called
    ret = clEnqueueNDRangeKernel(command_queue, kernel, 1, NULL, &temp, NULL, 0, NULL,NULL);

    This completely fixed my issue. I tried just casting the address_bits in the clEnqueue call but that did not work for whatever reason.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean