pub unsafe fn cuestPotentialDerivativeComputeWorkspaceQuery(
handle: cuestHandle_t,
plan: cuestOEIntPlan_t,
parameters: cuestPotentialDerivativeComputeParameters_t,
temporaryWorkspaceDescriptor: *mut cuestWorkspaceDescriptor_t,
numCharges: u64,
xyz: *const f64,
q: *const f64,
densityMatrix: *const f64,
outBasisGradient: *mut f64,
outChargeGradient: *mut f64,
) -> cuestStatus_tExpand description
@brief Query the temporary workspace required to compute the potential integral derivatives with respect to atomic and charge coordinates, contracted with a density matrix. @ingroup PotentialGrad
This function determines the workspace required for a potential derivative evaluation with a given plan and point-charge specification. The output descriptor is filled on success and can be used to allocate host and device workspace buffers prior to calling \c cuestPotentialDerivativeCompute.
The density matrix and output gradient pointers are optional and may be NULL.
\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_POTENTIALDERIVATIVECOMPUTE_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_POTENTIALDERIVATIVECOMPUTE_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.
- It is recommended to leave \c CUEST_FFLOAT_USAGE_MODE_OFF for general use of the potential derivative.
@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 cuestPotentialDerivativeComputeParameters_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 Cartesian coordinates of the point charges. May be NULL. @param q Optional point charges. May be NULL. @param densityMatrix Optional density matrix. May be NULL. @param outBasisGradient Optional output gradient buffer with respect to AO basis centers. May be NULL. @param outChargeGradient Optional output gradient buffer with respect to the point-charge coordinates. 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.