MAGMA  magma-1.4.0
Matrix Algebra on GPU and Multicore Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
testings.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define min(a, b)   (((a)<(b))?(a):(b))
 
#define max(a, b)   (((a)<(b))?(b):(a))
 
#define TESTING_CUDA_INIT()
 
#define TESTING_CUDA_FINALIZE()
 
#define TESTING_MALLOC(__ptr, __type, __size)
 
#define TESTING_HOSTALLOC(__ptr, __type, __size)
 
#define TESTING_DEVALLOC(__ptr, __type, __size)
 
#define TESTING_FREE(__ptr)   free(__ptr);
 
#define TESTING_HOSTFREE(__ptr)   cudaFreeHost( __ptr );
 
#define TESTING_DEVFREE(__ptr)   cudaFree( __ptr );
 

Macro Definition Documentation

#define max (   a,
 
)    (((a)<(b))?(b):(a))

Definition at line 8 of file testings.h.

#define min (   a,
 
)    (((a)<(b))?(a):(b))

Definition at line 5 of file testings.h.

#define TESTING_CUDA_FINALIZE ( )
Value:
cuCtxDetach( context ); \
cublasShutdown();
Definition: magma.h:25

Definition at line 29 of file testings.h.

#define TESTING_CUDA_INIT ( )
Value:
CUdevice dev; \
CUcontext context; \
if( CUDA_SUCCESS != cuInit( 0 ) ) { \
fprintf(stderr, "CUDA: Not initialized\n" ); exit(-1); \
} \
if( CUDA_SUCCESS != cuDeviceGet( &dev, 0 ) ) { \
fprintf(stderr, "CUDA: Cannot get the device\n"); exit(-1); \
} \
if( CUDA_SUCCESS != cuCtxCreate( &context, 0, dev ) ) { \
fprintf(stderr, "CUDA: Cannot create the context\n"); exit(-1); \
} \
if( CUBLAS_STATUS_SUCCESS != cublasInit( ) ) { \
fprintf(stderr, "CUBLAS: Not initialized\n"); exit(-1); \
} \
Definition: magma.h:25
void printout_devices()
Definition: auxiliary.cpp:128

Definition at line 11 of file testings.h.

#define TESTING_DEVALLOC (   __ptr,
  __type,
  __size 
)
Value:
if( cudaSuccess != cudaMalloc( (void**)&__ptr, (__size)*sizeof(__type) ) ){ \
fprintf (stderr, "!!!! cublasAlloc failed for: %s\n", #__ptr ); \
exit(-1); \
}

Definition at line 47 of file testings.h.

#define TESTING_DEVFREE (   __ptr)    cudaFree( __ptr );

Definition at line 60 of file testings.h.

#define TESTING_FREE (   __ptr)    free(__ptr);

Definition at line 54 of file testings.h.

#define TESTING_HOSTALLOC (   __ptr,
  __type,
  __size 
)
Value:
if( cudaSuccess != cudaMallocHost( (void**)&__ptr, (__size)*sizeof(__type) ) ) { \
fprintf (stderr, "!!!! cudaMallocHost failed for: %s\n", #__ptr ); \
exit(-1); \
}

Definition at line 41 of file testings.h.

#define TESTING_HOSTFREE (   __ptr)    cudaFreeHost( __ptr );

Definition at line 57 of file testings.h.

#define TESTING_MALLOC (   __ptr,
  __type,
  __size 
)
Value:
__ptr = (__type*)malloc((__size) * sizeof(__type)); \
if (__ptr == 0) { \
fprintf (stderr, "!!!! Malloc failed for: %s\n", #__ptr ); \
exit(-1); \
}

Definition at line 34 of file testings.h.