From fc0efd43fcedc608900f85d7f614ee896fa021cd Mon Sep 17 00:00:00 2001 From: Matt Bettencourt Date: Mon, 13 Feb 2023 17:07:32 +0100 Subject: [PATCH] added kokkos functinos to the list of functions registered for ML-IAP --- src/PYTHON/python_impl.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index 9177381a35..57f8ea1cf0 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -35,6 +35,17 @@ // However, that exposes -too many- headers. #include "mliap_model_python_couple.h" #include "mliap_unified_couple.h" +#ifdef LMP_KOKKOS +#include "mliap_model_python_kokkos.h" +#include "mliap_unified_kokkos.h" +// The above should somehow really be included in the next file. +// We could get around this with cython --capi-reexport-cincludes +// However, that exposes -too many- headers. +#include "mliap_model_python_couple_kokkos.h" +#include "mliap_unified_couple_kokkos.h" + + +#endif #endif using namespace LAMMPS_NS; @@ -71,6 +82,16 @@ PythonImpl::PythonImpl(LAMMPS *lmp) : Pointers(lmp) err = PyImport_AppendInittab("mliap_unified_couple", PyInit_mliap_unified_couple); if (err) error->all(FLERR, "Could not register MLIAPPY unified embedded python module."); +#ifdef LMP_KOKKOS + // Inform python intialization scheme of the mliappy module. + // This -must- happen before python is initialized. + err = PyImport_AppendInittab("mliap_model_python_couple_kokkos", PyInit_mliap_model_python_couple_kokkos); + if (err) error->all(FLERR, "Could not register MLIAPPY embedded python module."); + + err = PyImport_AppendInittab("mliap_unified_couple_kokkos", PyInit_mliap_unified_couple_kokkos); + if (err) error->all(FLERR, "Could not register MLIAPPY unified embedded python module."); + +#endif #endif Py_Initialize();