I declared “shared_H” shared memory in device:
shared int shared_H[3*BLOCK_SIZE_Y];
when passing “shared_H” from “scoreMatrix[0]” to “H_Matrix” function, and view shared memory cells of “shared_H”, all cells values are ??? and they haven’t values before calling “H_Matrix” function.
device int H_Matrix (int current_cell, int x, int y, int *dev_H, int shared_H, char *dev_seqA,
char *dev_seqB, int *dev_lenA){
if (threadIdx.x==0 || threadIdx.y==0){
int H= current_cell-(*(dev_lenA))-1;
return dev_H[H]+similarityScore(dev_seqB[x-1], dev_seqA[y-1]);
}
else{
int H=shared_compute_address()-BLOCK_SIZE_Y-1;
return shared_H[H]+similarityScore(dev_seqB[x-1], dev_seqA[y-1]);
}
}
//Calling H_Matrix function from device
scoreMatrix[0] = H_Matrix(current_cell, x, y, dev_H, shared_H, dev_seqA, dev_seqB, dev_lenA);
What should I do for passing a shared memory array to a function that previous values are kept and can change some cells of it and return to device, I need another method?