public class JCudpp
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
CUDPP_HASH_KEY_NOT_FOUND
The value that indicates that a hash key was not found
|
Modifier and Type | Method and Description |
---|---|
static int |
cudppBurrowsWheelerTransform(CUDPPHandle planHandle,
jcuda.Pointer d_in,
jcuda.Pointer d_out,
jcuda.Pointer d_index,
long numElements)
Performs the Burrows-Wheeler Transform.
|
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 |
cudppCompress(CUDPPHandle planHandle,
jcuda.Pointer d_uncompressed,
jcuda.Pointer d_bwtIndex,
jcuda.Pointer d_histSize,
jcuda.Pointer d_hist,
jcuda.Pointer d_encodeOffset,
jcuda.Pointer d_compressedSize,
jcuda.Pointer d_compressed,
long numElements)
Compresses data stream.
|
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,
jcuda.Pointer d_keys,
jcuda.Pointer d_vals,
long num)
Inserts keys and values into a CUDPP hash table.
|
static int |
cudppHashRetrieve(CUDPPHandle plan,
jcuda.Pointer d_keys,
jcuda.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 |
cudppListRank(CUDPPHandle planHandle,
jcuda.Pointer d_ranked_values,
jcuda.Pointer d_unranked_values,
jcuda.Pointer d_next_indices,
long head,
long numElements)
Performs list ranking of linked list node values.
|
static int |
cudppMergeSort(CUDPPHandle planHandle,
jcuda.Pointer d_keys,
jcuda.Pointer d_values,
long numElements)
Sorts key-value pairs or keys only.
|
static int |
cudppMoveToFrontTransform(CUDPPHandle planHandle,
jcuda.Pointer d_in,
jcuda.Pointer d_out,
long numElements)
Performs the Move-to-Front Transform.
|
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 |
cudppMultivalueHashGetAllValues(CUDPPHandle plan,
jcuda.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 |
cudppRadixSort(CUDPPHandle planHandle,
jcuda.Pointer d_keys,
jcuda.Pointer d_values,
long numElements)
Sorts key-value pairs or keys only.
|
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 |
cudppReduce(CUDPPHandle planHandle,
jcuda.Pointer d_out,
jcuda.Pointer d_in,
long numElements)
Reduces an array to a single element using a binary associative operator.
|
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 |
cudppSparseMatrix(CUDPPHandle cudppHandle,
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 int |
cudppStringSort(CUDPPHandle planHandle,
jcuda.Pointer d_stringVals,
jcuda.Pointer d_address,
byte termC,
long numElements,
long stringArrayLength)
Sorts strings.
|
static int |
cudppTridiagonal(CUDPPHandle planHandle,
jcuda.Pointer a,
jcuda.Pointer b,
jcuda.Pointer c,
jcuda.Pointer d,
jcuda.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(jcuda.LogLevel logLevel)
Set the specified log level for the JCudpp library.
|
public static final int CUDPP_HASH_KEY_NOT_FOUND
public 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 cudppCreate(CUDPPHandle theCudpp)
[in,out] theCudpp a pointer to the CUDPPHandle for the created CUDPP instance.
theCudpp
- The handlepublic static int cudppDestroy(CUDPPHandle theCudpp)
[in] theCudpp the handle to the CUDPP instance to destroy.
theCudpp
- The handlepublic 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, 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
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
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
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 cudppReduce(CUDPPHandle planHandle, jcuda.Pointer d_out, jcuda.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 cudppRadixSort(CUDPPHandle planHandle, jcuda.Pointer d_keys, jcuda.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
public static int cudppMergeSort(CUDPPHandle planHandle, jcuda.Pointer d_keys, jcuda.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
public static int cudppStringSort(CUDPPHandle planHandle, jcuda.Pointer d_stringVals, jcuda.Pointer d_address, byte termC, long numElements, long stringArrayLength)
[in] planHandle handle to CUDPPSortPlan [in] stringVals Original string input, no need for alignment or offsets. [in] d_address Pointers (in order) to each strings starting location in the stringVals array [in] termC Termination character used to separate strings [in] numElements number of strings [in] stringArrayLength Length in uint of the size of all strings
public static int cudppSparseMatrix(CUDPPHandle cudppHandle, CUDPPHandle sparseMatrixHandle, CUDPPConfiguration config, long numNonZeroElements, long numRows, jcuda.Pointer A, jcuda.Pointer h_rowIndices, jcuda.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, 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
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
public static int cudppTridiagonal(CUDPPHandle planHandle, jcuda.Pointer a, jcuda.Pointer b, jcuda.Pointer c, jcuda.Pointer d, jcuda.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 cudppCompress(CUDPPHandle planHandle, jcuda.Pointer d_uncompressed, jcuda.Pointer d_bwtIndex, jcuda.Pointer d_histSize, jcuda.Pointer d_hist, jcuda.Pointer d_encodeOffset, jcuda.Pointer d_compressedSize, jcuda.Pointer d_compressed, long numElements)
[out] d_bwtIndex BWT Index (int) [out] d_histSize Histogram size (ignored, null ptr) [out] d_hist Histogram (256-entry, uint) [out] d_encodeOffset Encoded offset table (256-entry, uint) [out] d_compressedSize Size of compressed data (uint) [out] d_compressed Compressed data [in] planHandle Handle to plan for compressor [in] d_uncompressed Uncompressed data [in] numElements Number of elements to compress
public static int cudppBurrowsWheelerTransform(CUDPPHandle planHandle, jcuda.Pointer d_in, jcuda.Pointer d_out, jcuda.Pointer d_index, long numElements)
[in] planHandle Handle to plan for BWT [out] d_in BWT Index [out] d_out Output data [in] d_index Input data [in] numElements Number of elements
public static int cudppMoveToFrontTransform(CUDPPHandle planHandle, jcuda.Pointer d_in, jcuda.Pointer d_out, long numElements)
[in] planHandle Handle to plan for MTF [out] d_out Output data [in] d_in Input data [in] numElements Number of elements
public static int cudppListRank(CUDPPHandle planHandle, jcuda.Pointer d_ranked_values, jcuda.Pointer d_unranked_values, jcuda.Pointer d_next_indices, long head, long numElements)
d_a = [ f a c d b e ]
d_b = [ -1 4 3 5 2 0 ]
head = 1
d_x = [ a b c d e f ]
[in] planHandle Handle to plan for list ranking [out] d_ranked_values Output ranked values [in] d_unranked_values Input unranked values [in] d_next_indices Input next indices [in] head Input head node index [in] numElements number of nodes
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, jcuda.Pointer d_keys, jcuda.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, jcuda.Pointer d_keys, jcuda.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, jcuda.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[])