Results 1 to 3 of 3

Thread: CL_INVALID_BINARY (-42) while trying to use double on Tesla

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    26

    CL_INVALID_BINARY (-42) while trying to use double on Tesla

    I get CL_INVALID_BINARY (-42) in Program::build() while trying to use double on Tesla C1060, here is the code:

    #pragma OPENCL EXTENSION cl_khr_fp64 : enable

    __kernel void compute(__global double *vd0,
    __global double *vd1,
    __global double *vd2)
    {
    uint index = get_global_id(0);
    (vd2[index]=2);
    (vd0[index]=(2+pown(vd2[index],3)));
    (vd1[index]=index);
    }

    what is wrong?

  2. #2
    Junior Member
    Join Date
    Dec 2010
    Posts
    26

    Re: CL_INVALID_BINARY (-42) while trying to use double on Te

    Solution: I had 2 cards and only one of them had double-precision support, so while creating context one needs only to mention one:

    devices.push_back(context.getInfo<CL_CONTEXT_DEVIC ES>()[0]);

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

    Re: CL_INVALID_BINARY (-42) while trying to use double on Te

    Funny, I was going to ask you to query whether the device actually supported doubles using clGetDeviceInfo(). I didn't post the message because you already mentioned it was a Tesla.
    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. Replies: 5
    Last Post: 11-24-2009, 02:22 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
  •