Context#

group Context

Functions

cuestStatus_t cuestCreate(
cuestHandleParameters_t params,
cuestHandle_t *handle
)#

Creates a new cuEST handle and its associated resources from a parameter structure.

Ownership of handles or pointers passed into the structure is NOT transferred. Default parameters will construct a generic GPU context.

Requirements:

  • A cudaStream alone may be provided, all others may be left NULL.

  • If cuBLAS or cuSolver handles are specified, a cudaStream must also be specified.

  • When cuBLAS or cuSolver handles are specified, these handles must be set to operate on the provided cudaStream. (i.e. by calling cublasSetStream or cusolverDnSetStream with the provided cudaStream);

Parameters:
  • params[in] Parameter structure handle (must not be NULL).

  • handle[out] Pointer to opaque cuEST handle for output.

Returns:

  • CUEST_STATUS_SUCCESS on success,

  • CUEST_STATUS_NULL_POINTER if params or handle is NULL,

  • CUEST_STATUS_INVALID_TYPE if params is not of the cuestHandleParameters_t type,

  • CUEST_STATUS_EXCEPTION or CUEST_STATUS_UNKNOWN_ERROR otherwise.

cuestStatus_t cuestDestroy(cuestHandle_t handle)#

Destroys a cuEST handle and all associated resources.

Frees memory for GPU resources, quadrature data, solid harmonics coefficients, and rys table.

Parameters:

handle[in] Opaque cuEST handle to destroy (must not be NULL).

Returns:

  • CUEST_STATUS_SUCCESS on success,

  • CUEST_STATUS_NULL_POINTER if handle is NULL,

  • CUEST_STATUS_INVALID_TYPE if handle is not of the cuestHandle_t type,

  • CUEST_STATUS_EXCEPTION or CUEST_STATUS_UNKNOWN_ERROR otherwise.

cuestStatus_t cuestSetMathMode(
cuestHandle_t handle,
cuestMathMode_t mode
)#

Sets the math mode used when cuEST functions are called with this handle.

  • CUEST_DEFAULT_MATH_MODE cuEST will use algorithms that are determined heuristically to maximize performance. Some results may use mixed precision arithmetic.

  • CUEST_NATIVE_FP64_MATH_MODE cuEST will use FP64 arithmetic everywhere.

Parameters:
  • handle[in] Opaque cuEST handle (must not be NULL).

  • mode[in] Math mode enum.

Returns:

  • CUEST_STATUS_SUCCESS on success,

  • CUEST_STATUS_INVALID_HANDLE if handle is NULL,

  • CUEST_STATUS_INVALID_TYPE if handle is not of the cuestHandle_t type,

  • CUEST_STATUS_INVALID_ARGUMENT if the cuestMathMode_t is invalid.

  • CUEST_STATUS_EXCEPTION or CUEST_STATUS_UNKNOWN_ERROR otherwise.

cuestStatus_t cuestGetMathMode(
cuestHandle_t handle,
cuestMathMode_t *mode
)#

Gets the math mode associated with this handle.

Parameters:
  • handle[in] Opaque cuEST handle (must not be NULL).

  • mode[out] Math mode enum (must not be NULL).

Returns:

  • CUEST_STATUS_SUCCESS on success,

  • CUEST_STATUS_INVALID_HANDLE if handle is NULL,

  • CUEST_STATUS_NULL_POINTER if mode is NULL,

  • CUEST_STATUS_INVALID_TYPE if handle is not of the cuestHandle_t type,

  • CUEST_STATUS_EXCEPTION or CUEST_STATUS_UNKNOWN_ERROR otherwise.

cuestStatus_t cuestSetComputeCapabilityTarget(
cuestHandle_t handle,
uint32_t targetMajorVersion,
uint32_t targetMinorVersion
)#

Sets the compute capability used in heuristics to determined the most performant code path.

Notes:

  • Manually setting the compute capability target is not recommended for production calculations. This option is intended only compare numerical performance of the same algorithm on different architectures.

  • Not all algorithms may be available on all architectures. Changing the compute capability target may result in exceptions during subsequent calls to cuEST.

  • The compute capability target only affects heuristics. It does not affect kernel execution or JIT compilation.

Parameters:
  • handle[in] Opaque cuEST handle (must not be NULL).

  • targetMajorVersion[in] Compute capability target major version.

  • targetMinorVersion[in] Compute capability target minor version.

Returns:

  • CUEST_STATUS_SUCCESS on success,

  • CUEST_STATUS_INVALID_HANDLE if handle is NULL,

  • CUEST_STATUS_INVALID_TYPE if handle is not of the cuestHandle_t type,

  • CUEST_STATUS_EXCEPTION or CUEST_STATUS_UNKNOWN_ERROR otherwise.

cuestStatus_t cuestGetComputeCapabilityTarget(
cuestHandle_t handle,
uint32_t *targetMajorVersion,
uint32_t *targetMinorVersion
)#

Gets the compute capability used in heuristics to determined the most performant code path.

Parameters:
  • handle[in] Opaque cuEST handle (must not be NULL).

  • targetMajorVersion[out] Compute capability target major version (must not be NULL).

  • targetMinorVersion[out] Compute capability target minor version (must not be NULL).

Returns:

  • CUEST_STATUS_SUCCESS on success,

  • CUEST_STATUS_INVALID_HANDLE if handle is NULL,

  • CUEST_STATUS_INVALID_TYPE if handle is not of the cuestHandle_t type,

  • CUEST_STATUS_NULL_POINTER if targetMajorVersion or targetMinorVersion is NULL,

  • CUEST_STATUS_EXCEPTION or CUEST_STATUS_UNKNOWN_ERROR otherwise.

cuestStatus_t cuestGetMajorVersion(
cuestHandle_t handle,
uint32_t *majorVersion
)#

Gets the major version of the cuEST library.

Parameters:
  • handle[in] Opaque cuEST handle (must not be NULL).

  • majorVersion[out] Major version of the cuEST library (must not be NULL).

Returns:

  • CUEST_STATUS_SUCCESS on success,

  • CUEST_STATUS_INVALID_HANDLE if handle is NULL,

  • CUEST_STATUS_INVALID_TYPE if handle is not of the cuestHandle_t type,

  • CUEST_STATUS_NULL_POINTER if majorVersion is NULL,

  • CUEST_STATUS_EXCEPTION or CUEST_STATUS_UNKNOWN_ERROR otherwise.

cuestStatus_t cuestGetMinorVersion(
cuestHandle_t handle,
uint32_t *minorVersion
)#

Gets the minor version of the cuEST library.

Parameters:
  • handle[in] Opaque cuEST handle (must not be NULL).

  • minorVersion[out] Minor version of the cuEST library (must not be NULL).

Returns:

  • CUEST_STATUS_SUCCESS on success,

  • CUEST_STATUS_INVALID_HANDLE if handle is NULL,

  • CUEST_STATUS_INVALID_TYPE if handle is not of the cuestHandle_t type,

  • CUEST_STATUS_NULL_POINTER if minorVersion is NULL,

  • CUEST_STATUS_EXCEPTION or CUEST_STATUS_UNKNOWN_ERROR otherwise.