2

これが私が書いた2つのカーネル関数です-完全なコードにはコンパイルエラーはありませんが、警告があります。

このプログラムは、生物学の配列アラインメントに関するものです。カーネル1では、行列はを使用しs0て計算され、カーネル2では、カーネル1と同じです。とそれ自体で計算されます。ここにコードと警告があります:gpu_samplegpu_datagpu_s0gpu_s0gpu_sgpu_s0

__global__ void myKernel1( char** gpu_sample, char** gpu_data, float **gpu_s0)   
{
    dim3 dimGrid1;
    dim3 dimBlock1;
    dimBlock1.x = dimBlock1.y = BLOCK_SIZE;
    dimGrid1.x = dimGrid1.y = GRID_SIZE;

    int i1 = threadIdx.x + blockIdx.x * dimBlock1.x;
    int j1 = threadIdx.y + blockIdx.y * dimBlock1.y;

    if( i1 > N || j1 > M ) return;
    while ( j1 < (M+1) && i1 < (N+1) )
    {
        if(gpu_sample[0][j1] == gpu_data[i1][0])    // here is the warning part.
        {

            gpu_s0[i1+1][j1+1] = 5;
        }
        else 

            gpu_s0[i1+1][j1+1] = -3;

    i1 += blockDim.x * gridDim.x;
    j1 += blockDim.y * gridDim.y;
    }
}

__global__ void myKernel2( float **gpu_s0, float **gpu_s )
{
    dim3 dimGrid2;
    dim3 dimBlock2;
    dimBlock2.x = dimBlock2.y = BLOCK_SIZE;
    dimGrid2.x = dimGrid2.y = GRID_SIZE;

    float w = -4;                                   
    float zero = 0;


    __shared__ float shared[ threadsPerBlock ][threadsPerBlock]; 
    int i2 = threadIdx.x + blockIdx.x * dimBlock2.x;
    int j2 = threadIdx.y + blockIdx.y * dimBlock2.y;

    while( j2 < (M+1) && i2 < (N+1) )
    {
      shared[threadIdx.x][threadIdx.y] = gpu_s0[i2][j2];      // here is the warning.

      i2 += blockDim.x * gridDim.x;
      j2 += blockDim.y * gridDim.y;
    }

    __syncthreads();


    if( j2 < (M+1) && i2 < (N+1) )
    gpu_s[i2][0] = gpu_s[0][j2] = 0;


    /*if ( j2 < (M+1) && i2 < (N+1) )
    sTemp0[threadIdx.x][threadIdx.y] = gpu_s0[i2][j2]; //????????
    __syncthreads();*/


    if( i2 > N || j2 > M ) return;
    while ( j2 < (M+1) && i2 < (N+1) )
    {

        gpu_s[i2][j2] = max(gpu_s[i2-1][(j2-1)] + shared[threadIdx.x][threadIdx.y], //?????????
                          gpu_s[i2][(j2-1)] + w, 
                          gpu_s[(i2-1)][j2] + w, 
                          zero);     // here is the warning.
        i2 += blockDim.x * gridDim.x;
        j2 += blockDim.y * gridDim.y;
    }

}

警告:

./test_10_15_2012.cu(155): Warning: Cannot tell what pointer points to, assuming global memory space
./test_10_15_2012.cu(155): Warning: Cannot tell what pointer points to, assuming global memory space
./test_10_15_2012.cu(155): Warning: Cannot tell what pointer points to, assuming global memory space
./test_10_15_2012.cu(186): Warning: Cannot tell what pointer points to, assuming global memory space
./test_10_15_2012.cu(208): Warning: Cannot tell what pointer points to, assuming global memory space
./test_10_15_2012.cu(208): Warning: Cannot tell what pointer points to, assuming global memory space
./test_10_15_2012.cu(208): Warning: Cannot tell what pointer points to, assuming global memory space
./test_10_15_2012.cu(208): Warning: Cannot tell what pointer points to, assuming global memory space

誰かが私がこの問題を解決するのを手伝ってくれるか、私にいくつかの提案をすることができますか?

4

0 に答える 0