Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@krk
Created June 27, 2017 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krk/28d513dd3418babe39a76ebadd919c5b to your computer and use it in GitHub Desktop.
Save krk/28d513dd3418babe39a76ebadd919c5b to your computer and use it in GitHub Desktop.
...
Ais[threadIdx.y][threadIdx.x] = *loc( d_A, n, i, j ); // A(i,j) elemanı Ais paylaşık hafızasına yüklenir.
Bis[threadIdx.y][threadIdx.x] = *loc( d_A, n, j, k ); // A(j,k) elemanı Bis paylaşık hafızasına yüklenir.
// kullanılacak elemanlar paylaşık hafızaya yüklenir.
__syncthreads(); // syncthreads, bloktaki tüm threadlerin bu noktaya erişmesini bekletir.
for(int k=0; k<BLOCK_SIZE;k++)
{
val += Ais[threadIdx.y][k] * Bis[k][threadIdx.x];
}
// tüm threadlerin sonucu yazması beklenir.
__syncthreads(); // syncthreads, bloktaki tüm threadlerin bu noktaya erişmesini bekletir.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment