MAGMA  2.3.0
Matrix Algebra for GPU and Multicore Architectures
 All Classes Files Functions Friends Groups Pages
Queue management

Classes

struct  magma_queue
 Define magma_queue structure, which wraps around CUDA and OpenCL queues. More...
 

Macros

#define magma_queue_create(device, queue_ptr)
 magma_queue_create( device, queue_ptr ) is the preferred alias to this function. More...
 
#define magma_queue_create_from_cuda(device, cuda_stream, cublas_handle, cusparse_handle, queue_ptr)
 Warning: non-portable outside of CUDA. More...
 
#define magma_queue_destroy(queue)
 Destroys a queue, freeing its resources. More...
 
#define magma_queue_sync(queue)
 Synchronizes with a queue. More...
 

Functions

size_t magma_mem_size (magma_queue_t queue)
 
magma_int_t magma_queue_get_device (magma_queue_t queue)
 
cudaStream_t magma_queue_get_cuda_stream (magma_queue_t queue)
 
cublasHandle_t magma_queue_get_cublas_handle (magma_queue_t queue)
 
cusparseHandle_t magma_queue_get_cusparse_handle (magma_queue_t queue)
 

Detailed Description

Macro Definition Documentation

magma_queue_create (   device,
  queue_ptr 
)

magma_queue_create( device, queue_ptr ) is the preferred alias to this function.

Creates a new MAGMA queue, with associated CUDA stream, cuBLAS handle, and cuSparse handle.

This is the MAGMA v2 version which takes a device ID.

Parameters
[in]deviceDevice to create queue on.
[out]queue_ptrOn output, the newly created queue.
magma_queue_create_from_cuda (   device,
  cuda_stream,
  cublas_handle,
  cusparse_handle,
  queue_ptr 
)

Warning: non-portable outside of CUDA.

Use with discretion.

Creates a new MAGMA queue, using the given CUDA stream, cuBLAS handle, and cuSparse handle. The caller retains ownership of the given stream and handles, so must free them after destroying the queue; see magma_queue_destroy().

MAGMA sets the stream on the cuBLAS and cuSparse handles, and assumes it will not be changed while MAGMA is running.

Parameters
[in]deviceDevice to create queue on.
[in]cuda_streamCUDA stream to use, even if NULL (the so-called default stream).
[in]cublas_handlecuBLAS handle to use. If NULL, a new handle is created.
[in]cusparse_handlecuSparse handle to use. If NULL, a new handle is created.
[out]queue_ptrOn output, the newly created queue.
magma_queue_destroy (   queue)

Destroys a queue, freeing its resources.

If the queue was created with magma_queue_create_from_cuda(), the CUDA stream, cuBLAS handle, and cuSparse handle given there are NOT freed – the caller retains ownership. However, if MAGMA allocated the handles, MAGMA will free them here.

Parameters
[in]queueQueue to destroy.
magma_queue_sync (   queue)

Synchronizes with a queue.

The CPU blocks until all operations on the queue are finished.

Parameters
[in]queueQueue to synchronize.

Function Documentation

size_t magma_mem_size ( magma_queue_t  queue)
Parameters
[in]queueQueue to query.
Returns
Amount of free memory in bytes available on the device associated with the queue.
magma_int_t magma_queue_get_device ( magma_queue_t  queue)
Parameters
[in]queueQueue to query.
Returns
Device ID associated with the MAGMA queue.
cudaStream_t magma_queue_get_cuda_stream ( magma_queue_t  queue)
Parameters
[in]queueQueue to query.
Returns
CUDA stream associated with the MAGMA queue.
cublasHandle_t magma_queue_get_cublas_handle ( magma_queue_t  queue)
Parameters
[in]queueQueue to query.
Returns
cuBLAS handle associated with the MAGMA queue. MAGMA assumes the handle's stream will not be modified.
cusparseHandle_t magma_queue_get_cusparse_handle ( magma_queue_t  queue)
Parameters
[in]queueQueue to query.
Returns
cuSparse handle associated with the MAGMA queue. MAGMA assumes the handle's stream will not be modified.