Results 1 to 2 of 2

Thread: pointer type conversion

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    5

    pointer type conversion

    I have some functions working with float8. During optimization it turns out that math with native lenght, like float4, vectors works faster. I don't want to re-write all code I have, but just split my float8 functions to two float4 functions calls.

    void f_native(float4 a)
    {
    //do something in vector4 math
    }

    void f(float8 a)
    {
    float4* ta = &a;
    f_native(ta[0]);
    f_native(ta[1]);
    }

    Nvidea SDK issues warnings about this code. Is it any proper way to do such conversion without expencive performance overhead?

  2. #2
    Senior Member
    Join Date
    Mar 2011
    Location
    Seoul
    Posts
    118

    Re: pointer type conversion

    It is my understanding that OpenCL does not allow indexing into built-in vector types using pointers. If you wish to accomplish this you should use *.hi, *.lo, etc. I believe the reason for this is that different vendors may store these types in different manners, such as big endian vs. little endian devices.

Similar Threads

  1. pointer type conversion in kernel won't work
    By sanderbeckers in forum OpenCL
    Replies: 3
    Last Post: 03-11-2011, 08:59 AM
  2. incompatible integer to pointer conversion!!
    By phoebe0105 in forum OpenCL
    Replies: 4
    Last Post: 05-02-2010, 11:40 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
  •