Hi,
I have been studying the source code of magma1.1 recently.
But I found some very strange thing and that tangled me.
When I want to learn the matrix multiply, so I just find the corresponding code, but what I get is just
the declaration of magmablas_sgemm in magmablas/magmablas_s.h, where is the realization of magmablas_sgemm ?
Kindly reply if you know some advice.
thanks in advance.
Ke Zeng
where is the realization of magmablas_sgemm?
Re: where is the realization of magmablas_sgemm?
I think you mean you found the declaration in include/magmablas_s.h
The actual code is in several files matching magmablas/sgemm*.cu
-mark
The actual code is in several files matching magmablas/sgemm*.cu
-mark
Re: where is the realization of magmablas_sgemm?
Thanks,but how does the declaration in include/magmablas_s.h match the actual code?mgates3 wrote:I think you mean you found the declaration in include/magmablas_s.h
The actual code is in several files matching magmablas/sgemm*.cu
-mark
At first i think there must be some function to choose the corresponding function such as magmablas/sgemm*.cu, but i cannot find the function.
Is anybody know?
Re: where is the realization of magmablas_sgemm?
In sgemm_fermi.cu, there is:
#define magmablas_sgemm_fermi magmablas_sgemm
extern "C" void
magmablas_sgemm_fermi( char TRANSA, char TRANSB, int m , int n , int k ,
float alpha, const float *A, int lda,
const float *B, int ldb,
float beta, float *C, int ldc )
{
// the actual sgemm code
}
Similarly, there is a #define in the sgemm_tesla.cu file, for cards with capability <= 1.3. Which file gets compiled is handled by the magmablas Makefile, using ${GPU_TARGET} defined in make.inc.
-mark
#define magmablas_sgemm_fermi magmablas_sgemm
extern "C" void
magmablas_sgemm_fermi( char TRANSA, char TRANSB, int m , int n , int k ,
float alpha, const float *A, int lda,
const float *B, int ldb,
float beta, float *C, int ldc )
{
// the actual sgemm code
}
Similarly, there is a #define in the sgemm_tesla.cu file, for cards with capability <= 1.3. Which file gets compiled is handled by the magmablas Makefile, using ${GPU_TARGET} defined in make.inc.
-mark
Re: where is the realization of magmablas_sgemm?
oh, i find it, thanks.mgates3 wrote:In sgemm_fermi.cu, there is:
#define magmablas_sgemm_fermi magmablas_sgemm
extern "C" void
magmablas_sgemm_fermi( char TRANSA, char TRANSB, int m , int n , int k ,
float alpha, const float *A, int lda,
const float *B, int ldb,
float beta, float *C, int ldc )
{
// the actual sgemm code
}
Similarly, there is a #define in the sgemm_tesla.cu file, for cards with capability <= 1.3. Which file gets compiled is handled by the magmablas Makefile, using ${GPU_TARGET} defined in make.inc.
-mark