-
-
Save krk/f4ec6a99917972f19a296f702bf65628 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// matMul1 (n adet global store): | |
d_C[ cIdx ] = 0; | |
// C matrisinin her bir hücresi için | |
for(int j=0; j<n; j++) | |
{ | |
// her bir eleman için C matrisinin bir elemanı okunur ve yazılır. | |
d_C[ cIdx ] += *loc( d_A, n, i, j ) * *loc( d_B, r, j, k ); // global hafızaya yazılır(d_C). | |
} | |
// matMul2 (1 adet global store): | |
float val = 0; // ara toplam değişkeni | |
// C matrisinin her bir hücresi için | |
for(int j=0; j<n; j++) | |
{ | |
val += *loc( d_A, n, i, j ) * *loc( d_B, r, j, k ); // local registera(val) yazılır. | |
} | |
// C matrisine bir kere yazılır. | |
d_C[ cIdx ] = val; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment