public class GPUContextPool extends Object
| Modifier and Type | Field and Description | 
|---|---|
static String | 
AVAILABLE_GPUS
GPUs to use, can specify -1 to use all, comma separated list of GPU numbers, a specific GPU or a range 
 | 
| Constructor and Description | 
|---|
GPUContextPool()  | 
| Modifier and Type | Method and Description | 
|---|---|
static void | 
freeAllGPUContexts()
Unreserves all GPUContexts 
 | 
static int | 
getAvailableCount()
Get the number of free GPUContexts 
 | 
static int | 
getDeviceCount()
Number of available devices on this machine 
 | 
static long | 
initialGPUMemBudget()
Gets the initial GPU memory budget. 
 | 
static void | 
initializeGPU()
Static initialization of the number of devices
 Also sets behaviour for J{Cuda, Cudnn, Cublas, Cusparse} in case of error
 Initializes the CUDA driver
 All these need be done once, and not per GPU 
 | 
static ArrayList<Integer> | 
parseListString(String str,
               int max)
Parses a string into a list. 
 | 
static List<GPUContext> | 
reserveAllGPUContexts()
Reserves and gets an initialized list of GPUContexts 
 | 
public static String AVAILABLE_GPUS
public static void initializeGPU()
public static ArrayList<Integer> parseListString(String str, int max)
str - input stringmax - maximum range of integerspublic static List<GPUContext> reserveAllGPUContexts()
public static int getAvailableCount()
public static int getDeviceCount()
public static void freeAllGPUContexts()
public static long initialGPUMemBudget()
                                throws RuntimeException
RuntimeException - if error initializing the GPUsCopyright © 2021 The Apache Software Foundation. All rights reserved.