view paper/src/twice_cuda.cu @ 16:958634b9fa32

make paper directory
author Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
date Wed, 17 Feb 2016 16:59:46 +0900
parents src/twice_cuda.cu@12d1c2f53258
children
line wrap: on
line source

__global__ void
twice(int* input, int* output)
{
    /**
     * Get index(x, y, z)
     *   kernel built-in variables
     *   x : blockIdx.x * blockDim.x + threadIdx.x
     *   y : blockIdx.y * blockDim.y + threadIdx.y
     *   z : blockIdx.z * blockDim.z + threadIdx.z
     */
    long i = blockIdx.x * blockDim.x + threadIdx.x;

    output[i] = input[i]*2;
    
    return 0;
}