|
|||||||||
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://code.google.com/p/cudpp)
Most comments are taken from the CUDPP library documentation.
Field Summary | |
---|---|
static int |
CUDPP_HASH_KEY_NOT_FOUND
The value that indicates that a hash key was not found |
Method Summary | |
---|---|
static int |
cudppCompact(CUDPPHandle planHandle,
Pointer d_out,
Pointer d_numValidElements,
Pointer d_in,
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 |
cudppCreate(CUDPPHandle theCudpp)
Creates an instance of the CUDPP library, and returns a handle. |
static int |
cudppDestroy(CUDPPHandle theCudpp)
Destroys an instance of the CUDPP library given its handle. |
static int |
cudppDestroyHashTable(CUDPPHandle cudppHandle,
CUDPPHandle plan)
Destroys a hash table given its handle. |
static int |
cudppDestroyPlan(CUDPPHandle plan)
Destroy a CUDPP Plan. |
static int |
cudppDestroySparseMatrix(CUDPPHandle sparseMatrixHandle)
Destroy a CUDPP Sparse Matrix Object. |
static int |
cudppHashInsert(CUDPPHandle plan,
Pointer d_keys,
Pointer d_vals,
long num)
Inserts keys and values into a CUDPP hash table. |
static int |
cudppHashRetrieve(CUDPPHandle plan,
Pointer d_keys,
Pointer d_vals,
long num)
Retrieves values, given keys, from a CUDPP hash table. |
static int |
cudppHashTable(CUDPPHandle cudppHandle,
CUDPPHandle plan,
CUDPPHashTableConfig config)
Creates a CUDPP hash table in GPU memory given an input hash table configuration; returns the plan for that hash table. |
static int |
cudppMultiScan(CUDPPHandle planHandle,
Pointer d_out,
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 |
cudppMultivalueHashGetAllValues(CUDPPHandle plan,
Pointer d_vals)
Retrieves a pointer to the values array in a multivalue hash table. |
static int |
cudppMultivalueHashGetValuesSize(CUDPPHandle plan,
int[] size)
Retrieves the size of the values array in a multivalue hash table. |
static int |
cudppPlan(CUDPPHandle cudppHandle,
CUDPPHandle planHandle,
CUDPPConfiguration config,
long n,
long rows,
long rowPitch)
Create a CUDPP plan. |
static int |
cudppRand(CUDPPHandle planHandle,
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 |
cudppReduce(CUDPPHandle planHandle,
Pointer d_out,
Pointer d_in,
long numElements)
Reduces an array to a single element using a binary associative operator. |
static int |
cudppScan(CUDPPHandle planHandle,
Pointer d_out,
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,
Pointer d_out,
Pointer d_idata,
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,
Pointer d_keys,
Pointer d_values,
long numElements)
Sorts key-value pairs or keys only. |
static int |
cudppSparseMatrix(CUDPPHandle cudppHandle,
CUDPPHandle sparseMatrixHandle,
CUDPPConfiguration config,
long numNonZeroElements,
long numRows,
Pointer A,
Pointer h_rowIndices,
Pointer h_indices)
Create a CUDPP Sparse Matrix Object. |
static int |
cudppSparseMatrixVectorMultiply(CUDPPHandle sparseMatrixHandle,
Pointer d_y,
Pointer d_x)
Perform matrix-vector multiply y = A*x for arbitrary sparse matrix A and vector x. |
static int |
cudppTridiagonal(CUDPPHandle planHandle,
Pointer a,
Pointer b,
Pointer c,
Pointer d,
Pointer x,
int systemSize,
int numSystems)
Solves tridiagonal linear systems. |
static void |
initialize()
Initializes the native library. |
static void |
setExceptionsEnabled(boolean enabled)
Enables or disables exceptions. |
static void |
setLogLevel(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 |
Field Detail |
---|
public static final int CUDPP_HASH_KEY_NOT_FOUND
Method Detail |
---|
public static void setLogLevel(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 cudppCreate(CUDPPHandle theCudpp)
[in,out] theCudpp a pointer to the CUDPPHandle for the created CUDPP instance.
theCudpp
- The handle
public static int cudppDestroy(CUDPPHandle theCudpp)
[in] theCudpp the handle to the CUDPP instance to destroy.
theCudpp
- The handle
public static int cudppPlan(CUDPPHandle cudppHandle, CUDPPHandle planHandle, CUDPPConfiguration config, long n, long rows, long rowPitch)
[in] cudppHandle A handle to an instance of the CUDPP library used for resource management [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, Pointer d_out, 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.CUDPPHandle, jcuda.jcudpp.CUDPPConfiguration, long, long, long)
,
cudppDestroyPlan(jcuda.jcudpp.CUDPPHandle)
public static int cudppMultiScan(CUDPPHandle planHandle, Pointer d_out, 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.CUDPPHandle, jcuda.jcudpp.CUDPPConfiguration, long, long, long)
public static int cudppSegmentedScan(CUDPPHandle planHandle, Pointer d_out, Pointer d_idata, 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.CUDPPHandle, jcuda.jcudpp.CUDPPConfiguration, long, long, long)
,
cudppDestroyPlan(jcuda.jcudpp.CUDPPHandle)
public static int cudppCompact(CUDPPHandle planHandle, Pointer d_out, Pointer d_numValidElements, Pointer d_in, 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 cudppReduce(CUDPPHandle planHandle, Pointer d_out, Pointer d_in, long numElements)
d_in = [ 3 2 0 1 -4 5 0 -1 ] d_out = [ 6 ]If the operator is CUDPP_MIN, then:
d_in = [ 3 2 0 1 -4 5 0 -1 ] d_out = [ -4 ]Limits: numElements must be at least 1, and is currently limited only by the addressable memory in CUDA (and the output accuracy is limited by numerical precision).
[in] planHandle handle to CUDPPReducePlan [out] d_out Output of reduce (a single element) in GPU memory. Must be a pointer to an array of at least a single element. [in] d_in Input array to reduce in GPU memory. Must be a pointer to an array of at least numElements elements. [in] numElements the number of elements to reduce.
public static int cudppSort(CUDPPHandle planHandle, Pointer d_keys, Pointer d_values, 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] numElements number of elements in d_keys and d_values
cudppPlan(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPConfiguration, long, long, long)
,
CUDPPConfiguration
,
CUDPPAlgorithm
public static int cudppSparseMatrix(CUDPPHandle cudppHandle, CUDPPHandle sparseMatrixHandle, CUDPPConfiguration config, long numNonZeroElements, long numRows, Pointer A, Pointer h_rowIndices, Pointer h_indices)
[in] cudppHandle A handle to an instance of the CUDPP library used for resource management [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, Pointer d_y, 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.CUDPPHandle, jcuda.jcudpp.CUDPPConfiguration, long, long, jcuda.Pointer, jcuda.Pointer, jcuda.Pointer)
,
cudppDestroySparseMatrix(jcuda.jcudpp.CUDPPHandle)
public static int cudppRand(CUDPPHandle planHandle, 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
public static int cudppTridiagonal(CUDPPHandle planHandle, Pointer a, Pointer b, Pointer c, Pointer d, Pointer x, int systemSize, int numSystems)
[in] planHandle Handle to plan for tridiagonal solver [in] d_a Lower diagonal [in] d_b Main diagonal [in] d_c Upper diagonal [in] d_d Right hand side [out] d_x Solution vector [in] systemSize The size of the linear system [in] numSystems The number of systems to be solved
public static int cudppHashTable(CUDPPHandle cudppHandle, CUDPPHandle plan, CUDPPHashTableConfig config)
[in] cudppHandle Handle to CUDPP instance [out] plan Handle to hash table instance [in] config Configuration for hash table to be created
cudppCreate(jcuda.jcudpp.CUDPPHandle)
,
cudppDestroyHashTable(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHandle)
,
CUDPPHashTableType
,
CUDPPHashTableConfig
public static int cudppDestroyHashTable(CUDPPHandle cudppHandle, CUDPPHandle plan)
[in] cudppHandle Handle to CUDPP instance [in] plan Handle to hash table instance
cudppHashTable(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHashTableConfig)
public static int cudppHashInsert(CUDPPHandle plan, Pointer d_keys, Pointer d_vals, long num)
[in] plan Handle to hash table instance [in] d_keys GPU pointer to keys to be inserted [in] d_vals GPU pointer to values to be inserted [in] num Number of keys/values to be inserted
cudppHashTable(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHashTableConfig)
,
cudppHashRetrieve(jcuda.jcudpp.CUDPPHandle, jcuda.Pointer, jcuda.Pointer, long)
public static int cudppHashRetrieve(CUDPPHandle plan, Pointer d_keys, Pointer d_vals, long num)
[in] plan Handle to hash table instance [in] d_keys GPU pointer to keys to be retrieved [out] d_vals GPU pointer to values to be retrieved [in] num Number of keys/values to be retrieved
cudppHashTable(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHashTableConfig)
public static int cudppMultivalueHashGetValuesSize(CUDPPHandle plan, int[] size)
[in] plan Handle to hash table instance [out] size Pointer to size of multivalue hash table
cudppHashTable(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHashTableConfig)
,
cudppMultivalueHashGetAllValues(jcuda.jcudpp.CUDPPHandle, jcuda.Pointer)
public static int cudppMultivalueHashGetAllValues(CUDPPHandle plan, Pointer d_vals)
[in] plan Handle to hash table instance [out] d_vals Pointer to pointer of values (in GPU memory)
cudppHashTable(jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHandle, jcuda.jcudpp.CUDPPHashTableConfig)
,
cudppMultivalueHashGetValuesSize(jcuda.jcudpp.CUDPPHandle, int[])
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |