cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

roddomi
Journeyman III

Byte addressable data not working

Hi,

The kernel below executes correctly when d_odata and d_idata point to int. However, if I change them to point to char the data doesn't get copied over. I can see that only 1 every 4 bytes is being copied but the rest is left untouched. It seems as if byte addressing was not working.

 

#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable

__kernel void testKernel(__global uchar *d_odata, __global uchar *d_idata, int numElements)
{
    int tid = get_global_id(0);
    int numThreads = get_global_size(0);

    for (int pos = tid ; pos < numElements ; pos += numThreads)
        d_odata[pos] = d_idata[pos];
}

 

I am using ATI Stream SDK 2.1.

Thank you.

 

0 Likes
4 Replies
omkaranathan
Journeyman III

Which GPU are you using? What is the behavior with CPU?

0 Likes

I am using an ATI Radeon HD 5870 (Catalyst 10.2). When I create the context on the CPU (CL_DEVICE_TYPE_CPU) it works fine.

0 Likes

Could you upgrade the driver to Catalyst 10.4 and see if it makes any difference?

0 Likes

Yes. It works now. Thank you.

0 Likes