- java.lang.Object
-
- com.ibm.cuda.CudaDevice
-
public final class CudaDevice extends Object
TheCudaDeviceclass represents a CUDA-capable device.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCudaDevice.CacheConfigCacheConfigidentifies the cache configuration choices for a device.static classCudaDevice.LimitLimitidentifies device limits that may be queried or configured.static classCudaDevice.SharedMemConfig
-
Field Summary
Fields Modifier and Type Field Description static intATTRIBUTE_ASYNC_ENGINE_COUNTNumber of asynchronous engines.static intATTRIBUTE_CAN_MAP_HOST_MEMORYDevice can map host memory into CUDA address space.static intATTRIBUTE_CLOCK_RATETypical clock frequency in kilohertz.static intATTRIBUTE_COMPUTE_CAPABILITYCompute capability version number.static intATTRIBUTE_COMPUTE_CAPABILITY_MAJORMajor compute capability version number.static intATTRIBUTE_COMPUTE_CAPABILITY_MINORMinor compute capability version number.static intATTRIBUTE_COMPUTE_MODECompute mode (see COMPUTE_MODE_XXX for details).static intATTRIBUTE_CONCURRENT_KERNELSDevice can possibly execute multiple kernels concurrently.static intATTRIBUTE_ECC_ENABLEDDevice has ECC support enabled.static intATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTHGlobal memory bus width in bits.static intATTRIBUTE_INTEGRATEDDevice is integrated with host memory.static intATTRIBUTE_KERNEL_EXEC_TIMEOUTSpecifies whether there is a run time limit on kernels.static intATTRIBUTE_L2_CACHE_SIZESize of L2 cache in bytes.static intATTRIBUTE_MAX_BLOCK_DIM_XMaximum block dimension X.static intATTRIBUTE_MAX_BLOCK_DIM_YMaximum block dimension Y.static intATTRIBUTE_MAX_BLOCK_DIM_ZMaximum block dimension Z.static intATTRIBUTE_MAX_GRID_DIM_XMaximum grid dimension X.static intATTRIBUTE_MAX_GRID_DIM_YMaximum grid dimension Y.static intATTRIBUTE_MAX_GRID_DIM_ZMaximum grid dimension Z.static intATTRIBUTE_MAX_PITCHMaximum pitch in bytes allowed by memory copies.static intATTRIBUTE_MAX_REGISTERS_PER_BLOCKMaximum number of 32-bit registers available per block.static intATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCKMaximum shared memory available per block in bytes.static intATTRIBUTE_MAX_THREADS_PER_BLOCKMaximum number of threads per block.static intATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSORMaximum resident threads per multiprocessor.static intATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERSMaximum layers in a 1D layered surface.static intATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTHMaximum 1D layered surface width.static intATTRIBUTE_MAXIMUM_SURFACE1D_WIDTHMaximum 1D surface width.static intATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHTMaximum 2D surface height.static intATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHTMaximum 2D layered surface height.static intATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERSMaximum layers in a 2D layered surface.static intATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTHMaximum 2D layered surface width.static intATTRIBUTE_MAXIMUM_SURFACE2D_WIDTHMaximum 2D surface width.static intATTRIBUTE_MAXIMUM_SURFACE3D_DEPTHMaximum 3D surface depth.static intATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHTMaximum 3D surface height.static intATTRIBUTE_MAXIMUM_SURFACE3D_WIDTHMaximum 3D surface width.static intATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERSMaximum layers in a cubemap layered surface.static intATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTHMaximum cubemap layered surface width.static intATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTHMaximum cubemap surface width.static intATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERSMaximum layers in a 1D layered texture.static intATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTHMaximum 1D layered texture width.static intATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTHMaximum 1D linear texture width.static intATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTHMaximum mipmapped 1D texture width.static intATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTHMaximum 1D texture width.static intATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHTMaximum 2D texture height if CUDA_ARRAY3D_TEXTURE_GATHER is set.static intATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTHMaximum 2D texture width if CUDA_ARRAY3D_TEXTURE_GATHER is set.static intATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHTMaximum 2D texture height.static intATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHTMaximum 2D layered texture height.static intATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERSMaximum layers in a 2D layered texture.static intATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTHMaximum 2D layered texture width.static intATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHTMaximum 2D linear texture height.static intATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCHMaximum 2D linear texture pitch in bytes.static intATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTHMaximum 2D linear texture width.static intATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHTMaximum mipmapped 2D texture height.static intATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTHMaximum mipmapped 2D texture width.static intATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTHMaximum 2D texture width.static intATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTHMaximum 3D texture depth.static intATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATEAlternate maximum 3D texture depth.static intATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHTMaximum 3D texture height.static intATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATEAlternate maximum 3D texture height.static intATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTHMaximum 3D texture width.static intATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATEAlternate maximum 3D texture width.static intATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERSMaximum layers in a cubemap layered texture.static intATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTHMaximum cubemap layered texture width/height.static intATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTHMaximum cubemap texture width/height.static intATTRIBUTE_MEMORY_CLOCK_RATEPeak memory clock frequency in kilohertz.static intATTRIBUTE_MULTIPROCESSOR_COUNTNumber of multiprocessors on device.static intATTRIBUTE_PCI_BUS_IDPCI bus ID of the device.static intATTRIBUTE_PCI_DEVICE_IDPCI device ID of the device.static intATTRIBUTE_PCI_DOMAIN_IDPCI domain ID of the device.static intATTRIBUTE_STREAM_PRIORITIES_SUPPORTEDDevice supports stream priorities.static intATTRIBUTE_SURFACE_ALIGNMENTAlignment requirement for surfaces.static intATTRIBUTE_TCC_DRIVERDevice is using TCC driver model.static intATTRIBUTE_TEXTURE_ALIGNMENTAlignment requirement for textures.static intATTRIBUTE_TEXTURE_PITCH_ALIGNMENTPitch alignment requirement for textures.static intATTRIBUTE_TOTAL_CONSTANT_MEMORYMemory available on device for __constant__ variables in a kernel in bytes.static intATTRIBUTE_UNIFIED_ADDRESSINGDevice shares a unified address space with the host.static intATTRIBUTE_WARP_SIZEWarp size in threads.static intCOMPUTE_MODE_DEFAULTDefault compute mode (multiple contexts allowed per device).static intCOMPUTE_MODE_PROCESS_EXCLUSIVECompute exclusive process mode (at most one context used by a single process can be present on this device at a time).static intCOMPUTE_MODE_PROHIBITEDCompute prohibited mode (no contexts can be created on this device at this time).static intCOMPUTE_MODE_THREAD_EXCLUSIVEExclusive thread mode (at most one context, used by a single thread, can be present on this device at a time).static intFLAG_LMEM_RESIZE_TO_MAXKeep local memory allocation after launch.static intFLAG_MAP_HOSTSupport mapped pinned allocations.static intFLAG_SCHED_AUTOAutomatic scheduling.static intFLAG_SCHED_BLOCKING_SYNCSet blocking synchronization as default scheduling.static intFLAG_SCHED_SPINSet spin as default scheduling.static intFLAG_SCHED_YIELDSet yield as default scheduling.static intMASK_SCHED
-
Constructor Summary
Constructors Constructor Description CudaDevice(int deviceId)Creates a device handle corresponding todeviceId.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCallback(Runnable callback)Queues the givencallbackto be executed when the associated device has completed all previous actions in the default stream.booleancanAccessPeer(CudaDevice peerDevice)Returns whether this device can access memory of the specifiedpeerDevice.voiddisablePeerAccess(CudaDevice peerDevice)Disable access to memory ofpeerDeviceby this device.voidenablePeerAccess(CudaDevice peerDevice)Enable access to memory ofpeerDeviceby this device.booleanequals(Object other)Does the argument represent the same device as this?intgetAttribute(int attribute)Returns the value of the specifiedattribute.CudaDevice.CacheConfiggetCacheConfig()Returns the current cache configuration of this device.static intgetCount()Returns the number of CUDA-capable devices available to the Java host.intgetDeviceId()Returns an integer identifying this device (the value provided when this object was constructed).static intgetDriverVersion()Deprecated.Use Cuda.getDriverVersion() instead.longgetFreeMemory()Returns the amount of free device memory in bytes.intgetGreatestStreamPriority()Returns the greatest possible priority of a stream on this device.intgetLeastStreamPriority()Returns the least possible priority of a stream on this device.longgetLimit(CudaDevice.Limit limit)Returns the value of the specifiedlimit.StringgetName()Returns the name of this device.static intgetRuntimeVersion()Deprecated.Use Cuda.getRuntimeVersion() instead.CudaDevice.SharedMemConfiggetSharedMemConfig()Returns the current shared memory configuration of this device.longgetTotalMemory()Returns the total amount of memory on this device in bytes.voidsetCacheConfig(CudaDevice.CacheConfig config)Configures the cache of this device.voidsetLimit(CudaDevice.Limit limit, long value)Configures the specifiedlimit.voidsetSharedMemConfig(CudaDevice.SharedMemConfig config)Configures the shared memory of this device.voidsynchronize()Synchronizes on this device.
-
-
-
Field Detail
-
ATTRIBUTE_ASYNC_ENGINE_COUNT
public static final int ATTRIBUTE_ASYNC_ENGINE_COUNT
Number of asynchronous engines.- See Also:
- Constant Field Values
-
ATTRIBUTE_CAN_MAP_HOST_MEMORY
public static final int ATTRIBUTE_CAN_MAP_HOST_MEMORY
Device can map host memory into CUDA address space.- See Also:
- Constant Field Values
-
ATTRIBUTE_CLOCK_RATE
public static final int ATTRIBUTE_CLOCK_RATE
Typical clock frequency in kilohertz.- See Also:
- Constant Field Values
-
ATTRIBUTE_COMPUTE_CAPABILITY
public static final int ATTRIBUTE_COMPUTE_CAPABILITY
Compute capability version number. This value is the major compute capability version * 10 + the minor compute capability version, so a compute capability version 3.5 function would return the value 35.- See Also:
- Constant Field Values
-
ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR
public static final int ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR
Major compute capability version number.- See Also:
- Constant Field Values
-
ATTRIBUTE_COMPUTE_CAPABILITY_MINOR
public static final int ATTRIBUTE_COMPUTE_CAPABILITY_MINOR
Minor compute capability version number.- See Also:
- Constant Field Values
-
ATTRIBUTE_COMPUTE_MODE
public static final int ATTRIBUTE_COMPUTE_MODE
Compute mode (see COMPUTE_MODE_XXX for details).- See Also:
- Constant Field Values
-
ATTRIBUTE_CONCURRENT_KERNELS
public static final int ATTRIBUTE_CONCURRENT_KERNELS
Device can possibly execute multiple kernels concurrently.- See Also:
- Constant Field Values
-
ATTRIBUTE_ECC_ENABLED
public static final int ATTRIBUTE_ECC_ENABLED
Device has ECC support enabled.- See Also:
- Constant Field Values
-
ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH
public static final int ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH
Global memory bus width in bits.- See Also:
- Constant Field Values
-
ATTRIBUTE_INTEGRATED
public static final int ATTRIBUTE_INTEGRATED
Device is integrated with host memory.- See Also:
- Constant Field Values
-
ATTRIBUTE_KERNEL_EXEC_TIMEOUT
public static final int ATTRIBUTE_KERNEL_EXEC_TIMEOUT
Specifies whether there is a run time limit on kernels.- See Also:
- Constant Field Values
-
ATTRIBUTE_L2_CACHE_SIZE
public static final int ATTRIBUTE_L2_CACHE_SIZE
Size of L2 cache in bytes.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_BLOCK_DIM_X
public static final int ATTRIBUTE_MAX_BLOCK_DIM_X
Maximum block dimension X.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_BLOCK_DIM_Y
public static final int ATTRIBUTE_MAX_BLOCK_DIM_Y
Maximum block dimension Y.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_BLOCK_DIM_Z
public static final int ATTRIBUTE_MAX_BLOCK_DIM_Z
Maximum block dimension Z.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_GRID_DIM_X
public static final int ATTRIBUTE_MAX_GRID_DIM_X
Maximum grid dimension X.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_GRID_DIM_Y
public static final int ATTRIBUTE_MAX_GRID_DIM_Y
Maximum grid dimension Y.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_GRID_DIM_Z
public static final int ATTRIBUTE_MAX_GRID_DIM_Z
Maximum grid dimension Z.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_PITCH
public static final int ATTRIBUTE_MAX_PITCH
Maximum pitch in bytes allowed by memory copies.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_REGISTERS_PER_BLOCK
public static final int ATTRIBUTE_MAX_REGISTERS_PER_BLOCK
Maximum number of 32-bit registers available per block.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK
public static final int ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK
Maximum shared memory available per block in bytes.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_THREADS_PER_BLOCK
public static final int ATTRIBUTE_MAX_THREADS_PER_BLOCK
Maximum number of threads per block.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR
public static final int ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR
Maximum resident threads per multiprocessor.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS
public static final int ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS
Maximum layers in a 1D layered surface.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH
public static final int ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH
Maximum 1D layered surface width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH
public static final int ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH
Maximum 1D surface width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT
public static final int ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT
Maximum 2D surface height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT
public static final int ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT
Maximum 2D layered surface height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS
public static final int ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS
Maximum layers in a 2D layered surface.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH
public static final int ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH
Maximum 2D layered surface width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH
public static final int ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH
Maximum 2D surface width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH
public static final int ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH
Maximum 3D surface depth.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT
public static final int ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT
Maximum 3D surface height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH
public static final int ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH
Maximum 3D surface width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS
public static final int ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS
Maximum layers in a cubemap layered surface.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH
public static final int ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH
Maximum cubemap layered surface width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH
public static final int ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH
Maximum cubemap surface width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS
public static final int ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS
Maximum layers in a 1D layered texture.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH
Maximum 1D layered texture width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH
Maximum 1D linear texture width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH
Maximum mipmapped 1D texture width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH
Maximum 1D texture width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT
Maximum 2D texture height if CUDA_ARRAY3D_TEXTURE_GATHER is set.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH
Maximum 2D texture width if CUDA_ARRAY3D_TEXTURE_GATHER is set.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT
Maximum 2D texture height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT
Maximum 2D layered texture height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS
Maximum layers in a 2D layered texture.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH
Maximum 2D layered texture width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT
Maximum 2D linear texture height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH
Maximum 2D linear texture pitch in bytes.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH
Maximum 2D linear texture width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT
Maximum mipmapped 2D texture height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH
Maximum mipmapped 2D texture width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH
Maximum 2D texture width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH
Maximum 3D texture depth.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE
public static final int ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE
Alternate maximum 3D texture depth.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT
public static final int ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT
Maximum 3D texture height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE
public static final int ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE
Alternate maximum 3D texture height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH
Maximum 3D texture width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE
public static final int ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE
Alternate maximum 3D texture width.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS
public static final int ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS
Maximum layers in a cubemap layered texture.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH
Maximum cubemap layered texture width/height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH
public static final int ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH
Maximum cubemap texture width/height.- See Also:
- Constant Field Values
-
ATTRIBUTE_MEMORY_CLOCK_RATE
public static final int ATTRIBUTE_MEMORY_CLOCK_RATE
Peak memory clock frequency in kilohertz.- See Also:
- Constant Field Values
-
ATTRIBUTE_MULTIPROCESSOR_COUNT
public static final int ATTRIBUTE_MULTIPROCESSOR_COUNT
Number of multiprocessors on device.- See Also:
- Constant Field Values
-
ATTRIBUTE_PCI_BUS_ID
public static final int ATTRIBUTE_PCI_BUS_ID
PCI bus ID of the device.- See Also:
- Constant Field Values
-
ATTRIBUTE_PCI_DEVICE_ID
public static final int ATTRIBUTE_PCI_DEVICE_ID
PCI device ID of the device.- See Also:
- Constant Field Values
-
ATTRIBUTE_PCI_DOMAIN_ID
public static final int ATTRIBUTE_PCI_DOMAIN_ID
PCI domain ID of the device.- See Also:
- Constant Field Values
-
ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED
public static final int ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED
Device supports stream priorities.- See Also:
- Constant Field Values
-
ATTRIBUTE_SURFACE_ALIGNMENT
public static final int ATTRIBUTE_SURFACE_ALIGNMENT
Alignment requirement for surfaces.- See Also:
- Constant Field Values
-
ATTRIBUTE_TCC_DRIVER
public static final int ATTRIBUTE_TCC_DRIVER
Device is using TCC driver model.- See Also:
- Constant Field Values
-
ATTRIBUTE_TEXTURE_ALIGNMENT
public static final int ATTRIBUTE_TEXTURE_ALIGNMENT
Alignment requirement for textures.- See Also:
- Constant Field Values
-
ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT
public static final int ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT
Pitch alignment requirement for textures.- See Also:
- Constant Field Values
-
ATTRIBUTE_TOTAL_CONSTANT_MEMORY
public static final int ATTRIBUTE_TOTAL_CONSTANT_MEMORY
Memory available on device for __constant__ variables in a kernel in bytes.- See Also:
- Constant Field Values
-
ATTRIBUTE_UNIFIED_ADDRESSING
public static final int ATTRIBUTE_UNIFIED_ADDRESSING
Device shares a unified address space with the host.- See Also:
- Constant Field Values
-
ATTRIBUTE_WARP_SIZE
public static final int ATTRIBUTE_WARP_SIZE
Warp size in threads.- See Also:
- Constant Field Values
-
COMPUTE_MODE_DEFAULT
public static final int COMPUTE_MODE_DEFAULT
Default compute mode (multiple contexts allowed per device).- See Also:
- Constant Field Values
-
COMPUTE_MODE_PROCESS_EXCLUSIVE
public static final int COMPUTE_MODE_PROCESS_EXCLUSIVE
Compute exclusive process mode (at most one context used by a single process can be present on this device at a time).- See Also:
- Constant Field Values
-
COMPUTE_MODE_PROHIBITED
public static final int COMPUTE_MODE_PROHIBITED
Compute prohibited mode (no contexts can be created on this device at this time).- See Also:
- Constant Field Values
-
COMPUTE_MODE_THREAD_EXCLUSIVE
public static final int COMPUTE_MODE_THREAD_EXCLUSIVE
Exclusive thread mode (at most one context, used by a single thread, can be present on this device at a time).- See Also:
- Constant Field Values
-
FLAG_LMEM_RESIZE_TO_MAX
public static final int FLAG_LMEM_RESIZE_TO_MAX
Keep local memory allocation after launch.- See Also:
- Constant Field Values
-
FLAG_MAP_HOST
public static final int FLAG_MAP_HOST
Support mapped pinned allocations.- See Also:
- Constant Field Values
-
FLAG_SCHED_AUTO
public static final int FLAG_SCHED_AUTO
Automatic scheduling.- See Also:
- Constant Field Values
-
FLAG_SCHED_BLOCKING_SYNC
public static final int FLAG_SCHED_BLOCKING_SYNC
Set blocking synchronization as default scheduling.- See Also:
- Constant Field Values
-
FLAG_SCHED_SPIN
public static final int FLAG_SCHED_SPIN
Set spin as default scheduling.- See Also:
- Constant Field Values
-
FLAG_SCHED_YIELD
public static final int FLAG_SCHED_YIELD
Set yield as default scheduling.- See Also:
- Constant Field Values
-
MASK_SCHED
public static final int MASK_SCHED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CudaDevice
public CudaDevice(int deviceId)
Creates a device handle corresponding todeviceId.No checking is done on
deviceId, but it must be non-negative and less than the value returnedgetCount()to be useful.- Parameters:
deviceId- an integer identifying the device of interest
-
-
Method Detail
-
getCount
public static int getCount() throws CudaExceptionReturns the number of CUDA-capable devices available to the Java host.- Returns:
- the number of available CUDA-capable devices
- Throws:
CudaException- if a CUDA exception occurs
-
getDriverVersion
@Deprecated public static int getDriverVersion() throws CudaException
Deprecated.Use Cuda.getDriverVersion() instead.Returns a number identifying the driver version.- Returns:
- the driver version number
- Throws:
CudaException- if a CUDA exception occurs
-
getRuntimeVersion
@Deprecated public static int getRuntimeVersion() throws CudaException
Deprecated.Use Cuda.getRuntimeVersion() instead.Returns a number identifying the runtime version.- Returns:
- the runtime version number
- Throws:
CudaException- if a CUDA exception occurs
-
addCallback
public void addCallback(Runnable callback) throws CudaException
Queues the givencallbackto be executed when the associated device has completed all previous actions in the default stream.- Parameters:
callback- code to run- Throws:
CudaException- if a CUDA exception occurs
-
canAccessPeer
public boolean canAccessPeer(CudaDevice peerDevice) throws CudaException
Returns whether this device can access memory of the specifiedpeerDevice.- Parameters:
peerDevice- the peer device- Returns:
- true if this device can access memory of
peerDevice, false otherwise - Throws:
CudaException- if a CUDA exception occurs
-
disablePeerAccess
public void disablePeerAccess(CudaDevice peerDevice) throws CudaException
Disable access to memory ofpeerDeviceby this device.- Parameters:
peerDevice- the peer device- Throws:
CudaException- if a CUDA exception occursSecurityException- if a security manager exists and the calling thread does not have permission to disable peer access
-
enablePeerAccess
public void enablePeerAccess(CudaDevice peerDevice) throws CudaException
Enable access to memory ofpeerDeviceby this device.- Parameters:
peerDevice- the peer device- Throws:
CudaException- if a CUDA exception occursSecurityException- if a security manager exists and the calling thread does not have permission to enable peer access
-
equals
public boolean equals(Object other)
Does the argument represent the same device as this?- Overrides:
equalsin classObject- Parameters:
other- Object the object to compare with this object.- Returns:
- boolean
trueif the object is the same as this objectfalseif it is different from this object. - See Also:
Object.hashCode()
-
getAttribute
public int getAttribute(int attribute) throws CudaExceptionReturns the value of the specifiedattribute.- Parameters:
attribute- the attribute to be queried (see ATTRIBUTE_XXX)- Returns:
- the attribute value
- Throws:
CudaException- if a CUDA exception occurs
-
getCacheConfig
public CudaDevice.CacheConfig getCacheConfig() throws CudaException
Returns the current cache configuration of this device.- Returns:
- the current cache configuration
- Throws:
CudaException- if a CUDA exception occurs
-
getDeviceId
public int getDeviceId()
Returns an integer identifying this device (the value provided when this object was constructed).- Returns:
- an integer identifying this device
-
getFreeMemory
public long getFreeMemory() throws CudaExceptionReturns the amount of free device memory in bytes.- Returns:
- the number of bytes of free device memory
- Throws:
CudaException- if a CUDA exception occurs
-
getGreatestStreamPriority
public int getGreatestStreamPriority() throws CudaExceptionReturns the greatest possible priority of a stream on this device. Note that stream priorities follow a convention where lower numbers imply greater priorities.- Returns:
- the greatest possible priority of a stream on this device
- Throws:
CudaException- if a CUDA exception occurs
-
getLeastStreamPriority
public int getLeastStreamPriority() throws CudaExceptionReturns the least possible priority of a stream on this device. Note that stream priorities follow a convention where lower numbers imply greater priorities.- Returns:
- the greatest possible priority of a stream on this device
- Throws:
CudaException- if a CUDA exception occurs
-
getLimit
public long getLimit(CudaDevice.Limit limit) throws CudaException
Returns the value of the specifiedlimit.- Parameters:
limit- the limit to be queried- Returns:
- the value of the specified limit
- Throws:
CudaException- if a CUDA exception occurs
-
getName
public String getName() throws CudaException
Returns the name of this device.- Returns:
- the name of this device
- Throws:
CudaException- if a CUDA exception occurs
-
getSharedMemConfig
public CudaDevice.SharedMemConfig getSharedMemConfig() throws CudaException
Returns the current shared memory configuration of this device.- Returns:
- the current shared memory configuration
- Throws:
CudaException- if a CUDA exception occurs
-
getTotalMemory
public long getTotalMemory() throws CudaExceptionReturns the total amount of memory on this device in bytes.- Returns:
- the number of bytes of device memory
- Throws:
CudaException- if a CUDA exception occurs
-
setCacheConfig
public void setCacheConfig(CudaDevice.CacheConfig config) throws CudaException
Configures the cache of this device.- Parameters:
config- the desired cache configuration- Throws:
CudaException- if a CUDA exception occursSecurityException- if a security manager exists and the calling thread does not have permission to set device cache configurations
-
setLimit
public void setLimit(CudaDevice.Limit limit, long value) throws CudaException
Configures the specifiedlimit.- Parameters:
limit- the limit to be configuredvalue- the desired limit value- Throws:
CudaException- if a CUDA exception occursSecurityException- if a security manager exists and the calling thread does not have permission to set device limits
-
setSharedMemConfig
public void setSharedMemConfig(CudaDevice.SharedMemConfig config) throws CudaException
Configures the shared memory of this device.- Parameters:
config- the desired shared memory configuration- Throws:
CudaException- if a CUDA exception occursSecurityException- if a security manager exists and the calling thread does not have permission to set device shared memory configurations
-
synchronize
public void synchronize() throws CudaExceptionSynchronizes on this device. This method blocks until the associated device has completed all previous actions in the default stream.- Throws:
CudaException- if a CUDA exception occurs
-
-