Program Listing for File c_api.h

Program Listing for File c_api.h#

↰ Return to documentation for file (source/api_c/include/c_api.h)

// SPDX-License-Identifier: LGPL-3.0-or-later
#pragma once
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#else
// for C99
#include <stdbool.h>
#endif


#define DP_C_API_VERSION 30

typedef struct DP_Nlist DP_Nlist;

extern DP_Nlist* DP_NewNlist(int inum_,
                             int* ilist_,
                             int* numneigh_,
                             int** firstneigh_);
extern DP_Nlist* DP_NewNlist_comm(int inum_,
                                  int* ilist_,
                                  int* numneigh_,
                                  int** firstneigh_,
                                  int nswap,
                                  int* sendnum,
                                  int* recvnum,
                                  int* firstrecv,
                                  int** sendlist,
                                  int* sendproc,
                                  int* recvproc,
                                  void* world,
                                  int nprocs);

extern void DP_NlistSetMask(DP_Nlist* nl, int mask);

extern void DP_NlistSetMapping(DP_Nlist* nl, int* mapping);

extern void DP_DeleteNlist(DP_Nlist* nl);

const char* DP_NlistCheckOK(DP_Nlist* dp);

typedef struct DP_DeepBaseModel DP_DeepBaseModel;

extern void DP_DeleteDeepBaseModel(DP_DeepBaseModel* dp);

typedef struct DP_DeepBaseModelDevi DP_DeepBaseModelDevi;

extern void DP_DeleteDeepBaseModelDevi(DP_DeepBaseModelDevi* dp);

typedef struct DP_DeepPot DP_DeepPot;

extern DP_DeepPot* DP_NewDeepPot(const char* c_model);

extern DP_DeepPot* DP_NewDeepPotWithParam(const char* c_model,
                                          const int gpu_rank,
                                          const char* c_file_content);

extern DP_DeepPot* DP_NewDeepPotWithParam2(const char* c_model,
                                           const int gpu_rank,
                                           const char* c_file_content,
                                           const int size_file_content);

extern void DP_DeleteDeepPot(DP_DeepPot* dp);

typedef struct DP_DeepSpin DP_DeepSpin;

extern DP_DeepSpin* DP_NewDeepSpin(const char* c_model);

extern DP_DeepSpin* DP_NewDeepSpinWithParam2(const char* c_model,
                                             const int gpu_rank,
                                             const char* c_file_content,
                                             const int size_file_content);

extern void DP_DeleteDeepSpin(DP_DeepSpin* dp);

// deprecated interface version1
extern void DP_DeepPotCompute(DP_DeepPot* dp,
                              const int natom,
                              const double* coord,
                              const int* atype,
                              const double* cell,
                              double* energy,
                              double* force,
                              double* virial,
                              double* atomic_energy,
                              double* atomic_virial);

extern void DP_DeepPotComputef(DP_DeepPot* dp,
                               const int natom,
                               const float* coord,
                               const int* atype,
                               const float* cell,
                               double* energy,
                               float* force,
                               float* virial,
                               float* atomic_energy,
                               float* atomic_virial);

extern void DP_DeepPotComputeNList(DP_DeepPot* dp,
                                   const int natom,
                                   const double* coord,
                                   const int* atype,
                                   const double* cell,
                                   const int nghost,
                                   const DP_Nlist* nlist,
                                   const int ago,
                                   double* energy,
                                   double* force,
                                   double* virial,
                                   double* atomic_energy,
                                   double* atomic_virial);

extern void DP_DeepPotComputeNListf(DP_DeepPot* dp,
                                    const int natom,
                                    const float* coord,
                                    const int* atype,
                                    const float* cell,
                                    const int nghost,
                                    const DP_Nlist* nlist,
                                    const int ago,
                                    double* energy,
                                    float* force,
                                    float* virial,
                                    float* atomic_energy,
                                    float* atomic_virial);

extern void DP_DeepPotComputeEdgesGPU(DP_DeepPot* dp,
                                      double* d_atom_energy,
                                      double* d_force,
                                      double* d_atom_virial,
                                      const double* d_coord,
                                      const int* d_atype,
                                      const int* d_edge_index,
                                      const double* d_edge_vec,
                                      int nloc,
                                      int nedge,
                                      const double* fparam,
                                      int64_t fparam_size,
                                      const double* aparam,
                                      int64_t aparam_size,
                                      int nall_nodes,
                                      const DP_Nlist* comm_nlist);

extern void DP_DeepPotComputeEdgesGPUFloat32(DP_DeepPot* dp,
                                             double* d_atom_energy,
                                             double* d_force,
                                             double* d_atom_virial,
                                             const double* d_coord,
                                             const int* d_atype,
                                             const int* d_edge_index,
                                             const float* d_edge_vec,
                                             int nloc,
                                             int nedge,
                                             const double* fparam,
                                             int64_t fparam_size,
                                             const double* aparam,
                                             int64_t aparam_size,
                                             int nall_nodes,
                                             const DP_Nlist* comm_nlist);

extern void DP_DeepPotComputeCanonicalGraphGPU(
    DP_DeepPot* dp,
    double* d_atom_energy,
    double* d_force,
    double* d_atom_virial,
    const int64_t* d_atype,
    const uint32_t* d_source,
    const float* d_edge_vec,
    const int64_t* d_destination_row_ptr,
    const int64_t* d_source_row_ptr,
    const uint32_t* d_source_order,
    int nloc,
    int nall_nodes,
    int64_t edge_storage);

extern bool DP_DeepPotSupportsDeviceEdgeInference(DP_DeepPot* dp);

extern bool DP_DeepPotUsesFP32EdgeVectors(DP_DeepPot* dp);

extern bool DP_DeepPotUsesCanonicalGraphInference(DP_DeepPot* dp);

extern void DP_DeepPotCompute2(DP_DeepPot* dp,
                               const int nframes,
                               const int natom,
                               const double* coord,
                               const int* atype,
                               const double* cell,
                               const double* fparam,
                               const double* aparam,
                               double* energy,
                               double* force,
                               double* virial,
                               double* atomic_energy,
                               double* atomic_virial);

extern void DP_DeepSpinCompute2(DP_DeepSpin* dp,
                                const int nframes,
                                const int natom,
                                const double* coord,
                                const double* spin,
                                const int* atype,
                                const double* cell,
                                const double* fparam,
                                const double* aparam,
                                double* energy,
                                double* force,
                                double* force_mag,
                                double* virial,
                                double* atomic_energy,
                                double* atomic_virial);

extern void DP_DeepPotComputef2(DP_DeepPot* dp,
                                const int nframes,
                                const int natom,
                                const float* coord,
                                const int* atype,
                                const float* cell,
                                const float* fparam,
                                const float* aparam,
                                double* energy,
                                float* force,
                                float* virial,
                                float* atomic_energy,
                                float* atomic_virial);

extern void DP_DeepSpinComputef2(DP_DeepSpin* dp,
                                 const int nframes,
                                 const int natom,
                                 const float* coord,
                                 const float* spin,
                                 const int* atype,
                                 const float* cell,
                                 const float* fparam,
                                 const float* aparam,
                                 double* energy,
                                 float* force,
                                 float* force_mag,
                                 float* virial,
                                 float* atomic_energy,
                                 float* atomic_virial);

extern void DP_DeepPotComputeNList2(DP_DeepPot* dp,
                                    const int nframes,
                                    const int natom,
                                    const double* coord,
                                    const int* atype,
                                    const double* cell,
                                    const int nghost,
                                    const DP_Nlist* nlist,
                                    const int ago,
                                    const double* fparam,
                                    const double* aparam,
                                    double* energy,
                                    double* force,
                                    double* virial,
                                    double* atomic_energy,
                                    double* atomic_virial);

extern void DP_DeepSpinComputeNList2(DP_DeepSpin* dp,
                                     const int nframes,
                                     const int natoms,
                                     const double* coord,
                                     const double* spin,
                                     const int* atype,
                                     const double* cell,
                                     const int nghost,
                                     const DP_Nlist* nlist,
                                     const int ago,
                                     const double* fparam,
                                     const double* aparam,
                                     double* energy,
                                     double* force,
                                     double* force_mag,
                                     double* virial,
                                     double* atomic_energy,
                                     double* atomic_virial);

extern void DP_DeepPotComputeNListf2(DP_DeepPot* dp,
                                     const int nframes,
                                     const int natom,
                                     const float* coord,
                                     const int* atype,
                                     const float* cell,
                                     const int nghost,
                                     const DP_Nlist* nlist,
                                     const int ago,
                                     const float* fparam,
                                     const float* aparam,
                                     double* energy,
                                     float* force,
                                     float* virial,
                                     float* atomic_energy,
                                     float* atomic_virial);

extern void DP_DeepPotCompute3(DP_DeepPot* dp,
                               const int nframes,
                               const int natoms,
                               const double* coord,
                               const int* atype,
                               const double* cell,
                               const double* fparam,
                               const double* aparam,
                               const double* charge_spin,
                               double* energy,
                               double* force,
                               double* virial,
                               double* atomic_energy,
                               double* atomic_virial);

extern void DP_DeepPotComputef3(DP_DeepPot* dp,
                                const int nframes,
                                const int natoms,
                                const float* coord,
                                const int* atype,
                                const float* cell,
                                const float* fparam,
                                const float* aparam,
                                const float* charge_spin,
                                double* energy,
                                float* force,
                                float* virial,
                                float* atomic_energy,
                                float* atomic_virial);

extern void DP_DeepPotComputeNList3(DP_DeepPot* dp,
                                    const int nframes,
                                    const int natoms,
                                    const double* coord,
                                    const int* atype,
                                    const double* cell,
                                    const int nghost,
                                    const DP_Nlist* nlist,
                                    const int ago,
                                    const double* fparam,
                                    const double* aparam,
                                    const double* charge_spin,
                                    double* energy,
                                    double* force,
                                    double* virial,
                                    double* atomic_energy,
                                    double* atomic_virial);

extern void DP_DeepPotComputeNListf3(DP_DeepPot* dp,
                                     const int nframes,
                                     const int natoms,
                                     const float* coord,
                                     const int* atype,
                                     const float* cell,
                                     const int nghost,
                                     const DP_Nlist* nlist,
                                     const int ago,
                                     const float* fparam,
                                     const float* aparam,
                                     const float* charge_spin,
                                     double* energy,
                                     float* force,
                                     float* virial,
                                     float* atomic_energy,
                                     float* atomic_virial);

extern void DP_DeepSpinComputeNListf2(DP_DeepSpin* dp,
                                      const int nframes,
                                      const int natoms,
                                      const float* coord,
                                      const float* spin,
                                      const int* atype,
                                      const float* cell,
                                      const int nghost,
                                      const DP_Nlist* nlist,
                                      const int ago,
                                      const float* fparam,
                                      const float* aparam,
                                      double* energy,
                                      float* force,
                                      float* force_mag,
                                      float* virial,
                                      float* atomic_energy,
                                      float* atomic_virial);

extern void DP_DeepSpinCompute3(DP_DeepSpin* dp,
                                const int nframes,
                                const int natoms,
                                const double* coord,
                                const double* spin,
                                const int* atype,
                                const double* cell,
                                const double* fparam,
                                const double* aparam,
                                const double* charge_spin,
                                double* energy,
                                double* force,
                                double* force_mag,
                                double* virial,
                                double* atomic_energy,
                                double* atomic_virial);

extern void DP_DeepSpinComputef3(DP_DeepSpin* dp,
                                 const int nframes,
                                 const int natoms,
                                 const float* coord,
                                 const float* spin,
                                 const int* atype,
                                 const float* cell,
                                 const float* fparam,
                                 const float* aparam,
                                 const float* charge_spin,
                                 double* energy,
                                 float* force,
                                 float* force_mag,
                                 float* virial,
                                 float* atomic_energy,
                                 float* atomic_virial);

extern void DP_DeepSpinComputeNList3(DP_DeepSpin* dp,
                                     const int nframes,
                                     const int natoms,
                                     const double* coord,
                                     const double* spin,
                                     const int* atype,
                                     const double* cell,
                                     const int nghost,
                                     const DP_Nlist* nlist,
                                     const int ago,
                                     const double* fparam,
                                     const double* aparam,
                                     const double* charge_spin,
                                     double* energy,
                                     double* force,
                                     double* force_mag,
                                     double* virial,
                                     double* atomic_energy,
                                     double* atomic_virial);

extern void DP_DeepSpinComputeNListf3(DP_DeepSpin* dp,
                                      const int nframes,
                                      const int natoms,
                                      const float* coord,
                                      const float* spin,
                                      const int* atype,
                                      const float* cell,
                                      const int nghost,
                                      const DP_Nlist* nlist,
                                      const int ago,
                                      const float* fparam,
                                      const float* aparam,
                                      const float* charge_spin,
                                      double* energy,
                                      float* force,
                                      float* force_mag,
                                      float* virial,
                                      float* atomic_energy,
                                      float* atomic_virial);

extern void DP_DeepSpinComputeCanonicalGraphGPU(
    DP_DeepSpin* dp,
    double* d_atom_energy,
    double* d_force,
    double* d_force_mag,
    double* d_atom_virial,
    const int64_t* d_atype,
    const uint32_t* d_source,
    const float* d_edge_vec,
    const int64_t* d_destination_row_ptr,
    const int64_t* d_source_row_ptr,
    const uint32_t* d_source_order,
    const float* d_spin,
    int nloc,
    int nall_nodes,
    int64_t edge_storage);

extern bool DP_DeepSpinUsesCanonicalGraphInference(DP_DeepSpin* dp);

extern bool DP_DeepSpinUsesNativeSpinScheme(DP_DeepSpin* dp);

extern void DP_DeepPotComputeMixedType(DP_DeepPot* dp,
                                       const int nframes,
                                       const int natoms,
                                       const double* coord,
                                       const int* atype,
                                       const double* cell,
                                       const double* fparam,
                                       const double* aparam,
                                       double* energy,
                                       double* force,
                                       double* virial,
                                       double* atomic_energy,
                                       double* atomic_virial);
extern void DP_DeepPotComputeMixedTypef(DP_DeepPot* dp,
                                        const int nframes,
                                        const int natoms,
                                        const float* coord,
                                        const int* atype,
                                        const float* cell,
                                        const float* fparam,
                                        const float* aparam,
                                        double* energy,
                                        float* force,
                                        float* virial,
                                        float* atomic_energy,
                                        float* atomic_virial);

typedef struct DP_DeepPotModelDevi DP_DeepPotModelDevi;

extern DP_DeepPotModelDevi* DP_NewDeepPotModelDevi(const char** c_models,
                                                   int n_models);

extern DP_DeepPotModelDevi* DP_NewDeepPotModelDeviWithParam(
    const char** c_model,
    const int n_models,
    const int gpu_rank,
    const char** c_file_contents,
    const int n_file_contents,
    const int* size_file_contents);

extern void DP_DeleteDeepPotModelDevi(DP_DeepPotModelDevi* dp);

typedef struct DP_DeepSpinModelDevi DP_DeepSpinModelDevi;

extern DP_DeepSpinModelDevi* DP_NewDeepSpinModelDevi(const char** c_models,
                                                     int n_models);

extern DP_DeepSpinModelDevi* DP_NewDeepSpinModelDeviWithParam(
    const char** c_model,
    const int n_models,
    const int gpu_rank,
    const char** c_file_contents,
    const int n_file_contents,
    const int* size_file_contents);

extern void DP_DeleteDeepSpinModelDevi(DP_DeepSpinModelDevi* dp);

// deprecated interface version1
extern void DP_DeepPotModelDeviCompute(DP_DeepPotModelDevi* dp,
                                       const int natom,
                                       const double* coord,
                                       const int* atype,
                                       const double* cell,
                                       double* energy,
                                       double* force,
                                       double* virial,
                                       double* atomic_energy,
                                       double* atomic_virial);

extern void DP_DeepPotModelDeviComputef(DP_DeepPotModelDevi* dp,
                                        const int natom,
                                        const float* coord,
                                        const int* atype,
                                        const float* cell,
                                        double* energy,
                                        float* force,
                                        float* virial,
                                        float* atomic_energy,
                                        float* atomic_virial);

void DP_DeepPotModelDeviCompute2(DP_DeepPotModelDevi* dp,
                                 const int nframes,
                                 const int natoms,
                                 const double* coord,
                                 const int* atype,
                                 const double* cell,
                                 const double* fparam,
                                 const double* aparam,
                                 double* energy,
                                 double* force,
                                 double* virial,
                                 double* atomic_energy,
                                 double* atomic_virial);

void DP_DeepSpinModelDeviCompute2(DP_DeepSpinModelDevi* dp,
                                  const int nframes,
                                  const int natoms,
                                  const double* coord,
                                  const double* spin,
                                  const int* atype,
                                  const double* cell,
                                  const double* fparam,
                                  const double* aparam,
                                  double* energy,
                                  double* force,
                                  double* force_mag,
                                  double* virial,
                                  double* atomic_energy,
                                  double* atomic_virial);
void DP_DeepPotModelDeviComputef2(DP_DeepPotModelDevi* dp,
                                  const int nframes,
                                  const int natoms,
                                  const float* coord,
                                  const int* atype,
                                  const float* cell,
                                  const float* fparam,
                                  const float* aparam,
                                  double* energy,
                                  float* force,
                                  float* virial,
                                  float* atomic_energy,
                                  float* atomic_virial);

void DP_DeepSpinModelDeviComputef2(DP_DeepSpinModelDevi* dp,
                                   const int nframes,
                                   const int natoms,
                                   const float* coord,
                                   const float* spin,
                                   const int* atype,
                                   const float* cell,
                                   const float* fparam,
                                   const float* aparam,
                                   double* energy,
                                   float* force,
                                   float* force_mag,
                                   float* virial,
                                   float* atomic_energy,
                                   float* atomic_virial);

// deprecated interface version1
extern void DP_DeepPotModelDeviComputeNList(DP_DeepPotModelDevi* dp,
                                            const int natom,
                                            const double* coord,
                                            const int* atype,
                                            const double* cell,
                                            const int nghost,
                                            const DP_Nlist* nlist,
                                            const int ago,
                                            double* energy,
                                            double* force,
                                            double* virial,
                                            double* atomic_energy,
                                            double* atomic_virial);

extern void DP_DeepPotModelDeviComputeNListf(DP_DeepPotModelDevi* dp,
                                             const int natom,
                                             const float* coord,
                                             const int* atype,
                                             const float* cell,
                                             const int nghost,
                                             const DP_Nlist* nlist,
                                             const int ago,
                                             double* energy,
                                             float* force,
                                             float* virial,
                                             float* atomic_energy,
                                             float* atomic_virial);

void DP_DeepPotModelDeviComputeNList2(DP_DeepPotModelDevi* dp,
                                      const int nframes,
                                      const int natoms,
                                      const double* coord,
                                      const int* atype,
                                      const double* cell,
                                      const int nghost,
                                      const DP_Nlist* nlist,
                                      const int ago,
                                      const double* fparam,
                                      const double* aparam,
                                      double* energy,
                                      double* force,
                                      double* virial,
                                      double* atomic_energy,
                                      double* atomic_virial);

void DP_DeepSpinModelDeviComputeNList2(DP_DeepSpinModelDevi* dp,
                                       const int nframes,
                                       const int natoms,
                                       const double* coord,
                                       const double* spin,
                                       const int* atype,
                                       const double* cell,
                                       const int nghost,
                                       const DP_Nlist* nlist,
                                       const int ago,
                                       const double* fparam,
                                       const double* aparam,
                                       double* energy,
                                       double* force,
                                       double* force_mag,
                                       double* virial,
                                       double* atomic_energy,
                                       double* atomic_virial);

void DP_DeepPotModelDeviComputeNListf2(DP_DeepPotModelDevi* dp,
                                       const int nframes,
                                       const int natoms,
                                       const float* coord,
                                       const int* atype,
                                       const float* cell,
                                       const int nghost,
                                       const DP_Nlist* nlist,
                                       const int ago,
                                       const float* fparam,
                                       const float* aparam,
                                       double* energy,
                                       float* force,
                                       float* virial,
                                       float* atomic_energy,
                                       float* atomic_virial);

void DP_DeepPotModelDeviCompute3(DP_DeepPotModelDevi* dp,
                                 const int nframes,
                                 const int natoms,
                                 const double* coord,
                                 const int* atype,
                                 const double* cell,
                                 const double* fparam,
                                 const double* aparam,
                                 const double* charge_spin,
                                 double* energy,
                                 double* force,
                                 double* virial,
                                 double* atomic_energy,
                                 double* atomic_virial);

void DP_DeepPotModelDeviComputef3(DP_DeepPotModelDevi* dp,
                                  const int nframes,
                                  const int natoms,
                                  const float* coord,
                                  const int* atype,
                                  const float* cell,
                                  const float* fparam,
                                  const float* aparam,
                                  const float* charge_spin,
                                  double* energy,
                                  float* force,
                                  float* virial,
                                  float* atomic_energy,
                                  float* atomic_virial);

void DP_DeepPotModelDeviComputeNList3(DP_DeepPotModelDevi* dp,
                                      const int nframes,
                                      const int natoms,
                                      const double* coord,
                                      const int* atype,
                                      const double* cell,
                                      const int nghost,
                                      const DP_Nlist* nlist,
                                      const int ago,
                                      const double* fparam,
                                      const double* aparam,
                                      const double* charge_spin,
                                      double* energy,
                                      double* force,
                                      double* virial,
                                      double* atomic_energy,
                                      double* atomic_virial);

void DP_DeepPotModelDeviComputeNListf3(DP_DeepPotModelDevi* dp,
                                       const int nframes,
                                       const int natoms,
                                       const float* coord,
                                       const int* atype,
                                       const float* cell,
                                       const int nghost,
                                       const DP_Nlist* nlist,
                                       const int ago,
                                       const float* fparam,
                                       const float* aparam,
                                       const float* charge_spin,
                                       double* energy,
                                       float* force,
                                       float* virial,
                                       float* atomic_energy,
                                       float* atomic_virial);

void DP_DeepSpinModelDeviComputeNListf2(DP_DeepSpinModelDevi* dp,
                                        const int nframes,
                                        const int natoms,
                                        const float* coord,
                                        const float* spin,
                                        const int* atype,
                                        const float* cell,
                                        const int nghost,
                                        const DP_Nlist* nlist,
                                        const int ago,
                                        const float* fparam,
                                        const float* aparam,
                                        double* energy,
                                        float* force,
                                        float* force_mag,
                                        float* virial,
                                        float* atomic_energy,
                                        float* atomic_virial);

void DP_DeepSpinModelDeviCompute3(DP_DeepSpinModelDevi* dp,
                                  const int nframes,
                                  const int natoms,
                                  const double* coord,
                                  const double* spin,
                                  const int* atype,
                                  const double* cell,
                                  const double* fparam,
                                  const double* aparam,
                                  const double* charge_spin,
                                  double* energy,
                                  double* force,
                                  double* force_mag,
                                  double* virial,
                                  double* atomic_energy,
                                  double* atomic_virial);

void DP_DeepSpinModelDeviComputef3(DP_DeepSpinModelDevi* dp,
                                   const int nframes,
                                   const int natoms,
                                   const float* coord,
                                   const float* spin,
                                   const int* atype,
                                   const float* cell,
                                   const float* fparam,
                                   const float* aparam,
                                   const float* charge_spin,
                                   double* energy,
                                   float* force,
                                   float* force_mag,
                                   float* virial,
                                   float* atomic_energy,
                                   float* atomic_virial);

void DP_DeepSpinModelDeviComputeNList3(DP_DeepSpinModelDevi* dp,
                                       const int nframes,
                                       const int natoms,
                                       const double* coord,
                                       const double* spin,
                                       const int* atype,
                                       const double* cell,
                                       const int nghost,
                                       const DP_Nlist* nlist,
                                       const int ago,
                                       const double* fparam,
                                       const double* aparam,
                                       const double* charge_spin,
                                       double* energy,
                                       double* force,
                                       double* force_mag,
                                       double* virial,
                                       double* atomic_energy,
                                       double* atomic_virial);

void DP_DeepSpinModelDeviComputeNListf3(DP_DeepSpinModelDevi* dp,
                                        const int nframes,
                                        const int natoms,
                                        const float* coord,
                                        const float* spin,
                                        const int* atype,
                                        const float* cell,
                                        const int nghost,
                                        const DP_Nlist* nlist,
                                        const int ago,
                                        const float* fparam,
                                        const float* aparam,
                                        const float* charge_spin,
                                        double* energy,
                                        float* force,
                                        float* force_mag,
                                        float* virial,
                                        float* atomic_energy,
                                        float* atomic_virial);

// Deep Base Model methods
double DP_DeepBaseModelGetCutoff(DP_DeepBaseModel* dpbase);

int DP_DeepBaseModelGetNumbTypes(DP_DeepBaseModel* dpbase);

int DP_DeepBaseModelGetNumbTypesSpin(DP_DeepBaseModel* dpbase);

int DP_DeepBaseModelGetDimFParam(DP_DeepBaseModel* dpbase);

int DP_DeepBaseModelGetDimAParam(DP_DeepBaseModel* dpbase);

bool DP_DeepBaseModelIsAParamNAll(DP_DeepBaseModel* dpbase);

bool DP_DeepBaseModelHasDefaultFParam(DP_DeepBaseModel* dpbase);

const char* DP_DeepBaseModelGetTypeMap(DP_DeepBaseModel* dpbase);

const char* DP_DeepBaseModelCheckOK(DP_DeepBaseModel* dpbase);

int DP_DeepBaseModelDeviGetDimFParam(DP_DeepBaseModelDevi* dpbase);
int DP_DeepBaseModelDeviGetDimAParam(DP_DeepBaseModelDevi* dpbase);

bool DP_DeepBaseModelDeviIsAParamNAll(DP_DeepBaseModelDevi* dpbase);

bool DP_DeepBaseModelDeviHasDefaultFParam(DP_DeepBaseModelDevi* dpbase);

double DP_DeepBaseModelDeviGetCutoff(DP_DeepBaseModelDevi* dpbase);

int DP_DeepBaseModelDeviGetNumbTypes(DP_DeepBaseModelDevi* dpbase);

int DP_DeepBaseModelDeviGetNumbTypesSpin(DP_DeepBaseModelDevi* dpbase);

const char* DP_DeepBaseModelDeviCheckOK(DP_DeepBaseModelDevi* dpbase);

// DeepPot methods for c_api
double DP_DeepPotGetCutoff(DP_DeepPot* dp);

int DP_DeepPotGetNumbTypes(DP_DeepPot* dp);

int DP_DeepPotGetNumbTypesSpin(DP_DeepPot* dp);

int DP_DeepPotGetDimFParam(DP_DeepPot* dp);

int DP_DeepPotGetDimAParam(DP_DeepPot* dp);

int DP_DeepPotGetDimChgSpin(DP_DeepPot* dp);

extern void DP_DeepPotSetChargeSpin(DP_DeepPot* dp,
                                    const double* charge_spin,
                                    const int numb_chg_spin);

bool DP_DeepPotIsAParamNAll(DP_DeepPot* dp);

bool DP_DeepPotHasDefaultFParam(DP_DeepPot* dp);

const char* DP_DeepPotGetTypeMap(DP_DeepPot* dp);

const char* DP_DeepPotCheckOK(DP_DeepPot* dp);

int DP_DeepPotModelDeviGetDimFParam(DP_DeepPotModelDevi* dp);
int DP_DeepPotModelDeviGetDimAParam(DP_DeepPotModelDevi* dp);

int DP_DeepPotModelDeviGetDimChgSpin(DP_DeepPotModelDevi* dp);

extern void DP_DeepPotModelDeviSetChargeSpin(DP_DeepPotModelDevi* dp,
                                             const double* charge_spin,
                                             const int numb_chg_spin);

bool DP_DeepPotModelDeviIsAParamNAll(DP_DeepPotModelDevi* dp);

bool DP_DeepPotModelDeviHasDefaultFParam(DP_DeepPotModelDevi* dp);

double DP_DeepPotModelDeviGetCutoff(DP_DeepPotModelDevi* dp);

int DP_DeepPotModelDeviGetNumbTypes(DP_DeepPotModelDevi* dp);

int DP_DeepPotModelDeviGetNumbTypesSpin(DP_DeepPotModelDevi* dp);

const char* DP_DeepPotModelDeviCheckOK(DP_DeepPotModelDevi* dp);

// DeepSpin methods for c_api
double DP_DeepSpinGetCutoff(DP_DeepSpin* dp);

int DP_DeepSpinGetNumbTypes(DP_DeepSpin* dp);

int DP_DeepSpinGetNumbTypesSpin(DP_DeepSpin* dp);

int DP_DeepSpinGetDimFParam(DP_DeepSpin* dp);

int DP_DeepSpinGetDimAParam(DP_DeepSpin* dp);

int DP_DeepSpinGetDimChgSpin(DP_DeepSpin* dp);

extern void DP_DeepSpinSetChargeSpin(DP_DeepSpin* dp,
                                     const double* charge_spin,
                                     const int numb_chg_spin);

bool DP_DeepSpinIsAParamNAll(DP_DeepSpin* dp);

bool DP_DeepSpinHasDefaultFParam(DP_DeepSpin* dp);

const char* DP_DeepSpinGetTypeMap(DP_DeepSpin* dp);

const char* DP_DeepSpinCheckOK(DP_DeepSpin* dp);

int DP_DeepSpinModelDeviGetDimFParam(DP_DeepSpinModelDevi* dp);
int DP_DeepSpinModelDeviGetDimAParam(DP_DeepSpinModelDevi* dp);

int DP_DeepSpinModelDeviGetDimChgSpin(DP_DeepSpinModelDevi* dp);

extern void DP_DeepSpinModelDeviSetChargeSpin(DP_DeepSpinModelDevi* dp,
                                              const double* charge_spin,
                                              const int numb_chg_spin);

bool DP_DeepSpinModelDeviIsAParamNAll(DP_DeepSpinModelDevi* dp);

bool DP_DeepSpinModelDeviHasDefaultFParam(DP_DeepSpinModelDevi* dp);

double DP_DeepSpinModelDeviGetCutoff(DP_DeepSpinModelDevi* dp);

int DP_DeepSpinModelDeviGetNumbTypes(DP_DeepSpinModelDevi* dp);

int DP_DeepSpinModelDeviGetNumbTypesSpin(DP_DeepSpinModelDevi* dp);

const char* DP_DeepSpinModelDeviCheckOK(DP_DeepSpinModelDevi* dp);

typedef struct DP_DeepTensor DP_DeepTensor;

extern DP_DeepTensor* DP_NewDeepTensor(const char* c_model);

extern DP_DeepTensor* DP_NewDeepTensorWithParam(const char* c_model,
                                                const int gpu_rank,
                                                const char* c_name_scope);

extern void DP_DeleteDeepTensor(DP_DeepTensor* dt);

extern void DP_DeepTensorComputeTensor(DP_DeepTensor* dt,
                                       const int natom,
                                       const double* coord,
                                       const int* atype,
                                       const double* cell,
                                       double** tensor,
                                       int* size);

extern void DP_DeepTensorComputeTensorf(DP_DeepTensor* dt,
                                        const int natom,
                                        const float* coord,
                                        const int* atype,
                                        const float* cell,
                                        float** tensor,
                                        int* size);

extern void DP_DeepTensorComputeTensorNList(DP_DeepTensor* dt,
                                            const int natom,
                                            const double* coord,
                                            const int* atype,
                                            const double* cell,
                                            const int nghost,
                                            const DP_Nlist* nlist,
                                            double** tensor,
                                            int* size);

extern void DP_DeepTensorComputeTensorNListf(DP_DeepTensor* dt,
                                             const int natom,
                                             const float* coord,
                                             const int* atype,
                                             const float* cell,
                                             const int nghost,
                                             const DP_Nlist* nlist,
                                             float** tensor,
                                             int* size);

extern void DP_DeepTensorCompute(DP_DeepTensor* dt,
                                 const int natom,
                                 const double* coord,
                                 const int* atype,
                                 const double* cell,
                                 double* global_tensor,
                                 double* force,
                                 double* virial,
                                 double** atomic_tensor,
                                 double* atomic_virial,
                                 int* size_at);

extern void DP_DeepTensorComputef(DP_DeepTensor* dt,
                                  const int natom,
                                  const float* coord,
                                  const int* atype,
                                  const float* cell,
                                  float* global_tensor,
                                  float* force,
                                  float* virial,
                                  float** atomic_tensor,
                                  float* atomic_virial,
                                  int* size_at);

extern void DP_DeepTensorComputeNList(DP_DeepTensor* dt,
                                      const int natom,
                                      const double* coord,
                                      const int* atype,
                                      const double* cell,
                                      const int nghost,
                                      const DP_Nlist* nlist,
                                      double* global_tensor,
                                      double* force,
                                      double* virial,
                                      double** atomic_tensor,
                                      double* atomic_virial,
                                      int* size_at);

extern void DP_DeepTensorComputeNListf(DP_DeepTensor* dt,
                                       const int natom,
                                       const float* coord,
                                       const int* atype,
                                       const float* cell,
                                       const int nghost,
                                       const DP_Nlist* nlist,
                                       float* global_tensor,
                                       float* force,
                                       float* virial,
                                       float** atomic_tensor,
                                       float* atomic_virial,
                                       int* size_at);

double DP_DeepTensorGetCutoff(DP_DeepTensor* dt);

int DP_DeepTensorGetNumbTypes(DP_DeepTensor* dt);

int DP_DeepTensorGetOutputDim(DP_DeepTensor* dt);

int* DP_DeepTensorGetSelTypes(DP_DeepTensor* dt);

int DP_DeepTensorGetNumbSelTypes(DP_DeepTensor* dt);

const char* DP_DeepTensorGetTypeMap(DP_DeepTensor* dt);

const char* DP_DeepTensorCheckOK(DP_DeepTensor* dt);

typedef struct DP_DipoleChargeModifier DP_DipoleChargeModifier;

extern DP_DipoleChargeModifier* DP_NewDipoleChargeModifier(const char* c_model);

extern DP_DipoleChargeModifier* DP_NewDipoleChargeModifierWithParam(
    const char* c_model, const int gpu_rank, const char* c_name_scope);

extern void DP_DeleteDipoleChargeModifier(DP_DipoleChargeModifier* dcm);

extern void DP_DipoleChargeModifierComputeNList(DP_DipoleChargeModifier* dcm,
                                                const int natom,
                                                const double* coord,
                                                const int* atype,
                                                const double* cell,
                                                const int* pairs,
                                                const int npairs,
                                                const double* delef_,
                                                const int nghost,
                                                const DP_Nlist* nlist,
                                                double* dfcorr_,
                                                double* dvcorr_);

extern void DP_DipoleChargeModifierComputeNListf(DP_DipoleChargeModifier* dcm,
                                                 const int natom,
                                                 const float* coord,
                                                 const int* atype,
                                                 const float* cell,
                                                 const int* pairs,
                                                 const int npairs,
                                                 const float* delef_,
                                                 const int nghost,
                                                 const DP_Nlist* nlist,
                                                 float* dfcorr_,
                                                 float* dvcorr_);

double DP_DipoleChargeModifierGetCutoff(DP_DipoleChargeModifier* dt);

int DP_DipoleChargeModifierGetNumbTypes(DP_DipoleChargeModifier* dt);

int* DP_DipoleChargeModifierGetSelTypes(DP_DipoleChargeModifier* dt);

int DP_DipoleChargeModifierGetNumbSelTypes(DP_DipoleChargeModifier* dt);

const char* DP_DipoleChargeModifierCheckOK(DP_DipoleChargeModifier* dcm);

extern void DP_ConvertPbtxtToPb(const char* c_pbtxt, const char* c_pb);

extern void DP_PrintSummary(const char* c_pre);

const char* DP_ReadFileToChar(const char* c_model);

const char* DP_ReadFileToChar2(const char* c_model, int* size);

void DP_SelectByType(const int natoms,
                     const int* atype,
                     const int nghost,
                     const int nsel_type,
                     const int* sel_type,
                     int* fwd_map,
                     int* nreal,
                     int* bkw_map,
                     int* nghost_real);

void DP_SelectMapInt(const int* in,
                     const int* fwd_map,
                     const int stride,
                     const int nall1,
                     const int nall2,
                     int* out);

void DP_DeleteChar(const char* c_str);

#ifdef __cplusplus
} /* end extern "C" */
#endif