pub unsafe fn cuestPCMPotentialComputeWorkspaceQuery(
handle: cuestHandle_t,
plan: cuestPCMIntPlan_t,
parameters: cuestPCMPotentialComputeParameters_t,
temporaryWorkspaceDescriptor: *mut cuestWorkspaceDescriptor_t,
densityMatrix: *const f64,
inQ: *const f64,
outQ: *mut f64,
outPCMResults: cuestPCMResults_t,
outPCMPotentialMatrix: *mut f64,
) -> cuestStatus_tExpand description
@brief Query the temporary workspace required for a PCM potential computation. @ingroup PCM
This function calculates the memory required for a PCM potential computation, returning host/device workspace buffer sizes in the output descriptor. The user arrays \c densityMatrix, \c inQ, \c outQ, \c outPCMResults, and \c outPCMPotentialMatrix may be NULL. All parameters and object handles must be valid.
\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_PCMPOTENTIALCOMPUTE_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_PCMPOTENTIALCOMPUTE_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 available and expected to provide a performance advantage on the present GPU architecture.
- JIT-compiled kernels and ffloat compute may be combined. When JIT is enabled, ffloat compute can be used throughout the operation. When JIT is disabled, ffloat compute can be used only while solving for the PCM charges; the remainder of the operation always uses fp64 compute.
@param[in] handle cuEST handle. Must not be NULL. @param[in] plan PCM integral plan constructed with \c cuestPCMIntPlanCreate. Must not be NULL. @param[in] parameters PCM potential compute parameters constructed with \c cuestParametersCreate. Must not be NULL. @param[out] temporaryWorkspaceDescriptor Output descriptor for temporary workspace sizes. Must not be NULL. @param densityMatrix Density matrix. May be NULL. @param inQ Input Q matrix. May be NULL. @param outQ Output Q matrix. May be NULL. @param outPCMResults PCM results constructed with \c cuestResultsCreate. May be NULL. @param outPCMPotentialMatrix Output PCM potential matrix. 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 the \c parameters are configured to have convergence threshold less than or equal to zero;
- \c CUEST_STATUS_INVALID_ARGUMENT if a parameter value is invalid, or if JIT-compiled kernels are requested with the cuEST CUDA 12 package;
- \c CUEST_STATUS_EXCEPTION or \c CUEST_STATUS_UNKNOWN_ERROR otherwise.