public interface Kernel
Java data type | C data type | |
boolean | int | |
byte | char, unsigned char | |
char | unsigned short int | |
short | short int, unsigned short int | |
int | int, unsigned int | |
long | long long int, unsigned long long int | |
float | float | |
double | double | |
GpuByteArray | char*, unsigned char* | |
GpuShortArray | short int*, unsigned short int* | |
GpuIntArray | int*, unsigned int* | |
GpuLongArray | long long int*, unsigned long long int* | |
GpuFloatArray | float* | |
GpuDoubleArray | double* | |
GpuByteMatrix | char**, unsigned char** | |
GpuShortMatrix | short int**, unsigned short int** | |
GpuIntMatrix | int**, unsigned int** | |
GpuLongMatrix | long long int**, unsigned long long int** | |
GpuFloatMatrix | float** | |
GpuDoubleMatrix | double** | |
GpuStructVbl | struct T* | |
GpuStructArray | struct T* | |
GpuStructMatrix | struct T** |
getModule()
method on a Gpu object, specifying the name of the compiled CUDA module file
relative to the Java class path. This returns a Module
object.
getKernel()
method on the Module object, as follows:
setGridDim()
,
setBlockDim()
, setCacheConfig()
, and setDynamicSharedMemorySize()
methods on the Bar proxy object as necessary.
Study the source code of the classes in package edu.rit.pj2.example to see examples of Parallel Java 2 GPU programs.
Note: A class that implements interface Kernel is not multiple thread safe. It is assumed that only one thread at a time will call methods on a Kernel object.
Modifier and Type | Method and Description |
---|---|
void |
setBlockDim(int blockDimX)
Specify that this kernel function will be invoked with a one-dimensional
block.
|
void |
setBlockDim(int blockDimX,
int blockDimY)
Specify that this kernel function will be invoked with a two-dimensional
block.
|
void |
setBlockDim(int blockDimX,
int blockDimY,
int blockDimZ)
Specify that this kernel function will be invoked with a
three-dimensional block.
|
void |
setCacheConfig(CacheConfig config)
Specify that this kernel function will be invoked with the given cache
configuration.
|
void |
setDynamicSharedMemorySize(int bytesize)
Specify that this kernel function will be invoked with the given dynamic
shared memory size.
|
void |
setGridDim(int gridDimX)
Specify that this kernel function will be invoked with a one-dimensional
grid.
|
void |
setGridDim(int gridDimX,
int gridDimY)
Specify that this kernel function will be invoked with a two-dimensional
grid.
|
void |
setGridDim(int gridDimX,
int gridDimY,
int gridDimZ)
Specify that this kernel function will be invoked with a
three-dimensional grid.
|
void setGridDim(int gridDimX)
gridDimX
- Grid X dimension (≥ 1).java.lang.IllegalArgumentException
- (unchecked exception) Thrown if gridDimX < 1.setGridDim(int,int)
,
setGridDim(int,int,int)
void setGridDim(int gridDimX, int gridDimY)
gridDimX
- Grid X dimension (≥ 1).gridDimY
- Grid Y dimension (≥ 1).java.lang.IllegalArgumentException
- (unchecked exception) Thrown if gridDimX < 1 or
gridDimY < 1.setGridDim(int)
,
setGridDim(int,int,int)
void setGridDim(int gridDimX, int gridDimY, int gridDimZ)
gridDimX
- Grid X dimension (≥ 1).gridDimY
- Grid Y dimension (≥ 1).gridDimZ
- Grid Z dimension (≥ 1).java.lang.IllegalArgumentException
- (unchecked exception) Thrown if gridDimX < 1 or
gridDimY < 1 or gridDimZ < 1.setGridDim(int)
,
setGridDim(int,int)
void setBlockDim(int blockDimX)
blockDimX
- Block X dimension (≥ 1).java.lang.IllegalArgumentException
- (unchecked exception) Thrown if blockDimX < 1.setBlockDim(int,int)
,
setBlockDim(int,int,int)
void setBlockDim(int blockDimX, int blockDimY)
blockDimX
- Block X dimension (≥ 1).blockDimY
- Block Y dimension (≥ 1).java.lang.IllegalArgumentException
- (unchecked exception) Thrown if blockDimX < 1 or
blockDimY < 1.setBlockDim(int)
,
setBlockDim(int,int,int)
void setBlockDim(int blockDimX, int blockDimY, int blockDimZ)
blockDimX
- Block X dimension (≥ 1).blockDimY
- Block Y dimension (≥ 1).blockDimZ
- Block Z dimension (≥ 1).java.lang.IllegalArgumentException
- (unchecked exception) Thrown if blockDimX < 1 or
blockDimY < 1 or blockDimZ < 1.setBlockDim(int)
,
setBlockDim(int,int)
void setCacheConfig(CacheConfig config)
config
- Cache configuration.java.lang.NullPointerException
- (unchecked exception) Thrown if config is null.GpuException
- (unchecked exception) Thrown if a GPU error occurred.Gpu.setCacheConfig(CacheConfig)
void setDynamicSharedMemorySize(int bytesize)
bytesize
- Number of dynamic shared memory bytes (≥ 0).java.lang.IllegalArgumentException
- (unchecked exception) Thrown if bytesize < 0.Copyright © 2013–2018 by Alan Kaminsky. All rights reserved. Send comments to ark@cs.rit.edu.