21#include <cuda_runtime.h>
24#ifdef AF_DEFINE_CUDA_TYPES
25typedef struct CUstream_st *cudaStream_t;
29 CUBLAS_DEFAULT_MATH = 0,
30 CUBLAS_TENSOR_OP_MATH = 1
40#if AF_API_VERSION >= 31
53#if AF_API_VERSION >= 31
66#if AF_API_VERSION >= 32
78#if AF_API_VERSION >= 37
101#if AF_API_VERSION >= 31
115 throw af::exception(
"Failed to get CUDA stream from ArrayFire");
120#if AF_API_VERSION >= 31
134 throw af::exception(
"Failed to get CUDA device native id from ArrayFire");
139#if AF_API_VERSION >= 32
151 throw af::exception(
"Failed to change active CUDA device to the device with given native id");
An ArrayFire exception class.
@ AF_SUCCESS
The function returned successfully.
static cudaStream_t getStream(int id)
Get the stream for the CUDA device with id in ArrayFire context.
static int getNativeId(int id)
Get the native device id of the CUDA device with id in ArrayFire context.
AFAPI af_err afcu_get_stream(cudaStream_t *stream, int id)
This file contain functions that apply only to the CUDA backend.
AFAPI af_err afcu_set_native_id(int nativeid)
Set the CUDA device with given native id as the active device for ArrayFire.
static void setNativeId(int nativeId)
Set the CUDA device with given native id as the active device for ArrayFire.
AFAPI af_err afcu_cublasSetMathMode(cublasMath_t mode)
Sets the cuBLAS math mode for the internal handle.
AFAPI af_err afcu_get_native_id(int *nativeid, int id)
Get the native device id of the CUDA device with id in ArrayFire context.