Skip to main content

cuestXCDensityComputeWorkspaceQuery

Function cuestXCDensityComputeWorkspaceQuery 

Source
pub unsafe fn cuestXCDensityComputeWorkspaceQuery(
    handle: cuestHandle_t,
    plan: cuestXCIntPlan_t,
    approximation: cuestXCAdvancedComputeParametersApproximation_t,
    parameters: cuestXCDensityComputeParameters_t,
    variableBufferSize: *const cuestWorkspaceDescriptor_t,
    temporaryWorkspaceDescriptor: *mut cuestWorkspaceDescriptor_t,
    numOccupied: u64,
    coefficientMatrix: *const f64,
    outGridDensity: *mut f64,
) -> cuestStatus_t
Expand description

@brief Query the temporary workspace required (in bytes) for an XC density computation. @ingroup ExchangeCorrelationAdvanced

Determines the GPU memory requirements for computing the electron density (and its derivatives) on the molecular grid using the provided XC integral plan and approximation type. Only memory requirements are estimated; no actual computation is performed. Input and output pointers may be NULL.

This call must precede \c cuestXCDensityCompute to ensure that sufficient temporary memory is available.

@param[in] handle cuEST handle. Must not be NULL. @param[in] plan XC integral plan (opaque handle) constructed with \c cuestXCIntPlanCreate. Must not be NULL. @param[in] approximation Specifies the XC approximation: LDA, GGA, or meta-GGA. @param[in] parameters Compute parameters (\c cuestXCDensityComputeParameters_t) Must not be NULL @param[in] variableBufferSize User-provided descriptor for the variable buffer size (host and device). Must not be NULL. 2 GB is a good default value for device memory. There are diminishing returns for very large values of the variableBufferSize. Some static allocations are made outside of what is controlled by the variableBufferSize. Host memory is currently unused. This value MUST remain unchanged between the WorkspaceQuery call and the Compute call. @param[out] temporaryWorkspaceDescriptor Output descriptor with required workspace sizes (in bytes). Must not be NULL. @param[in] numOccupied Number of occupied orbitals (rows in \c coefficientMatrix). Must be greater than zero. @param coefficientMatrix Input orbital coefficient matrix. May be NULL. @param outGridDensity Output buffer for computed density values. 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 of incorrect type;
  • \c CUEST_STATUS_INVALID_ARGUMENT if \c numOccupied is zero or \c approximation is invalid;
  • \c CUEST_STATUS_EXCEPTION on device or internal error;
  • \c CUEST_STATUS_UNKNOWN_ERROR otherwise.