![]() |
MAGMA 2.9.0
Matrix Algebra for GPU and Multicore Architectures
|
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. | |
#define | magma_queue_create_from_cuda( device, cuda_stream, cublas_handle, cusparse_handle, queue_ptr) |
Warning: non-portable outside of CUDA. | |
#define | magma_queue_create_from_hip( device, hip_stream, hipblas_handle, hipsparse_handle, queue_ptr) |
Warning: non-portable outside of CUDA. | |
#define | magma_queue_destroy(queue) |
Destroys a queue, freeing its resources. | |
#define | magma_queue_sync(queue) |
Synchronizes with a queue. | |
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) |
magma_int_t | magmablasSetKernelStream (magma_queue_t queue) |
magma_int_t | magmablasGetKernelStream (magma_queue_t *queue_ptr) |
magma_queue_t | magmablasGetQueue () |
#define 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.
[in] | device | Device to create queue on. |
[out] | queue_ptr | On output, the newly created queue. |
#define 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.
[in] | device | Device to create queue on. |
[in] | cuda_stream | CUDA stream to use, even if NULL (the so-called default stream). |
[in] | cublas_handle | cuBLAS handle to use. If NULL, a new handle is created. |
[in] | cusparse_handle | cuSparse handle to use. If NULL, a new handle is created. |
[out] | queue_ptr | On output, the newly created queue. |
#define magma_queue_create_from_hip | ( | device, | |
hip_stream, | |||
hipblas_handle, | |||
hipsparse_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.
[in] | device | Device to create queue on. |
[in] | cuda_stream | CUDA stream to use, even if NULL (the so-called default stream). |
[in] | cublas_handle | cuBLAS handle to use. If NULL, a new handle is created. |
[in] | cusparse_handle | cuSparse handle to use. If NULL, a new handle is created. |
[out] | queue_ptr | On output, the newly created queue. |
#define 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.
[in] | queue | Queue to destroy. |
#define magma_queue_sync | ( | queue | ) |
Synchronizes with a queue.
The CPU blocks until all operations on the queue are finished.
[in] | queue | Queue to synchronize. |
size_t magma_mem_size | ( | magma_queue_t | queue | ) |
[in] | queue | Queue to query. |
magma_int_t magma_queue_get_device | ( | magma_queue_t | queue | ) |
[in] | queue | Queue to query. |
cudaStream_t magma_queue_get_cuda_stream | ( | magma_queue_t | queue | ) |
[in] | queue | Queue to query. |
cublasHandle_t magma_queue_get_cublas_handle | ( | magma_queue_t | queue | ) |
[in] | queue | Queue to query. |
cusparseHandle_t magma_queue_get_cusparse_handle | ( | magma_queue_t | queue | ) |
[in] | queue | Queue to query. |
magma_int_t magmablasSetKernelStream | ( | magma_queue_t | queue | ) |
Sets the current global MAGMA v1 queue for kernels to execute in. In MAGMA v2, all kernels take queue as an argument, so this is deprecated. If compiled with MAGMA_NO_V1, this is not defined.
[in] | queue | Queue to set as current global MAGMA v1 queue. |
magma_int_t magmablasGetKernelStream | ( | magma_queue_t * | queue_ptr | ) |
Gets the current global MAGMA v1 queue for kernels to execute in. In MAGMA v2, all kernels take queue as an argument, so this is deprecated. If compiled with MAGMA_NO_V1, this is not defined.
[out] | queue_ptr | On output, set to the current global MAGMA v1 queue. |
magma_queue_t magmablasGetQueue | ( | ) |
Gets the current global MAGMA v1 queue for kernels to execute in. Unlike magmablasGetKernelStream(), if the current queue is NULL, this will return a special MAGMA queue that has a NULL CUDA stream. This allows MAGMA v1 wrappers to call v2 kernels with a non-NULL queue.
In MAGMA v2, all kernels take queue as an argument, so this is deprecated. If compiled with MAGMA_NO_V1, this is not defined.