Skip to main content

cuestPotentialComputeWorkspaceQuery

Function cuestPotentialComputeWorkspaceQuery 

Source
pub unsafe fn cuestPotentialComputeWorkspaceQuery(
    handle: cuestHandle_t,
    plan: cuestOEIntPlan_t,
    parameters: cuestPotentialComputeParameters_t,
    temporaryWorkspaceDescriptor: *mut cuestWorkspaceDescriptor_t,
    numCharges: u64,
    xyz: *const f64,
    q: *const f64,
    outVMatrix: *mut f64,
) -> cuestStatus_t
Expand description

@brief Query the temporary workspace required (in bytes) for a potential energy matrix calculation. @ingroup Potential

This function calculates the workspace required for a potential energy matrix evaluation, returning host/device workspace buffer sizes in the output descriptor. The user arrays \c q, \c xyz, and \c outVMatrix may be NULL; only sizes are computed. \c numCharges must be greater than zero.

\b Kernel and precision selection. This routine can use JIT-compiled kernels and/or reduced-precision “ffloat” compute, selected through the compute parameters:

  • \c CUEST_POTENTIALCOMPUTE_PARAMETERS_JIT_USAGE_MODE (\c cuestJITUsageMode_t): \c CUEST_JIT_USAGE_MODE_ON uses JIT-compiled kernels, \c CUEST_JIT_USAGE_MODE_OFF uses AOT-compiled kernels. JIT-compiled kernels are only available in the cuEST CUDA 13 package; the default is \c CUEST_JIT_USAGE_MODE_ON in the cuEST CUDA 13 package and \c CUEST_JIT_USAGE_MODE_OFF in the cuEST CUDA 12 package. Requesting \c CUEST_JIT_USAGE_MODE_ON with the cuEST CUDA 12 package returns \c CUEST_STATUS_INVALID_ARGUMENT.
  • \c CUEST_POTENTIALCOMPUTE_PARAMETERS_FFLOAT_USAGE_MODE (\c cuestFfloatUsageMode_t) selects the compute precision: \c CUEST_FFLOAT_USAGE_MODE_ON requests ffloat compute, \c CUEST_FFLOAT_USAGE_MODE_OFF requests fp64 compute, and \c CUEST_FFLOAT_USAGE_MODE_DEFAULT requests ffloat compute when it is expected to provide a performance advantage on the present GPU architecture.
  • ffloat compute is only compatible with JIT-compiled kernels. Requesting ffloat compute while JIT is disabled (\c CUEST_FFLOAT_USAGE_MODE_ON together with \c CUEST_JIT_USAGE_MODE_OFF) is not supported and returns \c CUEST_STATUS_INVALID_ARGUMENT.

@param[in] handle cuEST handle. Must not be NULL. @param[in] plan One-electron integral computation plan (opaque handle). Must not be NULL. @param[in] parameters Compute parameters (\c cuestPotentialComputeParameters_t). Must not be NULL @param[out] temporaryWorkspaceDescriptor Output descriptor for temporary workspace sizes (host and device). Must not be NULL. @param[in] numCharges Number of point charges (must be greater than zero.). @param xyz Optional array of charge coordinates (may be NULL). @param q Optional array of charge magnitudes (may be NULL). @param outVMatrix Optional output AO potential matrix buffer (may be NULL).

@return

  • \c CUEST_STATUS_SUCCESS on success;
  • \c CUEST_STATUS_INVALID_HANDLE if the cuEST handle is NULL;
  • \c CUEST_STATUS_NULL_POINTER if any required pointer is NULL;
  • \c CUEST_STATUS_INVALID_TYPE if opaque handles are not the correct type;
  • \c CUEST_STATUS_INVALID_ARGUMENT if \c numCharges is zero;
  • \c CUEST_STATUS_INVALID_ARGUMENT if a parameter value is invalid, if JIT-compiled kernels are requested with the cuEST CUDA 12 package, or if ffloat compute is requested while JIT is disabled (incompatible JIT/ffloat combination);
  • \c CUEST_STATUS_EXCEPTION or \c CUEST_STATUS_UNKNOWN_ERROR otherwise.