Accessing ArrayFire's stream, and native device id with other CUDA code.
More...
|
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_get_native_id (int *nativeid, int id) |
| Get the native device id of 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 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.
|
|
static void | setNativeId (int nativeId) |
| Set the CUDA device with given native id as the active device for ArrayFire.
|
|
Accessing ArrayFire's stream, and native device id with other CUDA code.
If your software is using ArrayFire's CUDA backend, you can also write custom kernels and do custom memory operations using native CUDA commands. The functions contained in the afcu
namespace provide methods to get the stream and native device id that ArrayFire is using.
◆ afcu_get_native_id()
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.
- Parameters
-
[out] | nativeid | native device id of the CUDA device with id in ArrayFire context |
[in] | id | ArrayFire device id |
- Returns
- af_err error code
◆ afcu_get_stream()
AFAPI af_err afcu_get_stream |
( |
cudaStream_t * |
stream, |
|
|
int |
id |
|
) |
| |
Get the stream for the CUDA device with id
in ArrayFire context.
- Parameters
-
[out] | stream | CUDA Stream of device with id in ArrayFire context |
[in] | id | ArrayFire device id |
- Returns
- af_err error code
◆ afcu_set_native_id()
Set the CUDA device with given native id as the active device for ArrayFire.
- Parameters
-
[in] | nativeid | native device id of the CUDA device |
- Returns
- af_err error code
◆ getNativeId()
static int getNativeId |
( |
int |
id | ) |
|
|
inlinestatic |
Get the native device id of the CUDA device with id
in ArrayFire context.
- Parameters
-
[in] | id | ArrayFire device id |
- Returns
- cuda native id of device
◆ getStream()
static cudaStream_t getStream |
( |
int |
id | ) |
|
|
inlinestatic |
Get the stream for the CUDA device with id
in ArrayFire context.
- Parameters
-
[in] | id | ArrayFire device id |
- Returns
- cuda stream used by CUDA device
◆ setNativeId()
static void setNativeId |
( |
int |
nativeId | ) |
|
|
inlinestatic |
Set the CUDA device with given native id as the active device for ArrayFire.
- Parameters
-
[in] | nativeId | native device id of the CUDA device |