public class Cuda extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Cuda.Event |
static class |
Cuda.Stream
A class representing a CUDA stream
|
| Modifier and Type | Field and Description |
|---|---|
static Cuda.Stream |
DEFAULT_STREAM |
| Constructor and Description |
|---|
Cuda() |
| Modifier and Type | Method and Description |
|---|---|
static void |
asyncMemset(long dst,
byte value,
long count)
Sets count bytes starting at the memory area pointed to by dst, with value.
|
static void |
autoSetDevice()
Set the device for this thread to the appropriate one.
|
static void |
freeZero()
Calls cudaFree(0).
|
static int |
getDevice()
Get the id of the current device.
|
static int |
getDeviceCount()
Get the device count.
|
static boolean |
isEnvCompatibleForTesting()
This should only be used for tests, to enable or disable tests if the current environment
is not compatible with this version of the library.
|
static boolean |
isPtdsEnabled()
Whether per-thread default stream is enabled.
|
static CudaMemInfo |
memGetInfo()
Mapping: cudaMemGetInfo(size_t *free, size_t *total)
|
static void |
memset(long dst,
byte value,
long count)
Sets count bytes starting at the memory area pointed to by dst, with value.
|
static void |
setDevice(int device)
Set the id of the current device.
|
public static final Cuda.Stream DEFAULT_STREAM
public static CudaMemInfo memGetInfo() throws CudaException
CudaExceptionpublic static void memset(long dst,
byte value,
long count)
throws CudaException
dst - - Destination memory addressvalue - - Byte value to set dst withcount - - Size in bytes to setCudaExceptionpublic static void asyncMemset(long dst,
byte value,
long count)
throws CudaException
dst - - Destination memory addressvalue - - Byte value to set dst withcount - - Size in bytes to setCudaExceptionpublic static int getDevice()
throws CudaException
CudaException - on any errorpublic static int getDeviceCount()
throws CudaException
CudaException - on any errorpublic static void setDevice(int device)
throws CudaException,
CudfException
Note this is relative to CUDA_SET_VISIBLE_DEVICES, e.g. if CUDA_SET_VISIBLE_DEVICES=1,0, and you call setDevice(0), you will get device 1.
Note if RMM has been initialized and the requested device ID does not match the device used to initialize RMM then this will throw an error.
CudaException - on any errorCudfExceptionpublic static void autoSetDevice()
throws CudaException
CudaException - on any errorpublic static void freeZero()
throws CudaException
CudaException - on any errorpublic static boolean isEnvCompatibleForTesting()
public static boolean isPtdsEnabled()
Copyright © 2021. All rights reserved.