2013년 7월 23일 화요일

inlie ptx

__global__ void sequence_gpu(int *d_ptr, int length)
{
    int elemID = blockIdx.x * blockDim.x + threadIdx.x;

    if (elemID < length)
    {
        unsigned int laneid;
        //This command gets the lane ID within the current warp
        asm(
".reg .u32 a,b,c; \n\t"
"mov.u32 %0, %%laneid; \n\t"
"add.u32 b, c,c; \n\t"
"add.u32 a, b,c; \n\t"
"add.u32 %0, a,c;"

: "=r"(laneid)
);
        d_ptr[elemID] = laneid;
    }
}

상호간의 관계를 이용해서 asm이 사라지기도 하는... 신기한..


내 gpu에서의 한계..

encrypt_gpu<<<64 1024="">>>(dev_cipher, dev_key);

댓글 없음:

댓글 쓰기