CUDPP  2.3
CUDA Data-Parallel Primitives Library
Classes | Enumerations | Functions
cudpp.h File Reference

Main library header file. Defines public interface. More...

#include <stdlib.h>
#include "cudpp_config.h"

Classes

struct  CUDPPConfiguration
 Configuration struct used to specify algorithm, datatype, operator, and options when creating a plan for CUDPP algorithms. More...
 

Enumerations

Functions

CUDPP_DLL CUDPPResult cudppCreate (CUDPPHandle *theCudpp)
 Creates an instance of the CUDPP library, and returns a handle. More...
 
CUDPP_DLL CUDPPResult cudppDestroy (CUDPPHandle theCudpp)
 Destroys an instance of the CUDPP library given its handle. More...
 
CUDPP_DLL CUDPPResult cudppPlan (const CUDPPHandle cudppHandle, CUDPPHandle *planHandle, CUDPPConfiguration config, size_t n, size_t rows, size_t rowPitch)
 Create a CUDPP plan. More...
 
CUDPP_DLL CUDPPResult cudppDestroyPlan (CUDPPHandle plan)
 Destroy a CUDPP Plan. More...
 
CUDPP_DLL CUDPPResult cudppScan (const CUDPPHandle planHandle, void *d_out, const void *d_in, size_t 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. More...
 
CUDPP_DLL CUDPPResult cudppMultiScan (const CUDPPHandle planHandle, void *d_out, const void *d_in, size_t numElements, size_t 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. Exactly like cudppScan except that it runs on multiple rows in parallel. More...
 
CUDPP_DLL CUDPPResult cudppSegmentedScan (const CUDPPHandle planHandle, void *d_out, const void *d_idata, const unsigned int *d_iflags, size_t 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. More...
 
CUDPP_DLL CUDPPResult cudppCompact (const CUDPPHandle planHandle, void *d_out, size_t *d_numValidElements, const void *d_in, const unsigned int *d_isValid, size_t 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. More...
 
CUDPP_DLL CUDPPResult cudppReduce (const CUDPPHandle planHandle, void *d_out, const void *d_in, size_t numElements)
 Reduces an array to a single element using a binary associative operator. More...
 
CUDPP_DLL CUDPPResult cudppRadixSort (const CUDPPHandle planHandle, void *d_keys, void *d_values, size_t numElements)
 Sorts key-value pairs or keys only. More...
 
CUDPP_DLL CUDPPResult cudppMergeSort (const CUDPPHandle planHandle, void *d_keys, void *d_values, size_t numElements)
 Sorts key-value pairs or keys only. More...
 
CUDPP_DLL CUDPPResult cudppStringSort (const CUDPPHandle planHandle, unsigned char *d_stringVals, unsigned int *d_address, unsigned char termC, size_t numElements, size_t stringArrayLength)
 Sorts strings. Keys are the first four characters of the string, and values are the addresses where the strings reside in memory (stringVals) More...
 
CUDPP_DLL CUDPPResult cudppStringSortAligned (const CUDPPHandle planHandle, unsigned int *d_keys, unsigned int *d_values, unsigned int *stringVals, size_t numElements, size_t stringArrayLength)
 Sorts strings. Keys are the first four characters of the string, and values are the addresses where the strings reside in memory (stringVals) More...
 
CUDPP_DLL CUDPPResult cudppSparseMatrix (const CUDPPHandle cudppHandle, CUDPPHandle *sparseMatrixHandle, CUDPPConfiguration config, size_t n, size_t rows, const void *A, const unsigned int *h_rowIndices, const unsigned int *h_indices)
 Create a CUDPP Sparse Matrix Object. More...
 
CUDPP_DLL CUDPPResult cudppDestroySparseMatrix (CUDPPHandle sparseMatrixHandle)
 Destroy a CUDPP Sparse Matrix Object. More...
 
CUDPP_DLL CUDPPResult cudppSparseMatrixVectorMultiply (const CUDPPHandle sparseMatrixHandle, void *d_y, const void *d_x)
 Perform matrix-vector multiply y = A*x for arbitrary sparse matrix A and vector x. More...
 
CUDPP_DLL CUDPPResult cudppRand (const CUDPPHandle planHandle, void *d_out, size_t numElements)
 Rand puts numElements random 32-bit elements into d_out. More...
 
CUDPP_DLL CUDPPResult cudppRandSeed (const CUDPPHandle planHandle, unsigned int seed)
 Sets the seed used for rand. More...
 
CUDPP_DLL CUDPPResult cudppTridiagonal (CUDPPHandle planHandle, void *a, void *b, void *c, void *d, void *x, int systemSize, int numSystems)
 Solves tridiagonal linear systems. More...
 
CUDPP_DLL CUDPPResult cudppCompress (CUDPPHandle planHandle, unsigned char *d_uncompressed, int *d_bwtIndex, unsigned int *d_histSize, unsigned int *d_hist, unsigned int *d_encodeOffset, unsigned int *d_compressedSize, unsigned int *d_compressed, size_t numElements)
 Compresses data stream. More...
 
CUDPP_DLL CUDPPResult cudppBurrowsWheelerTransform (CUDPPHandle planHandle, unsigned char *d_in, unsigned char *d_out, int *d_index, size_t numElements)
 Performs the Burrows-Wheeler Transform. More...
 
CUDPP_DLL CUDPPResult cudppMoveToFrontTransform (CUDPPHandle planHandle, unsigned char *d_in, unsigned char *d_out, size_t numElements)
 Performs the Move-to-Front Transform. More...
 
CUDPP_DLL CUDPPResult cudppListRank (CUDPPHandle planHandle, void *d_ranked_values, void *d_unranked_values, void *d_next_indices, size_t head, size_t numElements)
 Performs list ranking of linked list node values. More...
 
CUDPP_DLL CUDPPResult cudppSuffixArray (CUDPPHandle planHandle, unsigned char *d_str, unsigned int *d_keys_sa, size_t numElements)
 Performs the Suffix Array. More...
 
CUDPP_DLL CUDPPResult cudppMultiSplit (const CUDPPHandle planHandle, unsigned int *d_keys, unsigned int *d_values, size_t numElements, size_t numBuckets)
 Splits an array of keys and an optional array of values into a set of buckets. More...
 
CUDPP_DLL CUDPPResult cudppMultiSplitCustomBucketMapper (const CUDPPHandle planHandle, unsigned int *d_keys, unsigned int *d_values, size_t numElements, size_t numBuckets, BucketMappingFunc bucketMappingFunc)
 Splits an array of keys and an optional array of values into a set of buckets using a custom function to map elements to buckets. More...
 

Detailed Description

Main library header file. Defines public interface.

cudpp.h

The CUDPP public interface is a C-only interface to enable linking with code written in other languages (e.g. C, C++, and Fortran). While the internals of CUDPP are not limited to C (C++ features are used), the public interface is entirely C (thus it is declared "extern C").

Enumeration Type Documentation

CUDPP Result codes returned by CUDPP API functions.

Enumerator
CUDPP_SUCCESS 

No error.

CUDPP_ERROR_INVALID_HANDLE 

Specified handle (for example, to a plan) is invalid.

CUDPP_ERROR_ILLEGAL_CONFIGURATION 

Specified configuration is illegal. For example, an invalid or illogical combination of options.

CUDPP_ERROR_INVALID_PLAN 

The plan is not configured properly. For example, passing a plan for scan to cudppSegmentedScan.

CUDPP_ERROR_INSUFFICIENT_RESOURCES 

The function could not complete due to insufficient resources (typically CUDA device resources such as shared memory) for the specified problem size.

CUDPP_ERROR_UNKNOWN 

Unknown or untraceable error.

Options for configuring CUDPP algorithms.

See also
CUDPPConfiguration, cudppPlan, CUDPPAlgorithm
Enumerator
CUDPP_OPTION_FORWARD 

Algorithms operate forward: from start to end of input array

CUDPP_OPTION_BACKWARD 

Algorithms operate backward: from end to start of array

CUDPP_OPTION_EXCLUSIVE 

Exclusive (for scans) - scan includes all elements up to (but not including) the current element

CUDPP_OPTION_INCLUSIVE 

Inclusive (for scans) - scan includes all elements up to and including the current element

CUDPP_OPTION_CTA_LOCAL 

Algorithm performed only on the CTAs (blocks) with no communication between blocks.

Todo:
Currently ignored.
CUDPP_OPTION_KEYS_ONLY 

No associated value to a key (for global radix sort)

CUDPP_OPTION_KEY_VALUE_PAIRS 

Each key has an associated value

Datatypes supported by CUDPP algorithms.

See also
CUDPPConfiguration, cudppPlan
Enumerator
CUDPP_CHAR 

Character type (C char)

CUDPP_UCHAR 

Unsigned character (byte) type (C unsigned char)

CUDPP_SHORT 

Short integer type (C short)

CUDPP_USHORT 

Short unsigned integer type (C unsigned short)

CUDPP_INT 

Integer type (C int)

CUDPP_UINT 

Unsigned integer type (C unsigned int)

CUDPP_FLOAT 

Float type (C float)

CUDPP_DOUBLE 

Double type (C double)

CUDPP_LONGLONG 

64-bit integer type (C long long)

CUDPP_ULONGLONG 

64-bit unsigned integer type (C unsigned long long)

CUDPP_DATATYPE_INVALID 

invalid datatype (must be last in list)

Operators supported by CUDPP algorithms (currently scan and segmented scan).

These are all binary associative operators.

See also
CUDPPConfiguration, cudppPlan
Enumerator
CUDPP_ADD 

Addition of two operands.

CUDPP_MULTIPLY 

Multiplication of two operands.

CUDPP_MIN 

Minimum of two operands.

CUDPP_MAX 

Maximum of two operands.

CUDPP_OPERATOR_INVALID 

invalid operator (must be last in list)

Algorithms supported by CUDPP. Used to create appropriate plans using cudppPlan.

See also
CUDPPConfiguration, cudppPlan
Enumerator
CUDPP_SCAN 

Scan or prefix-sum.

CUDPP_SEGMENTED_SCAN 

Segmented scan.

CUDPP_COMPACT 

Stream compact.

CUDPP_REDUCE 

Parallel reduction.

CUDPP_SORT_RADIX 

Radix sort.

CUDPP_SORT_MERGE 

Merge Sort.

CUDPP_SORT_STRING 

String Sort.

CUDPP_SPMVMULT 

Sparse matrix-dense vector multiplication.

CUDPP_RAND_MD5 

Pseudorandom number generator using MD5 hash algorithm.

CUDPP_TRIDIAGONAL 

Tridiagonal solver algorithm.

CUDPP_COMPRESS 

Lossless data compression.

CUDPP_LISTRANK 

List ranking.

CUDPP_BWT 

Burrows-Wheeler transform.

CUDPP_MTF 

Move-to-Front transform.

CUDPP_SA 

Suffix Array algorithm.

CUDPP_MULTISPLIT 

Multi-Split algorithm.

CUDPP_ALGORITHM_INVALID 

Placeholder at end of enum.

Operators supported by CUDPP algorithms (currently scan and segmented scan).

BLAH

See also
CUDPPConfiguration, cudppPlan
Enumerator
CUDPP_LSB_BUCKET_MAPPER 

The bucket is determined by the element's LSBs.

CUDPP_MSB_BUCKET_MAPPER 

The bucket is determined by the element's MSBs.

CUDPP_DEFAULT_BUCKET_MAPPER 

The bucket is determined by the element's value.

CUDPP_CUSTOM_BUCKET_MAPPER 

The bucket mapping is a user-specified function.