2013년 4월 15일 월요일

cuda array


__global__ void sequence_gpu(int *d_ptr, int length, unsigned int* aaa)
{
    int elemID = blockIdx.x * blockDim.x + threadIdx.x;
unsigned int a,b,c;
unsigned int bb[4]={1,2,6,4};
    if (elemID < length)
    {

a=5;
b=3;
c=3;
        unsigned int laneid;
        //This command gets the lane ID within the current warp
        asm(
".reg .u32 t1; \n\t"
"ld.global.u32 t1, [%3+8]; \n\t"

"add.u32 %0, %1, t1;" : "=r"(c) :"r"(b),"r"(a),"r"(&bb) :"memory") ;
        d_ptr[elemID] = laneid;

    }
d_ptr[0]=c;
}

댓글 없음:

댓글 쓰기