(2014-04-30 15:38:09 -0400, (build fd32605))
#include <stdbool.h>
#include <stdlib.h>
#include <cuda.h>
#include <cuda_runtime_api.h>
#include <cuComplex.h>
#include <cusparse_v2.h>
Go to the source code of this file.
|
| #define | AFAPI __attribute__((visibility("default"))) |
| |
| #define | AFXAPI __attribute__((visibility("default"))) |
| |
|
| enum | af_matprop_t { af_none = 0,
af_ctrans,
af_trans
} |
| |
| enum | afError {
AF_SUCCESS =0,
AF_ERR_INTERNAL,
AF_ERR_NOMEM,
AF_ERR_BATCH,
AF_ERR_ARG,
AF_ERR_NOTSUP,
AF_ERR_DRIVER,
AF_ERR_RUNTIME,
AF_ERR_EXTERN,
AF_ERR_LICENSE,
AF_ERR_SYSTEM
} |
| |
| #define AFAPI __attribute__((visibility("default"))) |
| #define AFXAPI __attribute__((visibility("default"))) |
| typedef afError(* af_alloc_fn)(void **, size_t bytes) |
Memory handling function callback prototypes.
| typedef afError(* af_free_fn)(const void *) |
| typedef afError(* af_garbage_fn)(size_t bytes) |
| Enumerator |
|---|
| af_none |
Default.
|
| af_ctrans |
conjugate transpose
|
| af_trans |
transpose
|
| Enumerator |
|---|
| AF_SUCCESS |
No error.
|
| AF_ERR_INTERNAL |
Undocumented internal error.
|
| AF_ERR_NOMEM |
Out of memory.
|
| AF_ERR_BATCH |
Batch mode not supported.
|
| AF_ERR_ARG |
Invalid argument.
|
| AF_ERR_NOTSUP |
Operation unsupported.
|
| AF_ERR_DRIVER |
CUDA Driver error.
|
| AF_ERR_RUNTIME |
CUDA Runtime error.
|
| AF_ERR_EXTERN |
External library failure (FFT, BLAS, LAPACK,..)
|
| AF_ERR_LICENSE |
License error.
|
| AF_ERR_SYSTEM |
System Configuration problem.
|
| const char* af_errstr |
( |
void |
| ) |
|
Fetch the last error message, typically indicating file/line where error originated.
| afError af_malloc |
( |
void ** |
ptr, |
|
|
size_t |
bytes |
|
) |
| |
Allocate memory on the device.
Directly maps to cudaMalloc() unless overridden by af_init().
| afError af_free |
( |
const void * |
ptr | ) |
|
Free memory on the device.
Directly maps to cudaFree() unless overridden by af_init().
Initialize runtime to use these provided callbacks for memory management.
All routines in ArrayFire use af_malloc() and af_free() to get allocate and free device memory, and af_garbage() under memory pressure. Unless set with af_init, those directly call cudaMalloc()/cudaFree(). Applications can instead insert their own memory management algorithm to manage reference counting and garbage collection.
- Parameters
-
| [in] | alloc | Allocation callback |
| [in] | free | Deallocation callback |
| [in] | garbage | Garbage collection when under memory pressure |
| bool af_can_compute_dbl |
( |
int |
dev | ) |
|
Returns true if the device is capabale of doing double precision computation.