MAGMA  1.2.0
MatrixAlgebraonGPUandMulticoreArchitectures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
auxiliary.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  magma_timestr_s

Typedefs

typedef struct magma_timestr_s magma_timestr_t

Functions

int magma_get_spotrf_nb (int m)
int magma_get_sgeqrf_nb (int m)
int magma_get_sgeqlf_nb (int m)
int magma_get_sgetrf_nb (int m)
int magma_get_sgetri_nb (int m)
int magma_get_sgehrd_nb (int m)
int magma_get_ssytrd_nb (int m)
int magma_get_sgelqf_nb (int m)
int magma_get_sgebrd_nb (int m)
int magma_get_ssygst_nb (int m)
int magma_get_dpotrf_nb (int m)
int magma_get_dgeqrf_nb (int m)
int magma_get_dgeqlf_nb (int m)
int magma_get_dgetrf_nb (int m)
int magma_get_dgetri_nb (int m)
int magma_get_dgehrd_nb (int m)
int magma_get_dsytrd_nb (int m)
int magma_get_dgelqf_nb (int m)
int magma_get_dgebrd_nb (int m)
int magma_get_dsygst_nb (int m)
int magma_get_cpotrf_nb (int m)
int magma_get_cgetrf_nb (int m)
int magma_get_cgetri_nb (int m)
int magma_get_cgeqrf_nb (int m)
int magma_get_cgeqlf_nb (int m)
int magma_get_cgehrd_nb (int m)
int magma_get_chetrd_nb (int m)
int magma_get_cgelqf_nb (int m)
int magma_get_cgebrd_nb (int m)
int magma_get_chegst_nb (int m)
int magma_get_zpotrf_nb (int m)
int magma_get_zgetrf_nb (int m)
int magma_get_zgetri_nb (int m)
int magma_get_zgeqrf_nb (int m)
int magma_get_zgeqlf_nb (int m)
int magma_get_zgehrd_nb (int m)
int magma_get_zhetrd_nb (int m)
int magma_get_zgelqf_nb (int m)
int magma_get_zgebrd_nb (int m)
int magma_get_zhegst_nb (int m)
magma_timestr_t get_current_time (void)
double GetTimerValue (magma_timestr_t time_1, magma_timestr_t time_2)
double magma_wtime (void)
void printout_devices ()
void swp2pswp (char trans, int n, int *ipiv, int *newipiv)
float getv (float *da)
size_t magma_strlcpy (char *dst, const char *src, size_t siz)
int magma_num_gpus (void)

Typedef Documentation


Function Documentation

magma_timestr_t get_current_time ( void  )

Definition at line 76 of file timer.cpp.

{
struct timeval time_val;
cudaDeviceSynchronize();
gettimeofday(&time_val, NULL);
time.sec = time_val.tv_sec;
time.usec = time_val.tv_usec;
return (time);
}

Here is the caller graph for this function:

double GetTimerValue ( magma_timestr_t  time_1,
magma_timestr_t  time_2 
)

Definition at line 94 of file timer.cpp.

References magma_timestr_s::sec, and magma_timestr_s::usec.

{
int sec, usec;
sec = end.sec - start.sec;
usec = end.usec - start.usec;
return (1000.*(double)(sec) + (double)(usec) * 0.001);
}

Here is the caller graph for this function:

float getv ( float *  da)

Definition at line 161 of file auxiliary.cpp.

{
float res[1];
cublasGetVector(1, sizeof(float), da, 1, res, 1);
return res[0];
}
int magma_get_cgebrd_nb ( int  m)

Definition at line 271 of file get_nb_tesla.cpp.

{
return 32;
}

Here is the caller graph for this function:

int magma_get_cgehrd_nb ( int  m)

Definition at line 215 of file get_nb_tesla.cpp.

{
if (m <= 1024)
return 32;
else
return 64;
}

Here is the caller graph for this function:

int magma_get_cgelqf_nb ( int  m)

Definition at line 144 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 32;
else if (m <= 4032)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_cgeqlf_nb ( int  m)

Definition at line 108 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 32;
else if (m <= 4032)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_cgeqrf_nb ( int  m)

Definition at line 67 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 32;
else if (m <= 4032)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_cgetrf_nb ( int  m)

Definition at line 182 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_cgetri_nb ( int  m)

Definition at line 318 of file get_nb_tesla.cpp.

{
return 64;
}

Here is the caller graph for this function:

int magma_get_chegst_nb ( int  m)

Definition at line 295 of file get_nb_tesla.cpp.

{
return 64;
}

Here is the caller graph for this function:

int magma_get_chetrd_nb ( int  m)

Definition at line 246 of file get_nb_tesla.cpp.

{
return 32;
}

Here is the caller graph for this function:

int magma_get_cpotrf_nb ( int  m)

Definition at line 36 of file get_nb_tesla.cpp.

{
return 64;
}

Here is the caller graph for this function:

int magma_get_dgebrd_nb ( int  m)

Definition at line 266 of file get_nb_tesla.cpp.

{
return 32;
}

Here is the caller graph for this function:

int magma_get_dgehrd_nb ( int  m)

Definition at line 207 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 32;
else
return 64;
}

Here is the caller graph for this function:

int magma_get_dgelqf_nb ( int  m)

Definition at line 134 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 32;
else if (m <= 4032)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_dgeqlf_nb ( int  m)

Definition at line 98 of file get_nb_tesla.cpp.

{
if (m <= 1024)
return 32;
else if (m <= 4032)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_dgeqrf_nb ( int  m)

Definition at line 59 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_dgetrf_nb ( int  m)

Definition at line 174 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_dgetri_nb ( int  m)

Definition at line 313 of file get_nb_tesla.cpp.

{
return 64;
}

Here is the caller graph for this function:

int magma_get_dpotrf_nb ( int  m)

Definition at line 26 of file get_nb_tesla.cpp.

{
if (n <= 3328)
return 128;
else if (n <= 4256)
return 128;
else
return 256;
}

Here is the caller graph for this function:

int magma_get_dsygst_nb ( int  m)

Definition at line 290 of file get_nb_tesla.cpp.

{
return 64;
}

Here is the caller graph for this function:

int magma_get_dsytrd_nb ( int  m)

Definition at line 240 of file get_nb_tesla.cpp.

{
return 32;
//return 64;
}

Here is the caller graph for this function:

int magma_get_sgebrd_nb ( int  m)

Definition at line 261 of file get_nb_tesla.cpp.

{
return 32;
}

Here is the caller graph for this function:

int magma_get_sgehrd_nb ( int  m)

Definition at line 199 of file get_nb_tesla.cpp.

{
if (m <= 1024)
return 32;
else
return 64;
}

Here is the caller graph for this function:

int magma_get_sgelqf_nb ( int  m)

Definition at line 129 of file get_nb_tesla.cpp.

References magma_get_sgeqrf_nb().

{
}

Here is the call graph for this function:

Here is the caller graph for this function:

int magma_get_sgeqlf_nb ( int  m)

Definition at line 88 of file get_nb_tesla.cpp.

{
if (m <= 1024)
return 32;
else if (m <= 4032)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_sgeqrf_nb ( int  m)

Definition at line 49 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 32;
else if (m <= 4032)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_sgetrf_nb ( int  m)

Definition at line 166 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_sgetri_nb ( int  m)

Definition at line 308 of file get_nb_tesla.cpp.

{
return 64;
}

Here is the caller graph for this function:

int magma_get_spotrf_nb ( int  m)

Definition at line 16 of file get_nb_tesla.cpp.

{
if (n <= 3328)
return 128;
else if (n <= 4256)
return 224;
else
return 288;
}

Here is the caller graph for this function:

int magma_get_ssygst_nb ( int  m)

Definition at line 285 of file get_nb_tesla.cpp.

{
return 64;
}

Here is the caller graph for this function:

int magma_get_ssytrd_nb ( int  m)

Definition at line 235 of file get_nb_tesla.cpp.

{
return 32;
}

Here is the caller graph for this function:

int magma_get_zgebrd_nb ( int  m)

Definition at line 276 of file get_nb_tesla.cpp.

{
return 32;
}

Here is the caller graph for this function:

int magma_get_zgehrd_nb ( int  m)

Definition at line 223 of file get_nb_tesla.cpp.

{
if (m <= 2048)
return 32;
else
return 64;
}

Here is the caller graph for this function:

int magma_get_zgelqf_nb ( int  m)

Definition at line 154 of file get_nb_tesla.cpp.

{
if (m <= 1024)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_zgeqlf_nb ( int  m)

Definition at line 118 of file get_nb_tesla.cpp.

{
if (m <= 1024)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_zgeqrf_nb ( int  m)

Definition at line 77 of file get_nb_tesla.cpp.

{
if (m <= 1024)
return 64;
else
return 128;
}

Here is the caller graph for this function:

int magma_get_zgetrf_nb ( int  m)

Definition at line 190 of file get_nb_tesla.cpp.

{
return 128;
}

Here is the caller graph for this function:

int magma_get_zgetri_nb ( int  m)

Definition at line 323 of file get_nb_tesla.cpp.

{
return 64;
}

Here is the caller graph for this function:

int magma_get_zhegst_nb ( int  m)

Definition at line 300 of file get_nb_tesla.cpp.

{
return 64;
}

Here is the caller graph for this function:

int magma_get_zhetrd_nb ( int  m)

Definition at line 251 of file get_nb_tesla.cpp.

{
return 32;
//return 64;
}

Here is the caller graph for this function:

int magma_get_zpotrf_nb ( int  m)

Definition at line 41 of file get_nb_tesla.cpp.

{
return 64;
}

Here is the caller graph for this function:

int magma_num_gpus ( void  )

Definition at line 17 of file auxiliary.cpp.

References MagmaMaxGPUs, and min.

{
const char *ngpu_str = getenv("MAGMA_NUM_GPUS");
int ngpu = 1;
if ( ngpu_str != NULL ) {
char* endptr;
ngpu = strtol( ngpu_str, &endptr, 10 );
int ndevices;
cudaGetDeviceCount( &ndevices );
// if *endptr == '\0' then entire string was valid number (or empty)
if ( ngpu < 1 or *endptr != '\0' ) {
ngpu = 1;
fprintf( stderr, "$MAGMA_NUM_GPUS=%s is an invalid number; using %d GPU.\n",
ngpu_str, ngpu );
}
else if ( ngpu > MagmaMaxGPUs or ngpu > ndevices ) {
ngpu = min( ndevices, MagmaMaxGPUs );
fprintf( stderr, "$MAGMA_NUM_GPUS=%s exceeds MagmaMaxGPUs=%d or available GPUs=%d; using %d GPUs.\n",
ngpu_str, MagmaMaxGPUs, ndevices, ngpu );
}
assert( 1 <= ngpu and ngpu <= ndevices );
}
return ngpu;
}

Here is the caller graph for this function:

size_t magma_strlcpy ( char *  dst,
const char *  src,
size_t  siz 
)

Definition at line 47 of file strlcpy.cpp.

{
char *d = dst;
const char *s = src;
size_t n = siz;
/* Copy as many bytes as will fit */
if (n != 0) {
while (--n != 0) {
if ((*d++ = *s++) == '\0')
break;
}
}
/* Not enough room in dst, add NUL and traverse rest of src */
if (n == 0) {
if (siz != 0)
*d = '\0'; /* NUL-terminate dst */
while (*s++)
;
}
return (s - src - 1); /* count does not include NUL */
}
double magma_wtime ( void  )

Definition at line 110 of file timer.cpp.

{
struct timeval t;
gettimeofday( &t, NULL );
return t.tv_sec + t.tv_usec*1e-6;
}

Here is the caller graph for this function:

void printout_devices ( )

Definition at line 48 of file auxiliary.cpp.

References lapack_testing::f, and lapack_testing::name.

{
int ndevices;
cudaGetDeviceCount( &ndevices );
for( int idevice = 0; idevice < ndevices; idevice++ ) {
cudaDeviceProp prop;
cudaGetDeviceProperties( &prop, idevice );
printf( "device %d: %s, %.1f MHz clock, %.1f MB memory, capability %d.%d\n",
idevice,
prop.name,
prop.clockRate / 1000.,
prop.totalGlobalMem / (1024.*1024.),
prop.major,
prop.minor );
}
}

Here is the caller graph for this function:

void swp2pswp ( char  trans,
int  n,
int *  ipiv,
int *  newipiv 
)

Definition at line 74 of file auxiliary.cpp.

References lapackf77_lsame, and trans.

{
int i, newind, ind;
char trans_[2] = {trans, 0};
long int notran = lapackf77_lsame(trans_, "N");
for(i=0; i<n; i++)
newipiv[i] = -1;
if (notran){
for(i=0; i<n; i++){
newind = ipiv[i] - 1;
if (newipiv[newind] == -1) {
if (newipiv[i]==-1){
newipiv[i] = newind;
if (newind>i)
newipiv[newind]= i;
}
else
{
ind = newipiv[i];
newipiv[i] = newind;
if (newind>i)
newipiv[newind]= ind;
}
}
else {
if (newipiv[i]==-1){
if (newind>i){
ind = newipiv[newind];
newipiv[newind] = i;
newipiv[i] = ind;
}
else
newipiv[i] = newipiv[newind];
}
else{
ind = newipiv[i];
newipiv[i] = newipiv[newind];
if (newind > i)
newipiv[newind] = ind;
}
}
}
} else {
for(i=n-1; i>=0; i--){
newind = ipiv[i] - 1;
if (newipiv[newind] == -1) {
if (newipiv[i]==-1){
newipiv[i] = newind;
if (newind>i)
newipiv[newind]= i;
}
else
{
ind = newipiv[i];
newipiv[i] = newind;
if (newind>i)
newipiv[newind]= ind;
}
}
else {
if (newipiv[i]==-1){
if (newind>i){
ind = newipiv[newind];
newipiv[newind] = i;
newipiv[i] = ind;
}
else
newipiv[i] = newipiv[newind];
}
else{
ind = newipiv[i];
newipiv[i] = newipiv[newind];
if (newind > i)
newipiv[newind] = ind;
}
}
}
}
}

Here is the caller graph for this function: