Results 1 to 2 of 2

Thread: Type casting question

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    13

    Type casting question

    I am writing a convolution algorithm in c#, using the Cloo library. I have a convolution algorithm that I am sending into the GPU and I am testing it against a serial version of the same algorithm. Unfortunately, I am getting miniscule errors back in my data. I have 1243/64407 inconsistencies, where the output is off by 1, which leads me to think that there is something different going on dealing with truncation.

    Is there an inconsistency in the way that OpenCL truncates or approximates vs C#?

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

    Re: Type casting question

    Unfortunately, I am getting minuscule errors back in my data.
    Chances are that the floating point capabilities of your GPU are not identical to your CPU. You can query the single-precision floating point capabilities of an OpenCL device by calling clGetDeviceInfo(..., CL_DEVICE_SINGLE_FP_CONFIG, ...).

    All OpenCL-certified devices actually pass some very strict tests regarding their numerical accuracy.
    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. casting char* to struct
    By oconnellseanm in forum OpenCL
    Replies: 5
    Last Post: 07-28-2011, 10:38 AM
  2. Casting int2, float2
    By toneburst in forum OpenCL
    Replies: 1
    Last Post: 12-04-2010, 06:49 PM
  3. a question about the sampler data type in shading language
    By qqca in forum OpenGL ES general technical discussions
    Replies: 4
    Last Post: 11-15-2007, 02:14 PM

Posting Permissions

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