7 Replies Latest reply on Oct 30, 2009 4:17 PM by nou

    pointer to float3 can't reference members

    david_aiken

      hi..

      The following kernel code:

       

          __global float3 *pos = (__global float3*)(bufPnts + ndx * simData->stride);

          int gz = (pos->z - simData->min.z) * simData->delta.z ;

      produces an error:
      error: expression must have pointer-to-struct-or-union type
            int gz = (pos->z - simData->min.z) * simData->delta.z ;
      It seems like this should be allowed.
      It doesn't mind:
          __global float3 *pos2 = (__global float3*)(bufPnts);
          int q = (*pos2).x;