MAGMA  magma-1.4.0
Matrix Algebra on GPU and Multicore Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
magma.h File Reference
#include "magmablas.h"
#include "magma_z.h"
#include "magma_c.h"
#include "magma_d.h"
#include "magma_s.h"
#include "magma_zc.h"
#include "magma_ds.h"
#include "auxiliary.h"
Include dependency graph for magma.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define magma_free(ptr)   magma_free_internal( ptr, __func__, __FILE__, __LINE__ )
 
#define magma_free_pinned(ptr)   magma_free_pinned_internal( ptr, __func__, __FILE__, __LINE__ )
 
#define magma_queue_create(queuePtr)   magma_queue_create_internal( queuePtr, __func__, __FILE__, __LINE__ )
 
#define magma_queue_destroy(queue)   magma_queue_destroy_internal( queue, __func__, __FILE__, __LINE__ )
 
#define magma_queue_sync(queue)   magma_queue_sync_internal( queue, __func__, __FILE__, __LINE__ )
 

Functions

magma_err_t magma_init (void)
 
magma_err_t magma_finalize (void)
 
void magma_version (int *major, int *minor, int *micro)
 
magma_err_t magma_malloc (magma_ptr *ptrPtr, size_t bytes)
 
magma_err_t magma_malloc_cpu (void **ptrPtr, size_t bytes)
 
magma_err_t magma_malloc_pinned (void **ptrPtr, size_t bytes)
 
magma_err_t magma_free_cpu (void *ptr)
 
magma_err_t magma_free_internal (magma_ptr ptr, const char *func, const char *file, int line)
 
magma_err_t magma_free_pinned_internal (void *ptr, const char *func, const char *file, int line)
 
static magma_err_t magma_imalloc (magmaInt_ptr *ptrPtr, size_t n)
 
static magma_err_t magma_smalloc (magmaFloat_ptr *ptrPtr, size_t n)
 
static magma_err_t magma_dmalloc (magmaDouble_ptr *ptrPtr, size_t n)
 
static magma_err_t magma_cmalloc (magmaFloatComplex_ptr *ptrPtr, size_t n)
 
static magma_err_t magma_zmalloc (magmaDoubleComplex_ptr *ptrPtr, size_t n)
 
static magma_err_t magma_imalloc_cpu (magma_int_t **ptrPtr, size_t n)
 
static magma_err_t magma_smalloc_cpu (float **ptrPtr, size_t n)
 
static magma_err_t magma_dmalloc_cpu (double **ptrPtr, size_t n)
 
static magma_err_t magma_cmalloc_cpu (magmaFloatComplex **ptrPtr, size_t n)
 
static magma_err_t magma_zmalloc_cpu (magmaDoubleComplex **ptrPtr, size_t n)
 
static magma_err_t magma_imalloc_pinned (magma_int_t **ptrPtr, size_t n)
 
static magma_err_t magma_smalloc_pinned (float **ptrPtr, size_t n)
 
static magma_err_t magma_dmalloc_pinned (double **ptrPtr, size_t n)
 
static magma_err_t magma_cmalloc_pinned (magmaFloatComplex **ptrPtr, size_t n)
 
static magma_err_t magma_zmalloc_pinned (magmaDoubleComplex **ptrPtr, size_t n)
 
magma_int_t magma_getdevice_arch ()
 
void magma_getdevices (magma_device_t *devices, magma_int_t size, magma_int_t *numPtr)
 
void magma_getdevice (magma_device_t *dev)
 
void magma_setdevice (magma_device_t dev)
 
void magma_device_sync ()
 
void magma_queue_create_internal (magma_queue_t *queuePtr, const char *func, const char *file, int line)
 
void magma_queue_destroy_internal (magma_queue_t queue, const char *func, const char *file, int line)
 
void magma_queue_sync_internal (magma_queue_t queue, const char *func, const char *file, int line)
 
void magma_event_create (magma_event_t *eventPtr)
 
void magma_event_destroy (magma_event_t event)
 
void magma_event_record (magma_event_t event, magma_queue_t queue)
 
void magma_event_query (magma_event_t event)
 
void magma_event_sync (magma_event_t event)
 
void magma_queue_wait_event (magma_queue_t queue, magma_event_t event)
 
void magma_xerbla (const char *name, magma_int_t info)
 
const char * magma_strerror (magma_err_t error)
 

Macro Definition Documentation

#define magma_free (   ptr)    magma_free_internal( ptr, __func__, __FILE__, __LINE__ )

Definition at line 57 of file magma.h.

#define magma_free_pinned (   ptr)    magma_free_pinned_internal( ptr, __func__, __FILE__, __LINE__ )

Definition at line 60 of file magma.h.

#define magma_queue_create (   queuePtr)    magma_queue_create_internal( queuePtr, __func__, __FILE__, __LINE__ )

Definition at line 113 of file magma.h.

#define magma_queue_destroy (   queue)    magma_queue_destroy_internal( queue, __func__, __FILE__, __LINE__ )

Definition at line 116 of file magma.h.

#define magma_queue_sync (   queue)    magma_queue_sync_internal( queue, __func__, __FILE__, __LINE__ )

Definition at line 119 of file magma.h.

Function Documentation

static magma_err_t magma_cmalloc ( magmaFloatComplex_ptr ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 79 of file magma.h.

References magma_malloc().

79 { return magma_malloc( (magma_ptr*) ptrPtr, n*sizeof(magmaFloatComplex) ); }
void * magma_ptr
Definition: magma_types.h:228
magma_err_t magma_malloc(magma_ptr *ptrPtr, size_t bytes)

Here is the call graph for this function:

static magma_err_t magma_cmalloc_cpu ( magmaFloatComplex **  ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 85 of file magma.h.

References magma_malloc_cpu().

85 { return magma_malloc_cpu( (void**) ptrPtr, n*sizeof(magmaFloatComplex) ); }
magma_err_t magma_malloc_cpu(void **ptrPtr, size_t bytes)

Here is the call graph for this function:

Here is the caller graph for this function:

static magma_err_t magma_cmalloc_pinned ( magmaFloatComplex **  ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 91 of file magma.h.

References magma_malloc_pinned().

91 { return magma_malloc_pinned( (void**) ptrPtr, n*sizeof(magmaFloatComplex) ); }
magma_err_t magma_malloc_pinned(void **ptrPtr, size_t bytes)

Here is the call graph for this function:

Here is the caller graph for this function:

void magma_device_sync ( )

Here is the caller graph for this function:

static magma_err_t magma_dmalloc ( magmaDouble_ptr ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 78 of file magma.h.

References magma_malloc().

78 { return magma_malloc( (magma_ptr*) ptrPtr, n*sizeof(double) ); }
void * magma_ptr
Definition: magma_types.h:228
magma_err_t magma_malloc(magma_ptr *ptrPtr, size_t bytes)

Here is the call graph for this function:

static magma_err_t magma_dmalloc_cpu ( double **  ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 84 of file magma.h.

References magma_malloc_cpu().

84 { return magma_malloc_cpu( (void**) ptrPtr, n*sizeof(double) ); }
magma_err_t magma_malloc_cpu(void **ptrPtr, size_t bytes)

Here is the call graph for this function:

Here is the caller graph for this function:

static magma_err_t magma_dmalloc_pinned ( double **  ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 90 of file magma.h.

References magma_malloc_pinned().

90 { return magma_malloc_pinned( (void**) ptrPtr, n*sizeof(double) ); }
magma_err_t magma_malloc_pinned(void **ptrPtr, size_t bytes)

Here is the call graph for this function:

Here is the caller graph for this function:

void magma_event_create ( magma_event_t *  eventPtr)

Here is the caller graph for this function:

void magma_event_destroy ( magma_event_t  event)

Here is the caller graph for this function:

void magma_event_query ( magma_event_t  event)
void magma_event_record ( magma_event_t  event,
magma_queue_t  queue 
)

Here is the caller graph for this function:

void magma_event_sync ( magma_event_t  event)

Here is the caller graph for this function:

magma_err_t magma_finalize ( void  )
magma_err_t magma_free_cpu ( void *  ptr)
magma_err_t magma_free_internal ( magma_ptr  ptr,
const char *  func,
const char *  file,
int  line 
)
magma_err_t magma_free_pinned_internal ( void *  ptr,
const char *  func,
const char *  file,
int  line 
)
void magma_getdevice ( magma_device_t *  dev)
magma_int_t magma_getdevice_arch ( )

Here is the caller graph for this function:

void magma_getdevices ( magma_device_t *  devices,
magma_int_t  size,
magma_int_t numPtr 
)
static magma_err_t magma_imalloc ( magmaInt_ptr ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 76 of file magma.h.

References magma_malloc().

76 { return magma_malloc( (magma_ptr*) ptrPtr, n*sizeof(magma_int_t) ); }
int magma_int_t
Definition: magmablas.h:12
void * magma_ptr
Definition: magma_types.h:228
magma_err_t magma_malloc(magma_ptr *ptrPtr, size_t bytes)

Here is the call graph for this function:

static magma_err_t magma_imalloc_cpu ( magma_int_t **  ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 82 of file magma.h.

References magma_malloc_cpu().

82 { return magma_malloc_cpu( (void**) ptrPtr, n*sizeof(magma_int_t) ); }
int magma_int_t
Definition: magmablas.h:12
magma_err_t magma_malloc_cpu(void **ptrPtr, size_t bytes)

Here is the call graph for this function:

Here is the caller graph for this function:

static magma_err_t magma_imalloc_pinned ( magma_int_t **  ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 88 of file magma.h.

References magma_malloc_pinned().

88 { return magma_malloc_pinned( (void**) ptrPtr, n*sizeof(magma_int_t) ); }
magma_err_t magma_malloc_pinned(void **ptrPtr, size_t bytes)
int magma_int_t
Definition: magmablas.h:12

Here is the call graph for this function:

magma_err_t magma_init ( void  )
magma_err_t magma_malloc ( magma_ptr ptrPtr,
size_t  bytes 
)

Here is the caller graph for this function:

magma_err_t magma_malloc_cpu ( void **  ptrPtr,
size_t  bytes 
)

Here is the caller graph for this function:

magma_err_t magma_malloc_pinned ( void **  ptrPtr,
size_t  bytes 
)

Here is the caller graph for this function:

void magma_queue_create_internal ( magma_queue_t *  queuePtr,
const char *  func,
const char *  file,
int  line 
)
void magma_queue_destroy_internal ( magma_queue_t  queue,
const char *  func,
const char *  file,
int  line 
)
void magma_queue_sync_internal ( magma_queue_t  queue,
const char *  func,
const char *  file,
int  line 
)
void magma_queue_wait_event ( magma_queue_t  queue,
magma_event_t  event 
)

Here is the caller graph for this function:

void magma_setdevice ( magma_device_t  dev)
static magma_err_t magma_smalloc ( magmaFloat_ptr ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 77 of file magma.h.

References magma_malloc().

77 { return magma_malloc( (magma_ptr*) ptrPtr, n*sizeof(float) ); }
void * magma_ptr
Definition: magma_types.h:228
magma_err_t magma_malloc(magma_ptr *ptrPtr, size_t bytes)

Here is the call graph for this function:

static magma_err_t magma_smalloc_cpu ( float **  ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 83 of file magma.h.

References magma_malloc_cpu().

83 { return magma_malloc_cpu( (void**) ptrPtr, n*sizeof(float) ); }
magma_err_t magma_malloc_cpu(void **ptrPtr, size_t bytes)

Here is the call graph for this function:

Here is the caller graph for this function:

static magma_err_t magma_smalloc_pinned ( float **  ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 89 of file magma.h.

References magma_malloc_pinned().

89 { return magma_malloc_pinned( (void**) ptrPtr, n*sizeof(float) ); }
magma_err_t magma_malloc_pinned(void **ptrPtr, size_t bytes)

Here is the call graph for this function:

Here is the caller graph for this function:

const char* magma_strerror ( magma_err_t  error)

Definition at line 227 of file error.cpp.

References MAGMA_ERR, MAGMA_ERR_ALLOCATION, MAGMA_ERR_CUDASTREAM, MAGMA_ERR_DEVICE_ALLOC, MAGMA_ERR_FILESYSTEM, MAGMA_ERR_HOST_ALLOC, MAGMA_ERR_ILLEGAL_VALUE, MAGMA_ERR_INTERNAL_LIMIT, MAGMA_ERR_INVALID_PTR, MAGMA_ERR_NOT_FOUND, MAGMA_ERR_NOT_INITIALIZED, MAGMA_ERR_NOT_SUPPORTED, MAGMA_ERR_REINITIALIZED, MAGMA_ERR_SEQUENCE_FLUSHED, MAGMA_ERR_UNALLOCATED, MAGMA_ERR_UNEXPECTED, and MAGMA_SUCCESS.

228 {
229  // LAPACK-compliant errors
230  if ( error > 0 ) {
231  return "function-specific error, see documentation";
232  }
233  else if ( error < 0 && error > MAGMA_ERR ) {
234  return "invalid argument";
235  }
236  // MAGMA-specific errors
237  switch( error ) {
238  case MAGMA_SUCCESS:
239  return "success";
240 
241  case MAGMA_ERR:
242  return "unknown error";
243 
245  return "not initialized";
246 
248  return "reinitialized";
249 
251  return "not supported";
252 
254  return "illegal value";
255 
256  case MAGMA_ERR_NOT_FOUND:
257  return "not found";
258 
260  return "allocation";
261 
263  return "internal limit";
264 
266  return "unallocated error";
267 
269  return "filesystem error";
270 
272  return "unexpected error";
273 
275  return "sequence flushed";
276 
278  return "cannot allocate memory on CPU host";
279 
281  return "cannot allocate memory on GPU device";
282 
284  return "CUDA stream error";
285 
287  return "invalid pointer";
288 
289  default:
290  return "unknown error code";
291  }
292 }
#define MAGMA_ERR_ILLEGAL_VALUE
Definition: magma.h:107
#define MAGMA_ERR_UNALLOCATED
Definition: magma_types.h:271
#define MAGMA_ERR_FILESYSTEM
Definition: magma_types.h:272
#define MAGMA_ERR_SEQUENCE_FLUSHED
Definition: magma_types.h:274
#define MAGMA_ERR_UNEXPECTED
Definition: magma_types.h:273
#define MAGMA_ERR_NOT_SUPPORTED
Definition: magma_types.h:266
#define MAGMA_ERR_DEVICE_ALLOC
Definition: magma_types.h:276
#define MAGMA_ERR_INTERNAL_LIMIT
Definition: magma_types.h:270
#define MAGMA_ERR_NOT_INITIALIZED
Definition: magma_types.h:264
#define MAGMA_ERR_NOT_FOUND
Definition: magma_types.h:268
#define MAGMA_ERR_ALLOCATION
Definition: magma.h:108
#define MAGMA_ERR_REINITIALIZED
Definition: magma_types.h:265
#define MAGMA_SUCCESS
Definition: magma.h:106
#define MAGMA_ERR_CUDASTREAM
Definition: magma_types.h:277
#define MAGMA_ERR_INVALID_PTR
Definition: magma_types.h:278
#define MAGMA_ERR_HOST_ALLOC
Definition: magma_types.h:275
#define MAGMA_ERR
Definition: magma_types.h:263

Here is the caller graph for this function:

void magma_version ( int *  major,
int *  minor,
int *  micro 
)

Definition at line 29 of file auxiliary.cpp.

References MAGMA_VERSION_MAJOR, MAGMA_VERSION_MICRO, and MAGMA_VERSION_MINOR.

30 {
31  if ( major != NULL && minor != NULL && micro != NULL ) {
32  *major = MAGMA_VERSION_MAJOR;
33  *minor = MAGMA_VERSION_MINOR;
34  *micro = MAGMA_VERSION_MICRO;
35  }
36 }
#define MAGMA_VERSION_MINOR
Definition: magma_types.h:249
#define MAGMA_VERSION_MICRO
Definition: magma_types.h:250
#define MAGMA_VERSION_MAJOR
Definition: magma_types.h:248
void magma_xerbla ( const char *  name,
magma_int_t  info 
)

Definition at line 8 of file xerbla.cpp.

References lapackf77_xerbla.

9 {
10 /* -- MAGMA (version 1.4.0) --
11  Univ. of Tennessee, Knoxville
12  Univ. of California, Berkeley
13  Univ. of Colorado, Denver
14  August 2013
15 
16  Purpose
17  =======
18 
19  magma_xerbla is an error handler for the MAGMA routines.
20  It is called by a MAGMA routine if an input parameter has an
21  invalid value. It calls the LAPACK XERBLA routine, which by default
22  prints an error message and stops execution.
23 
24  Installers may consider modifying the STOP statement in order to
25  call system-specific exception-handling facilities.
26 
27  Arguments
28  =========
29 
30  SRNAME (input) CHARACTER*(*)
31  The name of the routine which called XERBLA.
32  In C it is convenient to use __func__.
33 
34  INFO (input) INTEGER
35  The position of the invalid parameter in the parameter list
36  of the calling routine.
37 
38  ===================================================================== */
39 
40  int len = strlen( srname );
41  lapackf77_xerbla( srname, &info, len );
42 }
#define lapackf77_xerbla
Definition: magma_lapack.h:24
static magma_err_t magma_zmalloc ( magmaDoubleComplex_ptr ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 80 of file magma.h.

References magma_malloc().

80 { return magma_malloc( (magma_ptr*) ptrPtr, n*sizeof(magmaDoubleComplex) ); }
void * magma_ptr
Definition: magma_types.h:228
magma_err_t magma_malloc(magma_ptr *ptrPtr, size_t bytes)

Here is the call graph for this function:

static magma_err_t magma_zmalloc_cpu ( magmaDoubleComplex **  ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 86 of file magma.h.

References magma_malloc_cpu().

86 { return magma_malloc_cpu( (void**) ptrPtr, n*sizeof(magmaDoubleComplex) ); }
magma_err_t magma_malloc_cpu(void **ptrPtr, size_t bytes)

Here is the call graph for this function:

Here is the caller graph for this function:

static magma_err_t magma_zmalloc_pinned ( magmaDoubleComplex **  ptrPtr,
size_t  n 
)
inlinestatic

Definition at line 92 of file magma.h.

References magma_malloc_pinned().

92 { return magma_malloc_pinned( (void**) ptrPtr, n*sizeof(magmaDoubleComplex) ); }
magma_err_t magma_malloc_pinned(void **ptrPtr, size_t bytes)

Here is the call graph for this function:

Here is the caller graph for this function: