MAGMA  2.3.0
Matrix Algebra for GPU and Multicore Architectures
 All Classes Files Functions Friends Groups Pages
Allocate GPU device memory

imalloc, smalloc, etc. More...

Macros

#define magma_free(ptr)
 Frees GPU memory previously allocated by magma_malloc(). More...
 

Functions

static magma_int_t magma_imalloc (magmaInt_ptr *ptr_ptr, size_t n)
 Type-safe version of magma_malloc(), for magma_int_t arrays. Allocates n*sizeof(magma_int_t) bytes.
 
static magma_int_t magma_index_malloc (magmaIndex_ptr *ptr_ptr, size_t n)
 Type-safe version of magma_malloc(), for magma_index_t arrays. Allocates n*sizeof(magma_index_t) bytes.
 
static magma_int_t magma_uindex_malloc (magmaUIndex_ptr *ptr_ptr, size_t n)
 Type-safe version of magma_malloc(), for magma_uindex_t arrays. Allocates n*sizeof(magma_uindex_t) bytes.
 
static magma_int_t magma_smalloc (magmaFloat_ptr *ptr_ptr, size_t n)
 Type-safe version of magma_malloc(), for float arrays. Allocates n*sizeof(float) bytes.
 
static magma_int_t magma_dmalloc (magmaDouble_ptr *ptr_ptr, size_t n)
 Type-safe version of magma_malloc(), for double arrays. Allocates n*sizeof(double) bytes.
 
static magma_int_t magma_cmalloc (magmaFloatComplex_ptr *ptr_ptr, size_t n)
 Type-safe version of magma_malloc(), for magmaFloatComplex arrays. Allocates n*sizeof(magmaFloatComplex) bytes.
 
static magma_int_t magma_zmalloc (magmaDoubleComplex_ptr *ptr_ptr, size_t n)
 Type-safe version of magma_malloc(), for magmaDoubleComplex arrays. Allocates n*sizeof(magmaDoubleComplex) bytes.
 
magma_int_t magma_malloc (magma_ptr *ptrPtr, size_t size)
 Allocates memory on the GPU. More...
 

Detailed Description

imalloc, smalloc, etc.

Macro Definition Documentation

magma_free (   ptr)

Frees GPU memory previously allocated by magma_malloc().

Parameters
[in]ptrPointer to free.
Returns
MAGMA_SUCCESS
MAGMA_ERR_INVALID_PTR on failure

Function Documentation

magma_int_t magma_malloc ( magma_ptr *  ptrPtr,
size_t  size 
)

Allocates memory on the GPU.

CUDA imposes a synchronization. Use magma_free() to free this memory.

Parameters
[out]ptrPtrOn output, set to the pointer that was allocated. NULL on failure.
[in]sizeSize in bytes to allocate. If size = 0, allocates some minimal size.
Returns
MAGMA_SUCCESS
MAGMA_ERR_DEVICE_ALLOC on failure

Type-safe versions avoid the need for a (void**) cast and explicit sizeof.

See Also
magma_smalloc
magma_dmalloc
magma_cmalloc
magma_zmalloc
magma_imalloc
magma_index_malloc