3 Replies Latest reply on Nov 3, 2010 6:27 AM by eklund.n

    Quick question about vector types

      Structural relation between arrays and vectors


      In AESEncryptDecrypt sample, some memory buffers are created and filled with an array of uchar. The buffer is later read from kernel, but as array of uchar4.

      Can we always expect the structural layout of an array of 'type' to map into an array of 'typeX' (where X is 2-16)?

      'type' ptr[nbr]; cl_mem buffer_object = clCreateBuffer(context, CL_MEM_COPY_HOST_PTR, sizeof('type')*nbr, ptr, NULL); clSetKernelArg(kernel, 0, sizeof(cl_mem), (void *)&buffer_object); __kernel void kernel_name(__global 'typeX' *buffer_object) {}