public class JCudaContext extends GPUContext
Modifier and Type | Field and Description |
---|---|
static ArrayList<GPUObject> |
allocatedPointers
Global list of allocated
GPUObject instances. |
static boolean |
DEBUG
enable this to print debug information before code pertaining to the GPU is executed
|
static int |
deviceCount
The total number of cuda devices on this machine
|
double |
GPU_MEMORY_UTILIZATION_FACTOR |
boolean |
REFRESH_AVAILABLE_MEMORY_EVERY_TIME |
static Object |
syncObj
Synchronization object to make sure no allocations happen when something is being evicted from memory
|
currContext, isGPUContextCreated
Constructor and Description |
---|
JCudaContext() |
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
ensureComputeCapability()
Ensures that all the CUDA cards on the current system are
of the minimum required compute capability.
|
long |
getAndAddAvailableMemory(long v)
Gets the available memory and then adds value to it
|
long |
getAvailableMemory()
Gets device memory available for SystemML operations
|
static jcuda.runtime.cudaDeviceProp |
getGPUProperties()
Gets the device properties for the active GPU (set with cudaSetDevice())
|
static jcuda.runtime.cudaDeviceProp |
getGPUProperties(int device)
Gets the device properties
|
static int |
getMaxBlocks()
Gets the maximum number of blocks supported by the active cuda device
|
static long |
getMaxSharedMemory()
Gets the shared memory per block supported by the active cuda device
|
static int |
getMaxThreadsPerBlock()
Gets the maximum number of threads per block for "active" GPU
|
static int |
getWarpSize()
Gets the warp size supported by the active cuda device
|
createGPUObject, getGPUContext
public static final Object syncObj
public static ArrayList<GPUObject> allocatedPointers
GPUObject
instances. This list must be accessed in a synchronized waypublic static int deviceCount
public static boolean DEBUG
public double GPU_MEMORY_UTILIZATION_FACTOR
public boolean REFRESH_AVAILABLE_MEMORY_EVERY_TIME
public JCudaContext() throws DMLRuntimeException
DMLRuntimeException
public long getAvailableMemory()
GPUContext
getAvailableMemory
in class GPUContext
public void ensureComputeCapability() throws DMLRuntimeException
GPUContext
JCudaContext
.ensureComputeCapability
in class GPUContext
DMLRuntimeException
- if DMLRuntimeException occurspublic static jcuda.runtime.cudaDeviceProp getGPUProperties()
public static jcuda.runtime.cudaDeviceProp getGPUProperties(int device)
device
- the device number (on a machine with more than 1 GPU)public static int getMaxThreadsPerBlock()
public static int getMaxBlocks()
public static long getMaxSharedMemory()
public static int getWarpSize()
public long getAndAddAvailableMemory(long v)
v
- the value to addpublic void destroy() throws DMLRuntimeException
destroy
in class GPUContext
DMLRuntimeException
Copyright © 2017 The Apache Software Foundation. All rights reserved.