13#include <cuda_runtime.h>
19#if AF_API_VERSION >= 31
32#if AF_API_VERSION >= 31
45#if AF_API_VERSION >= 32
66#if AF_API_VERSION >= 31
80 throw af::exception(
"Failed to get CUDA stream from ArrayFire");
85#if AF_API_VERSION >= 31
99 throw af::exception(
"Failed to get CUDA device native id from ArrayFire");
104#if AF_API_VERSION >= 32
116 throw af::exception(
"Failed to change active CUDA device to the device with given native id");
Definition: exception.h:20
af_err
Definition: defines.h:63
@ AF_SUCCESS
The function returned successfully.
Definition: defines.h:67
#define AFAPI
Definition: defines.h:31
static cudaStream_t getStream(int id)
Get the stream for the CUDA device with id in ArrayFire context.
Definition: cuda.h:75
static int getNativeId(int id)
Get the native device id of the CUDA device with id in ArrayFire context.
Definition: cuda.h:94
AFAPI af_err afcu_get_stream(cudaStream_t *stream, int id)
Get the stream for the CUDA device with id in ArrayFire context.
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.
Definition: cuda.h:112
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.