当我调试我的代码时,当光标转到时显示此错误:
scoreMatrix[0] = dev_matrix[a]+similarityScore(dev_strA[a-1],dev_strB[b-1]);
并重复显示scoreMatrix[1], scoreMatrix[2], scoreMatrix[3]
__global__ void kernel_ScoreMatrix(char *dev_strA, char *dev_strB, int *dev_matrix, int *dev_array, int *array_length)
{
int x= blockIdx.x;
int y=blockIdx.y;
int m = COLUMNS*y + x;
for (int i=0; i<*(array_length); i++)
if (m==dev_array[i]){
int a = COLUMNS*(y-1) + (x-1);
int b= COLUMNS*(y-1) + (x);
int c= COLUMNS*(y) + (x-1);
int scoreMatrix[4];
scoreMatrix[0] = dev_matrix[a]+similarityScore(dev_strA[a-1],dev_strB[b-1]);
scoreMatrix[1] = dev_matrix[b]+GAP;
scoreMatrix[2] = dev_matrix[c]+GAP;
scoreMatrix[3] = 0;
dev_matrix[m] = findMax(scoreMatrix,4);
}
}
这是问题的图片。