|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjcuda.jcudpp.JCudpp
public class JCudpp
Java bindings for the public interface of CUDPP, the CUDA Data
Parallel Primitives Library.
(http://www.gpgpu.org/developer/cudpp/)
Most comments are taken from the CUDPP library documentation.
Note about the emulation mode:
It is possible to use JCudpp in device emulation mode, which may
run even when no real CUDA capable device is available. In order
to activate the emulation mode, one must call
JCudpp.setEmulation(true);
before any other JCudpp method is called.
Interacting with the JCuda runtime API is only possible if JCuda
also has been initialized in emulation mode.
Also note that it is not possible to toggle the emulation mode on
or off after the library has been initialized, i.e. after any
JCudpp method has been called.
| Method Summary | |
|---|---|
static int |
cudppCompact(CUDPPHandle planHandle,
jcuda.Pointer d_out,
jcuda.Pointer d_numValidElements,
jcuda.Pointer d_in,
jcuda.Pointer d_isValid,
long numElements)
Given an array d_in and an array of 1/0 flags in deviceValid, returns a compacted array in d_out of corresponding only the "valid" values from d_in. |
static int |
cudppDestroyPlan(CUDPPHandle plan)
Destroy a CUDPP Plan. |
static int |
cudppDestroySparseMatrix(CUDPPHandle sparseMatrixHandle)
Destroy a CUDPP Sparse Matrix Object. |
static int |
cudppMultiScan(CUDPPHandle planHandle,
jcuda.Pointer d_out,
jcuda.Pointer d_in,
long numElements,
long numRows)
Performs numRows parallel scan operations of numElements each on its input (d_in) and places the output in d_out, with the scan parameters set by config. |
static int |
cudppPlan(CUDPPHandle planHandle,
CUDPPConfiguration config,
long n,
long rows,
long rowPitch)
Create a CUDPP plan. |
static int |
cudppRand(CUDPPHandle planHandle,
jcuda.Pointer d_out,
long numElements)
Rand puts numElements random 32-bit elements into d_out. |
static int |
cudppRandSeed(CUDPPHandle planHandle,
int seed)
Sets the seed used for rand. |
static int |
cudppScan(CUDPPHandle planHandle,
jcuda.Pointer d_out,
jcuda.Pointer d_in,
long numElements)
Performs a scan operation of numElements on its input in GPU memory (d_in) and places the output in GPU memory (d_out), with the scan parameters specified in the plan pointed to by planHandle. |
static int |
cudppSegmentedScan(CUDPPHandle planHandle,
jcuda.Pointer d_out,
jcuda.Pointer d_idata,
jcuda.Pointer d_iflags,
long numElements)
Performs a segmented scan operation of numElements on its input in GPU memory (d_idata) and places the output in GPU memory (d_out), with the scan parameters specified in the plan pointed to by planHandle. |
static int |
cudppSort(CUDPPHandle planHandle,
jcuda.Pointer d_keys,
jcuda.Pointer d_values,
int keyBits,
long numElements)
Sorts key-value pairs or keys only. |
static int |
cudppSparseMatrix(CUDPPHandle sparseMatrixHandle,
CUDPPConfiguration config,
long numNonZeroElements,
long numRows,
jcuda.Pointer A,
jcuda.Pointer h_rowIndices,
jcuda.Pointer h_indices)
Create a CUDPP Sparse Matrix Object. |
static int |
cudppSparseMatrixVectorMultiply(CUDPPHandle sparseMatrixHandle,
jcuda.Pointer d_y,
jcuda.Pointer d_x)
Perform matrix-vector multiply y = A*x for arbitrary sparse matrix A and vector x. |
static void |
initialize()
Initializes the native library according to the current value of the emulation flag. |
static void |
setEmulation(boolean emulation)
Set the flag which indicates whether the emulation mode should be used. |
static void |
setExceptionsEnabled(boolean enabled)
Enables or disables exceptions. |
static void |
setLogLevel(jcuda.LogLevel logLevel)
Set the specified log level for the JCudpp library. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void setEmulation(boolean emulation)
emulation - Whether emulation mode should be used
java.lang.UnsupportedOperationException - If the method is
called after the library has been initializedpublic static void setLogLevel(jcuda.LogLevel logLevel)
logLevel - The log level to use.public static void setExceptionsEnabled(boolean enabled)
enabled - Whether exceptions are enabledpublic static void initialize()
public static int cudppPlan(CUDPPHandle planHandle,
CUDPPConfiguration config,
long n,
long rows,
long rowPitch)
[out] planHandle A pointer to an opaque handle to the internal plan
[in] config The configuration struct specifying algorithm and options
[in] numElements The maximum number of elements to be processed
[in] numRows The number of rows (for 2D operations) to be processed
[in] rowPitch The pitch of the rows of input data, in elements
public static int cudppDestroyPlan(CUDPPHandle plan)
[in] planHandle The CUDPPHandle to the plan to be destroyed
public static int cudppScan(CUDPPHandle planHandle,
jcuda.Pointer d_out,
jcuda.Pointer d_in,
long numElements)
[in] planHandle Handle to plan for this scan
[out] d_out output of scan, in GPU memory
[in] d_in input to scan, in GPU memory
[in] numElements number of elements to scan
cudppPlan(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPConfiguration, long, long, long),
cudppDestroyPlan(jcuda.jcudpp.CUDPPHandle)
public static int cudppMultiScan(CUDPPHandle planHandle,
jcuda.Pointer d_out,
jcuda.Pointer d_in,
long numElements,
long numRows)
[in] planHandle handle to CUDPPScanPlan
[out] d_out output of scan, in GPU memory
[in] d_in input to scan, in GPU memory
[in] numElements number of elements (per row) to scan
[in] numRows number of rows to scan in parallel
cudppScan(jcuda.jcudpp.CUDPPHandle, jcuda.Pointer, jcuda.Pointer, long),
cudppPlan(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPConfiguration, long, long, long)
public static int cudppSegmentedScan(CUDPPHandle planHandle,
jcuda.Pointer d_out,
jcuda.Pointer d_idata,
jcuda.Pointer d_iflags,
long numElements)
[in] planHandle Handle to plan for this scan
[out] d_out output of segmented scan, in GPU memory
[in] d_idata input data to segmented scan, in GPU memory
[in] d_iflags input flags to segmented scan, in GPU memory
[in] numElements number of elements to perform segmented scan on
cudppPlan(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPConfiguration, long, long, long),
cudppDestroyPlan(jcuda.jcudpp.CUDPPHandle)
public static int cudppCompact(CUDPPHandle planHandle,
jcuda.Pointer d_out,
jcuda.Pointer d_numValidElements,
jcuda.Pointer d_in,
jcuda.Pointer d_isValid,
long numElements)
d_in = [ a b c d e f ] deviceValid = [ 1 0 1 1 0 1 ] d_out = [ a c d f ]
[in] planHandle handle to CUDPPCompactPlan
[out] d_out compacted output
[out] d_numValidElements set during cudppCompact;
is set with the number of elements valid flags in the
d_isValid input array
[in] d_in input to compact
[in] d_isValid which elements in d_in are valid
[in] numElements number of elements in d_in
public static int cudppSort(CUDPPHandle planHandle,
jcuda.Pointer d_keys,
jcuda.Pointer d_values,
int keyBits,
long numElements)
[in] planHandle handle to CUDPPSortPlan
[out] d_keys keys by which key-value pairs will be sorted
[in] d_values values to be sorted
[in] keyBits the number of least significant bits in each element of d_keys to sort by
[in] numElements number of elements in d_keys and d_values
cudppPlan(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPConfiguration, long, long, long),
CUDPPConfiguration,
CUDPPAlgorithm
public static int cudppSparseMatrix(CUDPPHandle sparseMatrixHandle,
CUDPPConfiguration config,
long numNonZeroElements,
long numRows,
jcuda.Pointer A,
jcuda.Pointer h_rowIndices,
jcuda.Pointer h_indices)
[out] sparseMatrixHandle A pointer to an opaque handle to the sparse matrix object
[in] config The configuration struct specifying algorithm and options
[in] numNonZeroElements The number of non zero elements in the sparse matrix
[in] numRows This is the number of rows in y, x and A for y = A * x
[in] A The matrix data
[in] h_rowIndices An array containing the index of the start of each row in A
[in] h_indices An array containing the index of each nonzero element in A
public static int cudppDestroySparseMatrix(CUDPPHandle sparseMatrixHandle)
[in] sparseMatrixHandle The CUDPPHandle to the matrix object to be destroyed
public static int cudppSparseMatrixVectorMultiply(CUDPPHandle sparseMatrixHandle,
jcuda.Pointer d_y,
jcuda.Pointer d_x)
sparseMatrixHandle Handle to a sparse matrix object created
with cudppSparseMatrix()
d_y The output vector, y
d_x The input vector, x
cudppSparseMatrix(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPConfiguration, long, long, jcuda.Pointer, jcuda.Pointer, jcuda.Pointer),
cudppDestroySparseMatrix(jcuda.jcudpp.CUDPPHandle)
public static int cudppRand(CUDPPHandle planHandle,
jcuda.Pointer d_out,
long numElements)
[in] planHandle Handle to plan for rand
[in] numElements number of elements in d_out.
[out] d_out output of rand, in GPU memory. Should be an array of unsigned integers.
CUDPPConfiguration,
CUDPPAlgorithm
public static int cudppRandSeed(CUDPPHandle planHandle,
int seed)
[in] planHandle the handle to the plan which specifies which rand seed to set
[in] seed the value which the internal cudpp seed will be set to
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||