From 17c89c2df14f50daf54f3b9c7acc9c918cd7a95c Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Fri, 19 Sep 2025 16:26:46 -0700 Subject: [PATCH 01/26] pick changes to sundials C/C++ interface or other core sundials --- .../cvode/kokkos/cv_bruss_batched_kokkos.cpp | 4 +- .../kokkos/cv_bruss_batched_kokkos_2D.cpp | 4 +- include/arkode/arkode.h | 4 +- include/arkode/arkode.hpp | 76 ++++ include/arkode/arkode_arkstep.h | 342 +--------------- include/arkode/arkode_arkstep_deprecated.h | 371 ++++++++++++++++++ include/arkode/arkode_butcher.h | 16 +- include/arkode/arkode_erkstep.h | 181 +-------- include/arkode/arkode_erkstep_deprecated.h | 204 ++++++++++ include/arkode/arkode_mristep.h | 213 +--------- include/arkode/arkode_mristep.hpp | 77 ++++ include/arkode/arkode_mristep_deprecated.h | 218 ++++++++++ include/arkode/arkode_splittingstep.h | 19 +- include/arkode/arkode_sprk.h | 8 +- include/arkode/arkode_sprk.hpp | 52 +++ include/arkode/arkode_sprkstep.h | 70 +--- include/arkode/arkode_sprkstep_deprecated.h | 97 +++++ include/cvode/cvode.h | 8 +- include/cvode/cvode.hpp | 54 +++ include/cvodes/cvodes.h | 79 ++-- include/cvodes/cvodes.hpp | 54 +++ include/cvodes/cvodes_ls.h | 20 +- include/ida/ida.h | 4 +- include/ida/ida.hpp | 54 +++ include/idas/idas.h | 73 ++-- include/idas/idas.hpp | 54 +++ include/idas/idas_ls.h | 14 +- include/kinsol/kinsol.h | 11 +- include/kinsol/kinsol.hpp | 54 +++ include/kinsol/kinsol_ls.h | 2 +- include/nvector/nvector_kokkos.hpp | 6 +- .../sunadaptcontroller_mrihtol.h | 2 - include/sundials/sundials_adaptcontroller.hpp | 53 +++ .../sundials_adjointcheckpointscheme.h | 2 +- .../sundials_adjointcheckpointscheme.hpp | 52 +++ include/sundials/sundials_adjointstepper.hpp | 54 +++ include/sundials/sundials_base.hpp | 37 +- include/sundials/sundials_context.hpp | 19 +- include/sundials/sundials_convertibleto.hpp | 4 +- include/sundials/sundials_domeigestimator.h | 1 + include/sundials/sundials_domeigestimator.hpp | 56 +++ include/sundials/sundials_errors.h | 2 +- include/sundials/sundials_futils.h | 19 +- include/sundials/sundials_iterative.h | 30 +- include/sundials/sundials_linearsolver.hpp | 16 +- include/sundials/sundials_logger.hpp | 79 ++++ include/sundials/sundials_matrix.hpp | 15 +- include/sundials/sundials_memory.h | 20 +- include/sundials/sundials_memory.hpp | 16 +- include/sundials/sundials_nonlinearsolver.hpp | 17 +- include/sundials/sundials_nvector.h | 120 +++--- include/sundials/sundials_nvector.hpp | 18 +- .../sundials/sundials_nvector_senswrapper.h | 2 +- include/sundials/sundials_profiler.hpp | 51 +++ include/sundials/sundials_stepper.h | 4 +- include/sundials/sundials_stepper.hpp | 62 +++ include/sundials/sundials_types.h | 62 ++- include/sunlinsol/sunlinsol_ginkgo.hpp | 4 +- include/sunlinsol/sunlinsol_kokkosdense.hpp | 4 +- include/sunmatrix/sunmatrix_band.h | 6 +- include/sunmatrix/sunmatrix_dense.h | 6 +- include/sunmatrix/sunmatrix_ginkgo.hpp | 6 +- include/sunmatrix/sunmatrix_kokkosdense.hpp | 6 +- include/sunmatrix/sunmatrix_sparse.h | 6 +- src/arkode/arkode.c | 23 +- src/arkode/arkode_impl.h | 33 +- src/arkode/arkode_io.c | 23 ++ src/arkode/arkode_mristep.c | 3 + src/arkode/arkode_mristep_impl.h | 1 + src/arkode/arkode_sprk.c | 4 +- src/cvode/cvode.c | 3 + src/cvode/cvode_impl.h | 5 +- src/cvode/cvode_io.c | 23 ++ src/cvodes/cvodea.c | 3 +- src/cvodes/cvodea_io.c | 86 ++++ src/cvodes/cvodes.c | 3 + src/cvodes/cvodes_impl.h | 6 +- src/cvodes/cvodes_io.c | 23 ++ src/ida/ida.c | 3 + src/ida/ida_impl.h | 5 +- src/ida/ida_io.c | 19 + src/idas/idaa_io.c | 47 +++ src/idas/idas.c | 3 + src/idas/idas_impl.h | 5 +- src/idas/idas_io.c | 19 + src/kinsol/kinsol.c | 3 + src/kinsol/kinsol_impl.h | 7 +- src/kinsol/kinsol_io.c | 22 ++ src/sundials/CMakeLists.txt | 5 + src/sundials/sundials_domeigestimator.c | 4 + src/sundials/sundials_futils.c | 13 +- src/sundials/sundials_nvector.c | 4 +- src/sundials/sundials_profiler.c | 67 +--- src/sundials/sundials_profiler_impl.h | 93 +++++ src/sundials/sundials_stepper.c | 2 + src/sundials/sundials_stepper_impl.h | 3 + .../ginkgo/test_sunlinsol_ginkgo.cpp | 20 +- tools/log_example_mri.py | 70 +--- tools/suntools/logs.py | 154 +++----- 99 files changed, 2786 insertions(+), 1315 deletions(-) create mode 100644 include/arkode/arkode.hpp create mode 100644 include/arkode/arkode_arkstep_deprecated.h create mode 100644 include/arkode/arkode_erkstep_deprecated.h create mode 100644 include/arkode/arkode_mristep.hpp create mode 100644 include/arkode/arkode_mristep_deprecated.h create mode 100644 include/arkode/arkode_sprk.hpp create mode 100644 include/arkode/arkode_sprkstep_deprecated.h create mode 100644 include/cvode/cvode.hpp create mode 100644 include/cvodes/cvodes.hpp create mode 100644 include/ida/ida.hpp create mode 100644 include/idas/idas.hpp create mode 100644 include/kinsol/kinsol.hpp create mode 100644 include/sundials/sundials_adaptcontroller.hpp create mode 100644 include/sundials/sundials_adjointcheckpointscheme.hpp create mode 100644 include/sundials/sundials_adjointstepper.hpp create mode 100644 include/sundials/sundials_domeigestimator.hpp create mode 100644 include/sundials/sundials_logger.hpp create mode 100644 include/sundials/sundials_stepper.hpp create mode 100644 src/sundials/sundials_profiler_impl.h diff --git a/examples/cvode/kokkos/cv_bruss_batched_kokkos.cpp b/examples/cvode/kokkos/cv_bruss_batched_kokkos.cpp index 316851a6d0..88a7f18df5 100644 --- a/examples/cvode/kokkos/cv_bruss_batched_kokkos.cpp +++ b/examples/cvode/kokkos/cv_bruss_batched_kokkos.cpp @@ -243,7 +243,7 @@ int main(int argc, char* argv[]) LS = std::make_unique(sunctx); // Attach the matrix and linear solver to CVODE - retval = CVodeSetLinearSolver(cvode_mem, LS->Convert(), A->Convert()); + retval = CVodeSetLinearSolver(cvode_mem, LS->get(), A->get()); if (check_flag(retval, "CVodeSetLinearSolver")) { return 1; } // Set the user-supplied Jacobian function @@ -257,7 +257,7 @@ int main(int argc, char* argv[]) SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, sunctx)); // Attach the linear solver to CVODE - retval = CVodeSetLinearSolver(cvode_mem, LS->Convert(), nullptr); + retval = CVodeSetLinearSolver(cvode_mem, LS->get(), nullptr); if (check_flag(retval, "CVodeSetLinearSolver")) { return 1; } } diff --git a/examples/cvode/kokkos/cv_bruss_batched_kokkos_2D.cpp b/examples/cvode/kokkos/cv_bruss_batched_kokkos_2D.cpp index 7507e8f15b..1432efab39 100644 --- a/examples/cvode/kokkos/cv_bruss_batched_kokkos_2D.cpp +++ b/examples/cvode/kokkos/cv_bruss_batched_kokkos_2D.cpp @@ -255,7 +255,7 @@ int main(int argc, char* argv[]) LS = std::make_unique(sunctx); // Attach the matrix and linear solver to CVODE - retval = CVodeSetLinearSolver(cvode_mem, LS->Convert(), A->Convert()); + retval = CVodeSetLinearSolver(cvode_mem, LS->get(), A->get()); if (check_flag(retval, "CVodeSetLinearSolver")) { return 1; } // Set the user-supplied Jacobian function @@ -269,7 +269,7 @@ int main(int argc, char* argv[]) SUNLinSol_SPGMR(y, SUN_PREC_NONE, 0, sunctx)); // Attach the linear solver to CVODE - retval = CVodeSetLinearSolver(cvode_mem, LS->Convert(), nullptr); + retval = CVodeSetLinearSolver(cvode_mem, LS->get(), nullptr); if (check_flag(retval, "CVodeSetLinearSolver")) { return 1; } } diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index 046c52f336..54475f2500 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -163,7 +163,7 @@ extern "C" { typedef int (*ARKRhsFn)(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); -typedef int (*ARKRootFn)(sunrealtype t, N_Vector y, sunrealtype* gout, +typedef int (*ARKRootFn)(sunrealtype t, N_Vector y, sunrealtype1d gout, void* user_data); typedef int (*ARKEwtFn)(N_Vector y, N_Vector ewt, void* user_data); @@ -265,6 +265,8 @@ SUNDIALS_EXPORT int ARKodeClearStopTime(void* arkode_mem); SUNDIALS_EXPORT int ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed); SUNDIALS_EXPORT int ARKodeSetStepDirection(void* arkode_mem, sunrealtype stepdir); SUNDIALS_EXPORT int ARKodeSetUserData(void* arkode_mem, void* user_data); +SUNDIALS_EXPORT int ARKodeSetOwnUserData(void* ark_mem, + sunbooleantype own_user_data); SUNDIALS_EXPORT int ARKodeSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); SUNDIALS_EXPORT int ARKodeSetPostprocessStageFn(void* arkode_mem, diff --git a/include/arkode/arkode.hpp b/include/arkode/arkode.hpp new file mode 100644 index 0000000000..1f11e5d1ee --- /dev/null +++ b/include/arkode/arkode.hpp @@ -0,0 +1,76 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ specific ARKODE definitions. + * ---------------------------------------------------------------------------*/ + +#ifndef _SUNDIALS_ARKODE_HPP +#define _SUNDIALS_ARKODE_HPP + +#include +#include + +namespace sundials { +namespace experimental { + +struct ARKodeDeleter +{ + void operator()(void* v) + { + if (v) { ARKodeFree(&v); } + } +}; + +class ARKodeView : public ClassView +{ +public: + using ClassView::ClassView; + template + static ARKodeView Create(Args&&... args); +}; + +template +ARKodeView ARKodeView::Create(Args&&... args) +{ + return ARKodeView(std::forward(args)...); +} + +struct ARKodeButcherTableDeleter +{ + void operator()(ARKodeButcherTable t) + { + if (t) { ARKodeButcherTable_Free(t); } + } +}; + +class ARKodeButcherTableView + : public ClassView +{ +public: + using ClassView::ClassView; + template + static ARKodeButcherTableView Create(Args&&... args); +}; + +template +ARKodeButcherTableView ARKodeButcherTableView::Create(Args&&... args) +{ + ARKodeButcherTable table = + ARKodeButcherTable_Create(std::forward(args)...); + return ARKodeButcherTableView(table); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/arkode/arkode_arkstep.h b/include/arkode/arkode_arkstep.h index 8500723cff..33723f1e26 100644 --- a/include/arkode/arkode_arkstep.h +++ b/include/arkode/arkode_arkstep.h @@ -18,6 +18,7 @@ #define _ARKSTEP_H #include +#include #include #include #include @@ -100,312 +101,6 @@ SUNDIALS_EXPORT int ARKStepGetTimestepperStats( long int* step_attempts, long int* nfe_evals, long int* nfi_evals, long int* nlinsetups, long int* netfails); -/* -------------------------------------------------------------------------- - * Deprecated Functions -- all are superseded by shared ARKODE-level routines - * -------------------------------------------------------------------------- */ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeCreateMRIStepInnerStepper instead") -int ARKStepCreateMRIStepInnerStepper(void* arkode_mem, - MRIStepInnerStepper* stepper); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") -int ARKStepResize(void* arkode_mem, N_Vector ynew, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") -int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") -int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") -int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") -int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResStolerance instead") -int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResVtolerance instead") -int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResFtolerance instead") -int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolver instead") -int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassLinearSolver instead") -int ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, - SUNMatrix M, sunbooleantype time_dep); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") -int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") -int ARKStepSetDefaults(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("adjust parameters individually instead") -int ARKStepSetOptimalParams(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") -int ARKStepSetOrder(void* arkode_mem, int maxord); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") -int ARKStepSetInterpolantType(void* arkode_mem, int itype); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") -int ARKStepSetInterpolantDegree(void* arkode_mem, int degree); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") -int ARKStepSetDenseOrder(void* arkode_mem, int dord); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinearSolver instead") -int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNlsRhsFn instead") -int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinear instead") -int ARKStepSetLinear(void* arkode_mem, int timedepend); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinear instead") -int ARKStepSetNonlinear(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeduceImplicitRhs instead") -int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptController instead") -int ARKStepSetAdaptController(void* arkode_mem, SUNAdaptController C); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptivityAdjustment instead") -int ARKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetCFLFraction instead") -int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSafetyFactor instead") -int ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") -int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxGrowth instead") -int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinReduction instead") -int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStepBounds instead") -int ARKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") -int ARKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, - int pq, sunrealtype adapt_params[3]); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") -int ARKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxFirstGrowth instead") -int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxEFailGrowth instead") -int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSmallNumEFails instead") -int ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxCFailGrowth instead") -int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinCRDown instead") -int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinRDiv instead") -int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeltaGammaMax instead") -int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSetupFrequency instead") -int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPredictorMethod instead") -int ARKStepSetPredictorMethod(void* arkode_mem, int method); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStabilityFn instead") -int ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxErrTestFails instead") -int ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNonlinIters instead") -int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxConvFails instead") -int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinConvCoef instead") -int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetConstraints instead") -int ARKStepSetConstraints(void* arkode_mem, N_Vector constraints); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") -int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") -int ARKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInitStep instead") -int ARKStepSetInitStep(void* arkode_mem, sunrealtype hin); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinStep instead") -int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxStep instead") -int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") -int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") -int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") -int ARKStepClearStopTime(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") -int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumConstrFails instead") -int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") -int ARKStepSetRootDirection(void* arkode_mem, int* rootdir); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") -int ARKStepSetNoInactiveRootWarn(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") -int ARKStepSetUserData(void* arkode_mem, void* user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") -int ARKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") -int ARKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStagePredictFn instead") -int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacFn instead") -int ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassFn instead") -int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacEvalFrequency instead") -int ARKStepSetJacEvalFrequency(void* arkode_mem, long int msbj); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolutionScaling instead") -int ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetEpsLin instead") -int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassEpsLin instead") -int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSNormFactor instead") -int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassLSNormFactor instead") -int ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPreconditioner instead") -int ARKStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, - ARKLsPrecSolveFn psolve); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassPreconditioner instead") -int ARKStepSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, - ARKLsMassPrecSolveFn psolve); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimes instead") -int ARKStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, - ARKLsJacTimesVecFn jtimes); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimesRhsFn instead") -int ARKStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassTimes instead") -int ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn msetup, - ARKLsMassTimesVecFn mtimes, void* mtimes_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinSysFn instead") -int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") -int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") -int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeComputeState instead") -int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumExpSteps instead") -int ARKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumAccSteps instead") -int ARKStepGetNumAccSteps(void* arkode_mem, long int* accsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") -int ARKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinSolvSetups instead") -int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumErrTestFails instead") -int ARKStepGetNumErrTestFails(void* arkode_mem, long int* netfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetEstLocalErrors instead") -int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); -SUNDIALS_DEPRECATED_EXPORT_MSG( - "Work space functions will be removed in version 8.0.0") -int ARKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") -int ARKStepGetNumSteps(void* arkode_mem, long int* nsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetActualInitStep instead") -int ARKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") -int ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentStep instead") -int ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") -int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentState instead") -int ARKStepGetCurrentState(void* arkode_mem, N_Vector* state); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentGamma instead") -int ARKStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentMassMatrix instead") -int ARKStepGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetTolScaleFactor instead") -int ARKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetErrWeights instead") -int ARKStepGetErrWeights(void* arkode_mem, N_Vector eweight); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetResWeights instead") -int ARKStepGetResWeights(void* arkode_mem, N_Vector rweight); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumGEvals instead") -int ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") -int ARKStepGetRootInfo(void* arkode_mem, int* rootsfound); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumConstrFails instead") -int ARKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") -int ARKStepGetUserData(void* arkode_mem, void** user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") -int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") -char* ARKStepGetReturnFlagName(long int flag); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") -int ARKStepWriteParameters(void* arkode_mem, FILE* fp); -SUNDIALS_DEPRECATED_EXPORT_MSG( - "use ARKStepGetCurrentButcherTables and ARKodeButcherTable_Write instead") -int ARKStepWriteButcher(void* arkode_mem, FILE* fp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") -int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, - sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinearSystemData instead") -int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, - N_Vector* zpred, N_Vector* z, N_Vector* Fi, - sunrealtype* gamma, N_Vector* sdata, - void** user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvIters instead") -int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvConvFails instead") -int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinSolvStats instead") -int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, - long int* nnfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepSolveFails instead") -int ARKStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJac instead") -int ARKStepGetJac(void* arkode_mem, SUNMatrix* J); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacTime instead") -int ARKStepGetJacTime(void* arkode_mem, sunrealtype* t_J); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacNumSteps instead") -int ARKStepGetJacNumSteps(void* arkode_mem, long int* nst_J); -SUNDIALS_DEPRECATED_EXPORT_MSG( - "Work space functions will be removed in version 8.0.0") -int ARKStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, - long int* leniwLS); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJacEvals instead") -int ARKStepGetNumJacEvals(void* arkode_mem, long int* njevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecEvals instead") -int ARKStepGetNumPrecEvals(void* arkode_mem, long int* npevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecSolves instead") -int ARKStepGetNumPrecSolves(void* arkode_mem, long int* npsolves); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinIters instead") -int ARKStepGetNumLinIters(void* arkode_mem, long int* nliters); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinConvFails instead") -int ARKStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJTSetupEvals instead") -int ARKStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJtimesEvals instead") -int ARKStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinRhsEvals instead") -int ARKStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastLinFlag instead") -int ARKStepGetLastLinFlag(void* arkode_mem, long int* flag); - -SUNDIALS_DEPRECATED_EXPORT_MSG( - "Work space functions will be removed in version 8.0.0") -int ARKStepGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, - long int* leniwMLS); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassSetups instead") -int ARKStepGetNumMassSetups(void* arkode_mem, long int* nmsetups); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassMultSetups instead") -int ARKStepGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassMult instead") -int ARKStepGetNumMassMult(void* arkode_mem, long int* nmvevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassSolves instead") -int ARKStepGetNumMassSolves(void* arkode_mem, long int* nmsolves); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassPrecEvals instead") -int ARKStepGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassPrecSolves instead") -int ARKStepGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassIters instead") -int ARKStepGetNumMassIters(void* arkode_mem, long int* nmiters); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassConvFails instead") -int ARKStepGetNumMassConvFails(void* arkode_mem, long int* nmcfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMTSetups instead") -int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetups); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastMassFlag instead") -int ARKStepGetLastMassFlag(void* arkode_mem, long int* flag); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinReturnFlagName instead") -char* ARKStepGetLinReturnFlagName(long int flag); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") -void ARKStepFree(void** arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") -void ARKStepPrintMem(void* arkode_mem, FILE* outfile); - /* Adjoint solver functions */ SUNDIALS_EXPORT int ARKStepCreateAdjointStepper(void* arkode_mem, SUNAdjRhsFn adj_fe, @@ -413,41 +108,6 @@ int ARKStepCreateAdjointStepper(void* arkode_mem, SUNAdjRhsFn adj_fe, SUNContext sunctx, SUNAdjointStepper* adj_stepper_ptr); -/* Relaxation functions */ -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxFn instead") -int ARKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxEtaFail instead") -int ARKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxLowerBound instead") -int ARKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxFails instead") -int ARKStepSetRelaxMaxFails(void* arkode_mem, int max_fails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxIters instead") -int ARKStepSetRelaxMaxIters(void* arkode_mem, int max_iters); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxSolver instead") -int ARKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxResTol instead") -int ARKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxTol instead") -int ARKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, - sunrealtype abs_tol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxUpperBound instead") -int ARKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFnEvals instead") -int ARKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxJacEvals instead") -int ARKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFails instead") -int ARKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxBoundFails instead") -int ARKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveFails instead") -int ARKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveIters instead") -int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") -int ARKStepGetNumRhsEvals(void* arkode_mem, long int* nfe_evals, - long int* nfi_evals); #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_arkstep_deprecated.h b/include/arkode/arkode_arkstep_deprecated.h new file mode 100644 index 0000000000..7abf53b5c1 --- /dev/null +++ b/include/arkode/arkode_arkstep_deprecated.h @@ -0,0 +1,371 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2025, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * -----------------------------------------------------------------*/ + +#ifndef _ARKSTEP_DEPRECATED_H +#define _ARKSTEP_DEPRECATED_H + +#include +#include + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +/* -------------------------------------------------------------------------- + * Deprecated Functions -- all are superseded by shared ARKODE-level routines + * -------------------------------------------------------------------------- */ + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeCreateMRIStepInnerStepper instead") +int ARKStepCreateMRIStepInnerStepper(void* arkode_mem, + MRIStepInnerStepper* stepper); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") +int ARKStepResize(void* arkode_mem, N_Vector ynew, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") +int ARKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") +int ARKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") +int ARKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") +int ARKStepWFtolerances(void* arkode_mem, ARKEwtFn efun); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResStolerance instead") +int ARKStepResStolerance(void* arkode_mem, sunrealtype rabstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResVtolerance instead") +int ARKStepResVtolerance(void* arkode_mem, N_Vector rabstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResFtolerance instead") +int ARKStepResFtolerance(void* arkode_mem, ARKRwtFn rfun); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolver instead") +int ARKStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassLinearSolver instead") +int ARKStepSetMassLinearSolver(void* arkode_mem, SUNLinearSolver LS, + SUNMatrix M, sunbooleantype time_dep); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") +int ARKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") +int ARKStepSetDefaults(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("adjust parameters individually instead") +int ARKStepSetOptimalParams(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") +int ARKStepSetOrder(void* arkode_mem, int maxord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") +int ARKStepSetInterpolantType(void* arkode_mem, int itype); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int ARKStepSetInterpolantDegree(void* arkode_mem, int degree); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int ARKStepSetDenseOrder(void* arkode_mem, int dord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinearSolver instead") +int ARKStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNlsRhsFn instead") +int ARKStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fi); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinear instead") +int ARKStepSetLinear(void* arkode_mem, int timedepend); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinear instead") +int ARKStepSetNonlinear(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeduceImplicitRhs instead") +int ARKStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptController instead") +int ARKStepSetAdaptController(void* arkode_mem, SUNAdaptController C); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptivityAdjustment instead") +int ARKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetCFLFraction instead") +int ARKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSafetyFactor instead") +int ARKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ARKStepSetErrorBias(void* arkode_mem, sunrealtype bias); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxGrowth instead") +int ARKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinReduction instead") +int ARKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStepBounds instead") +int ARKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ARKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, + int pq, sunrealtype adapt_params[3]); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ARKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxFirstGrowth instead") +int ARKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxEFailGrowth instead") +int ARKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSmallNumEFails instead") +int ARKStepSetSmallNumEFails(void* arkode_mem, int small_nef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxCFailGrowth instead") +int ARKStepSetMaxCFailGrowth(void* arkode_mem, sunrealtype etacf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinCRDown instead") +int ARKStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinRDiv instead") +int ARKStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeltaGammaMax instead") +int ARKStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSetupFrequency instead") +int ARKStepSetLSetupFrequency(void* arkode_mem, int msbp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPredictorMethod instead") +int ARKStepSetPredictorMethod(void* arkode_mem, int method); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStabilityFn instead") +int ARKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxErrTestFails instead") +int ARKStepSetMaxErrTestFails(void* arkode_mem, int maxnef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNonlinIters instead") +int ARKStepSetMaxNonlinIters(void* arkode_mem, int maxcor); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxConvFails instead") +int ARKStepSetMaxConvFails(void* arkode_mem, int maxncf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinConvCoef instead") +int ARKStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetConstraints instead") +int ARKStepSetConstraints(void* arkode_mem, N_Vector constraints); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") +int ARKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") +int ARKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInitStep instead") +int ARKStepSetInitStep(void* arkode_mem, sunrealtype hin); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinStep instead") +int ARKStepSetMinStep(void* arkode_mem, sunrealtype hmin); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxStep instead") +int ARKStepSetMaxStep(void* arkode_mem, sunrealtype hmax); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") +int ARKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") +int ARKStepSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") +int ARKStepClearStopTime(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") +int ARKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumConstrFails instead") +int ARKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") +int ARKStepSetRootDirection(void* arkode_mem, int* rootdir); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") +int ARKStepSetNoInactiveRootWarn(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") +int ARKStepSetUserData(void* arkode_mem, void* user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") +int ARKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") +int ARKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStagePredictFn instead") +int ARKStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacFn instead") +int ARKStepSetJacFn(void* arkode_mem, ARKLsJacFn jac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassFn instead") +int ARKStepSetMassFn(void* arkode_mem, ARKLsMassFn mass); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacEvalFrequency instead") +int ARKStepSetJacEvalFrequency(void* arkode_mem, long int msbj); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolutionScaling instead") +int ARKStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetEpsLin instead") +int ARKStepSetEpsLin(void* arkode_mem, sunrealtype eplifac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassEpsLin instead") +int ARKStepSetMassEpsLin(void* arkode_mem, sunrealtype eplifac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSNormFactor instead") +int ARKStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassLSNormFactor instead") +int ARKStepSetMassLSNormFactor(void* arkode_mem, sunrealtype nrmfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPreconditioner instead") +int ARKStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassPreconditioner instead") +int ARKStepSetMassPreconditioner(void* arkode_mem, ARKLsMassPrecSetupFn psetup, + ARKLsMassPrecSolveFn psolve); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimes instead") +int ARKStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, + ARKLsJacTimesVecFn jtimes); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimesRhsFn instead") +int ARKStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMassTimes instead") +int ARKStepSetMassTimes(void* arkode_mem, ARKLsMassTimesSetupFn msetup, + ARKLsMassTimesVecFn mtimes, void* mtimes_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinSysFn instead") +int ARKStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") +int ARKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") +int ARKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeComputeState instead") +int ARKStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumExpSteps instead") +int ARKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumAccSteps instead") +int ARKStepGetNumAccSteps(void* arkode_mem, long int* accsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") +int ARKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinSolvSetups instead") +int ARKStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumErrTestFails instead") +int ARKStepGetNumErrTestFails(void* arkode_mem, long int* netfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetEstLocalErrors instead") +int ARKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); +SUNDIALS_DEPRECATED_EXPORT_MSG( + "Work space functions will be removed in version 8.0.0") +int ARKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") +int ARKStepGetNumSteps(void* arkode_mem, long int* nsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetActualInitStep instead") +int ARKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") +int ARKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentStep instead") +int ARKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") +int ARKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentState instead") +int ARKStepGetCurrentState(void* arkode_mem, N_Vector* state); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentGamma instead") +int ARKStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentMassMatrix instead") +int ARKStepGetCurrentMassMatrix(void* arkode_mem, SUNMatrix* M); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetTolScaleFactor instead") +int ARKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetErrWeights instead") +int ARKStepGetErrWeights(void* arkode_mem, N_Vector eweight); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetResWeights instead") +int ARKStepGetResWeights(void* arkode_mem, N_Vector rweight); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumGEvals instead") +int ARKStepGetNumGEvals(void* arkode_mem, long int* ngevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") +int ARKStepGetRootInfo(void* arkode_mem, int* rootsfound); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumConstrFails instead") +int ARKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") +int ARKStepGetUserData(void* arkode_mem, void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") +int ARKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") +char* ARKStepGetReturnFlagName(long int flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") +int ARKStepWriteParameters(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG( + "use ARKStepGetCurrentButcherTables and ARKodeButcherTable_Write instead") +int ARKStepWriteButcher(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") +int ARKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinearSystemData instead") +int ARKStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* Fi, + sunrealtype* gamma, N_Vector* sdata, + void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvIters instead") +int ARKStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvConvFails instead") +int ARKStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinSolvStats instead") +int ARKStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepSolveFails instead") +int ARKStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJac instead") +int ARKStepGetJac(void* arkode_mem, SUNMatrix* J); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacTime instead") +int ARKStepGetJacTime(void* arkode_mem, sunrealtype* t_J); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacNumSteps instead") +int ARKStepGetJacNumSteps(void* arkode_mem, long int* nst_J); +SUNDIALS_DEPRECATED_EXPORT_MSG( + "Work space functions will be removed in version 8.0.0") +int ARKStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, + long int* leniwLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJacEvals instead") +int ARKStepGetNumJacEvals(void* arkode_mem, long int* njevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecEvals instead") +int ARKStepGetNumPrecEvals(void* arkode_mem, long int* npevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecSolves instead") +int ARKStepGetNumPrecSolves(void* arkode_mem, long int* npsolves); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinIters instead") +int ARKStepGetNumLinIters(void* arkode_mem, long int* nliters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinConvFails instead") +int ARKStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJTSetupEvals instead") +int ARKStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJtimesEvals instead") +int ARKStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinRhsEvals instead") +int ARKStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastLinFlag instead") +int ARKStepGetLastLinFlag(void* arkode_mem, long int* flag); + +SUNDIALS_DEPRECATED_EXPORT_MSG( + "Work space functions will be removed in version 8.0.0") +int ARKStepGetMassWorkSpace(void* arkode_mem, long int* lenrwMLS, + long int* leniwMLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassSetups instead") +int ARKStepGetNumMassSetups(void* arkode_mem, long int* nmsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassMultSetups instead") +int ARKStepGetNumMassMultSetups(void* arkode_mem, long int* nmvsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassMult instead") +int ARKStepGetNumMassMult(void* arkode_mem, long int* nmvevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassSolves instead") +int ARKStepGetNumMassSolves(void* arkode_mem, long int* nmsolves); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassPrecEvals instead") +int ARKStepGetNumMassPrecEvals(void* arkode_mem, long int* nmpevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassPrecSolves instead") +int ARKStepGetNumMassPrecSolves(void* arkode_mem, long int* nmpsolves); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassIters instead") +int ARKStepGetNumMassIters(void* arkode_mem, long int* nmiters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMassConvFails instead") +int ARKStepGetNumMassConvFails(void* arkode_mem, long int* nmcfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumMTSetups instead") +int ARKStepGetNumMTSetups(void* arkode_mem, long int* nmtsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastMassFlag instead") +int ARKStepGetLastMassFlag(void* arkode_mem, long int* flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinReturnFlagName instead") +char* ARKStepGetLinReturnFlagName(long int flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") +void ARKStepFree(void** arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") +void ARKStepPrintMem(void* arkode_mem, FILE* outfile); + +/* Relaxation functions */ +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxFn instead") +int ARKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxEtaFail instead") +int ARKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxLowerBound instead") +int ARKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxFails instead") +int ARKStepSetRelaxMaxFails(void* arkode_mem, int max_fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxIters instead") +int ARKStepSetRelaxMaxIters(void* arkode_mem, int max_iters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxSolver instead") +int ARKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxResTol instead") +int ARKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxTol instead") +int ARKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, + sunrealtype abs_tol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxUpperBound instead") +int ARKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFnEvals instead") +int ARKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxJacEvals instead") +int ARKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFails instead") +int ARKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxBoundFails instead") +int ARKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveFails instead") +int ARKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveIters instead") +int ARKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") +int ARKStepGetNumRhsEvals(void* arkode_mem, long int* nfe_evals, + long int* nfi_evals); + +#ifdef __cplusplus +} +#endif + +#endif /* _ARKSTEP_DEPRECATED_H */ \ No newline at end of file diff --git a/include/arkode/arkode_butcher.h b/include/arkode/arkode_butcher.h index 798957904d..1f2759e924 100644 --- a/include/arkode/arkode_butcher.h +++ b/include/arkode/arkode_butcher.h @@ -32,10 +32,10 @@ struct ARKodeButcherTableMem int q; /* method order of accuracy */ int p; /* embedding order of accuracy */ int stages; /* number of stages */ - sunrealtype** A; /* Butcher table coefficients */ - sunrealtype* c; /* canopy node coefficients */ - sunrealtype* b; /* root node coefficients */ - sunrealtype* d; /* embedding coefficients */ + sunrealtype2d A; /* Butcher table coefficients */ + sunrealtype1d c; /* canopy node coefficients */ + sunrealtype1d b; /* root node coefficients */ + sunrealtype1d d; /* embedding coefficients */ }; typedef _SUNDIALS_STRUCT_ ARKodeButcherTableMem* ARKodeButcherTable; @@ -44,10 +44,10 @@ typedef _SUNDIALS_STRUCT_ ARKodeButcherTableMem* ARKodeButcherTable; SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_Alloc(int stages, sunbooleantype embedded); SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_Create(int s, int q, int p, - sunrealtype* c, - sunrealtype* A, - sunrealtype* b, - sunrealtype* d); + sunrealtype1d c, + sunrealtype1d A, + sunrealtype1d b, + sunrealtype1d d); SUNDIALS_EXPORT ARKodeButcherTable ARKodeButcherTable_Copy(ARKodeButcherTable B); SUNDIALS_DEPRECATED_EXPORT_MSG( diff --git a/include/arkode/arkode_erkstep.h b/include/arkode/arkode_erkstep.h index 574c7fd3fd..6f9e2490e7 100644 --- a/include/arkode/arkode_erkstep.h +++ b/include/arkode/arkode_erkstep.h @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -75,186 +76,6 @@ int ERKStepCreateAdjointStepper(void* arkode_mem, SUNAdjRhsFn adj_f, sunrealtype tf, N_Vector sf, SUNContext sunctx, SUNAdjointStepper* adj_stepper_ptr); -/* -------------------------------------------------------------------------- - * Deprecated Functions -- all are superseded by shared ARKODE-level routines - * -------------------------------------------------------------------------- */ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") -int ERKStepResize(void* arkode_mem, N_Vector ynew, sunrealtype hscale, - sunrealtype t0, ARKVecResizeFn resize, void* resize_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") -int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") -int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") -int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") -int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") -int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") -int ERKStepSetDefaults(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") -int ERKStepSetOrder(void* arkode_mem, int maxord); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") -int ERKStepSetInterpolantType(void* arkode_mem, int itype); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") -int ERKStepSetInterpolantDegree(void* arkode_mem, int degree); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") -int ERKStepSetDenseOrder(void* arkode_mem, int dord); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptController instead") -int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptivityAdjustment instead") -int ERKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetCFLFraction instead") -int ERKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSafetyFactor instead") -int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") -int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxGrowth instead") -int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinReduction instead") -int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStepBounds instead") -int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") -int ERKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, - int pq, sunrealtype adapt_params[3]); -SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") -int ERKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxFirstGrowth instead") -int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxEFailGrowth instead") -int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSmallNumEFails instead") -int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStabilityFn instead") -int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxErrTestFails instead") -int ERKStepSetMaxErrTestFails(void* arkode_mem, int maxnef); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetConstraints instead") -int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") -int ERKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") -int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInitStep instead") -int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinStep instead") -int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxStep instead") -int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") -int ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") -int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") -int ERKStepClearStopTime(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") -int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumConstrFails instead") -int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") -int ERKStepSetRootDirection(void* arkode_mem, int* rootdir); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") -int ERKStepSetNoInactiveRootWarn(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") -int ERKStepSetUserData(void* arkode_mem, void* user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") -int ERKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") -int ERKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") -int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") -int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumExpSteps instead") -int ERKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumAccSteps instead") -int ERKStepGetNumAccSteps(void* arkode_mem, long int* accsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") -int ERKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumErrTestFails instead") -int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetEstLocalErrors instead") -int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); -SUNDIALS_DEPRECATED_EXPORT_MSG( - "Work space functions will be removed in version 8.0.0") -int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") -int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetActualInitStep instead") -int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") -int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentStep instead") -int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") -int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetTolScaleFactor instead") -int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetErrWeights instead") -int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumGEvals instead") -int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") -int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumConstrFails instead") -int ERKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") -int ERKStepGetUserData(void* arkode_mem, void** user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") -int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") -char* ERKStepGetReturnFlagName(long int flag); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") -int ERKStepWriteParameters(void* arkode_mem, FILE* fp); -SUNDIALS_DEPRECATED_EXPORT_MSG( - "use ERKStepGetCurrentButcherTable and ARKodeButcherTable_Write instead") -int ERKStepWriteButcher(void* arkode_mem, FILE* fp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") -int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, - sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") -void ERKStepFree(void** arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") -void ERKStepPrintMem(void* arkode_mem, FILE* outfile); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxFn instead") -int ERKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxEtaFail instead") -int ERKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxLowerBound instead") -int ERKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxFails instead") -int ERKStepSetRelaxMaxFails(void* arkode_mem, int max_fails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxIters instead") -int ERKStepSetRelaxMaxIters(void* arkode_mem, int max_iters); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxSolver instead") -int ERKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxResTol instead") -int ERKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxTol instead") -int ERKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, - sunrealtype abs_tol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxUpperBound instead") -int ERKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFnEvals instead") -int ERKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxJacEvals instead") -int ERKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFails instead") -int ERKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxBoundFails instead") -int ERKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveFails instead") -int ERKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveIters instead") -int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") -int ERKStepGetNumRhsEvals(void* arkode_mem, long int* nfevals); - #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_erkstep_deprecated.h b/include/arkode/arkode_erkstep_deprecated.h new file mode 100644 index 0000000000..2a88ebb0be --- /dev/null +++ b/include/arkode/arkode_erkstep_deprecated.h @@ -0,0 +1,204 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2025, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * -----------------------------------------------------------------*/ + +#ifndef _ERKSTEP_DEPRECATED_H +#define _ERKSTEP_DEPRECATED_H + +#include + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") +int ERKStepResize(void* arkode_mem, N_Vector ynew, sunrealtype hscale, + sunrealtype t0, ARKVecResizeFn resize, void* resize_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") +int ERKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") +int ERKStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") +int ERKStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") +int ERKStepWFtolerances(void* arkode_mem, ARKEwtFn efun); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") +int ERKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") +int ERKStepSetDefaults(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") +int ERKStepSetOrder(void* arkode_mem, int maxord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") +int ERKStepSetInterpolantType(void* arkode_mem, int itype); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int ERKStepSetInterpolantDegree(void* arkode_mem, int degree); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int ERKStepSetDenseOrder(void* arkode_mem, int dord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptController instead") +int ERKStepSetAdaptController(void* arkode_mem, SUNAdaptController C); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetAdaptivityAdjustment instead") +int ERKStepSetAdaptivityAdjustment(void* arkode_mem, int adjust); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetCFLFraction instead") +int ERKStepSetCFLFraction(void* arkode_mem, sunrealtype cfl_frac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSafetyFactor instead") +int ERKStepSetSafetyFactor(void* arkode_mem, sunrealtype safety); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ERKStepSetErrorBias(void* arkode_mem, sunrealtype bias); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxGrowth instead") +int ERKStepSetMaxGrowth(void* arkode_mem, sunrealtype mx_growth); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinReduction instead") +int ERKStepSetMinReduction(void* arkode_mem, sunrealtype eta_min); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStepBounds instead") +int ERKStepSetFixedStepBounds(void* arkode_mem, sunrealtype lb, sunrealtype ub); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ERKStepSetAdaptivityMethod(void* arkode_mem, int imethod, int idefault, + int pq, sunrealtype adapt_params[3]); +SUNDIALS_DEPRECATED_EXPORT_MSG("use SUNAdaptController instead") +int ERKStepSetAdaptivityFn(void* arkode_mem, ARKAdaptFn hfun, void* h_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxFirstGrowth instead") +int ERKStepSetMaxFirstGrowth(void* arkode_mem, sunrealtype etamx1); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxEFailGrowth instead") +int ERKStepSetMaxEFailGrowth(void* arkode_mem, sunrealtype etamxf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetSmallNumEFails instead") +int ERKStepSetSmallNumEFails(void* arkode_mem, int small_nef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStabilityFn instead") +int ERKStepSetStabilityFn(void* arkode_mem, ARKExpStabFn EStab, void* estab_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxErrTestFails instead") +int ERKStepSetMaxErrTestFails(void* arkode_mem, int maxnef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetConstraints instead") +int ERKStepSetConstraints(void* arkode_mem, N_Vector constraints); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") +int ERKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") +int ERKStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInitStep instead") +int ERKStepSetInitStep(void* arkode_mem, sunrealtype hin); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMinStep instead") +int ERKStepSetMinStep(void* arkode_mem, sunrealtype hmin); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxStep instead") +int ERKStepSetMaxStep(void* arkode_mem, sunrealtype hmax); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") +int ERKStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") +int ERKStepSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") +int ERKStepClearStopTime(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") +int ERKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumConstrFails instead") +int ERKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") +int ERKStepSetRootDirection(void* arkode_mem, int* rootdir); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") +int ERKStepSetNoInactiveRootWarn(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") +int ERKStepSetUserData(void* arkode_mem, void* user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") +int ERKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") +int ERKStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") +int ERKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") +int ERKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumExpSteps instead") +int ERKStepGetNumExpSteps(void* arkode_mem, long int* expsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumAccSteps instead") +int ERKStepGetNumAccSteps(void* arkode_mem, long int* accsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") +int ERKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumErrTestFails instead") +int ERKStepGetNumErrTestFails(void* arkode_mem, long int* netfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetEstLocalErrors instead") +int ERKStepGetEstLocalErrors(void* arkode_mem, N_Vector ele); +SUNDIALS_DEPRECATED_EXPORT_MSG( + "Work space functions will be removed in version 8.0.0") +int ERKStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") +int ERKStepGetNumSteps(void* arkode_mem, long int* nsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetActualInitStep instead") +int ERKStepGetActualInitStep(void* arkode_mem, sunrealtype* hinused); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") +int ERKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentStep instead") +int ERKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") +int ERKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetTolScaleFactor instead") +int ERKStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetErrWeights instead") +int ERKStepGetErrWeights(void* arkode_mem, N_Vector eweight); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumGEvals instead") +int ERKStepGetNumGEvals(void* arkode_mem, long int* ngevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") +int ERKStepGetRootInfo(void* arkode_mem, int* rootsfound); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumConstrFails instead") +int ERKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") +int ERKStepGetUserData(void* arkode_mem, void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") +int ERKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") +char* ERKStepGetReturnFlagName(long int flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") +int ERKStepWriteParameters(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG( + "use ERKStepGetCurrentButcherTable and ARKodeButcherTable_Write instead") +int ERKStepWriteButcher(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") +int ERKStepGetStepStats(void* arkode_mem, long int* nsteps, sunrealtype* hinused, + sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") +void ERKStepFree(void** arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") +void ERKStepPrintMem(void* arkode_mem, FILE* outfile); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxFn instead") +int ERKStepSetRelaxFn(void* arkode_mem, ARKRelaxFn rfn, ARKRelaxJacFn rjac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxEtaFail instead") +int ERKStepSetRelaxEtaFail(void* arkode_mem, sunrealtype eta_rf); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxLowerBound instead") +int ERKStepSetRelaxLowerBound(void* arkode_mem, sunrealtype lower); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxFails instead") +int ERKStepSetRelaxMaxFails(void* arkode_mem, int max_fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxMaxIters instead") +int ERKStepSetRelaxMaxIters(void* arkode_mem, int max_iters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxSolver instead") +int ERKStepSetRelaxSolver(void* arkode_mem, ARKRelaxSolver solver); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxResTol instead") +int ERKStepSetRelaxResTol(void* arkode_mem, sunrealtype res_tol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxTol instead") +int ERKStepSetRelaxTol(void* arkode_mem, sunrealtype rel_tol, + sunrealtype abs_tol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRelaxUpperBound instead") +int ERKStepSetRelaxUpperBound(void* arkode_mem, sunrealtype upper); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFnEvals instead") +int ERKStepGetNumRelaxFnEvals(void* arkode_mem, long int* r_evals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxJacEvals instead") +int ERKStepGetNumRelaxJacEvals(void* arkode_mem, long int* J_evals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxFails instead") +int ERKStepGetNumRelaxFails(void* arkode_mem, long int* relax_fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxBoundFails instead") +int ERKStepGetNumRelaxBoundFails(void* arkode_mem, long int* fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveFails instead") +int ERKStepGetNumRelaxSolveFails(void* arkode_mem, long int* fails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRelaxSolveIters instead") +int ERKStepGetNumRelaxSolveIters(void* arkode_mem, long int* iters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") +int ERKStepGetNumRhsEvals(void* arkode_mem, long int* nfevals); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index cb3cf3016d..a229ec56c3 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -128,13 +129,13 @@ typedef int (*MRIStepInnerSetRTol)(MRIStepInnerStepper stepper, sunrealtype rtol struct MRIStepCouplingMem { MRISTEP_METHOD_TYPE type; /* flag to encode the MRI method type */ - int nmat; /* number of MRI coupling matrices */ - int stages; /* size of coupling matrices ((stages+1) * stages) */ - int q; /* method order of accuracy */ - int p; /* embedding order of accuracy */ - sunrealtype* c; /* stage abscissae */ - sunrealtype*** W; /* explicit coupling matrices [nmat][stages+1][stages] */ - sunrealtype*** G; /* implicit coupling matrices [nmat][stages+1][stages] */ + int nmat; /* number of MRI coupling matrices */ + int stages; /* size of coupling matrices ((stages+1) * stages) */ + int q; /* method order of accuracy */ + int p; /* embedding order of accuracy */ + sunrealtype1d c; /* stage abscissae */ + sunrealtype3d W; /* explicit coupling matrices [nmat][stages+1][stages] */ + sunrealtype3d G; /* implicit coupling matrices [nmat][stages+1][stages] */ int ngroup; /* number of stage groups (MERK-specific) */ int** group; /* stages to integrate together (MERK-specific) */ @@ -153,9 +154,9 @@ SUNDIALS_EXPORT MRIStepCoupling MRIStepCoupling_Alloc(int nmat, int stages, MRISTEP_METHOD_TYPE type); SUNDIALS_EXPORT MRIStepCoupling MRIStepCoupling_Create(int nmat, int stages, int q, int p, - sunrealtype* W, - sunrealtype* G, - sunrealtype* c); + sunrealtype1d W, + sunrealtype1d G, + sunrealtype1d c); SUNDIALS_EXPORT MRIStepCoupling MRIStepCoupling_MIStoMRI(ARKodeButcherTable B, int q, int p); SUNDIALS_EXPORT MRIStepCoupling MRIStepCoupling_Copy(MRIStepCoupling MRIC); @@ -170,7 +171,7 @@ SUNDIALS_EXPORT void MRIStepCoupling_Write(MRIStepCoupling MRIC, FILE* outfile); * User-Supplied Function Types * ------------------------------ */ -typedef int (*MRIStepPreInnerFn)(sunrealtype t, N_Vector* f, int nvecs, +typedef int (*MRIStepPreInnerFn)(sunrealtype t, N_Vector1d f, int nvecs, void* user_data); typedef int (*MRIStepPostInnerFn)(sunrealtype t, N_Vector y, void* user_data); @@ -230,196 +231,6 @@ SUNDIALS_EXPORT int MRIStepInnerStepper_GetForcingData( MRIStepInnerStepper stepper, sunrealtype* tshift, sunrealtype* tscale, N_Vector** forcing, int* nforcing); -/* -------------------------------------------------------------------------- - * Deprecated Functions -- all are superseded by shared ARKODE-level routines - * -------------------------------------------------------------------------- */ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") -int MRIStepResize(void* arkode_mem, N_Vector ynew, sunrealtype t0, - ARKVecResizeFn resize, void* resize_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") -int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") -int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") -int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") -int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolver instead") -int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") -int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") -int MRIStepSetDefaults(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") -int MRIStepSetOrder(void* arkode_mem, int ord); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") -int MRIStepSetInterpolantType(void* arkode_mem, int itype); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") -int MRIStepSetInterpolantDegree(void* arkode_mem, int degree); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") -int MRIStepSetDenseOrder(void* arkode_mem, int dord); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinearSolver instead") -int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNlsRhsFn instead") -int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fs); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinear instead") -int MRIStepSetLinear(void* arkode_mem, int timedepend); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinear instead") -int MRIStepSetNonlinear(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") -int MRIStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinCRDown instead") -int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinRDiv instead") -int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeltaGammaMax instead") -int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSetupFrequency instead") -int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPredictorMethod instead") -int MRIStepSetPredictorMethod(void* arkode_mem, int method); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNonlinIters instead") -int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinConvCoef instead") -int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") -int MRIStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") -int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") -int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") -int MRIStepClearStopTime(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") -int MRIStepSetFixedStep(void* arkode_mem, sunrealtype hsfixed); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") -int MRIStepSetRootDirection(void* arkode_mem, int* rootdir); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") -int MRIStepSetNoInactiveRootWarn(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") -int MRIStepSetUserData(void* arkode_mem, void* user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") -int MRIStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") -int MRIStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStagePredictFn instead") -int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeduceImplicitRhs instead") -int MRIStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacFn instead") -int MRIStepSetJacFn(void* arkode_mem, ARKLsJacFn jac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacEvalFrequency instead") -int MRIStepSetJacEvalFrequency(void* arkode_mem, long int msbj); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolutionScaling instead") -int MRIStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetEpsLin instead") -int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSNormFactor instead") -int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPreconditioner instead") -int MRIStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, - ARKLsPrecSolveFn psolve); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimes instead") -int MRIStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, - ARKLsJacTimesVecFn jtimes); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimesRhsFn instead") -int MRIStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinSysFn instead") -int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") -int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") -int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeComputeState instead") -int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinSolvSetups instead") -int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups); -SUNDIALS_DEPRECATED_EXPORT_MSG( - "Work space functions will be removed in version 8.0.0") -int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") -int MRIStepGetNumSteps(void* arkode_mem, long int* nssteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") -int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") -int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentState instead") -int MRIStepGetCurrentState(void* arkode_mem, N_Vector* state); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentGamma instead") -int MRIStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetTolScaleFactor instead") -int MRIStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetErrWeights instead") -int MRIStepGetErrWeights(void* arkode_mem, N_Vector eweight); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumGEvals instead") -int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") -int MRIStepGetRootInfo(void* arkode_mem, int* rootsfound); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") -int MRIStepGetUserData(void* arkode_mem, void** user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") -int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") -char* MRIStepGetReturnFlagName(long int flag); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") -int MRIStepWriteParameters(void* arkode_mem, FILE* fp); -SUNDIALS_DEPRECATED_EXPORT_MSG( - "use MRIStepGetCurrentCoupling and MRIStepCoupling_Write instead") -int MRIStepWriteCoupling(void* arkode_mem, FILE* fp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinearSystemData instead") -int MRIStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, - N_Vector* zpred, N_Vector* z, N_Vector* F, - sunrealtype* gamma, N_Vector* sdata, - void** user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvIters instead") -int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvConvFails instead") -int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinSolvStats instead") -int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, - long int* nnfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepSolveFails instead") -int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJac instead") -int MRIStepGetJac(void* arkode_mem, SUNMatrix* J); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacTime instead") -int MRIStepGetJacTime(void* arkode_mem, sunrealtype* t_J); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacNumSteps instead") -int MRIStepGetJacNumSteps(void* arkode_mem, long* nst_J); -SUNDIALS_DEPRECATED_EXPORT_MSG( - "Work space functions will be removed in version 8.0.0") -int MRIStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, - long int* leniwLS); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJacEvals instead") -int MRIStepGetNumJacEvals(void* arkode_mem, long int* njevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecEvals instead") -int MRIStepGetNumPrecEvals(void* arkode_mem, long int* npevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecSolves instead") -int MRIStepGetNumPrecSolves(void* arkode_mem, long int* npsolves); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinIters instead") -int MRIStepGetNumLinIters(void* arkode_mem, long int* nliters); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinConvFails instead") -int MRIStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJTSetupEvals instead") -int MRIStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJtimesEvals instead") -int MRIStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinRhsEvals instead") -int MRIStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastLinFlag instead") -int MRIStepGetLastLinFlag(void* arkode_mem, long int* flag); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinReturnFlagName instead") -char* MRIStepGetLinReturnFlagName(long int flag); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") -void MRIStepFree(void** arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") -void MRIStepPrintMem(void* arkode_mem, FILE* outfile); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") -int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, - long int* nfsi_evals); - #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_mristep.hpp b/include/arkode/arkode_mristep.hpp new file mode 100644 index 0000000000..b418a2ff5c --- /dev/null +++ b/include/arkode/arkode_mristep.hpp @@ -0,0 +1,77 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ specific ARKODE definitions. + * ---------------------------------------------------------------------------*/ + +#ifndef _SUNDIALS_ARKODE_MRISTEP_HPP +#define _SUNDIALS_ARKODE_MRISTEP_HPP + +#include +#include + +namespace sundials { +namespace experimental { + +struct MRIStepCouplingDeleter +{ + void operator()(MRIStepCoupling t) + { + if (t) { MRIStepCoupling_Free(t); } + } +}; + +class MRIStepCouplingView + : public ClassView +{ +public: + using ClassView::ClassView; + template + static MRIStepCouplingView Create(Args&&... args); +}; + +template +MRIStepCouplingView MRIStepCouplingView::Create(Args&&... args) +{ + MRIStepCoupling table = MRIStepCoupling_Create(std::forward(args)...); + return MRIStepCouplingView(table); +} + +struct MRIStepInnerStepperDeleter +{ + void operator()(MRIStepInnerStepper s) + { + if (s) { MRIStepInnerStepper_Free(&s); } + } +}; + +class MRIStepInnerStepperView + : public ClassView +{ +public: + using ClassView::ClassView; + + template + static MRIStepInnerStepperView Create(Args&&... args); +}; + +template +MRIStepInnerStepperView MRIStepInnerStepperView::Create(Args&&... args) +{ + return MRIStepInnerStepperView(std::forward(args)...); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/arkode/arkode_mristep_deprecated.h b/include/arkode/arkode_mristep_deprecated.h new file mode 100644 index 0000000000..be56afa269 --- /dev/null +++ b/include/arkode/arkode_mristep_deprecated.h @@ -0,0 +1,218 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2025, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * -----------------------------------------------------------------*/ + +#ifndef _MRISTEP_DEPRECATED_H +#define _MRISTEP_DEPRECATED_H + +#include + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +/* -------------------------------------------------------------------------- + * Deprecated Functions -- all are superseded by shared ARKODE-level routines + * -------------------------------------------------------------------------- */ + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeResize instead") +int MRIStepResize(void* arkode_mem, N_Vector ynew, sunrealtype t0, + ARKVecResizeFn resize, void* resize_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") +int MRIStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSStolerances instead") +int MRIStepSStolerances(void* arkode_mem, sunrealtype reltol, sunrealtype abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSVtolerances instead") +int MRIStepSVtolerances(void* arkode_mem, sunrealtype reltol, N_Vector abstol); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWFtolerances instead") +int MRIStepWFtolerances(void* arkode_mem, ARKEwtFn efun); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolver instead") +int MRIStepSetLinearSolver(void* arkode_mem, SUNLinearSolver LS, SUNMatrix A); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") +int MRIStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") +int MRIStepSetDefaults(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") +int MRIStepSetOrder(void* arkode_mem, int ord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") +int MRIStepSetInterpolantType(void* arkode_mem, int itype); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int MRIStepSetInterpolantDegree(void* arkode_mem, int degree); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int MRIStepSetDenseOrder(void* arkode_mem, int dord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinearSolver instead") +int MRIStepSetNonlinearSolver(void* arkode_mem, SUNNonlinearSolver NLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNlsRhsFn instead") +int MRIStepSetNlsRhsFn(void* arkode_mem, ARKRhsFn nls_fs); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinear instead") +int MRIStepSetLinear(void* arkode_mem, int timedepend); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinear instead") +int MRIStepSetNonlinear(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") +int MRIStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinCRDown instead") +int MRIStepSetNonlinCRDown(void* arkode_mem, sunrealtype crdown); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinRDiv instead") +int MRIStepSetNonlinRDiv(void* arkode_mem, sunrealtype rdiv); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeltaGammaMax instead") +int MRIStepSetDeltaGammaMax(void* arkode_mem, sunrealtype dgmax); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSetupFrequency instead") +int MRIStepSetLSetupFrequency(void* arkode_mem, int msbp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPredictorMethod instead") +int MRIStepSetPredictorMethod(void* arkode_mem, int method); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNonlinIters instead") +int MRIStepSetMaxNonlinIters(void* arkode_mem, int maxcor); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNonlinConvCoef instead") +int MRIStepSetNonlinConvCoef(void* arkode_mem, sunrealtype nlscoef); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxHnilWarns instead") +int MRIStepSetMaxHnilWarns(void* arkode_mem, int mxhnil); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolateStopTime instead") +int MRIStepSetInterpolateStopTime(void* arkode_mem, sunbooleantype interp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") +int MRIStepSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeClearStopTime instead") +int MRIStepClearStopTime(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") +int MRIStepSetFixedStep(void* arkode_mem, sunrealtype hsfixed); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") +int MRIStepSetRootDirection(void* arkode_mem, int* rootdir); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") +int MRIStepSetNoInactiveRootWarn(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") +int MRIStepSetUserData(void* arkode_mem, void* user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") +int MRIStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") +int MRIStepSetPostprocessStageFn(void* arkode_mem, ARKPostProcessFn ProcessStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStagePredictFn instead") +int MRIStepSetStagePredictFn(void* arkode_mem, ARKStagePredictFn PredictStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDeduceImplicitRhs instead") +int MRIStepSetDeduceImplicitRhs(void* arkode_mem, sunbooleantype deduce); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacFn instead") +int MRIStepSetJacFn(void* arkode_mem, ARKLsJacFn jac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacEvalFrequency instead") +int MRIStepSetJacEvalFrequency(void* arkode_mem, long int msbj); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinearSolutionScaling instead") +int MRIStepSetLinearSolutionScaling(void* arkode_mem, sunbooleantype onoff); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetEpsLin instead") +int MRIStepSetEpsLin(void* arkode_mem, sunrealtype eplifac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLSNormFactor instead") +int MRIStepSetLSNormFactor(void* arkode_mem, sunrealtype nrmfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPreconditioner instead") +int MRIStepSetPreconditioner(void* arkode_mem, ARKLsPrecSetupFn psetup, + ARKLsPrecSolveFn psolve); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimes instead") +int MRIStepSetJacTimes(void* arkode_mem, ARKLsJacTimesSetupFn jtsetup, + ARKLsJacTimesVecFn jtimes); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetJacTimesRhsFn instead") +int MRIStepSetJacTimesRhsFn(void* arkode_mem, ARKRhsFn jtimesRhsFn); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetLinSysFn instead") +int MRIStepSetLinSysFn(void* arkode_mem, ARKLsLinSysFn linsys); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") +int MRIStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") +int MRIStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeComputeState instead") +int MRIStepComputeState(void* arkode_mem, N_Vector zcor, N_Vector z); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinSolvSetups instead") +int MRIStepGetNumLinSolvSetups(void* arkode_mem, long int* nlinsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG( + "Work space functions will be removed in version 8.0.0") +int MRIStepGetWorkSpace(void* arkode_mem, long int* lenrw, long int* leniw); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") +int MRIStepGetNumSteps(void* arkode_mem, long int* nssteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") +int MRIStepGetLastStep(void* arkode_mem, sunrealtype* hlast); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") +int MRIStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentState instead") +int MRIStepGetCurrentState(void* arkode_mem, N_Vector* state); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentGamma instead") +int MRIStepGetCurrentGamma(void* arkode_mem, sunrealtype* gamma); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetTolScaleFactor instead") +int MRIStepGetTolScaleFactor(void* arkode_mem, sunrealtype* tolsfac); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetErrWeights instead") +int MRIStepGetErrWeights(void* arkode_mem, N_Vector eweight); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumGEvals instead") +int MRIStepGetNumGEvals(void* arkode_mem, long int* ngevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") +int MRIStepGetRootInfo(void* arkode_mem, int* rootsfound); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") +int MRIStepGetUserData(void* arkode_mem, void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") +int MRIStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") +char* MRIStepGetReturnFlagName(long int flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") +int MRIStepWriteParameters(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG( + "use MRIStepGetCurrentCoupling and MRIStepCoupling_Write instead") +int MRIStepWriteCoupling(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinearSystemData instead") +int MRIStepGetNonlinearSystemData(void* arkode_mem, sunrealtype* tcur, + N_Vector* zpred, N_Vector* z, N_Vector* F, + sunrealtype* gamma, N_Vector* sdata, + void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvIters instead") +int MRIStepGetNumNonlinSolvIters(void* arkode_mem, long int* nniters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumNonlinSolvConvFails instead") +int MRIStepGetNumNonlinSolvConvFails(void* arkode_mem, long int* nnfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNonlinSolvStats instead") +int MRIStepGetNonlinSolvStats(void* arkode_mem, long int* nniters, + long int* nnfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepSolveFails instead") +int MRIStepGetNumStepSolveFails(void* arkode_mem, long int* nncfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJac instead") +int MRIStepGetJac(void* arkode_mem, SUNMatrix* J); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacTime instead") +int MRIStepGetJacTime(void* arkode_mem, sunrealtype* t_J); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetJacNumSteps instead") +int MRIStepGetJacNumSteps(void* arkode_mem, long* nst_J); +SUNDIALS_DEPRECATED_EXPORT_MSG( + "Work space functions will be removed in version 8.0.0") +int MRIStepGetLinWorkSpace(void* arkode_mem, long int* lenrwLS, + long int* leniwLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJacEvals instead") +int MRIStepGetNumJacEvals(void* arkode_mem, long int* njevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecEvals instead") +int MRIStepGetNumPrecEvals(void* arkode_mem, long int* npevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumPrecSolves instead") +int MRIStepGetNumPrecSolves(void* arkode_mem, long int* npsolves); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinIters instead") +int MRIStepGetNumLinIters(void* arkode_mem, long int* nliters); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinConvFails instead") +int MRIStepGetNumLinConvFails(void* arkode_mem, long int* nlcfails); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJTSetupEvals instead") +int MRIStepGetNumJTSetupEvals(void* arkode_mem, long int* njtsetups); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumJtimesEvals instead") +int MRIStepGetNumJtimesEvals(void* arkode_mem, long int* njvevals); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumLinRhsEvals instead") +int MRIStepGetNumLinRhsEvals(void* arkode_mem, long int* nfevalsLS); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastLinFlag instead") +int MRIStepGetLastLinFlag(void* arkode_mem, long int* flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLinReturnFlagName instead") +char* MRIStepGetLinReturnFlagName(long int flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") +void MRIStepFree(void** arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintMem instead") +void MRIStepPrintMem(void* arkode_mem, FILE* outfile); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") +int MRIStepGetNumRhsEvals(void* arkode_mem, long int* nfse_evals, + long int* nfsi_evals); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/arkode/arkode_splittingstep.h b/include/arkode/arkode_splittingstep.h index 63cf117a30..f133bf0ed7 100644 --- a/include/arkode/arkode_splittingstep.h +++ b/include/arkode/arkode_splittingstep.h @@ -30,8 +30,8 @@ extern "C" { ---------------------------------------------------------------*/ struct SplittingStepCoefficientsMem { - sunrealtype* alpha; /* weights for sum over sequential splitting methods */ - sunrealtype*** beta; /* subintegration nodes, indexed by the sequential method, stage, and partition */ + sunrealtype1d alpha; /* weights for sum over sequential splitting methods */ + sunrealtype3d beta; /* subintegration nodes, indexed by the sequential method, stage, and partition */ int sequential_methods; /* number of sequential splitting methods */ int stages; /* number of stages within each sequential splitting method */ int partitions; /* number of RHS partitions */ @@ -42,11 +42,12 @@ typedef _SUNDIALS_STRUCT_ SplittingStepCoefficientsMem* SplittingStepCoefficient /* Splitting names use the convention * ARKODE_SPLITTING____ */ -typedef enum +enum ARKODE_SplittingCoefficientsID { - ARKODE_SPLITTING_NONE = -1, /* ensure enum is signed int */ - ARKODE_MIN_SPLITTING_NUM = 0, - ARKODE_SPLITTING_LIE_TROTTER_1_1_2 = ARKODE_MIN_SPLITTING_NUM, + ARKODE_SPLITTING_NONE = -1, /* ensure enum is signed int */ + ARKODE_MIN_SPLITTING_NUM = 0, + ARKODE_SPLITTING_LIE_TROTTER_1_1_2 = + 0, /* setting this to ARKODE_MIN_SPLITTING_NUM confuses the python interface generator */ ARKODE_SPLITTING_STRANG_2_2_2, ARKODE_SPLITTING_BEST_2_2_2, ARKODE_SPLITTING_SUZUKI_3_3_2, @@ -54,14 +55,16 @@ typedef enum ARKODE_SPLITTING_YOSHIDA_4_4_2, ARKODE_SPLITTING_YOSHIDA_8_6_2, ARKODE_MAX_SPLITTING_NUM = ARKODE_SPLITTING_YOSHIDA_8_6_2 -} ARKODE_SplittingCoefficientsID; +}; + +typedef enum ARKODE_SplittingCoefficientsID ARKODE_SplittingCoefficientsID; /* Coefficient memory management */ SUNDIALS_EXPORT SplittingStepCoefficients SplittingStepCoefficients_Alloc( int sequential_methods, int stages, int partitions); SUNDIALS_EXPORT SplittingStepCoefficients SplittingStepCoefficients_Create( int sequential_methods, int stages, int partitions, int order, - sunrealtype* alpha, sunrealtype* beta); + sunrealtype1d alpha, sunrealtype1d beta); SUNDIALS_EXPORT void SplittingStepCoefficients_Destroy( SplittingStepCoefficients* coefficients); SUNDIALS_EXPORT SplittingStepCoefficients diff --git a/include/arkode/arkode_sprk.h b/include/arkode/arkode_sprk.h index 7925b96652..0c517a819d 100644 --- a/include/arkode/arkode_sprk.h +++ b/include/arkode/arkode_sprk.h @@ -50,17 +50,17 @@ struct ARKodeSPRKTableMem /* number of stages */ int stages; /* the a_i coefficients generate the explicit Butcher table */ - sunrealtype* a; + sunrealtype1d a; /* the ahat_i coefficients generate the diagonally-implicit Butcher table */ - sunrealtype* ahat; + sunrealtype1d ahat; }; typedef _SUNDIALS_STRUCT_ ARKodeSPRKTableMem* ARKodeSPRKTable; /* Utility routines to allocate/free/output SPRK structures */ SUNDIALS_EXPORT -ARKodeSPRKTable ARKodeSPRKTable_Create(int s, int q, const sunrealtype* a, - const sunrealtype* ahat); +ARKodeSPRKTable ARKodeSPRKTable_Create(int s, int q, sunrealtype1d a, + sunrealtype1d ahat); SUNDIALS_EXPORT ARKodeSPRKTable ARKodeSPRKTable_Alloc(int stages); diff --git a/include/arkode/arkode_sprk.hpp b/include/arkode/arkode_sprk.hpp new file mode 100644 index 0000000000..d15041c34c --- /dev/null +++ b/include/arkode/arkode_sprk.hpp @@ -0,0 +1,52 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ---------------------------------------------------------------------------*/ + +#ifndef _SUNDIALS_ARKODE_SPRKSTEP_HPP +#define _SUNDIALS_ARKODE_SPRKSTEP_HPP + +#include +#include + +namespace sundials { +namespace experimental { + +struct ARKodeSPRKTableDeleter +{ + void operator()(ARKodeSPRKTable t) + { + if (t) { ARKodeSPRKTable_Free(t); } + } +}; + +class ARKodeSPRKTableView + : public ClassView +{ +public: + using ClassView::ClassView; + template + static ARKodeSPRKTableView Create(Args&&... args); +}; + +template +ARKodeSPRKTableView ARKodeSPRKTableView::Create(Args&&... args) +{ + ARKodeSPRKTable table = ARKodeSPRKTable_Create(std::forward(args)...); + return ARKodeSPRKTableView(table); +} + + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/arkode/arkode_sprkstep.h b/include/arkode/arkode_sprkstep.h index 6b6f27cacb..084461ac55 100644 --- a/include/arkode/arkode_sprkstep.h +++ b/include/arkode/arkode_sprkstep.h @@ -19,6 +19,7 @@ #include #include +#include #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { @@ -58,75 +59,6 @@ SUNDIALS_EXPORT int SPRKStepSetMethodName(void* arkode_mem, const char* method); SUNDIALS_EXPORT int SPRKStepGetCurrentMethod(void* arkode_mem, ARKodeSPRKTable* sprk_storage); -/* -------------------------------------------------------------------------- - * Deprecated Functions -- all are superseded by shared ARKODE-level routines - * -------------------------------------------------------------------------- */ - -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") -int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") -int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") -int SPRKStepSetRootDirection(void* arkode_mem, int* rootdir); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") -int SPRKStepSetNoInactiveRootWarn(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") -int SPRKStepSetDefaults(void* arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") -int SPRKStepSetOrder(void* arkode_mem, int maxord); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") -int SPRKStepSetInterpolantType(void* arkode_mem, int itype); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") -int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") -int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") -int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") -int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") -int SPRKStepSetUserData(void* arkode_mem, void* user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") -int SPRKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") -int SPRKStepSetPostprocessStageFn(void* arkode_mem, - ARKPostProcessFn ProcessStage); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") -int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, - sunrealtype* tret, int itask); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") -int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") -char* SPRKStepGetReturnFlagName(long int flag); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentState instead") -int SPRKStepGetCurrentState(void* arkode_mem, N_Vector* state); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentStep instead") -int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") -int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") -int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") -int SPRKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") -int SPRKStepGetNumSteps(void* arkode_mem, long int* nsteps); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") -int SPRKStepGetRootInfo(void* arkode_mem, int* rootsfound); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") -int SPRKStepGetUserData(void* arkode_mem, void** user_data); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") -int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") -int SPRKStepWriteParameters(void* arkode_mem, FILE* fp); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") -int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, - sunrealtype* hinused, sunrealtype* hlast, - sunrealtype* hcur, sunrealtype* tcur); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") -void SPRKStepFree(void** arkode_mem); -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") -int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2); - #ifdef __cplusplus } #endif diff --git a/include/arkode/arkode_sprkstep_deprecated.h b/include/arkode/arkode_sprkstep_deprecated.h new file mode 100644 index 0000000000..ca40fcd05e --- /dev/null +++ b/include/arkode/arkode_sprkstep_deprecated.h @@ -0,0 +1,97 @@ +/* ----------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2025, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * -----------------------------------------------------------------*/ + +#ifndef _SPRKSTEP_DEPRECATED_H +#define _SPRKSTEP_DEPRECATED_H + +#include + +#ifdef __cplusplus /* wrapper to enable C++ usage */ +extern "C" { +#endif + +/* -------------------------------------------------------------------------- + * Deprecated Functions -- all are superseded by shared ARKODE-level routines + * -------------------------------------------------------------------------- */ + +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeReset instead") +int SPRKStepReset(void* arkode_mem, sunrealtype tR, N_Vector yR); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeRootInit instead") +int SPRKStepRootInit(void* arkode_mem, int nrtfn, ARKRootFn g); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetRootDirection instead") +int SPRKStepSetRootDirection(void* arkode_mem, int* rootdir); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetNoInactiveRootWarn instead") +int SPRKStepSetNoInactiveRootWarn(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetDefaults instead") +int SPRKStepSetDefaults(void* arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetOrder instead") +int SPRKStepSetOrder(void* arkode_mem, int maxord); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantType instead") +int SPRKStepSetInterpolantType(void* arkode_mem, int itype); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetInterpolantDegree instead") +int SPRKStepSetInterpolantDegree(void* arkode_mem, int degree); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetMaxNumSteps instead") +int SPRKStepSetMaxNumSteps(void* arkode_mem, long int mxsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetStopTime instead") +int SPRKStepSetStopTime(void* arkode_mem, sunrealtype tstop); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetFixedStep instead") +int SPRKStepSetFixedStep(void* arkode_mem, sunrealtype hfixed); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUserData instead") +int SPRKStepSetUserData(void* arkode_mem, void* user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStepFn instead") +int SPRKStepSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetPostprocessStageFn instead") +int SPRKStepSetPostprocessStageFn(void* arkode_mem, + ARKPostProcessFn ProcessStage); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeEvolve instead") +int SPRKStepEvolve(void* arkode_mem, sunrealtype tout, N_Vector yout, + sunrealtype* tret, int itask); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetDky instead") +int SPRKStepGetDky(void* arkode_mem, sunrealtype t, int k, N_Vector dky); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetReturnFlagName instead") +char* SPRKStepGetReturnFlagName(long int flag); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentState instead") +int SPRKStepGetCurrentState(void* arkode_mem, N_Vector* state); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentStep instead") +int SPRKStepGetCurrentStep(void* arkode_mem, sunrealtype* hcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetCurrentTime instead") +int SPRKStepGetCurrentTime(void* arkode_mem, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetLastStep instead") +int SPRKStepGetLastStep(void* arkode_mem, sunrealtype* hlast); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumStepAttempts instead") +int SPRKStepGetNumStepAttempts(void* arkode_mem, long int* step_attempts); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumSteps instead") +int SPRKStepGetNumSteps(void* arkode_mem, long int* nsteps); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetRootInfo instead") +int SPRKStepGetRootInfo(void* arkode_mem, int* rootsfound); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetUserData instead") +int SPRKStepGetUserData(void* arkode_mem, void** user_data); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodePrintAllStats instead") +int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeWriteParameters instead") +int SPRKStepWriteParameters(void* arkode_mem, FILE* fp); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetStepStats instead") +int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, + sunrealtype* hinused, sunrealtype* hlast, + sunrealtype* hcur, sunrealtype* tcur); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") +void SPRKStepFree(void** arkode_mem); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") +int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/cvode/cvode.h b/include/cvode/cvode.h index ec5a621340..a07548a360 100644 --- a/include/cvode/cvode.h +++ b/include/cvode/cvode.h @@ -89,7 +89,7 @@ extern "C" { typedef int (*CVRhsFn)(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); -typedef int (*CVRootFn)(sunrealtype t, N_Vector y, sunrealtype* gout, +typedef int (*CVRootFn)(sunrealtype t, N_Vector y, sunrealtype1d gout, void* user_data); typedef int (*CVEwtFn)(N_Vector y, N_Vector ewt, void* user_data); @@ -106,8 +106,8 @@ SUNDIALS_EXPORT void* CVodeCreate(int lmm, SUNContext sunctx); SUNDIALS_EXPORT int CVodeInit(void* cvode_mem, CVRhsFn f, sunrealtype t0, N_Vector y0); SUNDIALS_EXPORT int CVodeReInit(void* cvode_mem, sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int CVodeResizeHistory(void* cvode_mem, sunrealtype* t_hist, - N_Vector* y_hist, N_Vector* f_hist, +SUNDIALS_EXPORT int CVodeResizeHistory(void* cvode_mem, sunrealtype1d t_hist, + N_Vector1d y_hist, N_Vector1d f_hist, int num_y_hist, int num_f_hist); /* Tolerance input functions */ @@ -149,6 +149,8 @@ SUNDIALS_EXPORT int CVodeClearStopTime(void* cvode_mem); SUNDIALS_EXPORT int CVodeSetUseIntegratorFusedKernels(void* cvode_mem, sunbooleantype onoff); SUNDIALS_EXPORT int CVodeSetUserData(void* cvode_mem, void* user_data); +SUNDIALS_EXPORT int CVodeSetOwnUserData(void* cvode_mem, + sunbooleantype own_user_data); /* Optional step adaptivity input functions */ SUNDIALS_EXPORT diff --git a/include/cvode/cvode.hpp b/include/cvode/cvode.hpp new file mode 100644 index 0000000000..6456fd43ec --- /dev/null +++ b/include/cvode/cvode.hpp @@ -0,0 +1,54 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ specific CVODE definitions. + * ---------------------------------------------------------------------------*/ + +#ifndef _CVODE_HPP +#define _CVODE_HPP + +extern "C" { +#include +} + +#include + +namespace sundials { +namespace experimental { + +struct CVodeDeleter +{ + void operator()(void* v) + { + if (v) { CVodeFree(&v); } + } +}; + +class CVodeView : public ClassView +{ +public: + using ClassView::ClassView; + template + static CVodeView Create(Args&&... args); +}; + +template +CVodeView CVodeView::Create(Args&&... args) +{ + return CVodeView(std::forward(args)...); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/cvodes/cvodes.h b/include/cvodes/cvodes.h index 03676006a7..451c09f056 100644 --- a/include/cvodes/cvodes.h +++ b/include/cvodes/cvodes.h @@ -133,7 +133,7 @@ extern "C" { typedef int (*CVRhsFn)(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data); -typedef int (*CVRootFn)(sunrealtype t, N_Vector y, sunrealtype* gout, +typedef int (*CVRootFn)(sunrealtype t, N_Vector y, sunrealtype1d gout, void* user_data); typedef int (*CVEwtFn)(N_Vector y, N_Vector ewt, void* user_data); @@ -144,27 +144,27 @@ typedef int (*CVQuadRhsFn)(sunrealtype t, N_Vector y, N_Vector yQdot, void* user_data); typedef int (*CVSensRhsFn)(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, - N_Vector* yS, N_Vector* ySdot, void* user_data, + N_Vector1d yS, N_Vector1d ySdot, void* user_data, N_Vector tmp1, N_Vector tmp2); typedef int (*CVSensRhs1Fn)(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int iS, N_Vector yS, N_Vector ySdot, void* user_data, N_Vector tmp1, N_Vector tmp2); -typedef int (*CVQuadSensRhsFn)(int Ns, sunrealtype t, N_Vector y, N_Vector* yS, - N_Vector yQdot, N_Vector* yQSdot, +typedef int (*CVQuadSensRhsFn)(int Ns, sunrealtype t, N_Vector y, N_Vector1d yS, + N_Vector yQdot, N_Vector1d yQSdot, void* user_data, N_Vector tmp, N_Vector tmpQ); typedef int (*CVRhsFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector yBdot, void* user_dataB); -typedef int (*CVRhsFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, N_Vector yB, +typedef int (*CVRhsFnBS)(sunrealtype t, N_Vector y, N_Vector1d yS, N_Vector yB, N_Vector yBdot, void* user_dataB); typedef int (*CVQuadRhsFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector qBdot, void* user_dataB); -typedef int (*CVQuadRhsFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, +typedef int (*CVQuadRhsFnBS)(sunrealtype t, N_Vector y, N_Vector1d yS, N_Vector yB, N_Vector qBdot, void* user_dataB); /* --------------------------------------- @@ -177,8 +177,8 @@ SUNDIALS_EXPORT void* CVodeCreate(int lmm, SUNContext sunctx); SUNDIALS_EXPORT int CVodeInit(void* cvode_mem, CVRhsFn f, sunrealtype t0, N_Vector y0); SUNDIALS_EXPORT int CVodeReInit(void* cvode_mem, sunrealtype t0, N_Vector y0); -SUNDIALS_EXPORT int CVodeResizeHistory(void* cvode_mem, sunrealtype* t_hist, - N_Vector* y_hist, N_Vector* f_hist, +SUNDIALS_EXPORT int CVodeResizeHistory(void* cvode_mem, sunrealtype1d t_hist, + N_Vector1d y_hist, N_Vector1d f_hist, int num_y_hist, int num_f_hist); /* Tolerance input functions */ @@ -218,6 +218,8 @@ SUNDIALS_EXPORT int CVodeSetInterpolateStopTime(void* cvode_mem, sunbooleantype interp); SUNDIALS_EXPORT int CVodeClearStopTime(void* cvode_mem); SUNDIALS_EXPORT int CVodeSetUserData(void* cvode_mem, void* user_data); +SUNDIALS_EXPORT int CVodeSetOwnUserData(void* cvode_mem, + sunbooleantype own_user_data); /* Optional step adaptivity input functions */ SUNDIALS_EXPORT @@ -255,8 +257,8 @@ SUNDIALS_EXPORT int CVode(void* cvode_mem, sunrealtype tout, N_Vector yout, /* Utility functions to update/compute y based on ycor */ SUNDIALS_EXPORT int CVodeComputeState(void* cvode_mem, N_Vector ycor, N_Vector y); -SUNDIALS_EXPORT int CVodeComputeStateSens(void* cvode_mem, N_Vector* yScor, - N_Vector* yS); +SUNDIALS_EXPORT int CVodeComputeStateSens(void* cvode_mem, N_Vector1d yScor, + N_Vector1d yS); SUNDIALS_EXPORT int CVodeComputeStateSens1(void* cvode_mem, int idx, N_Vector yScor1, N_Vector yS1); @@ -281,8 +283,8 @@ SUNDIALS_EXPORT int CVodeGetNumStabLimOrderReds(void* cvode_mem, SUNDIALS_EXPORT int CVodeGetActualInitStep(void* cvode_mem, sunrealtype* hinused); SUNDIALS_EXPORT int CVodeGetLastStep(void* cvode_mem, sunrealtype* hlast); SUNDIALS_EXPORT int CVodeGetCurrentStep(void* cvode_mem, sunrealtype* hcur); -SUNDIALS_EXPORT int CVodeGetCurrentState(void* cvode_mem, N_Vector* y); -SUNDIALS_EXPORT int CVodeGetCurrentStateSens(void* cvode_mem, N_Vector** yS); +SUNDIALS_EXPORT int CVodeGetCurrentState(void* cvode_mem, N_Vector1d y); +SUNDIALS_EXPORT int CVodeGetCurrentStateSens(void* cvode_mem, N_Vector1d* yS); SUNDIALS_EXPORT int CVodeGetCurrentSensSolveIndex(void* cvode_mem, int* index); SUNDIALS_EXPORT int CVodeGetCurrentTime(void* cvode_mem, sunrealtype* tcur); SUNDIALS_EXPORT int CVodeGetTolScaleFactor(void* cvode_mem, sunrealtype* tolsfac); @@ -294,15 +296,13 @@ SUNDIALS_EXPORT int CVodeGetIntegratorStats( void* cvode_mem, long int* nsteps, long int* nfevals, long int* nlinsetups, long int* netfails, int* qlast, int* qcur, sunrealtype* hinused, sunrealtype* hlast, sunrealtype* hcur, sunrealtype* tcur); -SUNDIALS_EXPORT int CVodeGetNonlinearSystemData(void* cvode_mem, - sunrealtype* tcur, - N_Vector* ypred, N_Vector* yn, - N_Vector* fn, sunrealtype* gamma, - sunrealtype* rl1, N_Vector* zn1, - void** user_data); +SUNDIALS_EXPORT int CVodeGetNonlinearSystemData( + void* cvode_mem, sunrealtype* tcur, N_Vector1d ypred, N_Vector1d yn, + N_Vector1d fn, sunrealtype* gamma, sunrealtype* rl1, N_Vector1d zn1, + void** user_data); SUNDIALS_EXPORT int CVodeGetNonlinearSystemDataSens( - void* cvode_mem, sunrealtype* tcur, N_Vector** ySpred, N_Vector** ySn, - sunrealtype* gamma, sunrealtype* rl1, N_Vector** zn1, void** user_data); + void* cvode_mem, sunrealtype* tcur, N_Vector1d* ySpred, N_Vector1d* ySn, + sunrealtype* gamma, sunrealtype* rl1, N_Vector1d* zn1, void** user_data); SUNDIALS_EXPORT int CVodeGetNumNonlinSolvIters(void* cvode_mem, long int* nniters); SUNDIALS_EXPORT int CVodeGetNumNonlinSolvConvFails(void* cvode_mem, @@ -362,16 +362,16 @@ SUNDIALS_EXPORT void CVodeQuadFree(void* cvode_mem); /* Initialization functions */ SUNDIALS_EXPORT int CVodeSensInit(void* cvode_mem, int Ns, int ism, - CVSensRhsFn fS, N_Vector* yS0); + CVSensRhsFn fS, N_Vector1d yS0); SUNDIALS_EXPORT int CVodeSensInit1(void* cvode_mem, int Ns, int ism, - CVSensRhs1Fn fS1, N_Vector* yS0); -SUNDIALS_EXPORT int CVodeSensReInit(void* cvode_mem, int ism, N_Vector* yS0); + CVSensRhs1Fn fS1, N_Vector1d yS0); +SUNDIALS_EXPORT int CVodeSensReInit(void* cvode_mem, int ism, N_Vector1d yS0); /* Tolerance input functions */ SUNDIALS_EXPORT int CVodeSensSStolerances(void* cvode_mem, sunrealtype reltolS, - sunrealtype* abstolS); + sunrealtype1d abstolS); SUNDIALS_EXPORT int CVodeSensSVtolerances(void* cvode_mem, sunrealtype reltolS, - N_Vector* abstolS); + N_Vector1d abstolS); SUNDIALS_EXPORT int CVodeSensEEtolerances(void* cvode_mem); /* Optional input specification functions */ @@ -379,8 +379,8 @@ SUNDIALS_EXPORT int CVodeSetSensDQMethod(void* cvode_mem, int DQtype, sunrealtype DQrhomax); SUNDIALS_EXPORT int CVodeSetSensErrCon(void* cvode_mem, sunbooleantype errconS); SUNDIALS_EXPORT int CVodeSetSensMaxNonlinIters(void* cvode_mem, int maxcorS); -SUNDIALS_EXPORT int CVodeSetSensParams(void* cvode_mem, sunrealtype* p, - sunrealtype* pbar, int* plist); +SUNDIALS_EXPORT int CVodeSetSensParams(void* cvode_mem, sunrealtype1d p, + sunrealtype1d pbar, int1d plist); /* Integrator nonlinear solver specification functions */ SUNDIALS_EXPORT int CVodeSetNonlinearSolverSensSim(void* cvode_mem, @@ -395,12 +395,12 @@ SUNDIALS_EXPORT int CVodeSensToggleOff(void* cvode_mem); /* Extraction and dense output functions */ SUNDIALS_EXPORT int CVodeGetSens(void* cvode_mem, sunrealtype* tret, - N_Vector* ySout); + N_Vector1d ySout); SUNDIALS_EXPORT int CVodeGetSens1(void* cvode_mem, sunrealtype* tret, int is, N_Vector ySout); SUNDIALS_EXPORT int CVodeGetSensDky(void* cvode_mem, sunrealtype t, int k, - N_Vector* dkyA); + N_Vector1d dkyA); SUNDIALS_EXPORT int CVodeGetSensDky1(void* cvode_mem, sunrealtype t, int k, int is, N_Vector dky); @@ -411,7 +411,7 @@ SUNDIALS_EXPORT int CVodeGetSensNumErrTestFails(void* cvode_mem, long int* nSetfails); SUNDIALS_EXPORT int CVodeGetSensNumLinSolvSetups(void* cvode_mem, long int* nlinsetupsS); -SUNDIALS_EXPORT int CVodeGetSensErrWeights(void* cvode_mem, N_Vector* eSweight); +SUNDIALS_EXPORT int CVodeGetSensErrWeights(void* cvode_mem, N_Vector1d eSweight); SUNDIALS_EXPORT int CVodeGetSensStats(void* cvode_mem, long int* nfSevals, long int* nfevalsS, long int* nSetfails, long int* nlinsetupsS); @@ -443,16 +443,16 @@ SUNDIALS_EXPORT void CVodeSensFree(void* cvode_mem); /* Initialization functions */ SUNDIALS_EXPORT int CVodeQuadSensInit(void* cvode_mem, CVQuadSensRhsFn fQS, - N_Vector* yQS0); -SUNDIALS_EXPORT int CVodeQuadSensReInit(void* cvode_mem, N_Vector* yQS0); + N_Vector1d yQS0); +SUNDIALS_EXPORT int CVodeQuadSensReInit(void* cvode_mem, N_Vector1d yQS0); /* Tolerance input functions */ SUNDIALS_EXPORT int CVodeQuadSensSStolerances(void* cvode_mem, sunrealtype reltolQS, - sunrealtype* abstolQS); + sunrealtype1d abstolQS); SUNDIALS_EXPORT int CVodeQuadSensSVtolerances(void* cvode_mem, sunrealtype reltolQS, - N_Vector* abstolQS); + N_Vector1d abstolQS); SUNDIALS_EXPORT int CVodeQuadSensEEtolerances(void* cvode_mem); /* Optional input specification functions */ @@ -461,12 +461,12 @@ SUNDIALS_EXPORT int CVodeSetQuadSensErrCon(void* cvode_mem, /* Extraction and dense output functions */ SUNDIALS_EXPORT int CVodeGetQuadSens(void* cvode_mem, sunrealtype* tret, - N_Vector* yQSout); + N_Vector1d yQSout); SUNDIALS_EXPORT int CVodeGetQuadSens1(void* cvode_mem, sunrealtype* tret, int is, N_Vector yQSout); SUNDIALS_EXPORT int CVodeGetQuadSensDky(void* cvode_mem, sunrealtype t, int k, - N_Vector* dkyQS_all); + N_Vector1d dkyQS_all); SUNDIALS_EXPORT int CVodeGetQuadSensDky1(void* cvode_mem, sunrealtype t, int k, int is, N_Vector dkyQS); @@ -476,7 +476,7 @@ SUNDIALS_EXPORT int CVodeGetQuadSensNumRhsEvals(void* cvode_mem, SUNDIALS_EXPORT int CVodeGetQuadSensNumErrTestFails(void* cvode_mem, long int* nQSetfails); SUNDIALS_EXPORT int CVodeGetQuadSensErrWeights(void* cvode_mem, - N_Vector* eQSweight); + N_Vector1d eQSweight); SUNDIALS_EXPORT int CVodeGetQuadSensStats(void* cvode_mem, long int* nfQSevals, long int* nQSetfails); @@ -539,6 +539,8 @@ SUNDIALS_EXPORT int CVodeSetAdjNoSensi(void* cvode_mem); SUNDIALS_EXPORT int CVodeSetUserDataB(void* cvode_mem, int which, void* user_dataB); +SUNDIALS_EXPORT int CVodeSetOwnUserDataB(void* cvode_mem, int which, + sunbooleantype own_user_data); SUNDIALS_EXPORT int CVodeSetMaxOrdB(void* cvode_mem, int which, int maxordB); SUNDIALS_EXPORT int CVodeSetMaxNumStepsB(void* cvode_mem, int which, long int mxstepsB); @@ -567,6 +569,9 @@ SUNDIALS_EXPORT int CVodeGetQuadB(void* cvode_mem, int which, /* Optional Output Functions For Backward Problems */ +SUNDIALS_EXPORT int CVodeGetUserDataB(void* cvode_mem, int which, + void** user_dataB); + SUNDIALS_EXPORT void* CVodeGetAdjCVodeBmem(void* cvode_mem, int which); SUNDIALS_EXPORT int CVodeGetAdjY(void* cvode_mem, sunrealtype t, N_Vector y); diff --git a/include/cvodes/cvodes.hpp b/include/cvodes/cvodes.hpp new file mode 100644 index 0000000000..750c7cefd5 --- /dev/null +++ b/include/cvodes/cvodes.hpp @@ -0,0 +1,54 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ specific CVODES definitions. + * ---------------------------------------------------------------------------*/ + +#ifndef _CVODES_HPP +#define _CVODES_HPP + +extern "C" { +#include +} + +#include + +namespace sundials { +namespace experimental { + +struct CVodeDeleter +{ + void operator()(void* v) + { + if (v) { CVodeFree(&v); } + } +}; + +class CVodeView : public ClassView +{ +public: + using ClassView::ClassView; + template + static CVodeView Create(Args&&... args); +}; + +template +CVodeView CVodeView::Create(Args&&... args) +{ + return CVodeView(std::forward(args)...); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/cvodes/cvodes_ls.h b/include/cvodes/cvodes_ls.h index f8addf1cb5..341f849e8e 100644 --- a/include/cvodes/cvodes_ls.h +++ b/include/cvodes/cvodes_ls.h @@ -143,7 +143,7 @@ typedef int (*CVLsJacFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix JB, void* user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -typedef int (*CVLsJacFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, N_Vector yB, +typedef int (*CVLsJacFnBS)(sunrealtype t, N_Vector y, N_Vector1d yS, N_Vector yB, N_Vector fyB, SUNMatrix JB, void* user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); @@ -152,7 +152,7 @@ typedef int (*CVLsPrecSetupFnB)(sunrealtype t, N_Vector y, N_Vector yB, sunbooleantype* jcurPtrB, sunrealtype gammaB, void* user_dataB); -typedef int (*CVLsPrecSetupFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, +typedef int (*CVLsPrecSetupFnBS)(sunrealtype t, N_Vector y, N_Vector1d yS, N_Vector yB, N_Vector fyB, sunbooleantype jokB, sunbooleantype* jcurPtrB, sunrealtype gammaB, void* user_dataB); @@ -162,24 +162,24 @@ typedef int (*CVLsPrecSolveFnB)(sunrealtype t, N_Vector y, N_Vector yB, sunrealtype gammaB, sunrealtype deltaB, int lrB, void* user_dataB); -typedef int (*CVLsPrecSolveFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, +typedef int (*CVLsPrecSolveFnBS)(sunrealtype t, N_Vector y, N_Vector1d yS, N_Vector yB, N_Vector fyB, N_Vector rB, N_Vector zB, sunrealtype gammaB, sunrealtype deltaB, int lrB, void* user_dataB); typedef int (*CVLsJacTimesSetupFnB)(sunrealtype t, N_Vector y, N_Vector yB, - N_Vector fyB, void* jac_dataB); + N_Vector fyB, void* user_dataB); -typedef int (*CVLsJacTimesSetupFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, - N_Vector yB, N_Vector fyB, void* jac_dataB); +typedef int (*CVLsJacTimesSetupFnBS)(sunrealtype t, N_Vector y, N_Vector1d yS, + N_Vector yB, N_Vector fyB, void* user_dataB); typedef int (*CVLsJacTimesVecFnB)(N_Vector vB, N_Vector JvB, sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, - void* jac_dataB, N_Vector tmpB); + void* user_dataB, N_Vector tmpB); typedef int (*CVLsJacTimesVecFnBS)(N_Vector vB, N_Vector JvB, sunrealtype t, - N_Vector y, N_Vector* yS, N_Vector yB, - N_Vector fyB, void* jac_dataB, N_Vector tmpB); + N_Vector y, N_Vector1d yS, N_Vector yB, + N_Vector fyB, void* user_dataB, N_Vector tmpB); typedef int (*CVLsLinSysFnB)(sunrealtype t, N_Vector y, N_Vector yB, N_Vector fyB, SUNMatrix AB, sunbooleantype jokB, @@ -187,7 +187,7 @@ typedef int (*CVLsLinSysFnB)(sunrealtype t, N_Vector y, N_Vector yB, void* user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); -typedef int (*CVLsLinSysFnBS)(sunrealtype t, N_Vector y, N_Vector* yS, +typedef int (*CVLsLinSysFnBS)(sunrealtype t, N_Vector y, N_Vector1d yS, N_Vector yB, N_Vector fyB, SUNMatrix AB, sunbooleantype jokB, sunbooleantype* jcurB, sunrealtype gammaB, void* user_dataB, diff --git a/include/ida/ida.h b/include/ida/ida.h index 335b44085b..611449081e 100644 --- a/include/ida/ida.h +++ b/include/ida/ida.h @@ -88,7 +88,7 @@ typedef int (*IDAResFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, void* user_data); typedef int (*IDARootFn)(sunrealtype t, N_Vector y, N_Vector yp, - sunrealtype* gout, void* user_data); + sunrealtype1d gout, void* user_data); typedef int (*IDAEwtFn)(N_Vector y, N_Vector ewt, void* user_data); @@ -130,6 +130,8 @@ SUNDIALS_EXPORT int IDASetMaxBacksIC(void* ida_mem, int maxbacks); /* Optional input functions */ SUNDIALS_EXPORT int IDASetDeltaCjLSetup(void* ida_max, sunrealtype dcj); SUNDIALS_EXPORT int IDASetUserData(void* ida_mem, void* user_data); +SUNDIALS_EXPORT int IDASetOwnUserData(void* ida_mem, + sunbooleantype own_user_data); SUNDIALS_EXPORT int IDASetMaxOrd(void* ida_mem, int maxord); SUNDIALS_EXPORT int IDASetMaxNumSteps(void* ida_mem, long int mxsteps); SUNDIALS_EXPORT int IDASetInitStep(void* ida_mem, sunrealtype hin); diff --git a/include/ida/ida.hpp b/include/ida/ida.hpp new file mode 100644 index 0000000000..e49088bd8c --- /dev/null +++ b/include/ida/ida.hpp @@ -0,0 +1,54 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ specific IDA definitions. + * ---------------------------------------------------------------------------*/ + +#ifndef _IDA_HPP +#define _IDA_HPP + +extern "C" { +#include +} + +#include + +namespace sundials { +namespace experimental { + +struct IDADeleter +{ + void operator()(void* v) + { + if (v) { IDAFree(&v); } + } +}; + +class IDAView : public ClassView +{ +public: + using ClassView::ClassView; + template + static IDAView Create(Args&&... args); +}; + +template +IDAView IDAView::Create(Args&&... args) +{ + return IDAView(std::forward(args)...); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/idas/idas.h b/include/idas/idas.h index c378ac56d9..da8e0523d3 100644 --- a/include/idas/idas.h +++ b/include/idas/idas.h @@ -124,7 +124,7 @@ typedef int (*IDAResFn)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector rr, void* user_data); typedef int (*IDARootFn)(sunrealtype t, N_Vector y, N_Vector yp, - sunrealtype* gout, void* user_data); + sunrealtype1d gout, void* user_data); typedef int (*IDAEwtFn)(N_Vector y, N_Vector ewt, void* user_data); @@ -132,20 +132,20 @@ typedef int (*IDAQuadRhsFn)(sunrealtype tres, N_Vector yy, N_Vector yp, N_Vector rrQ, void* user_data); typedef int (*IDASensResFn)(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, - N_Vector resval, N_Vector* yyS, N_Vector* ypS, - N_Vector* resvalS, void* user_data, N_Vector tmp1, + N_Vector resval, N_Vector1d yyS, N_Vector1d ypS, + N_Vector1d resvalS, void* user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3); typedef int (*IDAQuadSensRhsFn)(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, - N_Vector* yyS, N_Vector* ypS, N_Vector rrQ, - N_Vector* rhsvalQS, void* user_data, + N_Vector1d yyS, N_Vector1d ypS, N_Vector rrQ, + N_Vector1d rhsvalQS, void* user_data, N_Vector yytmp, N_Vector yptmp, N_Vector tmpQS); typedef int (*IDAResFnB)(sunrealtype tt, N_Vector yy, N_Vector yp, N_Vector yyB, N_Vector ypB, N_Vector rrB, void* user_dataB); typedef int (*IDAResFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, - N_Vector* yyS, N_Vector* ypS, N_Vector yyB, + N_Vector1d yyS, N_Vector1d ypS, N_Vector yyB, N_Vector ypB, N_Vector rrBS, void* user_dataB); typedef int (*IDAQuadRhsFnB)(sunrealtype tt, N_Vector yy, N_Vector yp, @@ -153,7 +153,7 @@ typedef int (*IDAQuadRhsFnB)(sunrealtype tt, N_Vector yy, N_Vector yp, void* user_dataB); typedef int (*IDAQuadRhsFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, - N_Vector* yyS, N_Vector* ypS, N_Vector yyB, + N_Vector1d yyS, N_Vector1d ypS, N_Vector yyB, N_Vector ypB, N_Vector rhsvalBQS, void* user_dataB); /* --------------------------------------- @@ -194,6 +194,8 @@ SUNDIALS_EXPORT int IDASetMaxBacksIC(void* ida_mem, int maxbacks); /* Optional input functions */ SUNDIALS_EXPORT int IDASetDeltaCjLSetup(void* ida_max, sunrealtype dcj); SUNDIALS_EXPORT int IDASetUserData(void* ida_mem, void* user_data); +SUNDIALS_EXPORT int IDASetOwnUserData(void* ida_mem, + sunbooleantype own_user_data); SUNDIALS_EXPORT int IDASetMaxOrd(void* ida_mem, int maxord); SUNDIALS_EXPORT int IDASetMaxNumSteps(void* ida_mem, long int mxsteps); SUNDIALS_EXPORT int IDASetInitStep(void* ida_mem, sunrealtype hin); @@ -242,9 +244,10 @@ SUNDIALS_EXPORT int IDASolve(void* ida_mem, sunrealtype tout, sunrealtype* tret, /* Utility functions to update/compute y and yp based on ycor */ SUNDIALS_EXPORT int IDAComputeY(void* ida_mem, N_Vector ycor, N_Vector y); SUNDIALS_EXPORT int IDAComputeYp(void* ida_mem, N_Vector ycor, N_Vector yp); -SUNDIALS_EXPORT int IDAComputeYSens(void* ida_mem, N_Vector* ycor, N_Vector* yyS); -SUNDIALS_EXPORT int IDAComputeYpSens(void* ida_mem, N_Vector* ycor, - N_Vector* ypS); +SUNDIALS_EXPORT int IDAComputeYSens(void* ida_mem, N_Vector1d ycor, + N_Vector1d yyS); +SUNDIALS_EXPORT int IDAComputeYpSens(void* ida_mem, N_Vector1d ycor, + N_Vector1d ypS); /* Dense output function */ SUNDIALS_EXPORT int IDAGetDky(void* ida_mem, sunrealtype t, int k, N_Vector dky); @@ -264,9 +267,9 @@ SUNDIALS_EXPORT int IDAGetLastOrder(void* ida_mem, int* klast); SUNDIALS_EXPORT int IDAGetCurrentOrder(void* ida_mem, int* kcur); SUNDIALS_EXPORT int IDAGetCurrentCj(void* ida_mem, sunrealtype* cj); SUNDIALS_EXPORT int IDAGetCurrentY(void* ida_mem, N_Vector* ycur); -SUNDIALS_EXPORT int IDAGetCurrentYSens(void* ida_mem, N_Vector** yS); +SUNDIALS_EXPORT int IDAGetCurrentYSens(void* ida_mem, N_Vector1d* yS); SUNDIALS_EXPORT int IDAGetCurrentYp(void* ida_mem, N_Vector* ypcur); -SUNDIALS_EXPORT int IDAGetCurrentYpSens(void* ida_mem, N_Vector** ypS); +SUNDIALS_EXPORT int IDAGetCurrentYpSens(void* ida_mem, N_Vector1d* ypS); SUNDIALS_EXPORT int IDAGetActualInitStep(void* ida_mem, sunrealtype* hinused); SUNDIALS_EXPORT int IDAGetLastStep(void* ida_mem, sunrealtype* hlast); SUNDIALS_EXPORT int IDAGetCurrentStep(void* ida_mem, sunrealtype* hcur); @@ -288,8 +291,8 @@ SUNDIALS_EXPORT int IDAGetNonlinearSystemData(void* ida_mem, sunrealtype* tcur, N_Vector* ypn, N_Vector* res, sunrealtype* cj, void** user_data); SUNDIALS_EXPORT int IDAGetNonlinearSystemDataSens( - void* ida_mem, sunrealtype* tcur, N_Vector** yySpred, N_Vector** ypSpred, - N_Vector** yySn, N_Vector** ypSn, sunrealtype* cj, void** user_data); + void* ida_mem, sunrealtype* tcur, N_Vector1d* yySpred, N_Vector1d* ypSpred, + N_Vector1d* yySn, N_Vector1d* ypSn, sunrealtype* cj, void** user_data); SUNDIALS_EXPORT int IDAGetNumNonlinSolvIters(void* ida_mem, long int* nniters); SUNDIALS_EXPORT int IDAGetNumNonlinSolvConvFails(void* ida_mem, long int* nnfails); @@ -344,29 +347,29 @@ SUNDIALS_EXPORT void IDAQuadFree(void* ida_mem); * ------------------------------------ */ /* Initialization functions */ -SUNDIALS_EXPORT int IDASensInit(void* ida_mem, int Ns, int ism, - IDASensResFn resS, N_Vector* yS0, N_Vector* ypS0); -SUNDIALS_EXPORT int IDASensReInit(void* ida_mem, int ism, N_Vector* yS0, - N_Vector* ypS0); +SUNDIALS_EXPORT int IDASensInit(void* ida_mem, int Ns, int ism, IDASensResFn resS, + N_Vector1d yS0, N_Vector1d ypS0); +SUNDIALS_EXPORT int IDASensReInit(void* ida_mem, int ism, N_Vector1d yS0, + N_Vector1d ypS0); /* Tolerance input functions */ SUNDIALS_EXPORT int IDASensSStolerances(void* ida_mem, sunrealtype reltolS, sunrealtype* abstolS); SUNDIALS_EXPORT int IDASensSVtolerances(void* ida_mem, sunrealtype reltolS, - N_Vector* abstolS); + N_Vector1d abstolS); SUNDIALS_EXPORT int IDASensEEtolerances(void* ida_mem); /* Initial condition calculation function */ -SUNDIALS_EXPORT int IDAGetSensConsistentIC(void* ida_mem, N_Vector* yyS0, - N_Vector* ypS0); +SUNDIALS_EXPORT int IDAGetSensConsistentIC(void* ida_mem, N_Vector1d yyS0, + N_Vector1d ypS0); /* Optional input specification functions */ SUNDIALS_EXPORT int IDASetSensDQMethod(void* ida_mem, int DQtype, sunrealtype DQrhomax); SUNDIALS_EXPORT int IDASetSensErrCon(void* ida_mem, sunbooleantype errconS); SUNDIALS_EXPORT int IDASetSensMaxNonlinIters(void* ida_mem, int maxcorS); -SUNDIALS_EXPORT int IDASetSensParams(void* ida_mem, sunrealtype* p, - sunrealtype* pbar, int* plist); +SUNDIALS_EXPORT int IDASetSensParams(void* ida_mem, sunrealtype1d p, + sunrealtype1d pbar, int1d plist); /* Integrator nonlinear solver specification functions */ SUNDIALS_EXPORT int IDASetNonlinearSolverSensSim(void* ida_mem, @@ -379,12 +382,12 @@ SUNDIALS_EXPORT int IDASensToggleOff(void* ida_mem); /* Extraction and dense output functions */ SUNDIALS_EXPORT int IDAGetSens(void* ida_mem, sunrealtype* tret, - N_Vector* yySout); + N_Vector1d yySout); SUNDIALS_EXPORT int IDAGetSens1(void* ida_mem, sunrealtype* tret, int is, N_Vector yySret); SUNDIALS_EXPORT int IDAGetSensDky(void* ida_mem, sunrealtype t, int k, - N_Vector* dkyS); + N_Vector1d dkyS); SUNDIALS_EXPORT int IDAGetSensDky1(void* ida_mem, sunrealtype t, int k, int is, N_Vector dkyS); @@ -394,7 +397,7 @@ SUNDIALS_EXPORT int IDAGetNumResEvalsSens(void* ida_mem, long int* nresevalsS); SUNDIALS_EXPORT int IDAGetSensNumErrTestFails(void* ida_mem, long int* nSetfails); SUNDIALS_EXPORT int IDAGetSensNumLinSolvSetups(void* ida_mem, long int* nlinsetupsS); -SUNDIALS_EXPORT int IDAGetSensErrWeights(void* ida_mem, N_Vector_S eSweight); +SUNDIALS_EXPORT int IDAGetSensErrWeights(void* ida_mem, N_Vector1d eSweight); SUNDIALS_EXPORT int IDAGetSensStats(void* ida_mem, long int* nresSevals, long int* nresevalsS, long int* nSetfails, long int* nlinsetupsS); @@ -416,14 +419,14 @@ SUNDIALS_EXPORT void IDASensFree(void* ida_mem); /* Initialization functions */ SUNDIALS_EXPORT int IDAQuadSensInit(void* ida_mem, IDAQuadSensRhsFn resQS, - N_Vector* yQS0); -SUNDIALS_EXPORT int IDAQuadSensReInit(void* ida_mem, N_Vector* yQS0); + N_Vector1d yQS0); +SUNDIALS_EXPORT int IDAQuadSensReInit(void* ida_mem, N_Vector1d yQS0); /* Tolerance input functions */ SUNDIALS_EXPORT int IDAQuadSensSStolerances(void* ida_mem, sunrealtype reltolQS, sunrealtype* abstolQS); SUNDIALS_EXPORT int IDAQuadSensSVtolerances(void* ida_mem, sunrealtype reltolQS, - N_Vector* abstolQS); + N_Vector1d abstolQS); SUNDIALS_EXPORT int IDAQuadSensEEtolerances(void* ida_mem); /* Optional input specification functions */ @@ -431,11 +434,11 @@ SUNDIALS_EXPORT int IDASetQuadSensErrCon(void* ida_mem, sunbooleantype errconQS) /* Extraction and dense output functions */ SUNDIALS_EXPORT int IDAGetQuadSens(void* ida_mem, sunrealtype* tret, - N_Vector* yyQSout); + N_Vector1d yyQSout); SUNDIALS_EXPORT int IDAGetQuadSens1(void* ida_mem, sunrealtype* tret, int is, N_Vector yyQSret); SUNDIALS_EXPORT int IDAGetQuadSensDky(void* ida_mem, sunrealtype t, int k, - N_Vector* dkyQS); + N_Vector1d dkyQS); SUNDIALS_EXPORT int IDAGetQuadSensDky1(void* ida_mem, sunrealtype t, int k, int is, N_Vector dkyQS); @@ -444,7 +447,7 @@ SUNDIALS_EXPORT int IDAGetQuadSensNumRhsEvals(void* ida_mem, long int* nrhsQSevals); SUNDIALS_EXPORT int IDAGetQuadSensNumErrTestFails(void* ida_mem, long int* nQSetfails); -SUNDIALS_EXPORT int IDAGetQuadSensErrWeights(void* ida_mem, N_Vector* eQSweight); +SUNDIALS_EXPORT int IDAGetQuadSensErrWeights(void* ida_mem, N_Vector1d eQSweight); SUNDIALS_EXPORT int IDAGetQuadSensStats(void* ida_mem, long int* nrhsQSevals, long int* nQSetfails); @@ -501,8 +504,8 @@ SUNDIALS_EXPORT int IDACalcICB(void* ida_mem, int which, sunrealtype tout1, N_Vector yy0, N_Vector yp0); SUNDIALS_EXPORT int IDACalcICBS(void* ida_mem, int which, sunrealtype tout1, - N_Vector yy0, N_Vector yp0, N_Vector* yyS0, - N_Vector* ypS0); + N_Vector yy0, N_Vector yp0, N_Vector1d yyS0, + N_Vector1d ypS0); /* Solver Function For Forward Problems */ @@ -543,6 +546,8 @@ SUNDIALS_EXPORT int IDAGetQuadB(void* ida_mem, int which, sunrealtype* tret, /* Optional Output Functions For Backward Problems */ +SUNDIALS_EXPORT int IDAGetUserDataB(void* ida_mem, int which, void** user_data); + SUNDIALS_EXPORT void* IDAGetAdjIDABmem(void* ida_mem, int which); SUNDIALS_EXPORT int IDAGetConsistentICB(void* ida_mem, int which, N_Vector yyB0, diff --git a/include/idas/idas.hpp b/include/idas/idas.hpp new file mode 100644 index 0000000000..a0782ee38a --- /dev/null +++ b/include/idas/idas.hpp @@ -0,0 +1,54 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ specific IDAS definitions. + * ---------------------------------------------------------------------------*/ + +#ifndef _IDAS_HPP +#define _IDAS_HPP + +extern "C" { +#include +} + +#include + +namespace sundials { +namespace experimental { + +struct IDADeleter +{ + void operator()(void* v) + { + if (v) { IDAFree(&v); } + } +}; + +class IDAView : public ClassView +{ +public: + using ClassView::ClassView; + template + static IDAView Create(Args&&... args); +}; + +template +IDAView IDAView::Create(Args&&... args) +{ + return IDAView(std::forward(args)...); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/idas/idas_ls.h b/include/idas/idas_ls.h index 0112d17589..d10b41f0be 100644 --- a/include/idas/idas_ls.h +++ b/include/idas/idas_ls.h @@ -134,7 +134,7 @@ typedef int (*IDALsJacFnB)(sunrealtype tt, sunrealtype c_jB, N_Vector yy, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); typedef int (*IDALsJacFnBS)(sunrealtype tt, sunrealtype c_jB, N_Vector yy, - N_Vector yp, N_Vector* yS, N_Vector* ypS, + N_Vector yp, N_Vector1d yS, N_Vector1d ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, SUNMatrix JacB, void* user_dataB, N_Vector tmp1B, N_Vector tmp2B, N_Vector tmp3B); @@ -144,7 +144,7 @@ typedef int (*IDALsPrecSetupFnB)(sunrealtype tt, N_Vector yy, N_Vector yp, sunrealtype c_jB, void* user_dataB); typedef int (*IDALsPrecSetupFnBS)(sunrealtype tt, N_Vector yy, N_Vector yp, - N_Vector* yyS, N_Vector* ypS, N_Vector yyB, + N_Vector1d yyS, N_Vector1d ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, sunrealtype c_jB, void* user_dataB); @@ -154,7 +154,7 @@ typedef int (*IDALsPrecSolveFnB)(sunrealtype tt, N_Vector yy, N_Vector yp, sunrealtype deltaB, void* user_dataB); typedef int (*IDALsPrecSolveFnBS)(sunrealtype tt, N_Vector yy, N_Vector yp, - N_Vector* yyS, N_Vector* ypS, N_Vector yyB, + N_Vector1d yyS, N_Vector1d ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, N_Vector rvecB, N_Vector zvecB, sunrealtype c_jB, sunrealtype deltaB, void* user_dataB); @@ -164,7 +164,7 @@ typedef int (*IDALsJacTimesSetupFnB)(sunrealtype t, N_Vector yy, N_Vector yp, sunrealtype c_jB, void* user_dataB); typedef int (*IDALsJacTimesSetupFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, - N_Vector* yyS, N_Vector* ypS, + N_Vector1d yyS, N_Vector1d ypS, N_Vector yyB, N_Vector ypB, N_Vector rrB, sunrealtype c_jB, void* user_dataB); @@ -175,9 +175,9 @@ typedef int (*IDALsJacTimesVecFnB)(sunrealtype t, N_Vector yy, N_Vector yp, N_Vector tmp2B); typedef int (*IDALsJacTimesVecFnBS)(sunrealtype t, N_Vector yy, N_Vector yp, - N_Vector* yyS, N_Vector* ypS, N_Vector yyB, - N_Vector ypB, N_Vector rrB, N_Vector vB, - N_Vector JvB, sunrealtype c_jB, + N_Vector1d yyS, N_Vector1d ypS, + N_Vector yyB, N_Vector ypB, N_Vector rrB, + N_Vector vB, N_Vector JvB, sunrealtype c_jB, void* user_dataB, N_Vector tmp1B, N_Vector tmp2B); diff --git a/include/kinsol/kinsol.h b/include/kinsol/kinsol.h index f85e0b692c..e094246bca 100644 --- a/include/kinsol/kinsol.h +++ b/include/kinsol/kinsol.h @@ -81,8 +81,14 @@ extern "C" { typedef int (*KINSysFn)(N_Vector uu, N_Vector fval, void* user_data); -typedef void (*KINInfoHandlerFn)(const char* module, const char* function, - char* msg, void* user_data); +typedef int (*KINDampingFn)(long int iter, N_Vector u_val, N_Vector g_val, + sunrealtype1d qt_fn, long int depth, + void* user_data, sunrealtype* damping_factor); + +typedef int (*KINDepthFn)(long int iter, N_Vector u_val, N_Vector g_val, + N_Vector f_val, N_Vector1d df, sunrealtype1d R_mat, + long int depth, void* user_data, long int* new_depth, + sunbooleantype* remove_indices); typedef int (*KINDampingFn)(long int iter, N_Vector u_val, N_Vector g_val, sunrealtype* qt_fn, long int depth, void* user_data, @@ -111,6 +117,7 @@ SUNDIALS_EXPORT int KINSol(void* kinmem, N_Vector uu, int strategy, SUNDIALS_EXPORT int KINSetOptions(void* kinmem, const char* kinid, const char* file_name, int argc, char* argv[]); SUNDIALS_EXPORT int KINSetUserData(void* kinmem, void* user_data); +SUNDIALS_EXPORT int KINSetOwnUserData(void* kinmem, sunbooleantype own_user_data); SUNDIALS_EXPORT int KINSetDamping(void* kinmem, sunrealtype beta); SUNDIALS_EXPORT int KINSetMAA(void* kinmem, long int maa); SUNDIALS_EXPORT int KINSetOrthAA(void* kinmem, int orthaa); diff --git a/include/kinsol/kinsol.hpp b/include/kinsol/kinsol.hpp new file mode 100644 index 0000000000..feac102f83 --- /dev/null +++ b/include/kinsol/kinsol.hpp @@ -0,0 +1,54 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ specific KINSOL definitions. + * ---------------------------------------------------------------------------*/ + +#ifndef _KINSOL_HPP +#define _KINSOL_HPP + +extern "C" { +#include +} + +#include + +namespace sundials { +namespace experimental { + +struct KINDeleter +{ + void operator()(void* v) + { + if (v) { KINFree(&v); } + } +}; + +class KINView : public ClassView +{ +public: + using ClassView::ClassView; + template + static KINView Create(Args&&... args); +}; + +template +KINView KINView::Create(Args&&... args) +{ + return KINView(std::forward(args)...); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/kinsol/kinsol_ls.h b/include/kinsol/kinsol_ls.h index 5ede2e3567..3e7e15d871 100644 --- a/include/kinsol/kinsol_ls.h +++ b/include/kinsol/kinsol_ls.h @@ -58,7 +58,7 @@ typedef int (*KINLsPrecSolveFn)(N_Vector uu, N_Vector uscale, N_Vector fval, N_Vector fscale, N_Vector vv, void* user_data); typedef int (*KINLsJacTimesVecFn)(N_Vector v, N_Vector Jv, N_Vector uu, - sunbooleantype* new_uu, void* J_data); + sunbooleantype* new_uu, void* user_data); /*================================================================== KINLS Exported functions diff --git a/include/nvector/nvector_kokkos.hpp b/include/nvector/nvector_kokkos.hpp index 6e6df2220a..b4fb45de5b 100644 --- a/include/nvector/nvector_kokkos.hpp +++ b/include/nvector/nvector_kokkos.hpp @@ -75,7 +75,7 @@ N_Vector N_VClone_Kokkos(N_Vector w) { auto vec{GetVec(w)}; auto new_vec{new VectorType(*vec)}; - return new_vec->Convert(); + return new_vec->get(); } template @@ -567,9 +567,9 @@ class Vector : public sundials::impl::BaseNVector, operator N_Vector() const override { return object_.get(); } - N_Vector Convert() override { return object_.get(); } + N_Vector get() override { return object_.get(); } - N_Vector Convert() const override { return object_.get(); } + N_Vector get() const override { return object_.get(); } private: view_type view_; diff --git a/include/sunadaptcontroller/sunadaptcontroller_mrihtol.h b/include/sunadaptcontroller/sunadaptcontroller_mrihtol.h index 38e8affd9c..132e96fe27 100644 --- a/include/sunadaptcontroller/sunadaptcontroller_mrihtol.h +++ b/include/sunadaptcontroller/sunadaptcontroller_mrihtol.h @@ -47,7 +47,6 @@ SUNDIALS_EXPORT SUNAdaptController SUNAdaptController_MRIHTol(SUNAdaptController HControl, SUNAdaptController TolControl, SUNContext sunctx); - SUNDIALS_EXPORT SUNErrCode SUNAdaptController_SetParams_MRIHTol(SUNAdaptController C, sunrealtype inner_max_relch, @@ -87,7 +86,6 @@ SUNDIALS_EXPORT int SUNAdaptController_UpdateMRIHTol_MRIHTol(SUNAdaptController C, sunrealtype H, sunrealtype tolfac, sunrealtype DSM, sunrealtype dsm); - SUNDIALS_DEPRECATED_EXPORT_MSG( "Work space functions will be removed in version 8.0.0") int SUNAdaptController_Space_MRIHTol(SUNAdaptController C, long int* lenrw, diff --git a/include/sundials/sundials_adaptcontroller.hpp b/include/sundials/sundials_adaptcontroller.hpp new file mode 100644 index 0000000000..b198a72b59 --- /dev/null +++ b/include/sundials/sundials_adaptcontroller.hpp @@ -0,0 +1,53 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2025, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ view of SUNDIALS SUNAdaptController + * ---------------------------------------------------------------------------*/ + +#ifndef _SUNDIALS_ADAPTCONTROLLER_HPP +#define _SUNDIALS_ADAPTCONTROLLER_HPP + +#include +#include +#include "sundials_nvector.h" + +namespace sundials { +namespace experimental { + +struct SUNAdaptControllerDeleter +{ + void operator()(SUNAdaptController C) + { + if (C) { SUNAdaptController_Destroy(C); } + } +}; + +class SUNAdaptControllerView + : public ClassView +{ +public: + using ClassView::ClassView; + template + static SUNAdaptControllerView Create(Args&&... args); +}; + +template +SUNAdaptControllerView SUNAdaptControllerView::Create(Args&&... args) +{ + return SUNAdaptControllerView(std::forward(args)...); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/sundials/sundials_adjointcheckpointscheme.h b/include/sundials/sundials_adjointcheckpointscheme.h index bff46081a5..57ee743cd2 100644 --- a/include/sundials/sundials_adjointcheckpointscheme.h +++ b/include/sundials/sundials_adjointcheckpointscheme.h @@ -22,7 +22,7 @@ extern "C" { #endif -typedef struct SUNAdjointCheckpointScheme_* SUNAdjointCheckpointScheme; +typedef _SUNDIALS_STRUCT_ SUNAdjointCheckpointScheme_* SUNAdjointCheckpointScheme; typedef SUNErrCode (*SUNAdjointCheckpointSchemeNeedsSavingFn)( SUNAdjointCheckpointScheme check_scheme, suncountertype step_num, diff --git a/include/sundials/sundials_adjointcheckpointscheme.hpp b/include/sundials/sundials_adjointcheckpointscheme.hpp new file mode 100644 index 0000000000..ed6e32e955 --- /dev/null +++ b/include/sundials/sundials_adjointcheckpointscheme.hpp @@ -0,0 +1,52 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2025, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ view of SUNDIALS SUNAdjointCheckpointScheme + * ---------------------------------------------------------------------------*/ + +#ifndef _SUNDIALS_ADJOINTCHECKPOINTSCHEME_HPP +#define _SUNDIALS_ADJOINTCHECKPOINTSCHEME_HPP + +#include +#include + +namespace sundials { +namespace experimental { + +struct SUNAdjointCheckpointSchemeDeleter +{ + void operator()(SUNAdjointCheckpointScheme self) + { + if (self) { SUNAdjointCheckpointScheme_Destroy(&self); } + } +}; + +class SUNAdjointCheckpointSchemeView + : public ClassView +{ +public: + using ClassView::ClassView; + template + static SUNAdjointCheckpointSchemeView Create(Args&&... args); +}; + +template +SUNAdjointCheckpointSchemeView SUNAdjointCheckpointSchemeView::Create(Args&&... args) +{ + return SUNAdjointCheckpointSchemeView(std::forward(args)...); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/sundials/sundials_adjointstepper.hpp b/include/sundials/sundials_adjointstepper.hpp new file mode 100644 index 0000000000..4b840324af --- /dev/null +++ b/include/sundials/sundials_adjointstepper.hpp @@ -0,0 +1,54 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2025, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ view of SUNDIALS SUNAdjointStepper + * ---------------------------------------------------------------------------*/ + +#ifndef _SUNDIALS_ADJOINTSTEPPER_HPP +#define _SUNDIALS_ADJOINTSTEPPER_HPP + +#include +#include + +namespace sundials { +namespace experimental { + +struct SUNAdjointStepperDeleter +{ + void operator()(SUNAdjointStepper self) + { + if (self) { SUNAdjointStepper_Destroy(&self); } + } +}; + +class SUNAdjointStepperView + : public ClassView +{ +public: + using ClassView::ClassView; + template + static SUNAdjointStepperView Create(Args&&... args); +}; + +template +SUNAdjointStepperView SUNAdjointStepperView::Create(Args&&... args) +{ + SUNAdjointStepper stepper; + SUNAdjointStepper_Create(std::forward(args)..., &stepper); + return SUNAdjointStepperView(stepper); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/sundials/sundials_base.hpp b/include/sundials/sundials_base.hpp index f356b31308..a08ef98d0e 100644 --- a/include/sundials/sundials_base.hpp +++ b/include/sundials/sundials_base.hpp @@ -21,6 +21,7 @@ #include #include #include +#include namespace sundials { namespace impl { @@ -119,32 +120,48 @@ class ClassView : public sundials::ConvertibleTo public: ClassView() : object_(nullptr) {} - ClassView(T&& object) : object_(std::make_unique(object)) {} + ClassView(T& object) : object_(object) {} - ClassView(const ClassView&) = delete; - ClassView(ClassView&& other) = default; + ClassView(T&& object) : object_(object) {} + + ClassView(const ClassView&) = delete; + + ClassView(ClassView&& other) noexcept + : object_(std::exchange(other.object_, nullptr)) + {} ClassView& operator=(const ClassView&) = delete; - ClassView& operator=(ClassView&& rhs) = default; + + ClassView& operator=(ClassView&& rhs) noexcept + { + this->object_ = std::exchange(rhs.object_, nullptr); + return *this; + }; ~ClassView() { - if (object_) { Deleter{}(this->Convert()); } + if (object_) { Deleter{}(this->get()); } }; // Override ConvertibleTo functions - T Convert() override { return *object_.get(); } + T get() override { return object_; } - T Convert() const override { return *object_.get(); } + T get() const override { return object_; } - operator T() override { return *object_.get(); } + operator T() override { return object_; } - operator T() const override { return *object_.get(); } + operator T() const override { return object_; } private: - std::unique_ptr object_; + T object_; }; +template +T Create(Args&&... args) +{ + return ClassView(Func(std::forward(args)...)); +} + } // namespace experimental } // namespace sundials diff --git a/include/sundials/sundials_context.hpp b/include/sundials/sundials_context.hpp index ce3ea10234..71637ffd3b 100644 --- a/include/sundials/sundials_context.hpp +++ b/include/sundials/sundials_context.hpp @@ -28,12 +28,14 @@ namespace sundials { class Context : public sundials::ConvertibleTo { public: - explicit Context(SUNComm comm = SUN_COMM_NULL) + Context(SUNComm comm = SUN_COMM_NULL) { sunctx_ = std::make_unique(); SUNContext_Create(comm, sunctx_.get()); } + Context(SUNContext sunctx) { sunctx_.reset(&sunctx); } + /* disallow copy, but allow move construction */ Context(const Context&) = delete; Context(Context&&) = default; @@ -42,14 +44,17 @@ class Context : public sundials::ConvertibleTo Context& operator=(const Context&) = delete; Context& operator=(Context&&) = default; - SUNContext Convert() override { return *sunctx_.get(); } + SUNContext get() override { return *sunctx_.get(); } - SUNContext Convert() const override { return *sunctx_.get(); } + SUNContext get() const override { return *sunctx_.get(); } operator SUNContext() override { return *sunctx_.get(); } operator SUNContext() const override { return *sunctx_.get(); } + template + static Context Create(Args&&... args); + ~Context() { if (sunctx_) { SUNContext_Free(sunctx_.get()); } @@ -59,6 +64,14 @@ class Context : public sundials::ConvertibleTo std::unique_ptr sunctx_; }; +template +Context Context::Create(Args&&... args) +{ + return Context(std::forward(args)...); +} + +using SUNContextView = Context; + } // namespace sundials #endif // _SUNDIALS_CONTEXT_HPP diff --git a/include/sundials/sundials_convertibleto.hpp b/include/sundials/sundials_convertibleto.hpp index f7ab97710b..7a2be0573f 100644 --- a/include/sundials/sundials_convertibleto.hpp +++ b/include/sundials/sundials_convertibleto.hpp @@ -24,8 +24,8 @@ class ConvertibleTo { public: // Explicit conversion to the underlying type - virtual T Convert() = 0; - virtual T Convert() const = 0; + virtual T get() = 0; + virtual T get() const = 0; // Implicit conversion to the underlying type virtual operator T() = 0; diff --git a/include/sundials/sundials_domeigestimator.h b/include/sundials/sundials_domeigestimator.h index 52dfa316ec..2f2c8f4740 100644 --- a/include/sundials/sundials_domeigestimator.h +++ b/include/sundials/sundials_domeigestimator.h @@ -64,6 +64,7 @@ struct SUNDomEigEstimator_Ops_ struct SUNDomEigEstimator_ { void* content; + void* python; SUNDomEigEstimator_Ops ops; SUNContext sunctx; }; diff --git a/include/sundials/sundials_domeigestimator.hpp b/include/sundials/sundials_domeigestimator.hpp new file mode 100644 index 0000000000..af06517660 --- /dev/null +++ b/include/sundials/sundials_domeigestimator.hpp @@ -0,0 +1,56 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2025, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ view of SUNDIALS SUNDomEigEstimator + * ---------------------------------------------------------------------------*/ + +#ifndef _SUNDIALS_DOMEIGESTIMATOR_HPP +#define _SUNDIALS_DOMEIGESTIMATOR_HPP + +#include +#include + +namespace sundials { +namespace impl { +using BaseDomEigEstimator = + BaseObject; +} // namespace impl + +namespace experimental { +struct SUNDomEigEstimatorDeleter +{ + void operator()(SUNDomEigEstimator DEE) + { + if (DEE) { SUNDomEigEstimator_Destroy(&DEE); } + } +}; + +class SUNDomEigEstimatorView + : public ClassView +{ +public: + using ClassView::ClassView; + template + static SUNDomEigEstimatorView Create(Args&&... args); +}; + +template +SUNDomEigEstimatorView SUNDomEigEstimatorView::Create(Args&&... args) +{ + return SUNDomEigEstimatorView(std::forward(args)...); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/sundials/sundials_errors.h b/include/sundials/sundials_errors.h index 55293a288f..29802bfdd3 100644 --- a/include/sundials/sundials_errors.h +++ b/include/sundials/sundials_errors.h @@ -88,7 +88,7 @@ codes, and old/deprecated codes for matrix and (non)linear solvers. */ /* clang-format off */ -enum +enum SUNErrCode_ { SUN_ERR_MINIMUM = -10000, SUN_ERR_CODE_LIST(SUN_EXPAND_TO_ENUM) diff --git a/include/sundials/sundials_futils.h b/include/sundials/sundials_futils.h index 8e9b5ba371..6a26557f68 100644 --- a/include/sundials/sundials_futils.h +++ b/include/sundials/sundials_futils.h @@ -11,27 +11,34 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------- - * SUNDIALS Fortran 2003 interface utility definitions. + * SUNDIALS FILE utility definitions. * -----------------------------------------------------------------*/ #ifndef _SUNDIALS_FUTILS_H #define _SUNDIALS_FUTILS_H #include -#include -#include "sundials/sundials_types.h" +#include +#include #ifdef __cplusplus /* wrapper to enable C++ usage */ extern "C" { #endif /* Create a file pointer with the given file name and mode. */ -SUNDIALS_EXPORT SUNErrCode SUNDIALSFileOpen(const char* filename, - const char* modes, FILE** fp); +SUNDIALS_EXPORT +SUNErrCode SUNFileOpen(const char* filename, const char* modes, FILE** fp); + +SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNFileOpen") +SUNErrCode SUNDIALSFileOpen(const char* filename, const char* modes, FILE** fp); /* Close a file pointer with the given file name. */ -SUNDIALS_EXPORT SUNErrCode SUNDIALSFileClose(FILE** fp); +SUNDIALS_EXPORT +SUNErrCode SUNFileClose(FILE** fp); + +SUNDIALS_DEPRECATED_EXPORT_MSG("Use SUNFileClose") +SUNErrCode SUNDIALSFileClose(FILE** fp); #ifdef __cplusplus } diff --git a/include/sundials/sundials_iterative.h b/include/sundials/sundials_iterative.h index a0e7de7bfc..b285caa9b7 100644 --- a/include/sundials/sundials_iterative.h +++ b/include/sundials/sundials_iterative.h @@ -53,7 +53,7 @@ extern "C" { * ----------------------------------------------------------------- */ -enum +enum SUN_PREC_ID { SUN_PREC_NONE, SUN_PREC_LEFT, @@ -75,7 +75,7 @@ enum * ----------------------------------------------------------------- */ -enum +enum SUN_GRAMSCHMIDT_ID { SUN_MODIFIED_GS = 1, SUN_CLASSICAL_GS = 2 @@ -161,7 +161,7 @@ typedef int (*SUNPSolveFn)(void* P_data, N_Vector r, N_Vector z, * ----------------------------------------------------------------- */ -typedef int (*SUNQRAddFn)(N_Vector* Q, sunrealtype* R, N_Vector f, int m, +typedef int (*SUNQRAddFn)(N_Vector1d Q, sunrealtype1d R, N_Vector f, int m, int mMax, void* QR_data); /* @@ -201,7 +201,7 @@ typedef int (*SUNQRAddFn)(N_Vector* Q, sunrealtype* R, N_Vector f, int m, */ SUNDIALS_EXPORT -SUNErrCode SUNModifiedGS(N_Vector* v, sunrealtype** h, int k, int p, +SUNErrCode SUNModifiedGS(N_Vector1d v, sunrealtype2d h, int k, int p, sunrealtype* new_vk_norm); /* @@ -225,9 +225,9 @@ SUNErrCode SUNModifiedGS(N_Vector* v, sunrealtype** h, int k, int p, */ SUNDIALS_EXPORT -SUNErrCode SUNClassicalGS(N_Vector* v, sunrealtype** h, int k, int p, - sunrealtype* new_vk_norm, sunrealtype* stemp, - N_Vector* vtemp); +SUNErrCode SUNClassicalGS(N_Vector1d v, sunrealtype2d h, int k, int p, + sunrealtype* new_vk_norm, sunrealtype1d stemp, + N_Vector1d vtemp); /* * ----------------------------------------------------------------- @@ -262,7 +262,7 @@ SUNErrCode SUNClassicalGS(N_Vector* v, sunrealtype** h, int k, int p, */ SUNDIALS_EXPORT -int SUNQRfact(int n, sunrealtype** h, sunrealtype* q, int job); +int SUNQRfact(int n, sunrealtype2d h, sunrealtype1d q, int job); /* * ----------------------------------------------------------------- @@ -297,7 +297,7 @@ int SUNQRfact(int n, sunrealtype** h, sunrealtype* q, int job); */ SUNDIALS_EXPORT -int SUNQRsol(int n, sunrealtype** h, sunrealtype* q, sunrealtype* b); +int SUNQRsol(int n, sunrealtype2d h, sunrealtype1d q, sunrealtype1d b); /* * ----------------------------------------------------------------- @@ -328,7 +328,7 @@ int SUNQRsol(int n, sunrealtype** h, sunrealtype* q, sunrealtype* b); */ SUNDIALS_EXPORT -SUNErrCode SUNQRAdd_MGS(N_Vector* Q, sunrealtype* R, N_Vector df, int m, +SUNErrCode SUNQRAdd_MGS(N_Vector1d Q, sunrealtype1d R, N_Vector df, int m, int mMax, void* QRdata); /* @@ -366,7 +366,7 @@ SUNErrCode SUNQRAdd_MGS(N_Vector* Q, sunrealtype* R, N_Vector df, int m, */ SUNDIALS_EXPORT -SUNErrCode SUNQRAdd_ICWY(N_Vector* Q, sunrealtype* R, N_Vector df, int m, +SUNErrCode SUNQRAdd_ICWY(N_Vector1d Q, sunrealtype1d R, N_Vector df, int m, int mMax, void* QRdata); /* @@ -379,7 +379,7 @@ SUNErrCode SUNQRAdd_ICWY(N_Vector* Q, sunrealtype* R, N_Vector df, int m, */ SUNDIALS_EXPORT -SUNErrCode SUNQRAdd_ICWY_SB(N_Vector* Q, sunrealtype* R, N_Vector df, int m, +SUNErrCode SUNQRAdd_ICWY_SB(N_Vector1d Q, sunrealtype1d R, N_Vector df, int m, int mMax, void* QRdata); /* @@ -414,7 +414,7 @@ SUNErrCode SUNQRAdd_ICWY_SB(N_Vector* Q, sunrealtype* R, N_Vector df, int m, */ SUNDIALS_EXPORT -SUNErrCode SUNQRAdd_CGS2(N_Vector* Q, sunrealtype* R, N_Vector df, int m, +SUNErrCode SUNQRAdd_CGS2(N_Vector1d Q, sunrealtype1d R, N_Vector df, int m, int mMax, void* QRdata); /* @@ -451,7 +451,7 @@ SUNErrCode SUNQRAdd_CGS2(N_Vector* Q, sunrealtype* R, N_Vector df, int m, */ SUNDIALS_EXPORT -SUNErrCode SUNQRAdd_DCGS2(N_Vector* Q, sunrealtype* R, N_Vector df, int m, +SUNErrCode SUNQRAdd_DCGS2(N_Vector1d Q, sunrealtype1d R, N_Vector df, int m, int mMax, void* QRdata); /* @@ -464,7 +464,7 @@ SUNErrCode SUNQRAdd_DCGS2(N_Vector* Q, sunrealtype* R, N_Vector df, int m, */ SUNDIALS_EXPORT -SUNErrCode SUNQRAdd_DCGS2_SB(N_Vector* Q, sunrealtype* R, N_Vector df, int m, +SUNErrCode SUNQRAdd_DCGS2_SB(N_Vector1d Q, sunrealtype1d R, N_Vector df, int m, int mMax, void* QRdata); #ifdef __cplusplus diff --git a/include/sundials/sundials_linearsolver.hpp b/include/sundials/sundials_linearsolver.hpp index 36a1013f8b..b71c2b6e05 100644 --- a/include/sundials/sundials_linearsolver.hpp +++ b/include/sundials/sundials_linearsolver.hpp @@ -36,7 +36,21 @@ struct SUNLinearSolverDeleter } }; -using SUNLinearSolverView = ClassView; +class SUNLinearSolverView + : public ClassView +{ +public: + using ClassView::ClassView; + template + static SUNLinearSolverView Create(Args&&... args); +}; + +template +SUNLinearSolverView SUNLinearSolverView::Create(Args&&... args) +{ + return SUNLinearSolverView(std::forward(args)...); +} + } // namespace experimental } // namespace sundials diff --git a/include/sundials/sundials_logger.hpp b/include/sundials/sundials_logger.hpp new file mode 100644 index 0000000000..ce74d7e59c --- /dev/null +++ b/include/sundials/sundials_logger.hpp @@ -0,0 +1,79 @@ +/* ----------------------------------------------------------------- + * Programmer: Cody J. Balos @ LLNL + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2025, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * -----------------------------------------------------------------*/ + +#ifndef _SUNDIALS_LOGGER_HPP +#define _SUNDIALS_LOGGER_HPP + +#include +#include +#include + +namespace sundials { +namespace experimental { + +class SUNLoggerView : public sundials::ConvertibleTo +{ +public: + SUNLoggerView(SUNComm comm, int output_rank) + { + logger_ = std::make_unique(); + SUNLogger_Create(comm, output_rank, logger_.get()); + } + + SUNLoggerView(SUNComm comm) + { + logger_ = std::make_unique(); + SUNLogger_CreateFromEnv(comm, logger_.get()); + } + + SUNLoggerView(SUNLogger sunlogger) { logger_.reset(&sunlogger); } + + /* disallow copy, but allow move construction */ + SUNLoggerView(const SUNLoggerView&) = delete; + SUNLoggerView(SUNLoggerView&&) = default; + + /* disallow copy, but allow move operators */ + SUNLoggerView& operator=(const SUNLoggerView&) = delete; + SUNLoggerView& operator=(SUNLoggerView&&) = default; + + SUNLogger get() override { return *logger_.get(); } + + SUNLogger get() const override { return *logger_.get(); } + + operator SUNLogger() override { return *logger_.get(); } + + operator SUNLogger() const override { return *logger_.get(); } + + template + static SUNLoggerView Create(Args&&... args); + + ~SUNLoggerView() + { + if (logger_) { SUNLogger_Destroy(logger_.get()); } + } + +private: + std::unique_ptr logger_; +}; + +template +SUNLoggerView SUNLoggerView::Create(Args&&... args) +{ + return SUNLoggerView(std::forward(args)...); +} + +} // namespace experimental +} // namespace sundials + +#endif /* SUNDIALS_LOGGER_HPP */ diff --git a/include/sundials/sundials_matrix.hpp b/include/sundials/sundials_matrix.hpp index 07d521e761..9b65e9f481 100644 --- a/include/sundials/sundials_matrix.hpp +++ b/include/sundials/sundials_matrix.hpp @@ -35,7 +35,20 @@ struct SUNMatrixDeleter } }; -using SUNMatrixView = ClassView; +class SUNMatrixView : public ClassView +{ +public: + using ClassView::ClassView; + template + static SUNMatrixView Create(Args&&... args); +}; + +template +SUNMatrixView SUNMatrixView::Create(Args&&... args) +{ + return SUNMatrixView(std::forward(args)...); +} + } // namespace experimental } // namespace sundials diff --git a/include/sundials/sundials_memory.h b/include/sundials/sundials_memory.h index 2640525345..28abea8f9e 100644 --- a/include/sundials/sundials_memory.h +++ b/include/sundials/sundials_memory.h @@ -25,13 +25,21 @@ extern "C" { #endif -typedef enum +enum SUNMemoryType_ { - SUNMEMTYPE_HOST, /* pageable memory accessible on the host */ - SUNMEMTYPE_PINNED, /* page-locked memory accessible on the host */ - SUNMEMTYPE_DEVICE, /* memory accessible from the device */ - SUNMEMTYPE_UVM /* memory accessible from the host or device */ -} SUNMemoryType; + SUN_MEMTYPE_HOST, /* pageable memory accessible on the host */ + SUN_MEMTYPE_PINNED, /* page-locked memory accessible on the host */ + SUN_MEMTYPE_DEVICE, /* memory accessible from the device */ + SUN_MEMTYPE_UVM /* memory accessible from the host or device */ +}; + +typedef enum SUNMemoryType_ SUNMemoryType; + +/* For backwards compatibility with the old name */ +static const int SUNMEMTYPE_HOST = SUN_MEMTYPE_HOST; +static const int SUNMEMTYPE_PINNED = SUN_MEMTYPE_PINNED; +static const int SUNMEMTYPE_DEVICE = SUN_MEMTYPE_DEVICE; +static const int SUNMEMTYPE_UVM = SUN_MEMTYPE_UVM; /* * SUNMemory is a simple abstraction of a pointer to some diff --git a/include/sundials/sundials_memory.hpp b/include/sundials/sundials_memory.hpp index 8b327a0d8e..fbb77acaad 100644 --- a/include/sundials/sundials_memory.hpp +++ b/include/sundials/sundials_memory.hpp @@ -35,7 +35,21 @@ struct SUNMemoryHelperDeleter } }; -using SUNMemoryHelperView = ClassView; +class SUNMemoryHelperView + : public ClassView +{ +public: + using ClassView::ClassView; + template + static SUNMemoryHelperView Create(Args&&... args); +}; + +template +SUNMemoryHelperView SUNMemoryHelperView::Create(Args&&... args) +{ + return SUNMemoryHelperView(std::forward(args)...); +} + } // namespace experimental } // namespace sundials diff --git a/include/sundials/sundials_nonlinearsolver.hpp b/include/sundials/sundials_nonlinearsolver.hpp index 8289e2d138..48f56a0fa4 100644 --- a/include/sundials/sundials_nonlinearsolver.hpp +++ b/include/sundials/sundials_nonlinearsolver.hpp @@ -36,8 +36,21 @@ struct SUNNonlinearSolverDeleter } }; -using SUNNonlinearSolverView = - ClassView; +class SUNNonlinearSolverView + : public ClassView +{ +public: + using ClassView::ClassView; + template + static SUNNonlinearSolverView Create(Args&&... args); +}; + +template +SUNNonlinearSolverView SUNNonlinearSolverView::Create(Args&&... args) +{ + return SUNNonlinearSolverView(std::forward(args)...); +} + } // namespace experimental } // namespace sundials diff --git a/include/sundials/sundials_nvector.h b/include/sundials/sundials_nvector.h index 7385210b4c..b988bdc5ef 100644 --- a/include/sundials/sundials_nvector.h +++ b/include/sundials/sundials_nvector.h @@ -60,7 +60,7 @@ extern "C" { * Implemented N_Vector types * ----------------------------------------------------------------- */ -typedef enum +enum N_Vector_ID { SUNDIALS_NVEC_SERIAL, SUNDIALS_NVEC_PARALLEL, @@ -79,7 +79,9 @@ typedef enum SUNDIALS_NVEC_MPIMANYVECTOR, SUNDIALS_NVEC_MPIPLUSX, SUNDIALS_NVEC_CUSTOM -} N_Vector_ID; +}; + +typedef enum N_Vector_ID N_Vector_ID; /* ----------------------------------------------------------------- * Generic definition of N_Vector @@ -93,6 +95,8 @@ typedef _SUNDIALS_STRUCT_ _generic_N_Vector* N_Vector; /* Define array of N_Vectors */ typedef N_Vector* N_Vector_S; +typedef N_Vector* N_Vector1d; +typedef N_Vector** N_Vector2d; /* Structure containing function pointers to vector operations */ struct _generic_N_Vector_Ops @@ -109,9 +113,9 @@ struct _generic_N_Vector_Ops N_Vector (*nvcloneempty)(N_Vector); void (*nvdestroy)(N_Vector); void (*nvspace)(N_Vector, sunindextype*, sunindextype*); - sunrealtype* (*nvgetarraypointer)(N_Vector); - sunrealtype* (*nvgetdevicearraypointer)(N_Vector); - void (*nvsetarraypointer)(sunrealtype*, N_Vector); + sunrealtype1d (*nvgetarraypointer)(N_Vector); + sunrealtype1d (*nvgetdevicearraypointer)(N_Vector); + void (*nvsetarraypointer)(sunrealtype1d, N_Vector); SUNComm (*nvgetcommunicator)(N_Vector); sunindextype (*nvgetlength)(N_Vector); sunindextype (*nvgetlocallength)(N_Vector); @@ -144,23 +148,23 @@ struct _generic_N_Vector_Ops */ /* OPTIONAL fused vector operations */ - SUNErrCode (*nvlinearcombination)(int, sunrealtype*, N_Vector*, N_Vector); - SUNErrCode (*nvscaleaddmulti)(int, sunrealtype*, N_Vector, N_Vector*, - N_Vector*); - SUNErrCode (*nvdotprodmulti)(int, N_Vector, N_Vector*, sunrealtype*); + SUNErrCode (*nvlinearcombination)(int, sunrealtype1d, N_Vector1d, N_Vector); + SUNErrCode (*nvscaleaddmulti)(int, sunrealtype1d, N_Vector, N_Vector1d, + N_Vector1d); + SUNErrCode (*nvdotprodmulti)(int, N_Vector, N_Vector1d, sunrealtype1d); /* OPTIONAL vector array operations */ - SUNErrCode (*nvlinearsumvectorarray)(int, sunrealtype, N_Vector*, sunrealtype, - N_Vector*, N_Vector*); - SUNErrCode (*nvscalevectorarray)(int, sunrealtype*, N_Vector*, N_Vector*); - SUNErrCode (*nvconstvectorarray)(int, sunrealtype, N_Vector*); - SUNErrCode (*nvwrmsnormvectorarray)(int, N_Vector*, N_Vector*, sunrealtype*); - SUNErrCode (*nvwrmsnormmaskvectorarray)(int, N_Vector*, N_Vector*, N_Vector, - sunrealtype*); - SUNErrCode (*nvscaleaddmultivectorarray)(int, int, sunrealtype*, N_Vector*, - N_Vector**, N_Vector**); - SUNErrCode (*nvlinearcombinationvectorarray)(int, int, sunrealtype*, - N_Vector**, N_Vector*); + SUNErrCode (*nvlinearsumvectorarray)(int, sunrealtype, N_Vector1d, + sunrealtype, N_Vector1d, N_Vector1d); + SUNErrCode (*nvscalevectorarray)(int, sunrealtype1d, N_Vector1d, N_Vector1d); + SUNErrCode (*nvconstvectorarray)(int, sunrealtype, N_Vector1d); + SUNErrCode (*nvwrmsnormvectorarray)(int, N_Vector1d, N_Vector1d, sunrealtype1d); + SUNErrCode (*nvwrmsnormmaskvectorarray)(int, N_Vector1d, N_Vector1d, N_Vector, + sunrealtype1d); + SUNErrCode (*nvscaleaddmultivectorarray)(int, int, sunrealtype1d, N_Vector1d, + N_Vector2d, N_Vector2d); + SUNErrCode (*nvlinearcombinationvectorarray)(int, int, sunrealtype1d, + N_Vector2d, N_Vector1d); /* * OPTIONAL operations with no default implementation. @@ -178,8 +182,8 @@ struct _generic_N_Vector_Ops sunrealtype (*nvwsqrsummasklocal)(N_Vector, N_Vector, N_Vector); /* Single buffer reduction operations */ - SUNErrCode (*nvdotprodmultilocal)(int, N_Vector, N_Vector*, sunrealtype*); - SUNErrCode (*nvdotprodmultiallreduce)(int, N_Vector, sunrealtype*); + SUNErrCode (*nvdotprodmultilocal)(int, N_Vector, N_Vector1d, sunrealtype1d); + SUNErrCode (*nvdotprodmultiallreduce)(int, N_Vector, sunrealtype1d); /* XBraid interface operations */ SUNErrCode (*nvbufsize)(N_Vector, sunindextype*); @@ -205,7 +209,7 @@ struct _generic_N_Vector * Functions exported by NVECTOR module * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT N_Vector N_VNewEmpty(SUNContext sunctx); +SUNDIALS_EXPORT N_Vector N_VNewEmpty(SUNContext sunctx); // py::return_value_policy::reference SUNDIALS_EXPORT void N_VFreeEmpty(N_Vector v); SUNDIALS_EXPORT SUNErrCode N_VCopyOps(N_Vector w, N_Vector v); @@ -214,15 +218,15 @@ SUNDIALS_EXPORT SUNErrCode N_VCopyOps(N_Vector w, N_Vector v); */ SUNDIALS_EXPORT N_Vector_ID N_VGetVectorID(N_Vector w); -SUNDIALS_EXPORT N_Vector N_VClone(N_Vector w); -SUNDIALS_EXPORT N_Vector N_VCloneEmpty(N_Vector w); +SUNDIALS_EXPORT N_Vector N_VClone(N_Vector w); // py::return_value_policy::reference +SUNDIALS_EXPORT N_Vector N_VCloneEmpty(N_Vector w); // py::return_value_policy::reference SUNDIALS_EXPORT void N_VDestroy(N_Vector v); SUNDIALS_DEPRECATED_EXPORT_MSG( "Work space functions will be removed in version 8.0.0") void N_VSpace(N_Vector v, sunindextype* lrw, sunindextype* liw); -SUNDIALS_EXPORT sunrealtype* N_VGetArrayPointer(N_Vector v); -SUNDIALS_EXPORT sunrealtype* N_VGetDeviceArrayPointer(N_Vector v); -SUNDIALS_EXPORT void N_VSetArrayPointer(sunrealtype* v_data, N_Vector v); +SUNDIALS_EXPORT sunrealtype1d N_VGetArrayPointer(N_Vector v); +SUNDIALS_EXPORT sunrealtype1d N_VGetDeviceArrayPointer(N_Vector v); +SUNDIALS_EXPORT void N_VSetArrayPointer(sunrealtype1d v_data, N_Vector v); SUNDIALS_EXPORT SUNComm N_VGetCommunicator(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLength(N_Vector v); SUNDIALS_EXPORT sunindextype N_VGetLocalLength(N_Vector v); @@ -255,44 +259,48 @@ SUNDIALS_EXPORT sunrealtype N_VMinQuotient(N_Vector num, N_Vector denom); /* fused vector operations */ SUNDIALS_EXPORT -SUNErrCode N_VLinearCombination(int nvec, sunrealtype* c, N_Vector* X, +SUNErrCode N_VLinearCombination(int nvec, sunrealtype1d c_arr, N_Vector1d X_arr, N_Vector z); SUNDIALS_EXPORT -SUNErrCode N_VScaleAddMulti(int nvec, sunrealtype* a, N_Vector x, N_Vector* Y, - N_Vector* Z); +SUNErrCode N_VScaleAddMulti(int nvec, sunrealtype1d a, N_Vector x, + N_Vector1d Y_arr, N_Vector1d Z_arr); SUNDIALS_EXPORT -SUNErrCode N_VDotProdMulti(int nvec, N_Vector x, N_Vector* Y, - sunrealtype* dotprods); +SUNErrCode N_VDotProdMulti(int nvec, N_Vector x, N_Vector1d Y_arr, + sunrealtype1d dotprods); /* vector array operations */ SUNDIALS_EXPORT -SUNErrCode N_VLinearSumVectorArray(int nvec, sunrealtype a, N_Vector* X, - sunrealtype b, N_Vector* Y, N_Vector* Z); +SUNErrCode N_VLinearSumVectorArray(int nvec, sunrealtype a, N_Vector1d X_arr, + sunrealtype b, N_Vector1d Y_arr, + N_Vector1d Z_arr); SUNDIALS_EXPORT -SUNErrCode N_VScaleVectorArray(int nvec, sunrealtype* c, N_Vector* X, - N_Vector* Z); +SUNErrCode N_VScaleVectorArray(int nvec, sunrealtype1d c, N_Vector1d X_arr, + N_Vector1d Z_arr); SUNDIALS_EXPORT -SUNErrCode N_VConstVectorArray(int nvec, sunrealtype c, N_Vector* Z); +SUNErrCode N_VConstVectorArray(int nvec, sunrealtype c, N_Vector1d Z_arr); SUNDIALS_EXPORT -SUNErrCode N_VWrmsNormVectorArray(int nvec, N_Vector* X, N_Vector* W, - sunrealtype* nrm); +SUNErrCode N_VWrmsNormVectorArray(int nvec, N_Vector1d X_arr, N_Vector1d W_arr, + sunrealtype1d nrm); SUNDIALS_EXPORT -SUNErrCode N_VWrmsNormMaskVectorArray(int nvec, N_Vector* X, N_Vector* W, - N_Vector id, sunrealtype* nrm); +SUNErrCode N_VWrmsNormMaskVectorArray(int nvec, N_Vector1d X_arr, + N_Vector1d W_arr, N_Vector id, + sunrealtype1d nrm); SUNDIALS_EXPORT -SUNErrCode N_VScaleAddMultiVectorArray(int nvec, int nsum, sunrealtype* a, - N_Vector* X, N_Vector** Y, N_Vector** Z); +SUNErrCode N_VScaleAddMultiVectorArray(int nvec, int nsum, sunrealtype1d a, + N_Vector1d X_arr, N_Vector2d Y_arr, + N_Vector2d Z_arr); SUNDIALS_EXPORT -SUNErrCode N_VLinearCombinationVectorArray(int nvec, int nsum, sunrealtype* c, - N_Vector** X, N_Vector* Z); +SUNErrCode N_VLinearCombinationVectorArray(int nvec, int nsum, + sunrealtype1d c_arr, + N_Vector2d X_arr, N_Vector1d Z_arr); /* * OPTIONAL operations with no default implementation. @@ -312,10 +320,11 @@ SUNDIALS_EXPORT sunbooleantype N_VConstrMaskLocal(N_Vector c, N_Vector x, SUNDIALS_EXPORT sunrealtype N_VMinQuotientLocal(N_Vector num, N_Vector denom); /* single buffer reduction operations */ -SUNDIALS_EXPORT SUNErrCode N_VDotProdMultiLocal(int nvec, N_Vector x, N_Vector* Y, - sunrealtype* dotprods); +SUNDIALS_EXPORT SUNErrCode N_VDotProdMultiLocal(int nvec, N_Vector x, + N_Vector1d Y_arr, + sunrealtype1d dotprods); SUNDIALS_EXPORT SUNErrCode N_VDotProdMultiAllReduce(int nvec_total, N_Vector x, - sunrealtype* sum); + sunrealtype1d sum); /* XBraid interface operations */ SUNDIALS_EXPORT SUNErrCode N_VBufSize(N_Vector x, sunindextype* size); @@ -326,14 +335,15 @@ SUNDIALS_EXPORT SUNErrCode N_VBufUnpack(N_Vector x, void* buf); * Additional functions exported by NVECTOR module * ----------------------------------------------------------------- */ -SUNDIALS_EXPORT N_Vector* N_VNewVectorArray(int count, SUNContext sunctx); -SUNDIALS_EXPORT N_Vector* N_VCloneEmptyVectorArray(int count, N_Vector w); -SUNDIALS_EXPORT N_Vector* N_VCloneVectorArray(int count, N_Vector w); -SUNDIALS_EXPORT void N_VDestroyVectorArray(N_Vector* vs, int count); +SUNDIALS_EXPORT N_Vector1d N_VNewVectorArray(int count, SUNContext sunctx); +SUNDIALS_EXPORT N_Vector1d N_VCloneEmptyVectorArray(int count, N_Vector w); +SUNDIALS_EXPORT N_Vector1d N_VCloneVectorArray(int count, N_Vector w); +SUNDIALS_EXPORT void N_VDestroyVectorArray(N_Vector1d vs_arr, int count); /* These function are really only for users of the Fortran interface */ -SUNDIALS_EXPORT N_Vector N_VGetVecAtIndexVectorArray(N_Vector* vs, int index); -SUNDIALS_EXPORT void N_VSetVecAtIndexVectorArray(N_Vector* vs, int index, +SUNDIALS_EXPORT N_Vector N_VGetVecAtIndexVectorArray( + N_Vector1d vs_arr, int index); // py::return_value_policy::reference +SUNDIALS_EXPORT void N_VSetVecAtIndexVectorArray(N_Vector1d vs_arr, int index, N_Vector w); /* ----------------------------------------------------------------- diff --git a/include/sundials/sundials_nvector.hpp b/include/sundials/sundials_nvector.hpp index cd40a3f847..842c4c16ad 100644 --- a/include/sundials/sundials_nvector.hpp +++ b/include/sundials/sundials_nvector.hpp @@ -17,9 +17,9 @@ #ifndef _SUNDIALS_NVECTOR_HPP #define _SUNDIALS_NVECTOR_HPP -#include #include #include +#include "sundials_nvector.h" namespace sundials { namespace impl { @@ -27,6 +27,7 @@ using BaseNVector = BaseObject<_generic_N_Vector, _generic_N_Vector_Ops>; } // namespace impl namespace experimental { + struct NVectorDeleter { void operator()(N_Vector v) @@ -35,7 +36,20 @@ struct NVectorDeleter } }; -using NVectorView = ClassView; +class NVectorView : public ClassView +{ +public: + using ClassView::ClassView; + template + static NVectorView Create(Args&&... args); +}; + +template +NVectorView NVectorView::Create(Args&&... args) +{ + return NVectorView(std::forward(args)...); +} + } // namespace experimental } // namespace sundials diff --git a/include/sundials/sundials_nvector_senswrapper.h b/include/sundials/sundials_nvector_senswrapper.h index 25b1468715..dd6404de57 100644 --- a/include/sundials/sundials_nvector_senswrapper.h +++ b/include/sundials/sundials_nvector_senswrapper.h @@ -39,7 +39,7 @@ extern "C" { struct _N_VectorContent_SensWrapper { - N_Vector* vecs; /* array of wrapped vectors */ + N_Vector1d vecs; /* array of wrapped vectors */ int nvecs; /* number of wrapped vectors */ sunbooleantype own_vecs; /* flag indicating if wrapper owns vectors */ }; diff --git a/include/sundials/sundials_profiler.hpp b/include/sundials/sundials_profiler.hpp index 017d613612..f9f06303f7 100644 --- a/include/sundials/sundials_profiler.hpp +++ b/include/sundials/sundials_profiler.hpp @@ -16,6 +16,7 @@ #define _SUNDIALS_PROFILER_HPP #include +#include #include #include @@ -47,6 +48,56 @@ class ProfilerMarkScope SUNProfiler prof_; const char* name_; }; + +namespace experimental { + +class SUNProfilerView : public sundials::ConvertibleTo +{ +public: + SUNProfilerView(SUNComm comm, const char* title) + { + profiler_ = std::make_unique(); + SUNProfiler_Create(comm, title, profiler_.get()); + } + + SUNProfilerView(SUNProfiler sunctx) { profiler_.reset(&sunctx); } + + /* disallow copy, but allow move construction */ + SUNProfilerView(const SUNProfilerView&) = delete; + SUNProfilerView(SUNProfilerView&&) = default; + + /* disallow copy, but allow move operators */ + SUNProfilerView& operator=(const SUNProfilerView&) = delete; + SUNProfilerView& operator=(SUNProfilerView&&) = default; + + SUNProfiler get() override { return *profiler_.get(); } + + SUNProfiler get() const override { return *profiler_.get(); } + + operator SUNProfiler() override { return *profiler_.get(); } + + operator SUNProfiler() const override { return *profiler_.get(); } + + template + static SUNProfilerView Create(Args&&... args); + + ~SUNProfilerView() + { + if (profiler_) { SUNProfiler_Free(profiler_.get()); } + } + +private: + std::unique_ptr profiler_; +}; + +template +SUNProfilerView SUNProfilerView::Create(Args&&... args) +{ + return SUNProfilerView(std::forward(args)...); +} + +} // namespace experimental + } // namespace sundials #endif /* SUNDIALS_PROFILER_HPP */ diff --git a/include/sundials/sundials_stepper.h b/include/sundials/sundials_stepper.h index bfd802a944..cba8f37f8f 100644 --- a/include/sundials/sundials_stepper.h +++ b/include/sundials/sundials_stepper.h @@ -66,7 +66,7 @@ typedef SUNErrCode (*SUNStepperSetStepDirectionFn)(SUNStepper stepper, typedef SUNErrCode (*SUNStepperSetForcingFn)(SUNStepper stepper, sunrealtype tshift, sunrealtype tscale, - N_Vector* forcing, int nforcing); + N_Vector1d forcing, int nforcing); typedef SUNErrCode (*SUNStepperGetNumStepsFn)(SUNStepper stepper, suncountertype* nst); @@ -109,7 +109,7 @@ SUNErrCode SUNStepper_SetStepDirection(SUNStepper stepper, sunrealtype stepdir); SUNDIALS_EXPORT SUNErrCode SUNStepper_SetForcing(SUNStepper stepper, sunrealtype tshift, - sunrealtype tscale, N_Vector* forcing, + sunrealtype tscale, N_Vector1d forcing, int nforcing); SUNDIALS_EXPORT diff --git a/include/sundials/sundials_stepper.hpp b/include/sundials/sundials_stepper.hpp new file mode 100644 index 0000000000..684503b388 --- /dev/null +++ b/include/sundials/sundials_stepper.hpp @@ -0,0 +1,62 @@ +/* ----------------------------------------------------------------------------- + * Programmer(s): Cody J. Balos @ LLNL + * ----------------------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2025, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * ----------------------------------------------------------------------------- + * C++ view of SUNDIALS SUNStepper + * ---------------------------------------------------------------------------*/ + +#ifndef _SUNDIALS_STEPPER_HPP +#define _SUNDIALS_STEPPER_HPP + +#include +#include +#include + +namespace sundials { + +namespace experimental { + +struct SUNStepperDeleter +{ + void operator()(SUNStepper self) + { + if (self) { SUNStepper_Destroy(&self); } + } +}; + +class SUNStepperView : public ClassView +{ +public: + using ClassView::ClassView; + + template + static SUNStepperView Create(Args&&... args); +}; + +template<> +SUNStepperView SUNStepperView::Create(SUNStepper&& stepper) +{ + return SUNStepperView(std::forward(stepper)); +} + +template +SUNStepperView SUNStepperView::Create(Args&&... args) +{ + SUNStepper stepper; + SUNStepper_Create(std::forward(args)..., &stepper); + return SUNStepperView(std::move(stepper)); +} + +} // namespace experimental +} // namespace sundials + +#endif diff --git a/include/sundials/sundials_types.h b/include/sundials/sundials_types.h index 1e38985ff0..697f10ea4c 100644 --- a/include/sundials/sundials_types.h +++ b/include/sundials/sundials_types.h @@ -124,6 +124,19 @@ typedef long double sunrealtype; #endif +/* + *----------------------------------------------------------------------------- + * Type(s): sunrealtype1d, sunrealtype2d, sunrealtype3d + * These types are to be used in place of sunrealtype*, sunrealtype**, and + * sunrealtype*** when semantically these map to arrays. I.e., if sunrealtype* + * refers to an array, then use sunrealtype1d. If it refers to a + * a pointer to a singular value (for "out" params), use sunrealtype*. + *----------------------------------------------------------------------------- + */ +typedef sunrealtype* sunrealtype1d; +typedef sunrealtype** sunrealtype2d; +typedef sunrealtype*** sunrealtype3d; + /* *------------------------------------------------------------------ * Type : sunindextype @@ -137,6 +150,20 @@ typedef long double sunrealtype; typedef SUNDIALS_INDEX_TYPE sunindextype; + +/* + *----------------------------------------------------------------------------- + * Type(s): sunindextype1d, sunindextype2d, sunindextype3d + * These types are to be used in place of sunindextype*, sunindextype**, and + * sunindextype*** when semantically these map to arrays. I.e., if sunindextype* + * refers to an array, then use sunindextype1d. If it refers to a + * a pointer to a singular value (for "out" params), use sunindextype*. + *----------------------------------------------------------------------------- + */ +typedef sunindextype* sunindextype1d; +typedef sunindextype** sunindextype2d; +typedef sunindextype*** sunindextype3d; + /* *------------------------------------------------------------------ * Type : suncountertype @@ -176,6 +203,16 @@ typedef SUNDIALS_COUNTER_TYPE suncountertype; #define SUNTRUE 1 #endif +/* + *------------------------------------------------------------------ + * Type : int1d + *------------------------------------------------------------------ + * typedef for an int* which should be treated as an array of int. + *------------------------------------------------------------------ + */ + +typedef int* int1d; + /* *------------------------------------------------------------------ * Type : SUNOutputFormat @@ -184,11 +221,13 @@ typedef SUNDIALS_COUNTER_TYPE suncountertype; *------------------------------------------------------------------ */ -typedef enum +enum SUNOutputFormat_ { SUN_OUTPUTFORMAT_TABLE, SUN_OUTPUTFORMAT_CSV -} SUNOutputFormat; +}; + +typedef enum SUNOutputFormat_ SUNOutputFormat; /* *------------------------------------------------------------------ @@ -238,15 +277,17 @@ typedef void (*SUNErrHandlerFn)(int line, const char* func, const char* file, because we manually insert the wrapper code for SUN_COMM_NULL (and %ignoring it in the SWIG code doesn't seem to work). */ +#ifndef SWIG +#define SUN_COMM_NULL 0 +#endif + #if SUNDIALS_MPI_ENABLED #ifndef SWIG +#undef SUN_COMM_NULL #define SUN_COMM_NULL MPI_COMM_NULL #endif typedef MPI_Comm SUNComm; #else -#ifndef SWIG -#define SUN_COMM_NULL 0 -#endif typedef int SUNComm; #endif @@ -263,9 +304,14 @@ typedef int SUNComm; *------------------------------------------------------------------ */ -typedef enum +enum SUNDataIOMode_ { - SUNDATAIOMODE_INMEM, -} SUNDataIOMode; + SUN_DATAIOMODE_INMEM, +}; + +/* For backwards compatibility with the old name */ +static const int SUNDATAIOMODE_INMEM = SUN_DATAIOMODE_INMEM; + +typedef enum SUNDataIOMode_ SUNDataIOMode; #endif /* _SUNDIALS_TYPES_H */ diff --git a/include/sunlinsol/sunlinsol_ginkgo.hpp b/include/sunlinsol/sunlinsol_ginkgo.hpp index b6fe7c0f4e..a1a834db95 100644 --- a/include/sunlinsol/sunlinsol_ginkgo.hpp +++ b/include/sunlinsol/sunlinsol_ginkgo.hpp @@ -251,10 +251,10 @@ class LinearSolver : public ConvertibleTo operator SUNLinearSolver() const override { return sunlinsol_.get(); } /// Explicit conversion to a :c:type:`SUNLinearSolver` - SUNLinearSolver Convert() override { return sunlinsol_.get(); } + SUNLinearSolver get() override { return sunlinsol_.get(); } /// Explicit conversion to a :c:type:`SUNLinearSolver` - SUNLinearSolver Convert() const override { return sunlinsol_.get(); } + SUNLinearSolver get() const override { return sunlinsol_.get(); } /// Get the ``gko::Executor`` associated with the Ginkgo solver std::shared_ptr GkoExec() const diff --git a/include/sunlinsol/sunlinsol_kokkosdense.hpp b/include/sunlinsol/sunlinsol_kokkosdense.hpp index ac0672e224..d95ecb4b54 100644 --- a/include/sunlinsol/sunlinsol_kokkosdense.hpp +++ b/include/sunlinsol/sunlinsol_kokkosdense.hpp @@ -206,10 +206,10 @@ class DenseLinearSolver : public sundials::impl::BaseLinearSolver, operator SUNLinearSolver() const override { return object_.get(); } // Explicit conversion to a SUNLinearSolver - SUNLinearSolver Convert() override { return object_.get(); } + SUNLinearSolver get() override { return object_.get(); } // Explicit conversion to a SUNLinearSolver - SUNLinearSolver Convert() const override { return object_.get(); } + SUNLinearSolver get() const override { return object_.get(); } private: void initSUNLinearSolver() diff --git a/include/sunmatrix/sunmatrix_band.h b/include/sunmatrix/sunmatrix_band.h index a1b0a58532..10edadf17e 100644 --- a/include/sunmatrix/sunmatrix_band.h +++ b/include/sunmatrix/sunmatrix_band.h @@ -108,9 +108,9 @@ SUNDIALS_EXPORT sunindextype SUNBandMatrix_UpperBandwidth(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNBandMatrix_StoredUpperBandwidth(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNBandMatrix_LDim(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNBandMatrix_LData(SUNMatrix A); -SUNDIALS_EXPORT sunrealtype* SUNBandMatrix_Data(SUNMatrix A); -SUNDIALS_EXPORT sunrealtype** SUNBandMatrix_Cols(SUNMatrix A); -SUNDIALS_EXPORT sunrealtype* SUNBandMatrix_Column(SUNMatrix A, sunindextype j); +SUNDIALS_EXPORT sunrealtype1d SUNBandMatrix_Data(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype2d SUNBandMatrix_Cols(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype1d SUNBandMatrix_Column(SUNMatrix A, sunindextype j); SUNDIALS_EXPORT SUNMatrix_ID SUNMatGetID_Band(SUNMatrix A); SUNDIALS_EXPORT SUNMatrix SUNMatClone_Band(SUNMatrix A); diff --git a/include/sunmatrix/sunmatrix_dense.h b/include/sunmatrix/sunmatrix_dense.h index 6d22492c4d..f5f7b93cb8 100644 --- a/include/sunmatrix/sunmatrix_dense.h +++ b/include/sunmatrix/sunmatrix_dense.h @@ -85,9 +85,9 @@ SUNDIALS_EXPORT void SUNDenseMatrix_Print(SUNMatrix A, FILE* outfile); SUNDIALS_EXPORT sunindextype SUNDenseMatrix_Rows(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNDenseMatrix_Columns(SUNMatrix A); SUNDIALS_EXPORT sunindextype SUNDenseMatrix_LData(SUNMatrix A); -SUNDIALS_EXPORT sunrealtype* SUNDenseMatrix_Data(SUNMatrix A); -SUNDIALS_EXPORT sunrealtype** SUNDenseMatrix_Cols(SUNMatrix A); -SUNDIALS_EXPORT sunrealtype* SUNDenseMatrix_Column(SUNMatrix A, sunindextype j); +SUNDIALS_EXPORT sunrealtype1d SUNDenseMatrix_Data(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype2d SUNDenseMatrix_Cols(SUNMatrix A); +SUNDIALS_EXPORT sunrealtype1d SUNDenseMatrix_Column(SUNMatrix A, sunindextype j); SUNDIALS_EXPORT SUNMatrix_ID SUNMatGetID_Dense(SUNMatrix A); SUNDIALS_EXPORT SUNMatrix SUNMatClone_Dense(SUNMatrix A); diff --git a/include/sunmatrix/sunmatrix_ginkgo.hpp b/include/sunmatrix/sunmatrix_ginkgo.hpp index 13002dc570..0e33e16f72 100644 --- a/include/sunmatrix/sunmatrix_ginkgo.hpp +++ b/include/sunmatrix/sunmatrix_ginkgo.hpp @@ -92,7 +92,7 @@ SUNMatrix SUNMatClone_Ginkgo(SUNMatrix A) { auto A_mat{static_cast*>(A->content)}; auto new_mat{new Matrix(*A_mat)}; // NOLINT - return new_mat->Convert(); + return new_mat->get(); } template @@ -229,10 +229,10 @@ class Matrix : public sundials::impl::BaseMatrix, operator SUNMatrix() const override { return object_.get(); } /// Explicit conversion to a :c:type:`SUNMatrix` - SUNMatrix Convert() override { return object_.get(); } + SUNMatrix get() override { return object_.get(); } /// Explicit conversion to a :c:type:`SUNMatrix` - SUNMatrix Convert() const override { return object_.get(); } + SUNMatrix get() const override { return object_.get(); } private: std::shared_ptr gkomtx_; diff --git a/include/sunmatrix/sunmatrix_kokkosdense.hpp b/include/sunmatrix/sunmatrix_kokkosdense.hpp index 793dd8e0e7..4c5490bd73 100644 --- a/include/sunmatrix/sunmatrix_kokkosdense.hpp +++ b/include/sunmatrix/sunmatrix_kokkosdense.hpp @@ -56,7 +56,7 @@ SUNMatrix SUNMatClone_KokkosDense(SUNMatrix A) { auto A_mat{GetDenseMat(A)}; auto new_mat{new MatrixType(*A_mat)}; - return new_mat->Convert(); + return new_mat->get(); } template @@ -373,10 +373,10 @@ class DenseMatrix : public sundials::impl::BaseMatrix, operator SUNMatrix() const override { return object_.get(); } // Explicit conversion to a SUNMatrix - SUNMatrix Convert() override { return object_.get(); } + SUNMatrix get() override { return object_.get(); } // Explicit conversion to a SUNMatrix - SUNMatrix Convert() const override { return object_.get(); } + SUNMatrix get() const override { return object_.get(); } private: exec_space exec_space_; // Kokkos execution space diff --git a/include/sunmatrix/sunmatrix_sparse.h b/include/sunmatrix/sunmatrix_sparse.h index 697812dbb4..159f7f1e69 100644 --- a/include/sunmatrix/sunmatrix_sparse.h +++ b/include/sunmatrix/sunmatrix_sparse.h @@ -143,13 +143,13 @@ SUNDIALS_EXPORT int SUNSparseMatrix_SparseType(SUNMatrix A); SUNDIALS_EXPORT -sunrealtype* SUNSparseMatrix_Data(SUNMatrix A); +sunrealtype1d SUNSparseMatrix_Data(SUNMatrix A); SUNDIALS_EXPORT -sunindextype* SUNSparseMatrix_IndexValues(SUNMatrix A); +sunindextype1d SUNSparseMatrix_IndexValues(SUNMatrix A); SUNDIALS_EXPORT -sunindextype* SUNSparseMatrix_IndexPointers(SUNMatrix A); +sunindextype1d SUNSparseMatrix_IndexPointers(SUNMatrix A); SUNDIALS_EXPORT SUNMatrix_ID SUNMatGetID_Sparse(SUNMatrix A); diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index 8ee3920ed7..d080d72ba1 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -1277,6 +1277,13 @@ void ARKodeFree(void** arkode_mem) ark_mem->relax_mem = NULL; } + /* free user data if ARKODE owns it */ + if (ark_mem->own_user_data && (ark_mem->user_data != NULL)) + { + free(ark_mem->user_data); + ark_mem->user_data = NULL; + } + free(*arkode_mem); *arkode_mem = NULL; } @@ -1592,7 +1599,8 @@ ARKodeMem arkCreate(SUNContext sunctx) ark_mem->ProcessStage = NULL; /* No user_data pointer yet */ - ark_mem->user_data = NULL; + ark_mem->user_data = NULL; + ark_mem->own_user_data = SUNFALSE; /* Allocate step adaptivity structure and note storage */ ark_mem->hadapt_mem = arkAdaptInit(); @@ -2051,6 +2059,19 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) return (retval); } + /* Load initial residual weights */ + if (ark_mem->rwt_is_ewt) + { /* update pointer to ewt */ + ark_mem->rwt = ark_mem->ewt; + } + retval = ark_mem->step_init(ark_mem, tout, ark_mem->init_type); + if (retval != ARK_SUCCESS) + { + arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, + "Error in initialization of time stepper module"); + return (retval); + } + /* Load initial residual weights */ if (ark_mem->rwt_is_ewt) { /* update pointer to ewt */ diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index fe645a941c..2884b7c363 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -378,26 +378,27 @@ struct ARKodeMemRec sunrealtype uround; /* machine unit roundoff */ /* Problem specification data */ - void* user_data; /* user ptr passed to supplied functions */ - int itol; /* itol = ARK_SS (scalar, default), + void* user_data; /* user ptr passed to supplied functions */ + sunbooleantype own_user_data; /* SUNTRUE if we own user_data and should free it */ + int itol; /* itol = ARK_SS (scalar, default), ARK_SV (vector), ARK_WF (user weight function) */ - int ritol; /* itol = ARK_SS (scalar, default), + int ritol; /* itol = ARK_SS (scalar, default), ARK_SV (vector), ARK_WF (user weight function) */ - sunrealtype reltol; /* relative tolerance */ - sunrealtype Sabstol; /* scalar absolute solution tolerance */ - N_Vector Vabstol; /* vector absolute solution tolerance */ - sunbooleantype atolmin0; /* flag indicating that min(abstol) = 0 */ - sunrealtype SRabstol; /* scalar absolute residual tolerance */ - N_Vector VRabstol; /* vector absolute residual tolerance */ - sunbooleantype Ratolmin0; /* flag indicating that min(Rabstol) = 0 */ - sunbooleantype user_efun; /* SUNTRUE if user sets efun */ - ARKEwtFn efun; /* function to set ewt */ - void* e_data; /* user pointer passed to efun */ - sunbooleantype user_rfun; /* SUNTRUE if user sets rfun */ - ARKRwtFn rfun; /* function to set rwt */ - void* r_data; /* user pointer passed to rfun */ + sunrealtype reltol; /* relative tolerance */ + sunrealtype Sabstol; /* scalar absolute solution tolerance */ + N_Vector Vabstol; /* vector absolute solution tolerance */ + sunbooleantype atolmin0; /* flag indicating that min(abstol) = 0 */ + sunrealtype SRabstol; /* scalar absolute residual tolerance */ + N_Vector VRabstol; /* vector absolute residual tolerance */ + sunbooleantype Ratolmin0; /* flag indicating that min(Rabstol) = 0 */ + sunbooleantype user_efun; /* SUNTRUE if user sets efun */ + ARKEwtFn efun; /* function to set ewt */ + void* e_data; /* user pointer passed to efun */ + sunbooleantype user_rfun; /* SUNTRUE if user sets rfun */ + ARKRwtFn rfun; /* function to set rwt */ + void* r_data; /* user pointer passed to rfun */ sunbooleantype constraintsSet; /* check inequality constraints */ /* Time stepper module -- general */ diff --git a/src/arkode/arkode_io.c b/src/arkode/arkode_io.c index bdbc1e47e2..0c1573d8db 100644 --- a/src/arkode/arkode_io.c +++ b/src/arkode/arkode_io.c @@ -879,6 +879,29 @@ int ARKodeSetUserData(void* arkode_mem, void* user_data) return (ARK_SUCCESS); } +/*--------------------------------------------------------------- + ARKodeSetOwnUserData: + + Set whether the ARKodeMem structure owns the user data pointer. + If set to SUNTRUE, ARKode will free the user data pointer when + ARKodeFree is called. + ---------------------------------------------------------------*/ +int ARKodeSetOwnUserData(void* arkode_mem, sunbooleantype own_user_data) +{ + ARKodeMem ark_mem; + if (arkode_mem == NULL) + { + arkProcessError(NULL, ARK_MEM_NULL, __LINE__, __func__, __FILE__, + MSG_ARK_NO_MEM); + return (ARK_MEM_NULL); + } + ark_mem = (ARKodeMem)arkode_mem; + + ark_mem->own_user_data = own_user_data; + + return (ARK_SUCCESS); +} + /*--------------------------------------------------------------- ARKodeSetAdaptController: diff --git a/src/arkode/arkode_mristep.c b/src/arkode/arkode_mristep.c index cdd0508fda..99437ca857 100644 --- a/src/arkode/arkode_mristep.c +++ b/src/arkode/arkode_mristep.c @@ -4324,6 +4324,9 @@ int MRIStepInnerStepper_Free(MRIStepInnerStepper* stepper) /* free operations structure */ free((*stepper)->ops); + /* free python data */ + free((*stepper)->python); + /* free inner stepper mem */ free(*stepper); *stepper = NULL; diff --git a/src/arkode/arkode_mristep_impl.h b/src/arkode/arkode_mristep_impl.h index b029714399..e33b9937b8 100644 --- a/src/arkode/arkode_mristep_impl.h +++ b/src/arkode/arkode_mristep_impl.h @@ -183,6 +183,7 @@ struct _MRIStepInnerStepper { /* stepper specific content and operations */ void* content; + void* python; MRIStepInnerStepper_Ops ops; /* stepper context */ diff --git a/src/arkode/arkode_sprk.c b/src/arkode/arkode_sprk.c index e65a5fb496..faf4f12846 100644 --- a/src/arkode/arkode_sprk.c +++ b/src/arkode/arkode_sprk.c @@ -401,8 +401,8 @@ static ARKodeSPRKTable arkodeSymplecticSofroniou10(void) return sprk_table; } -ARKodeSPRKTable ARKodeSPRKTable_Create(int s, int q, const sunrealtype* a, - const sunrealtype* ahat) +ARKodeSPRKTable ARKodeSPRKTable_Create(int s, int q, sunrealtype1d a, + sunrealtype1d ahat) { if (s < 1 || !a || !ahat) { return NULL; } diff --git a/src/cvode/cvode.c b/src/cvode/cvode.c index ef03280257..0d33f5e932 100644 --- a/src/cvode/cvode.c +++ b/src/cvode/cvode.c @@ -272,6 +272,7 @@ void* CVodeCreate(int lmm, SUNContext sunctx) /* Set default values for integrator optional inputs */ cv_mem->cv_f = NULL; cv_mem->cv_user_data = NULL; + cv_mem->cv_own_user_data = SUNFALSE; cv_mem->cv_itol = CV_NN; cv_mem->cv_atolmin0 = SUNTRUE; cv_mem->cv_user_efun = SUNFALSE; @@ -1815,6 +1816,8 @@ void CVodeFree(void** cvode_mem) if (cv_mem->proj_mem) { cvProjFree(&(cv_mem->proj_mem)); } + if (cv_mem->cv_own_user_data) { free(cv_mem->cv_user_data); } + free(*cvode_mem); *cvode_mem = NULL; } diff --git a/src/cvode/cvode_impl.h b/src/cvode/cvode_impl.h index edf5b0a3c1..f6c78f823a 100644 --- a/src/cvode/cvode_impl.h +++ b/src/cvode/cvode_impl.h @@ -202,8 +202,9 @@ typedef struct CVodeMemRec CVRhsFn cv_f; /* y' = f(t,y(t)) */ void* cv_user_data; /* user pointer passed to f */ - int cv_lmm; /* lmm = CV_ADAMS or CV_BDF */ - int cv_itol; /* itol = CV_SS, CV_SV, CV_WF, CV_NN */ + sunbooleantype cv_own_user_data; /* SUNTRUE if we own user_data and should free it */ + int cv_lmm; /* lmm = CV_ADAMS or CV_BDF */ + int cv_itol; /* itol = CV_SS, CV_SV, CV_WF, CV_NN */ sunrealtype cv_reltol; /* relative tolerance */ sunrealtype cv_Sabstol; /* scalar absolute tolerance */ diff --git a/src/cvode/cvode_io.c b/src/cvode/cvode_io.c index fc16633d2f..6c2c47d9da 100644 --- a/src/cvode/cvode_io.c +++ b/src/cvode/cvode_io.c @@ -81,6 +81,29 @@ int CVodeSetUserData(void* cvode_mem, void* user_data) return (CV_SUCCESS); } +/* + * CVodeSetOwnUserData + * + * Specifies whether the integrator owns the user data pointer. + */ + +int CVodeSetOwnUserData(void* cvode_mem, sunbooleantype own_user_data) +{ + CVodeMem cv_mem; + + if (cvode_mem == NULL) + { + cvProcessError(NULL, CV_MEM_NULL, __LINE__, __func__, __FILE__, MSGCV_NO_MEM); + return (CV_MEM_NULL); + } + + cv_mem = (CVodeMem)cvode_mem; + + cv_mem->cv_own_user_data = own_user_data; + + return (CV_SUCCESS); +} + /* * CVodeSetMonitorFn * diff --git a/src/cvodes/cvodea.c b/src/cvodes/cvodea.c index 96e00e59f2..7291a109f2 100644 --- a/src/cvodes/cvodea.c +++ b/src/cvodes/cvodea.c @@ -726,7 +726,8 @@ int CVodeCreateB(void* cvode_mem, int lmmB, int* which) new_cvB_mem->cv_fQ = NULL; new_cvB_mem->cv_fQs = NULL; - new_cvB_mem->cv_user_data = NULL; + new_cvB_mem->cv_user_data = NULL; + new_cvB_mem->cv_own_user_data = SUNFALSE; new_cvB_mem->cv_lmem = NULL; new_cvB_mem->cv_lfree = NULL; diff --git a/src/cvodes/cvodea_io.c b/src/cvodes/cvodea_io.c index 1d23c5a42c..10bbf2e364 100644 --- a/src/cvodes/cvodea_io.c +++ b/src/cvodes/cvodea_io.c @@ -171,6 +171,92 @@ int CVodeSetUserDataB(void* cvode_mem, int which, void* user_dataB) return (CV_SUCCESS); } +int CVodeSetOwnUserDataB(void* cvode_mem, int which, sunbooleantype own_user_data) +{ + CVodeMem cv_mem; + CVadjMem ca_mem; + CVodeBMem cvB_mem; + + /* Check if cvode_mem exists */ + if (cvode_mem == NULL) + { + cvProcessError(NULL, CV_MEM_NULL, __LINE__, __func__, __FILE__, MSGCV_NO_MEM); + return (CV_MEM_NULL); + } + cv_mem = (CVodeMem)cvode_mem; + + /* Was ASA initialized? */ + if (cv_mem->cv_adjMallocDone == SUNFALSE) + { + cvProcessError(cv_mem, CV_NO_ADJ, __LINE__, __func__, __FILE__, MSGCV_NO_ADJ); + return (CV_NO_ADJ); + } + ca_mem = cv_mem->cv_adj_mem; + + /* Check which */ + if (which >= ca_mem->ca_nbckpbs) + { + cvProcessError(cv_mem, CV_ILL_INPUT, __LINE__, __func__, __FILE__, + MSGCV_BAD_WHICH); + return (CV_ILL_INPUT); + } + + /* Find the CVodeBMem entry in the linked list corresponding to which */ + cvB_mem = ca_mem->cvB_mem; + while (cvB_mem != NULL) + { + if (which == cvB_mem->cv_index) { break; } + cvB_mem = cvB_mem->cv_next; + } + + cvB_mem->cv_own_user_data = own_user_data; + + return (CV_SUCCESS); +} + +int CVodeGetUserDataB(void* cvode_mem, int which, void** user_dataB) +{ + CVodeMem cv_mem; + CVadjMem ca_mem; + CVodeBMem cvB_mem; + + /* Check if cvode_mem exists */ + if (cvode_mem == NULL) + { + cvProcessError(NULL, CV_MEM_NULL, __LINE__, __func__, __FILE__, MSGCV_NO_MEM); + return (CV_MEM_NULL); + } + cv_mem = (CVodeMem)cvode_mem; + + /* Was ASA initialized? */ + if (cv_mem->cv_adjMallocDone == SUNFALSE) + { + cvProcessError(cv_mem, CV_NO_ADJ, __LINE__, __func__, __FILE__, MSGCV_NO_ADJ); + return (CV_NO_ADJ); + } + ca_mem = cv_mem->cv_adj_mem; + + /* Check which */ + if (which >= ca_mem->ca_nbckpbs) + { + cvProcessError(cv_mem, CV_ILL_INPUT, __LINE__, __func__, __FILE__, + MSGCV_BAD_WHICH); + return (CV_ILL_INPUT); + } + + /* Find the CVodeBMem entry in the linked list corresponding to which */ + cvB_mem = ca_mem->cvB_mem; + while (cvB_mem != NULL) + { + if (which == cvB_mem->cv_index) { break; } + cvB_mem = cvB_mem->cv_next; + } + + *user_dataB = cvB_mem->cv_user_data; + + return (CV_SUCCESS); +} + int CVodeSetMaxOrdB(void* cvode_mem, int which, int maxordB) { CVodeMem cv_mem; diff --git a/src/cvodes/cvodes.c b/src/cvodes/cvodes.c index 2e4f559d18..c3de1eee7c 100644 --- a/src/cvodes/cvodes.c +++ b/src/cvodes/cvodes.c @@ -507,6 +507,7 @@ void* CVodeCreate(int lmm, SUNContext sunctx) /* Set default values for integrator optional inputs */ cv_mem->cv_f = NULL; cv_mem->cv_user_data = NULL; + cv_mem->cv_own_user_data = SUNFALSE; cv_mem->cv_itol = CV_NN; cv_mem->cv_atolmin0 = SUNTRUE; cv_mem->cv_user_efun = SUNFALSE; @@ -4453,6 +4454,8 @@ void CVodeFree(void** cvode_mem) if (cv_mem->proj_mem) { cvProjFree(&(cv_mem->proj_mem)); } + if (cv_mem->cv_own_user_data) { free(cv_mem->cv_user_data); } + free(*cvode_mem); *cvode_mem = NULL; } diff --git a/src/cvodes/cvodes_impl.h b/src/cvodes/cvodes_impl.h index 3b202aec63..ea3bf3d121 100644 --- a/src/cvodes/cvodes_impl.h +++ b/src/cvodes/cvodes_impl.h @@ -233,8 +233,9 @@ typedef struct CVodeMemRec CVRhsFn cv_f; /* y' = f(t,y(t)) */ void* cv_user_data; /* user pointer passed to f */ - int cv_lmm; /* lmm = CV_ADAMS or CV_BDF */ - int cv_itol; /* itol = CV_SS, CV_SV, CV_WF, CV_NN */ + sunbooleantype cv_own_user_data; /* SUNTRUE if we own user_data and should free it */ + int cv_lmm; /* lmm = CV_ADAMS or CV_BDF */ + int cv_itol; /* itol = CV_SS, CV_SV, CV_WF, CV_NN */ sunrealtype cv_reltol; /* relative tolerance */ sunrealtype cv_Sabstol; /* scalar absolute tolerance */ @@ -851,6 +852,7 @@ struct CVodeBMemRec /* User user_data */ void* cv_user_data; + sunbooleantype cv_own_user_data; /* Memory block for a linear solver's interface to CVODEA */ void* cv_lmem; diff --git a/src/cvodes/cvodes_io.c b/src/cvodes/cvodes_io.c index 7087ddd853..d6e9035fd8 100644 --- a/src/cvodes/cvodes_io.c +++ b/src/cvodes/cvodes_io.c @@ -81,6 +81,29 @@ int CVodeSetUserData(void* cvode_mem, void* user_data) return (CV_SUCCESS); } +/* + * CVodeSetOwnUserData + * + * Specifies whether the user data pointer is owned by CVODES. + */ + +int CVodeSetOwnUserData(void* cvode_mem, sunbooleantype own_user_data) +{ + CVodeMem cv_mem; + + if (cvode_mem == NULL) + { + cvProcessError(NULL, CV_MEM_NULL, __LINE__, __func__, __FILE__, MSGCV_NO_MEM); + return (CV_MEM_NULL); + } + + cv_mem = (CVodeMem)cvode_mem; + + cv_mem->cv_own_user_data = own_user_data; + + return (CV_SUCCESS); +} + /* * CVodeSetMonitorFn * diff --git a/src/ida/ida.c b/src/ida/ida.c index 364d4364ef..17cc9269e9 100644 --- a/src/ida/ida.c +++ b/src/ida/ida.c @@ -301,6 +301,7 @@ void* IDACreate(SUNContext sunctx) /* Set default values for integrator optional inputs */ IDA_mem->ida_res = NULL; IDA_mem->ida_user_data = NULL; + IDA_mem->ida_own_user_data = SUNFALSE; IDA_mem->ida_itol = IDA_NN; IDA_mem->ida_atolmin0 = SUNTRUE; IDA_mem->ida_user_efun = SUNFALSE; @@ -1718,6 +1719,8 @@ void IDAFree(void** ida_mem) IDA_mem->ida_gactive = NULL; } + if (IDA_mem->ida_own_user_data) { free(IDA_mem->ida_user_data); } + free(*ida_mem); *ida_mem = NULL; } diff --git a/src/ida/ida_impl.h b/src/ida/ida_impl.h index ead0816242..09b92671d9 100644 --- a/src/ida/ida_impl.h +++ b/src/ida/ida_impl.h @@ -94,8 +94,9 @@ typedef struct IDAMemRec Problem Specification Data --------------------------*/ - IDAResFn ida_res; /* F(t,y(t),y'(t))=0; the function F */ - void* ida_user_data; /* user pointer passed to res */ + IDAResFn ida_res; /* F(t,y(t),y'(t))=0; the function F */ + void* ida_user_data; /* user pointer passed to res */ + sunbooleantype ida_own_user_data; /* SUNTRUE if we own user_data and should free it */ int ida_itol; /* itol = IDA_SS, IDA_SV, IDA_WF, IDA_NN */ sunrealtype ida_rtol; /* relative tolerance */ diff --git a/src/ida/ida_io.c b/src/ida/ida_io.c index 6a820126ce..04aa69f4ba 100644 --- a/src/ida/ida_io.c +++ b/src/ida/ida_io.c @@ -74,6 +74,25 @@ int IDASetUserData(void* ida_mem, void* user_data) /*-----------------------------------------------------------------*/ +int IDASetOwnUserData(void* ida_mem, sunbooleantype own_user_data) +{ + IDAMem IDA_mem; + + if (ida_mem == NULL) + { + IDAProcessError(NULL, IDA_MEM_NULL, __LINE__, __func__, __FILE__, MSG_NO_MEM); + return (IDA_MEM_NULL); + } + + IDA_mem = (IDAMem)ida_mem; + + IDA_mem->ida_own_user_data = own_user_data; + + return (IDA_SUCCESS); +} + +/*-----------------------------------------------------------------*/ + int IDASetEtaFixedStepBounds(void* ida_mem, sunrealtype eta_min_fx, sunrealtype eta_max_fx) { diff --git a/src/idas/idaa_io.c b/src/idas/idaa_io.c index 29e17f652a..4f4a956f40 100644 --- a/src/idas/idaa_io.c +++ b/src/idas/idaa_io.c @@ -726,6 +726,53 @@ int IDAGetConsistentICB(void* ida_mem, int which, N_Vector yyB0_mod, return (flag); } +/*-----------------------------------------------------------------*/ + +int IDAGetUserDataB(void* ida_mem, int which, void** user_dataB) +{ + IDAMem IDA_mem; + IDAadjMem IDAa_mem; + IDABMem IDAB_mem; + + /* Check if IDA_mem exists */ + if (ida_mem == NULL) + { + IDAProcessError(NULL, IDA_MEM_NULL, __LINE__, __func__, __FILE__, + MSGAM_NULL_IDAMEM); + return (IDA_MEM_NULL); + } + IDA_mem = (IDAMem)ida_mem; + + /* Was ASA initialized? */ + if (IDA_mem->ida_adjMallocDone == SUNFALSE) + { + IDAProcessError(IDA_mem, IDA_NO_ADJ, __LINE__, __func__, __FILE__, + MSGAM_NO_ADJ); + return (IDA_NO_ADJ); + } + IDAa_mem = IDA_mem->ida_adj_mem; + + /* Check which */ + if (which >= IDAa_mem->ia_nbckpbs) + { + IDAProcessError(IDA_mem, IDA_ILL_INPUT, __LINE__, __func__, __FILE__, + MSGAM_BAD_WHICH); + return (IDA_ILL_INPUT); + } + + /* Find the IDABMem entry in the linked list corresponding to which */ + IDAB_mem = IDAa_mem->IDAB_mem; + while (IDAB_mem != NULL) + { + if (which == IDAB_mem->ida_index) { break; } + IDAB_mem = IDAB_mem->ida_next; + } + + *user_dataB = IDAB_mem->ida_user_data; + + return (IDA_SUCCESS); +} + /* * ----------------------------------------------------------------- * Undocumented development user-callable functions diff --git a/src/idas/idas.c b/src/idas/idas.c index ebfab1d8f1..fb7fb8601a 100644 --- a/src/idas/idas.c +++ b/src/idas/idas.c @@ -430,6 +430,7 @@ void* IDACreate(SUNContext sunctx) /* Set default values for integrator optional inputs */ IDA_mem->ida_res = NULL; IDA_mem->ida_user_data = NULL; + IDA_mem->ida_own_user_data = SUNFALSE; IDA_mem->ida_itol = IDA_NN; IDA_mem->ida_atolmin0 = SUNTRUE; IDA_mem->ida_user_efun = SUNFALSE; @@ -4094,6 +4095,8 @@ void IDAFree(void** ida_mem) free(IDA_mem->ida_Zvecs); IDA_mem->ida_Zvecs = NULL; + if (IDA_mem->ida_own_user_data) { free(IDA_mem->ida_user_data); } + free(*ida_mem); *ida_mem = NULL; } diff --git a/src/idas/idas_impl.h b/src/idas/idas_impl.h index 656bd9070b..022e7fd323 100644 --- a/src/idas/idas_impl.h +++ b/src/idas/idas_impl.h @@ -104,8 +104,9 @@ typedef struct IDAMemRec Problem Specification Data --------------------------*/ - IDAResFn ida_res; /* F(t,y(t),y'(t))=0; the function F */ - void* ida_user_data; /* user pointer passed to res */ + IDAResFn ida_res; /* F(t,y(t),y'(t))=0; the function F */ + void* ida_user_data; /* user pointer passed to res */ + sunbooleantype ida_own_user_data; /* SUNTRUE if we own user_data and should free it */ int ida_itol; /* itol = IDA_SS, IDA_SV, IDA_WF, IDA_NN */ sunrealtype ida_rtol; /* relative tolerance */ diff --git a/src/idas/idas_io.c b/src/idas/idas_io.c index e297762256..c8a930ece8 100644 --- a/src/idas/idas_io.c +++ b/src/idas/idas_io.c @@ -73,6 +73,25 @@ int IDASetUserData(void* ida_mem, void* user_data) /*-----------------------------------------------------------------*/ +int IDASetOwnUserData(void* ida_mem, sunbooleantype own_user_data) +{ + IDAMem IDA_mem; + + if (ida_mem == NULL) + { + IDAProcessError(NULL, IDA_MEM_NULL, __LINE__, __func__, __FILE__, MSG_NO_MEM); + return (IDA_MEM_NULL); + } + + IDA_mem = (IDAMem)ida_mem; + + IDA_mem->ida_own_user_data = own_user_data; + + return (IDA_SUCCESS); +} + +/*-----------------------------------------------------------------*/ + int IDASetEtaFixedStepBounds(void* ida_mem, sunrealtype eta_min_fx, sunrealtype eta_max_fx) { diff --git a/src/kinsol/kinsol.c b/src/kinsol/kinsol.c index b64e02ce56..0d2d00083c 100644 --- a/src/kinsol/kinsol.c +++ b/src/kinsol/kinsol.c @@ -244,6 +244,7 @@ void* KINCreate(SUNContext sunctx) kin_mem->kin_func = NULL; kin_mem->kin_user_data = NULL; + kin_mem->kin_own_user_data = SUNFALSE; kin_mem->kin_uu = NULL; kin_mem->kin_unew = NULL; kin_mem->kin_fval = NULL; @@ -793,6 +794,8 @@ void KINFree(void** kinmem) /* free orthogonalization workspace */ KINFreeOrth(kin_mem); + if (kin_mem->kin_own_user_data) { free(kin_mem->kin_user_data); } + free(*kinmem); *kinmem = NULL; } diff --git a/src/kinsol/kinsol_impl.h b/src/kinsol/kinsol_impl.h index ad4a292d32..e7f0208265 100644 --- a/src/kinsol/kinsol_impl.h +++ b/src/kinsol/kinsol_impl.h @@ -76,9 +76,10 @@ typedef struct KINMemRec /* problem specification data */ - KINSysFn kin_func; /* nonlinear system function implementation */ - void* kin_user_data; /* work space available to func routine */ - sunrealtype kin_fnormtol; /* stopping tolerance on L2-norm of function + KINSysFn kin_func; /* nonlinear system function implementation */ + void* kin_user_data; /* work space available to func routine */ + sunbooleantype kin_own_user_data; /* SUNTRUE if we own user_data and should free it */ + sunrealtype kin_fnormtol; /* stopping tolerance on L2-norm of function value */ sunrealtype kin_scsteptol; /* scaled step length tolerance */ int kin_globalstrategy; /* choices are KIN_NONE, KIN_LINESEARCH diff --git a/src/kinsol/kinsol_io.c b/src/kinsol/kinsol_io.c index 3457a9d3b7..f0a87ee016 100644 --- a/src/kinsol/kinsol_io.c +++ b/src/kinsol/kinsol_io.c @@ -62,6 +62,28 @@ int KINSetUserData(void* kinmem, void* user_data) return (KIN_SUCCESS); } +/* + * ----------------------------------------------------------------- + * Function : KINSetOwnUserData + * ----------------------------------------------------------------- + */ + +int KINSetOwnUserData(void* kinmem, sunbooleantype own_user_data) +{ + KINMem kin_mem; + + if (kinmem == NULL) + { + KINProcessError(NULL, KIN_MEM_NULL, __LINE__, __func__, __FILE__, MSG_NO_MEM); + return (KIN_MEM_NULL); + } + + kin_mem = (KINMem)kinmem; + kin_mem->kin_own_user_data = own_user_data; + + return (KIN_SUCCESS); +} + /* * ----------------------------------------------------------------- * Function : KINSetDamping diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index b7899d66b5..590378bc10 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -22,8 +22,11 @@ install(CODE "MESSAGE(\"\nInstall shared components\n\")") # Add variable sundials_HEADERS with the exported SUNDIALS header files set(sundials_HEADERS sundials_adaptcontroller.h + sundials_adaptcontroller.hpp sundials_adjointcheckpointscheme.h + sundials_adjointcheckpointscheme.hpp sundials_adjointstepper.h + sundials_adjointstepper.hpp sundials_band.h sundials_base.hpp sundials_context.h @@ -34,12 +37,14 @@ set(sundials_HEADERS sundials_dense.h sundials_direct.h sundials_domeigestimator.h + sundials_domeigestimator.hpp sundials_errors.h sundials_futils.h sundials_iterative.h sundials_linearsolver.h sundials_linearsolver.hpp sundials_logger.h + sundials_logger.hpp sundials_math.h sundials_matrix.h sundials_matrix.hpp diff --git a/src/sundials/sundials_domeigestimator.c b/src/sundials/sundials_domeigestimator.c index 43a4f405a9..9846429170 100644 --- a/src/sundials/sundials_domeigestimator.c +++ b/src/sundials/sundials_domeigestimator.c @@ -71,6 +71,7 @@ SUNDomEigEstimator SUNDomEigEstimator_NewEmpty(SUNContext sunctx) /* attach ops and initialize content and context to NULL */ DEE->ops = ops; DEE->content = NULL; + DEE->python = NULL; DEE->sunctx = sunctx; return (DEE); @@ -88,6 +89,9 @@ void SUNDomEigEstimator_FreeEmpty(SUNDomEigEstimator DEE) if (DEE->ops) { free(DEE->ops); } DEE->ops = NULL; + if (DEE->python) { free(DEE->python); } + DEE->python = NULL; + /* free overall SUNDomEigEstimator object and return */ free(DEE); return; diff --git a/src/sundials/sundials_futils.c b/src/sundials/sundials_futils.c index 38d2af7659..6f5f85bee6 100644 --- a/src/sundials/sundials_futils.c +++ b/src/sundials/sundials_futils.c @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------- - * SUNDIALS Fortran 2003 interface utility implementations. + * SUNDIALS FILE interface utility implementations. * -----------------------------------------------------------------*/ #include @@ -20,7 +20,7 @@ #include /* Create a file pointer with the given file name and mode. */ -SUNErrCode SUNDIALSFileOpen(const char* filename, const char* mode, FILE** fp_out) +SUNErrCode SUNFileOpen(const char* filename, const char* mode, FILE** fp_out) { SUNErrCode err = SUN_SUCCESS; FILE* fp = *fp_out; @@ -38,11 +38,18 @@ SUNErrCode SUNDIALSFileOpen(const char* filename, const char* mode, FILE** fp_ou return err; } +SUNErrCode SUNDIALSFileOpen(const char* filename, const char* mode, FILE** fp_out) +{ + return SUNFileOpen(filename, mode, fp_out); +} + /* Close a file pointer with the given file name. */ -SUNErrCode SUNDIALSFileClose(FILE** fp_ptr) +SUNErrCode SUNFileClose(FILE** fp_ptr) { if (!fp_ptr) { return SUN_SUCCESS; } FILE* fp = *fp_ptr; if (fp && (fp != stdout) && (fp != stderr)) { fclose(fp); } return SUN_SUCCESS; } + +SUNErrCode SUNDIALSFileClose(FILE** fp_ptr) { return SUNFileClose(fp_ptr); } diff --git a/src/sundials/sundials_nvector.c b/src/sundials/sundials_nvector.c index f998510a4d..d7d90ff2c4 100644 --- a/src/sundials/sundials_nvector.c +++ b/src/sundials/sundials_nvector.c @@ -305,7 +305,7 @@ void N_VDestroy(N_Vector v) if (v == NULL) { return; } /* if the destroy operation exists use it */ - if (v->ops->nvdestroy) { v->ops->nvdestroy(v); } + if (v->ops && v->ops->nvdestroy) { v->ops->nvdestroy(v); } else { /* if we reach this point, either ops == NULL or nvdestroy == NULL, @@ -335,7 +335,7 @@ void N_VSpace(N_Vector v, sunindextype* lrw, sunindextype* liw) sunrealtype* N_VGetArrayPointer(N_Vector v) { - if (v->ops->nvgetarraypointer) + if (v->ops && v->ops->nvgetarraypointer) { return (sunrealtype*)v->ops->nvgetarraypointer(v); } diff --git a/src/sundials/sundials_profiler.c b/src/sundials/sundials_profiler.c index 37c03349c8..ec0e6ef96a 100644 --- a/src/sundials/sundials_profiler.c +++ b/src/sundials/sundials_profiler.c @@ -24,61 +24,11 @@ #include #include -#if SUNDIALS_MPI_ENABLED -#include -#endif - -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) -#include -#include -#include -#elif defined(WIN32) || defined(_WIN32) -#include -#else -#error SUNProfiler needs POSIX or Windows timers -#endif - #include "sundials_debug.h" #include "sundials_hashmap_impl.h" +#include "sundials_profiler_impl.h" #include "sundials_macros.h" -#define SUNDIALS_ROOT_TIMER ((const char*)"From profiler epoch") - -#if defined(SUNDIALS_HAVE_POSIX_TIMERS) -typedef struct timespec sunTimespec; -#else -typedef struct _sunTimespec -{ - long int tv_sec; - long int tv_nsec; -} sunTimespec; -#endif - -/* Private functions */ -#if SUNDIALS_MPI_ENABLED -static SUNErrCode sunCollectTimers(SUNProfiler p); -#endif -static void sunPrintTimer(SUNHashMapKeyValue kv, FILE* fp, void* pvoid); -static int sunCompareTimes(const void* l, const void* r); -static int sunclock_gettime_monotonic(sunTimespec* tp); - -/* - sunTimerStruct. - A private structure holding timing information. - */ - -struct _sunTimerStruct -{ - sunTimespec* tic; - sunTimespec* toc; - double average; - double maximum; - double elapsed; - long count; -}; - -typedef struct _sunTimerStruct sunTimerStruct; - static sunTimerStruct* sunTimerStructNew(void) { sunTimerStruct* ts = (sunTimerStruct*)malloc(sizeof(sunTimerStruct)); @@ -150,21 +100,6 @@ static void sunResetTiming(sunTimerStruct* entry) entry->count = 0; } -/* - SUNProfiler. - - This structure holds all of the timers in a map.s - */ - -struct SUNProfiler_ -{ - SUNComm comm; - char* title; - SUNHashMap map; - sunTimerStruct* overhead; - double sundials_time; -}; - SUNErrCode SUNProfiler_Create(SUNComm comm, const char* title, SUNProfiler* p) { SUNProfiler profiler; diff --git a/src/sundials/sundials_profiler_impl.h b/src/sundials/sundials_profiler_impl.h new file mode 100644 index 0000000000..b637e8d8ce --- /dev/null +++ b/src/sundials/sundials_profiler_impl.h @@ -0,0 +1,93 @@ +/* ----------------------------------------------------------------- + * Programmer: Cody J. Balos @ LLNL + * ----------------------------------------------------------------- + * SUNDIALS Copyright Start + * Copyright (c) 2002-2024, Lawrence Livermore National Security + * and Southern Methodist University. + * All rights reserved. + * + * See the top-level LICENSE and NOTICE files for details. + * + * SPDX-License-Identifier: BSD-3-Clause + * SUNDIALS Copyright End + * -----------------------------------------------------------------*/ + +#ifndef SUNDIALS_PROFILER_IMPL_H_ +#define SUNDIALS_PROFILER_IMPL_H_ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#if SUNDIALS_MPI_ENABLED +#include +#endif + +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) +#include +#include +#include +#elif defined(WIN32) || defined(_WIN32) +#include +#else +#error SUNProfiler needs POSIX or Windows timers +#endif + +#include "sundials_debug.h" +#include "sundials_hashmap_impl.h" +#include "sundials_macros.h" + +#define SUNDIALS_ROOT_TIMER ((const char*)"From profiler epoch") + +#if defined(SUNDIALS_HAVE_POSIX_TIMERS) +typedef struct timespec sunTimespec; +#else +typedef struct _sunTimespec +{ + long int tv_sec; + long int tv_nsec; +} sunTimespec; +#endif + +/* Private functions */ +#if SUNDIALS_MPI_ENABLED +static SUNErrCode sunCollectTimers(SUNProfiler p); +#endif +static void sunPrintTimer(SUNHashMapKeyValue kv, FILE* fp, void* pvoid); +static int sunCompareTimes(const void* l, const void* r); +static int sunclock_gettime_monotonic(sunTimespec* tp); + +/* + sunTimerStruct. + A private structure holding timing information. + */ + +struct _sunTimerStruct +{ + sunTimespec* tic; + sunTimespec* toc; + double average; + double maximum; + double elapsed; + long count; +}; + +typedef struct _sunTimerStruct sunTimerStruct; + +struct SUNProfiler_ +{ + SUNComm comm; + char* title; + SUNHashMap map; + sunTimerStruct* overhead; + double sundials_time; +}; + +#endif diff --git a/src/sundials/sundials_stepper.c b/src/sundials/sundials_stepper.c index 10a6afbc95..1f8af4bb06 100644 --- a/src/sundials/sundials_stepper.c +++ b/src/sundials/sundials_stepper.c @@ -29,6 +29,7 @@ SUNErrCode SUNStepper_Create(SUNContext sunctx, SUNStepper* stepper_ptr) SUNAssert(stepper, SUN_ERR_MALLOC_FAIL); stepper->content = NULL; + stepper->python = NULL; stepper->sunctx = sunctx; stepper->last_flag = SUN_SUCCESS; @@ -56,6 +57,7 @@ SUNErrCode SUNStepper_Destroy(SUNStepper* stepper_ptr) const SUNStepper_Ops ops = (*stepper_ptr)->ops; if (ops && ops->destroy) { ops->destroy(*stepper_ptr); } free(ops); + free((*stepper_ptr)->python); free(*stepper_ptr); *stepper_ptr = NULL; } diff --git a/src/sundials/sundials_stepper_impl.h b/src/sundials/sundials_stepper_impl.h index ed20e3a9a8..fae173fc25 100644 --- a/src/sundials/sundials_stepper_impl.h +++ b/src/sundials/sundials_stepper_impl.h @@ -39,6 +39,9 @@ struct SUNStepper_Ops_ struct SUNStepper_ { + /* python interface specific content */ + void* python; + /* stepper specific content and operations */ void* content; SUNStepper_Ops ops; diff --git a/test/unit_tests/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp b/test/unit_tests/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp index 50a26fbae3..567174e2b6 100644 --- a/test/unit_tests/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp +++ b/test/unit_tests/sunlinsol/ginkgo/test_sunlinsol_ginkgo.cpp @@ -537,8 +537,8 @@ int main(int argc, char* argv[]) } /* Create right-hand side vector for linear solve */ - fails += SUNMatMatvecSetup(A->Convert()); - fails += SUNMatMatvec(A->Convert(), x, b); + fails += SUNMatMatvecSetup(A->get()); + fails += SUNMatMatvec(A->get(), x, b); if (fails) { std::cerr << "FAIL: SUNLinSol SUNMatMatvec failure\n"; @@ -733,12 +733,11 @@ int main(int argc, char* argv[]) } /* Run Tests */ - fails += Test_SUNLinSolGetID(LS->Convert(), SUNLINEARSOLVER_GINKGO, 0); - fails += Test_SUNLinSolGetType(LS->Convert(), - SUNLINEARSOLVER_MATRIX_ITERATIVE, 0); - fails += Test_SUNLinSolInitialize(LS->Convert(), 0); - fails += Test_SUNLinSolSetup(LS->Convert(), A->Convert(), 0); - fails += Test_SUNLinSolSolve(LS->Convert(), A->Convert(), x, b, + fails += Test_SUNLinSolGetID(LS->get(), SUNLINEARSOLVER_GINKGO, 0); + fails += Test_SUNLinSolGetType(LS->get(), SUNLINEARSOLVER_MATRIX_ITERATIVE, 0); + fails += Test_SUNLinSolInitialize(LS->get(), 0); + fails += Test_SUNLinSolSetup(LS->get(), A->get(), 0); + fails += Test_SUNLinSolSolve(LS->get(), A->get(), x, b, 1e4 * SUN_UNIT_ROUNDOFF, SUNTRUE, 0); /* Print result */ @@ -750,9 +749,8 @@ int main(int argc, char* argv[]) /* Print solve information */ std::cout << "Number of linear solver iterations: " - << static_cast(SUNLinSolNumIters(LS->Convert())) - << std::endl; - std::cout << "Final residual norm: " << SUNLinSolResNorm(LS->Convert()) + << static_cast(SUNLinSolNumIters(LS->get())) << std::endl; + std::cout << "Final residual norm: " << SUNLinSolResNorm(LS->get()) << std::endl; // clear global_exec diff --git a/tools/log_example_mri.py b/tools/log_example_mri.py index bf6e0d08e4..1578c02453 100755 --- a/tools/log_example_mri.py +++ b/tools/log_example_mri.py @@ -31,8 +31,6 @@ def main(): parser.add_argument("logfiles", type=str, nargs="+", help="Log file to plot") - parser.add_argument("--scatter", action="store_true", help="Use scatter plot for step sizes") - parser.add_argument("--stats", action="store_true", help="Print step statistics") parser.add_argument("--labels", type=str, nargs="+", help="Labels for plot legend") @@ -45,14 +43,6 @@ def main(): parser.add_argument("--step-number", action="store_true", help="Plot value vs step number") - parser.add_argument("--timescale", type=float, help="Time scaling factor") - - parser.add_argument("--stepscale", type=float, help="Step size scaling factor") - - parser.add_argument("--xlabel", type=str, help="X-axis label") - - parser.add_argument("--ylabel", type=str, help="Y-axis label") - parser.add_argument( "--step-range", type=int, @@ -133,16 +123,6 @@ def main(): x_a = times_a x_f = times_f - if args.timescale: - for level_idx in range(len(x_a)): - x_a[level_idx] = args.timescale * np.array(x_a[level_idx]) - x_f[level_idx] = args.timescale * np.array(x_f[level_idx]) - - if args.stepscale: - for level_idx in range(len(vals_a)): - vals_a[level_idx] = args.stepscale * np.array(vals_a[level_idx]) - vals_f[level_idx] = args.stepscale * np.array(vals_f[level_idx]) - # now that we've read the first log, make as many subplots as time levels if log_idx == 0: _, axes = plt.subplots(len(x_a), sharex=True) @@ -154,24 +134,14 @@ def main(): for level_idx in range(len(x_a)): # plot step attempts - if args.scatter: - axes[level_idx].scatter( - x_a[level_idx], - vals_a[level_idx], - color=colors(log_idx), - marker=".", - zorder=0.1, - label="attempts", - ) - else: - axes[level_idx].plot( - x_a[level_idx], - vals_a[level_idx], - color=colors(log_idx), - marker=".", - zorder=0.1, - label="attempts", - ) + axes[level_idx].plot( + x_a[level_idx], + vals_a[level_idx], + color=colors(log_idx), + marker=".", + zorder=0.1, + label="attempts", + ) # plot failed steps axes[level_idx].scatter( @@ -186,19 +156,8 @@ def main(): ) axes[level_idx].grid(alpha=0.3, linestyle="--") - - if args.ylabel: - axes[level_idx].set_ylabel(args.ylabel) - else: - axes[level_idx].set_ylabel("step size") - - if len(x_a) == 2: - if level_idx == 0: - axes[level_idx].set_title(f"Slow Time Scale") - else: - axes[level_idx].set_title(f"Fast Time Scale") - else: - axes[level_idx].set_title(f"Level {level_idx}") + axes[level_idx].set_ylabel("step size") + axes[level_idx].set_title(f"level {level_idx}") if args.logx: axes[level_idx].set_xscale("log") @@ -222,13 +181,10 @@ def main(): f"Avg level {level_idx} attempts per level {level_idx - 1} attempts: {len(vals_a[level_idx])/len(vals_a[level_idx - 1]):.2f}" ) - if args.xlabel: - axes[len(x_a) - 1].set_xlabel(args.xlabel) + if args.step_number: + axes[len(x_a) - 1].set_xlabel("step") else: - if args.step_number: - axes[len(x_a) - 1].set_xlabel("step") - else: - axes[len(x_a) - 1].set_xlabel("time") + axes[len(x_a) - 1].set_xlabel("time") # number of logfiles nlogs = len(args.logfiles) diff --git a/tools/suntools/logs.py b/tools/suntools/logs.py index 411d87dccc..7f170880f2 100644 --- a/tools/suntools/logs.py +++ b/tools/suntools/logs.py @@ -17,33 +17,25 @@ # ----------------------------------------------------------------------------- import re +import numpy as np from collections import ChainMap -def _convert_to_num(s): - """Try to convert a string to an int or float - - :param str s: The string to convert. - :returns: If the string is a numerical value, an integer (long long) or floating - point (double) value, otherwise the input string. - """ +def convert_to_num(s): + """Try to convert a string to an int or float""" try: - return int(s) + return np.longlong(s) except ValueError: try: - return float(s) + return np.double(s) except ValueError: return s -def _parse_logfile_payload(payload, line_number, all_lines, array_indicator="(:)"): - """Parse the payload of a log file line into a dictionary. - - :param str payload: The payload of a log file line. - :param int line_number: The line number of payload in the log file. - :param str all_lines: All the lines in the log file. - :param str array_indicator: The string that denotes an array output in the log file. - :returns: A dictionary of key-value pairs from the payload. +def parse_logfile_payload(payload, line_number, all_lines, array_indicator="(:)"): + """ + Parse the payload of a SUNDIALS log file line into a dictionary. The payload + of a SUNDIALS log file line is the part after all the [ ] brackets. """ kvpstrs = payload.split(",") kvp_dict = {} @@ -61,56 +53,42 @@ def _parse_logfile_payload(payload, line_number, all_lines, array_indicator="(:) for line in all_lines[line_number + 1 :]: if line.startswith("[") or not line.strip(): break - values.append(float(line)) + values.append(np.double(line)) kvp_dict[key.strip()] = values else: kvp_dict[key.strip()] = value.strip() return kvp_dict -def _parse_logfile_line(line, line_number, all_lines): - """Parse a line from a log file into a dictionary. - - :param str line: The log file line to parse. - :param int line_number: The line number of the line in the log file. - :param str all_lines: All the lines in the log file. - :returns: A dictionary of key-value pairs from the line payload. - - A log file line begins a preamble containing the logging level (ERROR, WARNING, - INFO, or DEBUG), the MPI rank that issued the message, the function that issued the - message (scope), and a label with additional context for the message. For - informational or debugging logs the preamble is followed by the payload which is - either a comma-separated list of key-value pairs - - .. code-block:: none - - [loglvl][rank][scope][label] key1 = value1, key2 = value2 - - or multiline output with one value per line for keys corresponding to a vector or - array - - .. code-block:: none - - [loglvl][rank][scope][label] y(:) = - y_1 - y_2 - ... +def parse_logfile_line(line, line_number, all_lines): + """ + Parse a line from a SUNDIALS log file into a dictionary. + + A log file line has the form: + [loglvl][rank][scope][label] key1 = value, key2 = value + The log line payload (everything after the brackets) can be multiline with + one value per line for keys corresponding to an array/vector: + [loglvl][rank][scope][label] y(:) = + y_1 + y_2 + ... """ pattern = re.compile(r"\[(\w+)\]\[(rank \d+)\]\[(.*)\]\[(.*)\](.*)") matches = pattern.findall(line) line_dict = {} if matches: line_dict["loglvl"] = matches[0][0] - line_dict["rank"] = _convert_to_num(matches[0][1].split()[1]) + line_dict["rank"] = convert_to_num(matches[0][1].split()[1]) line_dict["scope"] = matches[0][2] line_dict["label"] = matches[0][3] - line_dict["payload"] = _parse_logfile_payload(matches[0][4], line_number, all_lines) + line_dict["payload"] = parse_logfile_payload(matches[0][4], line_number, all_lines) return line_dict class StepData: - """Helper class for parsing a step attempt from a log file into a hierarchical - dictionary where entries may be lists of dictionaries. + """ + Helper class for parsing a step attempt from a SUNDIALS log file into a + hierarchical dictionary where entries may be lists of dictionaries. """ def __init__(self): @@ -164,17 +142,19 @@ def get_step(self): def log_file_to_list(filename): - """Parses a log file and returns a list of dictionaries. - - :param str filename: The name of the log file to parse. - :returns: A list of dictionaries. - - The list returned for a time integrator log file will contain a dictionary for each - step attempt e.g., - - .. code-block:: none - - [ {step : 1, tn : 0.0, h : 0.01, ...}, {step : 2, tn : 0.01, h : 0.10, ...}, ...] + """ + This function takes a SUNDIALS log file and creates a list where each list + element represents an integrator step attempt. + + E.g., + [ + { + step : 1, + tn : 0.0, + stages : [ {stage : 1, tcur : 0.0, ...}, {stage : 2, tcur : 0.5, ...}, ...] + ... + }, ... + ] """ with open(filename, "r") as logfile: @@ -195,7 +175,7 @@ def log_file_to_list(filename): for line_number, line in enumerate(all_lines): - line_dict = _parse_logfile_line(line.rstrip(), line_number, all_lines) + line_dict = parse_logfile_line(line.rstrip(), line_number, all_lines) if not line_dict: continue @@ -331,45 +311,43 @@ def log_file_to_list(filename): return step_attempts -def _print_log_list(a_list, indent=0): - """Print list value from a log entry dictionary""" +def print_log_list(a_list, indent=0): + """Print list value in step attempt dictionary""" spaces = (indent + 2) * " " for entry in a_list: if type(entry) is list: print(f"{spaces}[") - _print_log_list(entry, indent + 2) + print_log_list(entry, indent + 2) print(f"{spaces}]") elif type(entry) is dict: print(f"{spaces}{{") - _print_log_dict(entry, indent + 2) + print_log_dict(entry, indent + 2) print(f"{spaces}}}") else: print(f"{spaces}{entry}") -def _print_log_dict(a_dict, indent=0): - """Print dictionary value from a log entry dictionary""" +def print_log_dict(a_dict, indent=0): + """Print dictionary value in step attempt dictionary""" spaces = (indent + 2) * " " for key in a_dict: if type(a_dict[key]) is list: print(f"{spaces}{key} :") print(f"{spaces}[") - _print_log_list(a_dict[key], indent=indent + 2) + print_log_list(a_dict[key], indent=indent + 2) print(f"{spaces}]") elif type(a_dict[key]) is dict: print(f"{spaces}{key} :") print(f"{spaces}{{") - _print_log_dict(a_dict[key], indent=indent + 2) + print_log_dict(a_dict[key], indent=indent + 2) print(f"{spaces}}}") else: print(f"{spaces}{key} : {a_dict[key]}") def print_log(log, indent=0): - """Print a log file list created by :py:func:`log_file_to_list`. - - :param list log: The log file list to print. - :param int indent: The number of spaces to indent the output. + """ + Print the entries from a log file list of step attempts. """ spaces = indent * " " subspaces = (indent + 2) * " " @@ -379,12 +357,12 @@ def print_log(log, indent=0): if type(entry[key]) is list: print(f"{subspaces}{key} :") print(f"{subspaces}[") - _print_log_list(entry[key], indent=indent + 2) + print_log_list(entry[key], indent=indent + 2) print(f"{subspaces}]") elif type(entry[key]) is dict: print(f"{subspaces}{key} :") print(f"{subspaces}{{") - _print_log_dict(entry[key], indent=indent + 2) + print_log_dict(entry[key], indent=indent + 2) print(f"{subspaces}}}") else: print(f"{subspaces}{key} : {entry[key]}") @@ -394,23 +372,11 @@ def print_log(log, indent=0): def get_history( log, key, step_status=None, time_range=None, step_range=None, group_by_level=False ): - """Extract the history of a key from a log file list created by - :py:func:`log_file_to_list`. - - :param list log: The log file list to extract values from. - :param str key: The key to extract. - :param str step_status: Only extract values for steps which match the given status - e.g., "success" or "failed". - :param time_range: Only extract values in the time interval, [low, high]. - :type time_range: [float, float] - :param step_range: Only extract values in the step number interval, [low, high]. - :type step_range: [int, int] - :param bool group_by_level: Group outputs by time level. - :returns: A list of steps, times, and values + """ + Extract the step/time series of the requested value. """ steps, times, values, levels = _get_history(log, key, step_status, time_range, step_range) - if group_by_level: from collections import defaultdict @@ -427,7 +393,9 @@ def get_history( def _get_history(log, key, step_status, time_range, step_range): - """Extract the step/time series of the requested value.""" + """ + Extract the step/time series of the requested value. + """ steps = [] times = [] @@ -436,8 +404,8 @@ def _get_history(log, key, step_status, time_range, step_range): for entry in log: - step = int(entry["step"]) - time = float(entry["tn"]) + step = np.longlong(entry["step"]) + time = np.double(entry["tn"]) level = entry["level"] if time_range is not None: @@ -456,7 +424,7 @@ def _get_history(log, key, step_status, time_range, step_range): if key in entry and save_data: steps.append(step) times.append(time) - values.append(_convert_to_num(entry[key])) + values.append(convert_to_num(entry[key])) levels.append(level) if "stages" in entry: From 683cb92287782d0fd30f7ea5b99111ad80996fb9 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Fri, 19 Sep 2025 16:42:33 -0700 Subject: [PATCH 02/26] document API changes --- doc/shared/nvectors/NVector_Kokkos.rst | 8 ++++---- doc/shared/sundials/SUNContext.rst | 4 ++-- doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst | 6 +++--- doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst | 6 +++--- doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst | 8 ++++---- doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst | 6 +++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/doc/shared/nvectors/NVector_Kokkos.rst b/doc/shared/nvectors/NVector_Kokkos.rst index 17ff29252e..b02acdf6c3 100644 --- a/doc/shared/nvectors/NVector_Kokkos.rst +++ b/doc/shared/nvectors/NVector_Kokkos.rst @@ -70,8 +70,8 @@ e.g., .. code-block:: cpp sundials::kokkos::Vector<> x{length, sunctx}; - N_Vector x2 = x; // implicit conversion to N_Vector - N_Vector x3 = x.Convert(); // explicit conversion to N_Vector + N_Vector x2 = x; // implicit conversion to N_Vector + N_Vector x3 = x.get(); // explicit conversion to N_Vector No further interaction with a ``Vector`` is required from this point, and it is possible to use the :c:type:`N_Vector` API to operate on ``x2`` or ``x3``. @@ -184,11 +184,11 @@ class. Implicit conversion to a :c:type:`N_Vector`. - .. cpp:function:: N_Vector Convert() override + .. cpp:function:: N_Vector get() override Explicit conversion to a :c:type:`N_Vector`. - .. cpp:function:: N_Vector Convert() const override + .. cpp:function:: N_Vector get() const override Explicit conversion to a :c:type:`N_Vector`. diff --git a/doc/shared/sundials/SUNContext.rst b/doc/shared/sundials/SUNContext.rst index 22b7921618..f1da6d3f88 100644 --- a/doc/shared/sundials/SUNContext.rst +++ b/doc/shared/sundials/SUNContext.rst @@ -302,11 +302,11 @@ For C++ users a RAII safe class, ``sundials::Context``, is provided: Context& operator=(const Context&) = delete; Context& operator=(Context&&) = default; - SUNContext Convert() override + SUNContext get() override { return *sunctx_.get(); } - SUNContext Convert() const override + SUNContext get() const override { return *sunctx_.get(); } diff --git a/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst b/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst index ddc2703c8e..702b7a52e6 100644 --- a/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst +++ b/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst @@ -89,7 +89,7 @@ expecting a ``SUNLinearSolver`` object through the implicit conversion operator // Alternatively with explicit conversion of LS to a SUNLinearSolver // and A to a SUNMatrix: - CVodeSetLinearSolver(cvode_mem, LS->Convert(), A->Convert()); + CVodeSetLinearSolver(cvode_mem, LS->get(), A->get()); .. warning:: @@ -139,11 +139,11 @@ In this section we list the public API of the :cpp:type:`sundials::ginkgo::Linea Implicit conversion to a :c:type:`SUNLinearSolver`. - .. cpp:function:: SUNLinearSolver Convert() override + .. cpp:function:: SUNLinearSolver get() override Explicit conversion to a :c:type:`SUNLinearSolver`. - .. cpp:function:: SUNLinearSolver Convert() const override + .. cpp:function:: SUNLinearSolver get() const override Explicit conversion to a :c:type:`SUNLinearSolver`. diff --git a/doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst b/doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst index 8ec91184dc..83bd09b9fe 100644 --- a/doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst +++ b/doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst @@ -62,7 +62,7 @@ the :cpp:func:`~DenseLinearSolver::Convert` method) convertible to a sundials::kokkos::DenseLinearSolver<> LS{sunctx}; SUNLinearSolver LSA = LS; // implicit conversion to SUNLinearSolver - SUNLinearSolver LSB = LS.Convert(); // explicit conversion to SUNLinearSolver + SUNLinearSolver LSB = LS.get(); // explicit conversion to SUNLinearSolver .. warning:: @@ -118,10 +118,10 @@ In this section we list the public API of the Implicit conversion to a :c:type:`SUNLinearSolver`. - .. cpp:function:: SUNLinearSolver Convert() override + .. cpp:function:: SUNLinearSolver get() override Explicit conversion to a :c:type:`SUNLinearSolver`. - .. cpp:function:: SUNLinearSolver Convert() const override + .. cpp:function:: SUNLinearSolver get() const override Explicit conversion to a :c:type:`SUNLinearSolver`. diff --git a/doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst b/doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst index d7636c1895..1c0c60beb1 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Ginkgo.rst @@ -75,12 +75,12 @@ and then fill the diagonal of the matrix with ones to make an identity matrix: After we have a Ginkgo matrix object, we wrap it in an instance of the ``sundials::ginkgo::Matrix`` class. This object can be provided to other SUNDIALS functions that expect a ``SUNMatrix`` object -via implicit conversion, or the ``Convert()`` method: +via implicit conversion, or the ``get()`` method: .. code-block:: cpp sundials::ginkgo::Matrix matrix{gko_matrix, sunctx}; - SUNMatrix I1 = matrix.Convert(); // explicit conversion to SUNMatrix + SUNMatrix I1 = matrix.get(); // explicit conversion to SUNMatrix SUNMatrix I2 = matrix; // implicit conversion to SUNMatrix No further interaction with ``matrix`` is required from this point, and it is possible to @@ -156,10 +156,10 @@ In this section we list the public API of the ``sundials::ginkgo::Matrix`` class Implicit conversion to a :c:type:`SUNMatrix`. - .. cpp:function:: SUNMatrix Convert() override + .. cpp:function:: SUNMatrix get() override Explicit conversion to a :c:type:`SUNMatrix`. - .. cpp:function:: SUNMatrix Convert() const override + .. cpp:function:: SUNMatrix get() const override Explicit conversion to a :c:type:`SUNMatrix`. diff --git a/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst b/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst index 765e19fe98..9c663f0232 100644 --- a/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst @@ -76,7 +76,7 @@ e.g., sundials::kokkos::DenseMatrix<> A{rows, cols, sunctx}; SUNMatrix B = A; // implicit conversion to SUNMatrix - SUNMatrix C = A.Convert(); // explicit conversion to SUNMatrix + SUNMatrix C = A.get(); // explicit conversion to SUNMatrix No further interaction with a ``DenseMatrix`` is required from this point, and it is possible to use the :c:type:`SUNMatrix` API to operate on ``B`` or ``C``. @@ -232,11 +232,11 @@ class. Implicit conversion to a :c:type:`SUNMatrix`. - .. cpp:function:: SUNMatrix Convert() override + .. cpp:function:: SUNMatrix get() override Explicit conversion to a :c:type:`SUNMatrix`. - .. cpp:function:: SUNMatrix Convert() const override + .. cpp:function:: SUNMatrix get() const override Explicit conversion to a :c:type:`SUNMatrix`. From 431905b7d2cf142dcd5311c9dc492594b96eb667 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Fri, 19 Sep 2025 16:43:32 -0700 Subject: [PATCH 03/26] pick gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 9d1c6fe6e6..84b2d13c25 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ /.pydevproject .vscode compile_commands.json +.venv .clangd # custom test environment setup script @@ -82,3 +83,7 @@ uberenv_libs # tools /tools/suntools/__pycache__ + +# python +.pytest_cache +__pycache__ From 5213a1e3fb2871bdb00e5ecb1945f3c60b48eb4f Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Fri, 19 Sep 2025 16:43:44 -0700 Subject: [PATCH 04/26] doc update --- doc/shared/sundials/Fortran.rst | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/doc/shared/sundials/Fortran.rst b/doc/shared/sundials/Fortran.rst index 994062bd46..aaaeae20c1 100644 --- a/doc/shared/sundials/Fortran.rst +++ b/doc/shared/sundials/Fortran.rst @@ -488,6 +488,11 @@ a C file pointer, SUNDIALS provides two utility functions for creating a .. c:function:: SUNErrCode SUNDIALSFileOpen(const char* filename, const char* mode, FILE** fp) + Deprecated alias to :c:func:`SUNFileOpen`. + + +.. c:function:: SUNErrCode SUNFileOpen(const char* filename, const char* mode, FILE** fp) + The function allocates a ``FILE*`` by calling the C function ``fopen`` with the provided filename and I/O mode. @@ -522,7 +527,7 @@ a C file pointer, SUNDIALS provides two utility functions for creating a type(c_ptr) :: fp ! Open up the file output.log for writing - ierr = FSUNDIALSFileOpen("output.log", "w+", fp) + ierr = FSUNFileOpen("output.log", "w+", fp) ! The C function ARKStepPrintMem takes void* arkode_mem and FILE* fp as arguments call FARKStepPrintMem(arkode_mem, fp) @@ -530,25 +535,28 @@ a C file pointer, SUNDIALS provides two utility functions for creating a ! Close the file ierr = FSUNDIALSFileClose(fp) - .. versionchanged:: 7.0.0 + .. versionadded:: X.Y.Z - The function signature was updated to return a `SUNErrCode` and take a `FILE**` as the last input parameter rather then return a `FILE*`. .. c:function:: SUNErrCode SUNDIALSFileClose(FILE** fp) + Deprecated alias to :c:func:`SUNFileOpen` + + .. deprecated:: X.Y.Z + + +.. c:function:: SUNErrCode SUNFileClose(FILE** fp) + The function deallocates a C ``FILE*`` by calling the C function ``fclose`` with the provided pointer. :param fp: the C ``FILE*`` that was previously obtained from ``fopen``. This should have the Fortran type ``type(c_ptr)``. Note that if either - ``stdout`` or ``stderr`` were opened using :c:func:`SUNDIALSFileOpen()` + ``stdout`` or ``stderr`` were opened using :c:func:`SUNFileOpen()` :return: A :c:type:`SUNErrCode` - - .. versionchanged:: 7.0.0 - - The function signature was updated to return a `SUNErrCode` and the `fp` parameter was changed from `FILE*` to `FILE**`. - + + .. versionadded:: X.Y.Z .. _SUNDIALS.Fortran.Portability: From 1c40de4caa2bb2a3efe51bf9292fcbd726aa4774 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Fri, 19 Sep 2025 17:03:23 -0700 Subject: [PATCH 05/26] move SetOwnUserData functions to impl --- include/arkode/arkode.h | 2 -- include/cvode/cvode.h | 2 -- include/cvodes/cvodes.h | 4 ---- include/ida/ida.h | 2 -- include/idas/idas.h | 2 -- include/kinsol/kinsol.h | 1 - src/arkode/arkode_impl.h | 4 ++++ src/cvode/cvode_impl.h | 5 +++++ src/cvodes/cvodes_impl.h | 8 ++++++++ src/ida/ida_impl.h | 5 +++++ src/idas/idas_impl.h | 5 +++++ src/kinsol/kinsol_impl.h | 4 ++++ 12 files changed, 31 insertions(+), 13 deletions(-) diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index 54475f2500..82520a6e1d 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -265,8 +265,6 @@ SUNDIALS_EXPORT int ARKodeClearStopTime(void* arkode_mem); SUNDIALS_EXPORT int ARKodeSetFixedStep(void* arkode_mem, sunrealtype hfixed); SUNDIALS_EXPORT int ARKodeSetStepDirection(void* arkode_mem, sunrealtype stepdir); SUNDIALS_EXPORT int ARKodeSetUserData(void* arkode_mem, void* user_data); -SUNDIALS_EXPORT int ARKodeSetOwnUserData(void* ark_mem, - sunbooleantype own_user_data); SUNDIALS_EXPORT int ARKodeSetPostprocessStepFn(void* arkode_mem, ARKPostProcessFn ProcessStep); SUNDIALS_EXPORT int ARKodeSetPostprocessStageFn(void* arkode_mem, diff --git a/include/cvode/cvode.h b/include/cvode/cvode.h index a07548a360..f3553ee523 100644 --- a/include/cvode/cvode.h +++ b/include/cvode/cvode.h @@ -149,8 +149,6 @@ SUNDIALS_EXPORT int CVodeClearStopTime(void* cvode_mem); SUNDIALS_EXPORT int CVodeSetUseIntegratorFusedKernels(void* cvode_mem, sunbooleantype onoff); SUNDIALS_EXPORT int CVodeSetUserData(void* cvode_mem, void* user_data); -SUNDIALS_EXPORT int CVodeSetOwnUserData(void* cvode_mem, - sunbooleantype own_user_data); /* Optional step adaptivity input functions */ SUNDIALS_EXPORT diff --git a/include/cvodes/cvodes.h b/include/cvodes/cvodes.h index 451c09f056..8d5cc621f9 100644 --- a/include/cvodes/cvodes.h +++ b/include/cvodes/cvodes.h @@ -218,8 +218,6 @@ SUNDIALS_EXPORT int CVodeSetInterpolateStopTime(void* cvode_mem, sunbooleantype interp); SUNDIALS_EXPORT int CVodeClearStopTime(void* cvode_mem); SUNDIALS_EXPORT int CVodeSetUserData(void* cvode_mem, void* user_data); -SUNDIALS_EXPORT int CVodeSetOwnUserData(void* cvode_mem, - sunbooleantype own_user_data); /* Optional step adaptivity input functions */ SUNDIALS_EXPORT @@ -539,8 +537,6 @@ SUNDIALS_EXPORT int CVodeSetAdjNoSensi(void* cvode_mem); SUNDIALS_EXPORT int CVodeSetUserDataB(void* cvode_mem, int which, void* user_dataB); -SUNDIALS_EXPORT int CVodeSetOwnUserDataB(void* cvode_mem, int which, - sunbooleantype own_user_data); SUNDIALS_EXPORT int CVodeSetMaxOrdB(void* cvode_mem, int which, int maxordB); SUNDIALS_EXPORT int CVodeSetMaxNumStepsB(void* cvode_mem, int which, long int mxstepsB); diff --git a/include/ida/ida.h b/include/ida/ida.h index 611449081e..0aefcee475 100644 --- a/include/ida/ida.h +++ b/include/ida/ida.h @@ -130,8 +130,6 @@ SUNDIALS_EXPORT int IDASetMaxBacksIC(void* ida_mem, int maxbacks); /* Optional input functions */ SUNDIALS_EXPORT int IDASetDeltaCjLSetup(void* ida_max, sunrealtype dcj); SUNDIALS_EXPORT int IDASetUserData(void* ida_mem, void* user_data); -SUNDIALS_EXPORT int IDASetOwnUserData(void* ida_mem, - sunbooleantype own_user_data); SUNDIALS_EXPORT int IDASetMaxOrd(void* ida_mem, int maxord); SUNDIALS_EXPORT int IDASetMaxNumSteps(void* ida_mem, long int mxsteps); SUNDIALS_EXPORT int IDASetInitStep(void* ida_mem, sunrealtype hin); diff --git a/include/idas/idas.h b/include/idas/idas.h index da8e0523d3..f187ef1734 100644 --- a/include/idas/idas.h +++ b/include/idas/idas.h @@ -194,8 +194,6 @@ SUNDIALS_EXPORT int IDASetMaxBacksIC(void* ida_mem, int maxbacks); /* Optional input functions */ SUNDIALS_EXPORT int IDASetDeltaCjLSetup(void* ida_max, sunrealtype dcj); SUNDIALS_EXPORT int IDASetUserData(void* ida_mem, void* user_data); -SUNDIALS_EXPORT int IDASetOwnUserData(void* ida_mem, - sunbooleantype own_user_data); SUNDIALS_EXPORT int IDASetMaxOrd(void* ida_mem, int maxord); SUNDIALS_EXPORT int IDASetMaxNumSteps(void* ida_mem, long int mxsteps); SUNDIALS_EXPORT int IDASetInitStep(void* ida_mem, sunrealtype hin); diff --git a/include/kinsol/kinsol.h b/include/kinsol/kinsol.h index e094246bca..23ca0b38e6 100644 --- a/include/kinsol/kinsol.h +++ b/include/kinsol/kinsol.h @@ -117,7 +117,6 @@ SUNDIALS_EXPORT int KINSol(void* kinmem, N_Vector uu, int strategy, SUNDIALS_EXPORT int KINSetOptions(void* kinmem, const char* kinid, const char* file_name, int argc, char* argv[]); SUNDIALS_EXPORT int KINSetUserData(void* kinmem, void* user_data); -SUNDIALS_EXPORT int KINSetOwnUserData(void* kinmem, sunbooleantype own_user_data); SUNDIALS_EXPORT int KINSetDamping(void* kinmem, sunrealtype beta); SUNDIALS_EXPORT int KINSetMAA(void* kinmem, long int maa); SUNDIALS_EXPORT int KINSetOrthAA(void* kinmem, int orthaa); diff --git a/src/arkode/arkode_impl.h b/src/arkode/arkode_impl.h index 2884b7c363..4738c9b1b7 100644 --- a/src/arkode/arkode_impl.h +++ b/src/arkode/arkode_impl.h @@ -695,6 +695,10 @@ SUNErrCode arkSUNStepperSelfDestruct(SUNStepper stepper); int arkSetForcePass(void* arkode_mem, sunbooleantype force_pass); int arkGetLastKFlag(void* arkode_mem, int* last_kflag); +/* Utility function to tell ARKode to free the user data. + This is used by the Python interfaces. */ +int ARKodeSetOwnUserData(void* ark_mem, sunbooleantype own_user_data); + /*=============================================================== Reusable ARKODE Error Messages ===============================================================*/ diff --git a/src/cvode/cvode_impl.h b/src/cvode/cvode_impl.h index f6c78f823a..4a9d732811 100644 --- a/src/cvode/cvode_impl.h +++ b/src/cvode/cvode_impl.h @@ -662,6 +662,11 @@ int cvDiagSetup_buildM(const sunrealtype fract, const sunrealtype uround, int cvDiagSolve_updateM(const sunrealtype r, N_Vector M); #endif +/* Utility function to tell CVODE to free the user data. + This is used by the Python interfaces. */ + +int CVodeSetOwnUserData(void* cvode_mem, sunbooleantype own_user_data); + /* * ================================================================= * E R R O R M E S S A G E S diff --git a/src/cvodes/cvodes_impl.h b/src/cvodes/cvodes_impl.h index ea3bf3d121..f2429b300d 100644 --- a/src/cvodes/cvodes_impl.h +++ b/src/cvodes/cvodes_impl.h @@ -1182,6 +1182,14 @@ int cvSensRhs1InternalDQ(int Ns, sunrealtype t, N_Vector y, N_Vector ydot, int is, N_Vector yS, N_Vector ySdot, void* fS_data, N_Vector tempv, N_Vector ftemp); +/* Utility functions to tell CVODE to free the user data. + This is used by the Python interfaces. */ + +int CVodeSetOwnUserData(void* cvode_mem, sunbooleantype own_user_data); + +int CVodeSetOwnUserDataB(void* cvode_mem, int which, + sunbooleantype own_user_data); + /* * ================================================================= * E R R O R M E S S A G E S diff --git a/src/ida/ida_impl.h b/src/ida/ida_impl.h index 09b92671d9..5496ef1739 100644 --- a/src/ida/ida_impl.h +++ b/src/ida/ida_impl.h @@ -447,6 +447,11 @@ sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, int idaNlsInit(IDAMem IDA_mem); +/* Utility function to tell IDA to free the user data. + This is used by the Python interfaces. */ + +int IDASetOwnUserData(void* ida_mem, sunbooleantype own_user_data); + /* * ================================================================= * E R R O R M E S S A G E S diff --git a/src/idas/idas_impl.h b/src/idas/idas_impl.h index 022e7fd323..f15ff0b2ee 100644 --- a/src/idas/idas_impl.h +++ b/src/idas/idas_impl.h @@ -975,6 +975,11 @@ int IDASensResDQ(int Ns, sunrealtype t, N_Vector yy, N_Vector yp, N_Vector* resvalS, void* user_dataS, N_Vector ytemp, N_Vector yptemp, N_Vector restemp); +/* Utility function to tell IDA to free the user data. + This is used by the Python interfaces. */ + +int IDASetOwnUserData(void* ida_mem, sunbooleantype own_user_data); + /* * ================================================================= * E R R O R M E S S A G E S diff --git a/src/kinsol/kinsol_impl.h b/src/kinsol/kinsol_impl.h index e7f0208265..17a105b438 100644 --- a/src/kinsol/kinsol_impl.h +++ b/src/kinsol/kinsol_impl.h @@ -397,6 +397,10 @@ void KINFreeAA(KINMem kin_mem); int KINInitOrth(KINMem kin_mem); void KINFreeOrth(KINMem kin_mem); +/* Utility function to tell KINSOL to free the user data. + This is used by the Python interfaces. */ +int KINSetOwnUserData(void* kinmem, sunbooleantype own_user_data); + /* * ================================================================= * K I N S O L E R R O R M E S S A G E S From 0352562ef74816bbed2c85aea5b60919b3ba266a Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Fri, 19 Sep 2025 17:03:29 -0700 Subject: [PATCH 06/26] doc some types --- doc/shared/sundials/Types.rst | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/doc/shared/sundials/Types.rst b/doc/shared/sundials/Types.rst index 07c908e588..acae2393f0 100644 --- a/doc/shared/sundials/Types.rst +++ b/doc/shared/sundials/Types.rst @@ -88,6 +88,21 @@ code can use SUNDIALS without modifying the code to use ``sunrealtype``, ``SUN_RCONST``, or the ``SUNR`` macros so long as the SUNDIALS libraries are built to use the corresponding precision (see :numref:`Installation.Options`). +For implementation reasons, SUNDIALS also defines the types: + +.. c:type:: sunrealtype1d + + This is a ``sunrealtype*`` which should be treated as 1D contiguous array. + +.. c:type:: sunrealtype2d + + This is a ``sunrealtype**`` which should be treated as 2D contiguous array. + +.. c:type:: sunrealtype3d + + This is a ``sunrealtype***`` which should be treated as 3D contiguous array. + + Integer types used for indexing ------------------------------- @@ -116,6 +131,20 @@ SUNDIALS without modifying the code to use ``sunindextype``, so long as the SUNDIALS libraries use the appropriate index storage type (for details see :numref:`Installation.Options`). +For implementation reasons, SUNDIALS also defines the types: + +.. c:type:: sunindextype1d + + This is a ``sunindextype*`` which should be treated as 1D contiguous array. + +.. c:type:: sunindextype2d + + This is a ``sunindextype**`` which should be treated as 2D contiguous array. + +.. c:type:: sunindextype3d + + This is a ``sunindextype***`` which should be treated as 3D contiguous array. + Integer type used for counters ------------------------------ From ae7adeeeb2912f76b4a17ad9b24ac3c70d86a58b Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 10:21:19 -0700 Subject: [PATCH 07/26] use macro defines for constants instead of const int to enable integer constant expression folding --- include/sundials/sundials_memory.h | 8 ++++---- include/sundials/sundials_types.h | 3 +-- src/sundials/sundials_datanode.c | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/sundials/sundials_memory.h b/include/sundials/sundials_memory.h index 28abea8f9e..2e0a32b0e4 100644 --- a/include/sundials/sundials_memory.h +++ b/include/sundials/sundials_memory.h @@ -36,10 +36,10 @@ enum SUNMemoryType_ typedef enum SUNMemoryType_ SUNMemoryType; /* For backwards compatibility with the old name */ -static const int SUNMEMTYPE_HOST = SUN_MEMTYPE_HOST; -static const int SUNMEMTYPE_PINNED = SUN_MEMTYPE_PINNED; -static const int SUNMEMTYPE_DEVICE = SUN_MEMTYPE_DEVICE; -static const int SUNMEMTYPE_UVM = SUN_MEMTYPE_UVM; +#define SUNMEMTYPE_HOST SUN_MEMTYPE_HOST +#define SUNMEMTYPE_PINNED SUN_MEMTYPE_PINNED +#define SUNMEMTYPE_DEVICE SUN_MEMTYPE_DEVICE +#define SUNMEMTYPE_UVM SUN_MEMTYPE_UVM /* * SUNMemory is a simple abstraction of a pointer to some diff --git a/include/sundials/sundials_types.h b/include/sundials/sundials_types.h index 697f10ea4c..b4beaef939 100644 --- a/include/sundials/sundials_types.h +++ b/include/sundials/sundials_types.h @@ -150,7 +150,6 @@ typedef sunrealtype*** sunrealtype3d; typedef SUNDIALS_INDEX_TYPE sunindextype; - /* *----------------------------------------------------------------------------- * Type(s): sunindextype1d, sunindextype2d, sunindextype3d @@ -310,7 +309,7 @@ enum SUNDataIOMode_ }; /* For backwards compatibility with the old name */ -static const int SUNDATAIOMODE_INMEM = SUN_DATAIOMODE_INMEM; +#define SUNDATAIOMODE_INMEM SUN_DATAIOMODE_INMEM typedef enum SUNDataIOMode_ SUNDataIOMode; diff --git a/src/sundials/sundials_datanode.c b/src/sundials/sundials_datanode.c index abda9b876d..6eb5935bdc 100644 --- a/src/sundials/sundials_datanode.c +++ b/src/sundials/sundials_datanode.c @@ -92,7 +92,7 @@ SUNErrCode SUNDataNode_CreateLeaf(SUNDataIOMode io_mode, SUNErrCode err = SUN_SUCCESS; switch (io_mode) { - case (SUNDATAIOMODE_INMEM): + case (SUN_DATAIOMODE_INMEM): err = SUNDataNode_CreateLeaf_InMem(mem_helper, sunctx, node_out); break; default: err = SUN_ERR_ARG_OUTOFRANGE; @@ -123,7 +123,7 @@ SUNErrCode SUNDataNode_CreateList(SUNDataIOMode io_mode, SUNErrCode err = SUN_SUCCESS; switch (io_mode) { - case (SUNDATAIOMODE_INMEM): + case (SUN_DATAIOMODE_INMEM): err = SUNDataNode_CreateList_InMem(num_elements, sunctx, node_out); break; default: err = SUN_ERR_ARG_OUTOFRANGE; @@ -154,7 +154,7 @@ SUNErrCode SUNDataNode_CreateObject(SUNDataIOMode io_mode, SUNErrCode err = SUN_SUCCESS; switch (io_mode) { - case (SUNDATAIOMODE_INMEM): + case (SUN_DATAIOMODE_INMEM): err = SUNDataNode_CreateObject_InMem(num_elements, sunctx, node_out); break; default: err = SUN_ERR_ARG_OUTOFRANGE; From 915394e27b36db024082e6da7305a9714b31f073 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 10:22:35 -0700 Subject: [PATCH 08/26] use SUN_DATAIOMODE_ --- doc/shared/sunadjoint/SUNAdjointCheckpointScheme.rst | 2 +- examples/arkode/C_serial/ark_lotka_volterra_ASA.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/shared/sunadjoint/SUNAdjointCheckpointScheme.rst b/doc/shared/sunadjoint/SUNAdjointCheckpointScheme.rst index 66bfc603d5..2fc9daf810 100644 --- a/doc/shared/sunadjoint/SUNAdjointCheckpointScheme.rst +++ b/doc/shared/sunadjoint/SUNAdjointCheckpointScheme.rst @@ -29,7 +29,7 @@ and a structure of function pointers to the derived class implementations of the .. c:enum:: SUNDataIOMode - .. c:enumerator:: SUNDATAIOMODE_INMEM + .. c:enumerator:: SUN_DATAIOMODE_INMEM The IO mode for data that is stored in addressable random access memory. The location of the memory (e.g., CPU or GPU) is not specified by this mode. diff --git a/examples/arkode/C_serial/ark_lotka_volterra_ASA.c b/examples/arkode/C_serial/ark_lotka_volterra_ASA.c index f3ac027d7c..cae86a3a1a 100644 --- a/examples/arkode/C_serial/ark_lotka_volterra_ASA.c +++ b/examples/arkode/C_serial/ark_lotka_volterra_ASA.c @@ -131,7 +131,7 @@ int main(int argc, char* argv[]) SUNAdjointCheckpointScheme checkpoint_scheme = NULL; SUNMemoryHelper mem_helper = SUNMemoryHelper_Sys(sunctx); - retval = SUNAdjointCheckpointScheme_Create_Fixed(SUNDATAIOMODE_INMEM, + retval = SUNAdjointCheckpointScheme_Create_Fixed(SUN_DATAIOMODE_INMEM, mem_helper, check_interval, ncheck, keep_check, sunctx, &checkpoint_scheme); From 112b638eb59fe1e456869ab80f2d26b93c18baf3 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 10:24:44 -0700 Subject: [PATCH 09/26] use SUN_MEMTYPE --- .../raja/ParallelGrid.hpp | 14 ++--- doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst | 4 +- .../sunmatrix/SUNMatrix_OneMklDense.rst | 4 +- doc/shared/sunmemory/SUNMemory_CUDA.rst | 8 +-- .../sunmemory/SUNMemory_Description.rst | 8 +-- doc/shared/sunmemory/SUNMemory_HIP.rst | 8 +-- doc/shared/sunmemory/SUNMemory_SYCL.rst | 8 +-- .../CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp | 2 +- .../cvode/magma/cv_bruss_batched_magma.cpp | 4 +- examples/utilities/custom_memory_helper_gpu.h | 24 ++++---- .../utilities/custom_memory_helper_sycl.h | 14 ++--- include/sundials/sundials_memory.h | 8 +-- src/nvector/cuda/nvector_cuda.cu | 56 +++++++++---------- src/nvector/hip/nvector_hip.hip.cpp | 44 +++++++-------- src/nvector/raja/nvector_raja.cpp | 42 +++++++------- src/nvector/sycl/nvector_sycl.cpp | 56 +++++++++---------- src/sundials/sundatanode/sundatanode_inmem.c | 6 +- src/sundials/sundials_memory.c | 4 +- .../magmadense/sunlinsol_magmadense.cpp | 8 +-- src/sunmatrix/cusparse/sunmatrix_cusparse.cu | 32 +++++------ .../magmadense/sunmatrix_magmadense.cpp | 6 +- .../onemkldense/sunmatrix_onemkldense.cpp | 6 +- src/sunmemory/cuda/sundials_cuda_memory.cu | 56 +++++++++---------- src/sunmemory/hip/sundials_hip_memory.hip.cpp | 56 +++++++++---------- src/sunmemory/sycl/sundials_sycl_memory.cpp | 30 +++++----- src/sunmemory/system/sundials_system_memory.c | 14 ++--- .../sundials/test_sundials_datanode.cpp | 20 +++---- .../magmadense/test_sunlinsol_magmadense.cpp | 4 +- .../test_sunlinsol_onemkldense.cpp | 4 +- .../magmadense/test_sunmatrix_magmadense.cpp | 2 +- .../test_sunmatrix_onemkldense.cpp | 2 +- .../sunmemory/cuda/test_sunmemory_cuda.cu | 14 ++--- .../sunmemory/hip/test_sunmemory_hip.cpp | 14 ++--- .../sunmemory/sycl/test_sunmemory_sycl.cpp | 14 ++--- .../sunmemory/sys/test_sunmemory_sys.cpp | 4 +- 35 files changed, 300 insertions(+), 300 deletions(-) diff --git a/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp b/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp index c5c06d214c..951552be61 100644 --- a/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp +++ b/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp @@ -549,25 +549,25 @@ class ParallelGrid SUNMemoryType memoryType() { SUNMemory test; - if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE_PINNED, + if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUN_MEMTYPE_PINNED, nullptr)) { SUNMemoryHelper_Dealloc(memhelp, test, nullptr); - return (SUNMEMTYPE_PINNED); + return (SUN_MEMTYPE_PINNED); } - if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE_DEVICE, + if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUN_MEMTYPE_DEVICE, nullptr)) { SUNMemoryHelper_Dealloc(memhelp, test, nullptr); - return (SUNMEMTYPE_DEVICE); + return (SUN_MEMTYPE_DEVICE); } - if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE_UVM, + if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUN_MEMTYPE_UVM, nullptr)) { SUNMemoryHelper_Dealloc(memhelp, test, nullptr); - return (SUNMEMTYPE_UVM); + return (SUN_MEMTYPE_UVM); } - else { return (SUNMEMTYPE_HOST); } + else { return (SUN_MEMTYPE_HOST); } } }; diff --git a/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst b/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst index 7c39b4e2ef..6cfd8d0447 100644 --- a/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst @@ -80,7 +80,7 @@ implementation specific functions: * *M* -- the number of matrix rows. * *N* -- the number of matrix columns. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUNMEMTYPE_UVM`` or ``SUNMEMTYPE_DEVICE``. + ``SUN_MEMTYPE_UVM`` or ``SUN_MEMTYPE_DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- a ``cudaStream_t`` when using CUDA or a ``hipStream_t`` when using HIP. @@ -100,7 +100,7 @@ implementation specific functions: * *M_block* -- the number of matrix rows in each block. * *N_block* -- the number of matrix columns in each block. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUNMEMTYPE_UVM`` or ``SUNMEMTYPE_DEVICE``. + ``SUN_MEMTYPE_UVM`` or ``SUN_MEMTYPE_DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- a ``cudaStream_t`` when using CUDA or a ``hipStream_t`` when using HIP. diff --git a/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst b/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst index 5dc17353c0..0c62f4c246 100644 --- a/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst @@ -80,7 +80,7 @@ Constructors * *M* -- the number of matrix rows. * *N* -- the number of matrix columns. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUNMEMTYPE_UVM`` or ``SUNMEMTYPE_DEVICE``. + ``SUN_MEMTYPE_UVM`` or ``SUN_MEMTYPE_DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- the SYCL queue to which operations will be submitted. * *sunctx* -- the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) @@ -100,7 +100,7 @@ Constructors * *M_block* -- the number of matrix rows in each block. * *N_block* -- the number of matrix columns in each block. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUNMEMTYPE_UVM`` or ``SUNMEMTYPE_DEVICE``. + ``SUN_MEMTYPE_UVM`` or ``SUN_MEMTYPE_DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- the SYCL queue to which operations will be submitted. * *sunctx* -- the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) diff --git a/doc/shared/sunmemory/SUNMemory_CUDA.rst b/doc/shared/sunmemory/SUNMemory_CUDA.rst index cdb5478151..ca475a9b92 100644 --- a/doc/shared/sunmemory/SUNMemory_CUDA.rst +++ b/doc/shared/sunmemory/SUNMemory_CUDA.rst @@ -52,10 +52,10 @@ The implementation provides the following operations defined by the :param memptr: pointer to the allocated ``SUNMemory``. :param mem_size: the size in bytes of the ``ptr``. :param mem_type: the ``SUNMemoryType`` of the ``ptr``. Supported values are: - * ``SUNMEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. - * ``SUNMEMTYPE_PINNED`` -- memory is allocated with a call to ``cudaMallocHost``. - * ``SUNMEMTYPE_DEVICE`` -- memory is allocated with a call to ``cudaMalloc``. - * ``SUNMEMTYPE_UVM`` -- memory is allocated with a call to ``cudaMallocManaged``. + * ``SUN_MEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. + * ``SUN_MEMTYPE_PINNED`` -- memory is allocated with a call to ``cudaMallocHost``. + * ``SUN_MEMTYPE_DEVICE`` -- memory is allocated with a call to ``cudaMalloc``. + * ``SUN_MEMTYPE_UVM`` -- memory is allocated with a call to ``cudaMallocManaged``. :param queue: currently unused. :return: A new :c:type:`SUNMemory` object. diff --git a/doc/shared/sunmemory/SUNMemory_Description.rst b/doc/shared/sunmemory/SUNMemory_Description.rst index 144b0d38f6..2699100a6e 100644 --- a/doc/shared/sunmemory/SUNMemory_Description.rst +++ b/doc/shared/sunmemory/SUNMemory_Description.rst @@ -66,19 +66,19 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, The :c:type:`SUNMemoryType` type is an enumeration that defines the supported memory types: - .. c:enumerator:: SUNMEMTYPE_HOST + .. c:enumerator:: SUN_MEMTYPE_HOST Pageable memory accessible on the host - .. c:enumerator:: SUNMEMTYPE_PINNED + .. c:enumerator:: SUN_MEMTYPE_PINNED Page-locked memory accessible on the host - .. c:enumerator:: SUNMEMTYPE_DEVICE + .. c:enumerator:: SUN_MEMTYPE_DEVICE Memory accessible from the device - .. c:enumerator:: SUNMEMTYPE_UVM + .. c:enumerator:: SUN_MEMTYPE_UVM Memory accessible from the host or device diff --git a/doc/shared/sunmemory/SUNMemory_HIP.rst b/doc/shared/sunmemory/SUNMemory_HIP.rst index 5936fba525..98d62b22c4 100644 --- a/doc/shared/sunmemory/SUNMemory_HIP.rst +++ b/doc/shared/sunmemory/SUNMemory_HIP.rst @@ -52,10 +52,10 @@ The implementation provides the following operations defined by the :param memptr: pointer to the allocated ``SUNMemory``. :param mem_size: the size in bytes of the ``ptr``. :param mem_type: the ``SUNMemoryType`` of the ``ptr``. Supported values are: - * ``SUNMEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. - * ``SUNMEMTYPE_PINNED`` -- memory is allocated with a call to ``hipMallocHost``. - * ``SUNMEMTYPE_DEVICE`` -- memory is allocated with a call to ``hipMalloc``. - * ``SUNMEMTYPE_UVM`` -- memory is allocated with a call to ``hipMallocManaged``. + * ``SUN_MEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. + * ``SUN_MEMTYPE_PINNED`` -- memory is allocated with a call to ``hipMallocHost``. + * ``SUN_MEMTYPE_DEVICE`` -- memory is allocated with a call to ``hipMalloc``. + * ``SUN_MEMTYPE_UVM`` -- memory is allocated with a call to ``hipMallocManaged``. :param queue: currently unused. :return: A new :c:type:`SUNMemory` object. diff --git a/doc/shared/sunmemory/SUNMemory_SYCL.rst b/doc/shared/sunmemory/SUNMemory_SYCL.rst index 7d9a62e254..091fb1c345 100644 --- a/doc/shared/sunmemory/SUNMemory_SYCL.rst +++ b/doc/shared/sunmemory/SUNMemory_SYCL.rst @@ -52,10 +52,10 @@ The implementation provides the following operations defined by the :param memptr: pointer to the allocated ``SUNMemory``. :param mem_size: the size in bytes of the ``ptr``. :param mem_type: the ``SUNMemoryType`` of the ``ptr``. Supported values are: - * ``SUNMEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. - * ``SUNMEMTYPE_PINNED`` -- memory is allocated with a call to ``sycl::malloc_host``. - * ``SUNMEMTYPE_DEVICE`` -- memory is allocated with a call to ``sycl::malloc_device``. - * ``SUNMEMTYPE_UVM`` -- memory is allocated with a call to ``sycl::malloc_shared``. + * ``SUN_MEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. + * ``SUN_MEMTYPE_PINNED`` -- memory is allocated with a call to ``sycl::malloc_host``. + * ``SUN_MEMTYPE_DEVICE`` -- memory is allocated with a call to ``sycl::malloc_device``. + * ``SUN_MEMTYPE_UVM`` -- memory is allocated with a call to ``sycl::malloc_shared``. :param queue: the ``sycl::queue`` handle for the stream that the allocation will be performed on. :return: A new :c:type:`SUNMemory` object. diff --git a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp index 429aaf4313..ab598b577e 100644 --- a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp +++ b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp @@ -208,7 +208,7 @@ int main(int argc, char* argv[]) { // Create SUNMatrix for use in linear solves A = SUNMatrix_OneMklDenseBlock(ngroups, GROUPSIZE, GROUPSIZE, - SUNMEMTYPE_DEVICE, memhelper, &myQueue, + SUN_MEMTYPE_DEVICE, memhelper, &myQueue, sunctx); if (check_retval((void*)A, "SUNMatrix_OneMklDenseBlock", 0)) { return 1; } diff --git a/examples/cvode/magma/cv_bruss_batched_magma.cpp b/examples/cvode/magma/cv_bruss_batched_magma.cpp index e7e007d2e0..ab9387c9a1 100644 --- a/examples/cvode/magma/cv_bruss_batched_magma.cpp +++ b/examples/cvode/magma/cv_bruss_batched_magma.cpp @@ -131,7 +131,7 @@ class Array public: Array(I size, SUNMemoryHelper helper) : helper_(helper), mem_(nullptr) { - SUNMemoryHelper_Alloc(helper, &mem_, size * sizeof(T), SUNMEMTYPE_UVM, NULL); + SUNMemoryHelper_Alloc(helper, &mem_, size * sizeof(T), SUN_MEMTYPE_UVM, NULL); } Array(SUNMemory mem, SUNMemoryHelper helper) : helper_(helper), mem_(mem) {} @@ -301,7 +301,7 @@ int main(int argc, char* argv[]) { /* Create SUNMatrix for use in linear solves */ A = SUNMatrix_MagmaDenseBlock(udata.nbatches, udata.batchSize, - udata.batchSize, SUNMEMTYPE_DEVICE, memhelper, + udata.batchSize, SUN_MEMTYPE_DEVICE, memhelper, NULL, sunctx); if (check_retval((void*)A, "SUNMatrix_MagmaDenseBlock", 0)) { return (1); } diff --git a/examples/utilities/custom_memory_helper_gpu.h b/examples/utilities/custom_memory_helper_gpu.h index f9677bd274..ef9bb219d5 100644 --- a/examples/utilities/custom_memory_helper_gpu.h +++ b/examples/utilities/custom_memory_helper_gpu.h @@ -59,7 +59,7 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, mem->ptr = NULL; mem->own = SUNTRUE; - if (mem_type == SUNMEMTYPE_HOST) + if (mem_type == SUN_MEMTYPE_HOST) { mem->ptr = malloc(mem_size); if (mem->ptr == NULL) @@ -67,12 +67,12 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, free(mem); return (-1); } - mem->type = SUNMEMTYPE_HOST; + mem->type = SUN_MEMTYPE_HOST; } - else if (mem_type == SUNMEMTYPE_UVM || mem_type == SUNMEMTYPE_DEVICE) + else if (mem_type == SUN_MEMTYPE_UVM || mem_type == SUN_MEMTYPE_DEVICE) { MY_GPUCHK(MY_GPU(Malloc)(&(mem->ptr), mem_size)); - mem->type = SUNMEMTYPE_DEVICE; + mem->type = SUN_MEMTYPE_DEVICE; } else { @@ -90,12 +90,12 @@ int MyMemoryHelper_Dealloc(SUNMemoryHelper helper, SUNMemory mem, void* queue) if (mem->ptr && mem->own) { - if (mem->type == SUNMEMTYPE_HOST) + if (mem->type == SUN_MEMTYPE_HOST) { free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE_DEVICE) + else if (mem->type == SUN_MEMTYPE_DEVICE) { MY_GPUCHK(MY_GPU(Free)(mem->ptr)); mem->ptr = NULL; @@ -113,24 +113,24 @@ int MyMemoryHelper_Copy(SUNMemoryHelper helper, SUNMemory dst, SUNMemory src, { switch (src->type) { - case SUNMEMTYPE_HOST: - if (dst->type == SUNMEMTYPE_HOST) + case SUN_MEMTYPE_HOST: + if (dst->type == SUN_MEMTYPE_HOST) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUNMEMTYPE_DEVICE) + else if (dst->type == SUN_MEMTYPE_DEVICE) { MY_GPUCHK(MY_GPU(Memcpy)(dst->ptr, src->ptr, memory_size, MY_GPU(MemcpyHostToDevice))); } break; - case SUNMEMTYPE_DEVICE: - if (dst->type == SUNMEMTYPE_HOST) + case SUN_MEMTYPE_DEVICE: + if (dst->type == SUN_MEMTYPE_HOST) { MY_GPUCHK(MY_GPU(Memcpy)(dst->ptr, src->ptr, memory_size, MY_GPU(MemcpyDeviceToHost))); } - else if (dst->type == SUNMEMTYPE_DEVICE) + else if (dst->type == SUN_MEMTYPE_DEVICE) { MY_GPUCHK(MY_GPU(Memcpy)(dst->ptr, src->ptr, memory_size, MY_GPU(MemcpyDeviceToDevice))); diff --git a/examples/utilities/custom_memory_helper_sycl.h b/examples/utilities/custom_memory_helper_sycl.h index bd6bf233b2..d6ae839487 100644 --- a/examples/utilities/custom_memory_helper_sycl.h +++ b/examples/utilities/custom_memory_helper_sycl.h @@ -34,7 +34,7 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, mem->ptr = NULL; mem->own = SUNTRUE; - if (mem_type == SUNMEMTYPE_HOST) + if (mem_type == SUN_MEMTYPE_HOST) { mem->ptr = malloc(mem_size); if (mem->ptr == NULL) @@ -42,9 +42,9 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, free(mem); return -1; } - mem->type = SUNMEMTYPE_HOST; + mem->type = SUN_MEMTYPE_HOST; } - else if (mem_type == SUNMEMTYPE_DEVICE) + else if (mem_type == SUN_MEMTYPE_DEVICE) { mem->ptr = sycl::malloc_device(mem_size, *sycl_queue); if (mem->ptr == NULL) @@ -52,7 +52,7 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, free(mem); return -1; } - mem->type = SUNMEMTYPE_DEVICE; + mem->type = SUN_MEMTYPE_DEVICE; } else { @@ -74,12 +74,12 @@ int MyMemoryHelper_Dealloc(SUNMemoryHelper helper, SUNMemory mem, void* queue) sycl::queue* sycl_queue = static_cast(queue); - if (mem->type == SUNMEMTYPE_HOST) + if (mem->type == SUN_MEMTYPE_HOST) { free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE_DEVICE) + else if (mem->type == SUN_MEMTYPE_DEVICE) { sycl::free(mem->ptr, *sycl_queue); mem->ptr = NULL; @@ -98,7 +98,7 @@ int MyMemoryHelper_Copy(SUNMemoryHelper helper, SUNMemory dst, SUNMemory src, if (!queue) return -1; sycl::queue* sycl_queue = static_cast(queue); - if (src->type == SUNMEMTYPE_HOST && dst->type == SUNMEMTYPE_HOST) + if (src->type == SUN_MEMTYPE_HOST && dst->type == SUN_MEMTYPE_HOST) { memcpy(dst->ptr, src->ptr, memory_size); } diff --git a/include/sundials/sundials_memory.h b/include/sundials/sundials_memory.h index 2e0a32b0e4..a856b0b962 100644 --- a/include/sundials/sundials_memory.h +++ b/include/sundials/sundials_memory.h @@ -36,10 +36,10 @@ enum SUNMemoryType_ typedef enum SUNMemoryType_ SUNMemoryType; /* For backwards compatibility with the old name */ -#define SUNMEMTYPE_HOST SUN_MEMTYPE_HOST -#define SUNMEMTYPE_PINNED SUN_MEMTYPE_PINNED -#define SUNMEMTYPE_DEVICE SUN_MEMTYPE_DEVICE -#define SUNMEMTYPE_UVM SUN_MEMTYPE_UVM +#define SUN_MEMTYPE_HOST SUN_MEMTYPE_HOST +#define SUN_MEMTYPE_PINNED SUN_MEMTYPE_PINNED +#define SUN_MEMTYPE_DEVICE SUN_MEMTYPE_DEVICE +#define SUN_MEMTYPE_UVM SUN_MEMTYPE_UVM /* * SUNMemory is a simple abstraction of a pointer to some diff --git a/src/nvector/cuda/nvector_cuda.cu b/src/nvector/cuda/nvector_cuda.cu index 14a25d66de..c7cd45475b 100644 --- a/src/nvector/cuda/nvector_cuda.cu +++ b/src/nvector/cuda/nvector_cuda.cu @@ -354,9 +354,9 @@ N_Vector N_VMake_Cuda(sunindextype length, sunrealtype* h_vdata, NVEC_CUDA_CONTENT(v)->length = length; NVEC_CUDA_CONTENT(v)->mem_helper = SUNMemoryHelper_Cuda(sunctx); NVEC_CUDA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), h_vdata, SUNMEMTYPE_HOST); + SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), h_vdata, SUN_MEMTYPE_HOST); NVEC_CUDA_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), d_vdata, SUNMEMTYPE_DEVICE); + SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), d_vdata, SUN_MEMTYPE_DEVICE); NVEC_CUDA_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); NVEC_CUDA_CONTENT(v)->reduce_exec_policy = DEFAULT_REDUCTION_EXECPOLICY.clone(); NVEC_CUDA_CONTENT(v)->own_helper = SUNTRUE; @@ -395,7 +395,7 @@ N_Vector N_VMakeManaged_Cuda(sunindextype length, sunrealtype* vdata, NVEC_CUDA_CONTENT(v)->length = length; NVEC_CUDA_CONTENT(v)->mem_helper = SUNMemoryHelper_Cuda(sunctx); NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), - vdata, SUNMEMTYPE_UVM); + vdata, SUN_MEMTYPE_UVM); NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->host_data); NVEC_CUDA_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); @@ -440,7 +440,7 @@ void N_VSetHostArrayPointer_Cuda(sunrealtype* h_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE_UVM); + SUN_MEMTYPE_UVM); NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->host_data); @@ -456,7 +456,7 @@ void N_VSetHostArrayPointer_Cuda(sunrealtype* h_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); } } } @@ -478,7 +478,7 @@ void N_VSetDeviceArrayPointer_Cuda(sunrealtype* d_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE_UVM); + SUN_MEMTYPE_UVM); NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->device_data); @@ -494,7 +494,7 @@ void N_VSetDeviceArrayPointer_Cuda(sunrealtype* d_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE_DEVICE); + SUN_MEMTYPE_DEVICE); } } } @@ -2033,7 +2033,7 @@ SUNErrCode N_VBufPack_Cuda(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(x), buf, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_CUDA_MEMHELP(x), buf_mem, @@ -2059,7 +2059,7 @@ SUNErrCode N_VBufUnpack_Cuda(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(x), buf, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_CUDA_MEMHELP(x), @@ -2231,33 +2231,33 @@ static int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vc->device_data), - NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE_UVM, + NVEC_CUDA_MEMSIZE(v), SUN_MEMTYPE_UVM, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUNMEMTYPE_UVM\n"); + "failed for SUN_MEMTYPE_UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vc->host_data), - NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE_HOST, + NVEC_CUDA_MEMSIZE(v), SUN_MEMTYPE_HOST, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_HOST\n"); + "failed to alloc SUN_MEMTYPE_HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vc->device_data), - NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE_DEVICE, + NVEC_CUDA_MEMSIZE(v), SUN_MEMTYPE_DEVICE, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_DEVICE\n"); + "failed to alloc SUN_MEMTYPE_DEVICE\n"); } } @@ -2293,37 +2293,37 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) // Allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE_PINNED, + SUN_MEMTYPE_PINNED, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); + "alloc SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); // If pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE_HOST, + SUN_MEMTYPE_HOST, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE_HOST\n"); + "alloc SUN_MEMTYPE_HOST\n"); } } // Allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->reduce_buffer_dev), bytes, - SUNMEMTYPE_DEVICE, + SUN_MEMTYPE_DEVICE, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE_DEVICE\n"); + "alloc SUN_MEMTYPE_DEVICE\n"); } } @@ -2436,23 +2436,23 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // Allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE_PINNED, + SUN_MEMTYPE_PINNED, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in FusedBuffer_Init: SUNMemoryHelper_Alloc failed to alloc " - "SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); + "SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); // If pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE_HOST, + SUN_MEMTYPE_HOST, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_HOST\n"); + "failed to alloc SUN_MEMTYPE_HOST\n"); return SUN_ERR_GENERIC; } } @@ -2460,12 +2460,12 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // Allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->fused_buffer_dev), bytes, - SUNMEMTYPE_DEVICE, + SUN_MEMTYPE_DEVICE, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_DEVICE\n"); + "failed to alloc SUN_MEMTYPE_DEVICE\n"); return SUN_ERR_GENERIC; } @@ -2633,7 +2633,7 @@ static int InitializeDeviceCounter(N_Vector v) { retval = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(NVEC_CUDA_PRIVATE(v)->device_counter), - sizeof(unsigned int), SUNMEMTYPE_DEVICE, + sizeof(unsigned int), SUN_MEMTYPE_DEVICE, (void*)NVEC_CUDA_STREAM(v)); } cudaMemsetAsync(NVEC_CUDA_DCOUNTERp(v), 0, sizeof(unsigned int), diff --git a/src/nvector/hip/nvector_hip.hip.cpp b/src/nvector/hip/nvector_hip.hip.cpp index f0cc472903..0af285641c 100644 --- a/src/nvector/hip/nvector_hip.hip.cpp +++ b/src/nvector/hip/nvector_hip.hip.cpp @@ -325,9 +325,9 @@ N_Vector N_VMake_Hip(sunindextype length, sunrealtype* h_vdata, NVEC_HIP_CONTENT(v)->length = length; NVEC_HIP_CONTENT(v)->mem_helper = SUNMemoryHelper_Hip(sunctx); NVEC_HIP_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), h_vdata, SUNMEMTYPE_HOST); + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), h_vdata, SUN_MEMTYPE_HOST); NVEC_HIP_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), d_vdata, SUNMEMTYPE_DEVICE); + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), d_vdata, SUN_MEMTYPE_DEVICE); NVEC_HIP_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); NVEC_HIP_CONTENT(v)->reduce_exec_policy = DEFAULT_REDUCTION_EXECPOLICY.clone(); NVEC_HIP_CONTENT(v)->own_helper = SUNTRUE; @@ -366,7 +366,7 @@ N_Vector N_VMakeManaged_Hip(sunindextype length, sunrealtype* vdata, NVEC_HIP_CONTENT(v)->length = length; NVEC_HIP_CONTENT(v)->mem_helper = SUNMemoryHelper_Hip(sunctx); NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), - vdata, SUNMEMTYPE_UVM); + vdata, SUN_MEMTYPE_UVM); NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->host_data); NVEC_HIP_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); @@ -410,7 +410,7 @@ void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v) else { NVEC_HIP_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)h_vdata, SUNMEMTYPE_UVM); + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)h_vdata, SUN_MEMTYPE_UVM); NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->host_data); @@ -426,7 +426,7 @@ void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v) { NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); } } } @@ -447,7 +447,7 @@ void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v) else { NVEC_HIP_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, SUNMEMTYPE_UVM); + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, SUN_MEMTYPE_UVM); NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->device_data); @@ -463,7 +463,7 @@ void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v) { NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE_DEVICE); + SUN_MEMTYPE_DEVICE); } } } @@ -1976,7 +1976,7 @@ SUNErrCode N_VBufPack_Hip(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(x), buf, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_HIP_MEMHELP(x), buf_mem, @@ -2002,7 +2002,7 @@ SUNErrCode N_VBufUnpack_Hip(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(x), buf, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_HIP_MEMHELP(x), @@ -2267,33 +2267,33 @@ int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vc->device_data), - NVEC_HIP_MEMSIZE(v), SUNMEMTYPE_UVM, + NVEC_HIP_MEMSIZE(v), SUN_MEMTYPE_UVM, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUNMEMTYPE_UVM\n"); + "failed for SUN_MEMTYPE_UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vc->host_data), - NVEC_HIP_MEMSIZE(v), SUNMEMTYPE_HOST, + NVEC_HIP_MEMSIZE(v), SUN_MEMTYPE_HOST, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_HOST\n"); + "failed to alloc SUN_MEMTYPE_HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vc->device_data), - NVEC_HIP_MEMSIZE(v), SUNMEMTYPE_DEVICE, + NVEC_HIP_MEMSIZE(v), SUN_MEMTYPE_DEVICE, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_DEVICE\n"); + "failed to alloc SUN_MEMTYPE_DEVICE\n"); } } @@ -2329,34 +2329,34 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) // Allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_host), - bytes, SUNMEMTYPE_PINNED, (void*)NVEC_HIP_STREAM(v)); + bytes, SUN_MEMTYPE_PINNED, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); + "alloc SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); // If pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_host), - bytes, SUNMEMTYPE_HOST, (void*)NVEC_HIP_STREAM(v)); + bytes, SUN_MEMTYPE_HOST, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE_HOST\n"); + "alloc SUN_MEMTYPE_HOST\n"); } } // Allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_dev), - bytes, SUNMEMTYPE_DEVICE, (void*)NVEC_HIP_STREAM(v)); + bytes, SUN_MEMTYPE_DEVICE, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE_DEVICE\n"); + "alloc SUN_MEMTYPE_DEVICE\n"); } } @@ -2448,7 +2448,7 @@ static int InitializeDeviceCounter(N_Vector v) { retval = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(NVEC_HIP_PRIVATE(v)->device_counter), - sizeof(unsigned int), SUNMEMTYPE_DEVICE, + sizeof(unsigned int), SUN_MEMTYPE_DEVICE, (void*)NVEC_HIP_STREAM(v)); } hipMemsetAsync(NVEC_HIP_DCOUNTERp(v), 0, sizeof(unsigned int), diff --git a/src/nvector/raja/nvector_raja.cpp b/src/nvector/raja/nvector_raja.cpp index 621d9baf2e..a19afea937 100644 --- a/src/nvector/raja/nvector_raja.cpp +++ b/src/nvector/raja/nvector_raja.cpp @@ -354,9 +354,9 @@ N_Vector N_VMake_Raja(sunindextype length, sunrealtype* h_vdata, #endif NVEC_RAJA_CONTENT(v)->own_helper = SUNTRUE; NVEC_RAJA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), h_vdata, SUNMEMTYPE_HOST); + SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), h_vdata, SUN_MEMTYPE_HOST); NVEC_RAJA_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), d_vdata, SUNMEMTYPE_DEVICE); + SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), d_vdata, SUN_MEMTYPE_DEVICE); NVEC_RAJA_PRIVATE(v)->use_managed_mem = SUNFALSE; if (NVEC_RAJA_MEMHELP(v) == NULL) @@ -398,7 +398,7 @@ N_Vector N_VMakeManaged_Raja(sunindextype length, sunrealtype* vdata, NVEC_RAJA_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); #endif NVEC_RAJA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_RAJA_CONTENT(v)->mem_helper, vdata, SUNMEMTYPE_UVM); + SUNMemoryHelper_Wrap(NVEC_RAJA_CONTENT(v)->mem_helper, vdata, SUN_MEMTYPE_UVM); NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_RAJA_CONTENT(v)->mem_helper, NVEC_RAJA_CONTENT(v)->host_data); @@ -465,7 +465,7 @@ void N_VSetHostArrayPointer_Raja(sunrealtype* h_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE_UVM); + SUN_MEMTYPE_UVM); NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_RAJA_MEMHELP(v), NVEC_RAJA_CONTENT(v)->host_data); @@ -481,7 +481,7 @@ void N_VSetHostArrayPointer_Raja(sunrealtype* h_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); } } } @@ -503,7 +503,7 @@ void N_VSetDeviceArrayPointer_Raja(sunrealtype* d_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE_UVM); + SUN_MEMTYPE_UVM); NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_RAJA_MEMHELP(v), NVEC_RAJA_CONTENT(v)->device_data); @@ -519,7 +519,7 @@ void N_VSetDeviceArrayPointer_Raja(sunrealtype* d_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE_DEVICE); + SUN_MEMTYPE_DEVICE); } } } @@ -1452,7 +1452,7 @@ SUNErrCode N_VBufPack_Raja(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(x), buf, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } #if defined(SUNDIALS_RAJA_BACKENDS_SYCL) @@ -1493,7 +1493,7 @@ SUNErrCode N_VBufUnpack_Raja(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(x), buf, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } #if defined(SUNDIALS_RAJA_BACKENDS_SYCL) @@ -1715,33 +1715,33 @@ int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vc->device_data), - NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE_UVM, + NVEC_RAJA_MEMSIZE(v), SUN_MEMTYPE_UVM, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUNMEMTYPE_UVM\n"); + "failed for SUN_MEMTYPE_UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_RAJA_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vc->host_data), - NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE_HOST, + NVEC_RAJA_MEMSIZE(v), SUN_MEMTYPE_HOST, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_HOST\n"); + "failed to alloc SUN_MEMTYPE_HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vc->device_data), - NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE_DEVICE, + NVEC_RAJA_MEMSIZE(v), SUN_MEMTYPE_DEVICE, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_DEVICE\n"); + "failed to alloc SUN_MEMTYPE_DEVICE\n"); } } @@ -1775,21 +1775,21 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE_PINNED, queue); + SUN_MEMTYPE_PINNED, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in FusedBuffer_Init: SUNMemoryHelper_Alloc failed to alloc " - "SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); + "SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); // if pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE_HOST, queue); + SUN_MEMTYPE_HOST, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_HOST\n"); + "failed to alloc SUN_MEMTYPE_HOST\n"); return SUN_ERR_GENERIC; } } @@ -1797,11 +1797,11 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vcp->fused_buffer_dev), bytes, - SUNMEMTYPE_DEVICE, queue); + SUN_MEMTYPE_DEVICE, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_DEVICE\n"); + "failed to alloc SUN_MEMTYPE_DEVICE\n"); return SUN_ERR_GENERIC; } diff --git a/src/nvector/sycl/nvector_sycl.cpp b/src/nvector/sycl/nvector_sycl.cpp index 7adf6bced6..c52ea9a52c 100644 --- a/src/nvector/sycl/nvector_sycl.cpp +++ b/src/nvector/sycl/nvector_sycl.cpp @@ -435,9 +435,9 @@ N_Vector N_VMake_Sycl(sunindextype length, sunrealtype* h_vdata, NVEC_SYCL_CONTENT(v)->own_helper = SUNTRUE; NVEC_SYCL_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); NVEC_SYCL_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), h_vdata, SUNMEMTYPE_HOST); + SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), h_vdata, SUN_MEMTYPE_HOST); NVEC_SYCL_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), d_vdata, SUNMEMTYPE_DEVICE); + SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), d_vdata, SUN_MEMTYPE_DEVICE); NVEC_SYCL_CONTENT(v)->stream_exec_policy = new ThreadDirectExecPolicy(SYCL_BLOCKDIM(Q)); NVEC_SYCL_CONTENT(v)->reduce_exec_policy = @@ -502,7 +502,7 @@ N_Vector N_VMakeManaged_Sycl(sunindextype length, sunrealtype* vdata, NVEC_SYCL_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); NVEC_SYCL_CONTENT(v)->own_helper = SUNTRUE; NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), - vdata, SUNMEMTYPE_UVM); + vdata, SUN_MEMTYPE_UVM); NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->host_data); NVEC_SYCL_CONTENT(v)->stream_exec_policy = @@ -562,7 +562,7 @@ void N_VSetHostArrayPointer_Sycl(sunrealtype* h_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE_UVM); + SUN_MEMTYPE_UVM); NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->host_data); @@ -578,7 +578,7 @@ void N_VSetHostArrayPointer_Sycl(sunrealtype* h_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); } } } @@ -597,7 +597,7 @@ void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE_UVM); + SUN_MEMTYPE_UVM); NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->device_data); @@ -613,7 +613,7 @@ void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE_DEVICE); + SUN_MEMTYPE_DEVICE); } } } @@ -1878,7 +1878,7 @@ SUNErrCode N_VBufPack_Sycl(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(x), buf, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_Copy(NVEC_SYCL_MEMHELP(x), buf_mem, @@ -1900,7 +1900,7 @@ SUNErrCode N_VBufUnpack_Sycl(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(x), buf, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_Copy(NVEC_SYCL_MEMHELP(x), @@ -2036,33 +2036,33 @@ static int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vc->device_data), - NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE_UVM, + NVEC_SYCL_MEMSIZE(v), SUN_MEMTYPE_UVM, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUNMEMTYPE_UVM\n"); + "failed for SUN_MEMTYPE_UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vc->host_data), - NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE_HOST, + NVEC_SYCL_MEMSIZE(v), SUN_MEMTYPE_HOST, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_HOST\n"); + "failed to alloc SUN_MEMTYPE_HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vc->device_data), - NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE_DEVICE, + NVEC_SYCL_MEMSIZE(v), SUN_MEMTYPE_DEVICE, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_DEVICE\n"); + "failed to alloc SUN_MEMTYPE_DEVICE\n"); } } @@ -2082,7 +2082,7 @@ static int InitializeReductionBuffer(N_Vector v, const sunrealtype value, size_t /* Wrap the initial value as SUNMemory object */ SUNMemory value_mem = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), - (void*)&value, SUNMEMTYPE_HOST); + (void*)&value, SUN_MEMTYPE_HOST); /* check if the existing reduction memory is not large enough */ if (vcp->reduce_buffer_bytes < bytes) @@ -2096,34 +2096,34 @@ static int InitializeReductionBuffer(N_Vector v, const sunrealtype value, size_t /* allocate pinned memory on the host */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE_PINNED, NVEC_SYCL_QUEUE(v)); + SUN_MEMTYPE_PINNED, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); + "alloc SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); /* if pinned alloc failed, allocate plain host memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE_HOST, NVEC_SYCL_QUEUE(v)); + SUN_MEMTYPE_HOST, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE_HOST\n"); + "alloc SUN_MEMTYPE_HOST\n"); } } /* allocate device memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->reduce_buffer_dev), bytes, - SUNMEMTYPE_DEVICE, NVEC_SYCL_QUEUE(v)); + SUN_MEMTYPE_DEVICE, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE_DEVICE\n"); + "alloc SUN_MEMTYPE_DEVICE\n"); } } @@ -2224,21 +2224,21 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) /* allocate pinned memory on the host */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE_PINNED, NVEC_SYCL_QUEUE(v)); + SUN_MEMTYPE_PINNED, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in FusedBuffer_Init: SUNMemoryHelper_Alloc failed to alloc " - "SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); + "SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); /* if pinned alloc failed, allocate plain host memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE_HOST, NVEC_SYCL_QUEUE(v)); + SUN_MEMTYPE_HOST, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_HOST\n"); + "failed to alloc SUN_MEMTYPE_HOST\n"); return SUN_ERR_GENERIC; } } @@ -2246,11 +2246,11 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) /* allocate device memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->fused_buffer_dev), bytes, - SUNMEMTYPE_DEVICE, NVEC_SYCL_QUEUE(v)); + SUN_MEMTYPE_DEVICE, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE_DEVICE\n"); + "failed to alloc SUN_MEMTYPE_DEVICE\n"); return SUN_ERR_GENERIC; } diff --git a/src/sundials/sundatanode/sundatanode_inmem.c b/src/sundials/sundatanode/sundatanode_inmem.c index 0c6fcf1d7a..bb22d962ed 100644 --- a/src/sundials/sundatanode/sundatanode_inmem.c +++ b/src/sundials/sundatanode/sundatanode_inmem.c @@ -330,14 +330,14 @@ SUNErrCode SUNDataNode_GetDataNvector_InMem(const SUNDataNode self, N_Vector v, SUNAssert((buffer_size + sizeof(sunrealtype)) == leaf_data->bytes, SUN_ERR_ARG_INCOMPATIBLE); - if (leaf_mem_type != SUNMEMTYPE_HOST) + if (leaf_mem_type != SUN_MEMTYPE_HOST) { /* BufUnpack assumes the data is on the host. So if the leaf has it elsewhere, we need to move it to the host first. */ SUNMemory leaf_host_data = NULL; SUNCheckCall(SUNMemoryHelper_Alloc(IMPL_MEMBER(self, mem_helper), &leaf_host_data, leaf_data->bytes, - SUNMEMTYPE_HOST, queue)); + SUN_MEMTYPE_HOST, queue)); SUNCheckCall(SUNMemoryHelper_Copy(IMPL_MEMBER(self, mem_helper), leaf_host_data, leaf_data, buffer_size, @@ -398,7 +398,7 @@ SUNErrCode SUNDataNode_SetDataNvector_InMem(SUNDataNode self, N_Vector v, /* Use the default queue for the memory helper */ void* queue = NULL; - SUNMemoryType leaf_mem_type = SUNMEMTYPE_HOST; + SUNMemoryType leaf_mem_type = SUN_MEMTYPE_HOST; sunindextype buffer_size = 0; SUNCheckCall(N_VBufSize(v, &buffer_size)); diff --git a/src/sundials/sundials_memory.c b/src/sundials/sundials_memory.c index fa12b5bcf6..e9cd7971ad 100644 --- a/src/sundials/sundials_memory.c +++ b/src/sundials/sundials_memory.c @@ -103,8 +103,8 @@ SUNMemory SUNMemoryHelper_Wrap(SUNMemoryHelper helper, void* ptr, { SUNFunctionBegin(helper->sunctx); - SUNCheckNull(mem_type == SUNMEMTYPE_HOST || mem_type == SUNMEMTYPE_PINNED || - mem_type == SUNMEMTYPE_DEVICE || mem_type == SUNMEMTYPE_UVM, + SUNCheckNull(mem_type == SUN_MEMTYPE_HOST || mem_type == SUN_MEMTYPE_PINNED || + mem_type == SUN_MEMTYPE_DEVICE || mem_type == SUN_MEMTYPE_UVM, SUN_ERR_ARG_OUTOFRANGE); SUNMemory mem = SUNMemoryNewEmpty(helper->sunctx); diff --git a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp index 7490693281..60da238f20 100644 --- a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp +++ b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp @@ -164,7 +164,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc but in device memory for the batched methods. */ retval = SUNMemoryHelper_Alloc(content->memhelp, &content->pivots, M * nblocks * sizeof(sunindextype), - nblocks > 1 ? SUNMEMTYPE_DEVICE : SUNMEMTYPE_HOST, + nblocks > 1 ? SUN_MEMTYPE_DEVICE : SUN_MEMTYPE_HOST, nullptr); if (retval) { @@ -178,7 +178,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc { retval = SUNMemoryHelper_Alloc(content->memhelp, &content->pivotsarr, nblocks * sizeof(sunindextype*), - SUNMEMTYPE_DEVICE, nullptr); + SUN_MEMTYPE_DEVICE, nullptr); if (retval) { SUNLinSolFree(S); @@ -199,7 +199,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc check its values on the host and we need it to have fast transfers. */ retval = SUNMemoryHelper_Alloc(content->memhelp, &content->infoarr, nblocks * sizeof(sunindextype), - SUNMEMTYPE_PINNED, nullptr); + SUN_MEMTYPE_PINNED, nullptr); if (retval) { SUNLinSolFree(S); @@ -208,7 +208,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc retval = SUNMemoryHelper_Alloc(content->memhelp, &content->rhsarr, nblocks * sizeof(sunrealtype*), - SUNMEMTYPE_DEVICE, nullptr); + SUN_MEMTYPE_DEVICE, nullptr); if (retval) { SUNLinSolFree(S); diff --git a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu index 709b032b58..02007f0cba 100644 --- a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu +++ b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu @@ -166,14 +166,14 @@ SUNMatrix SUNMatrix_cuSparse_NewCSR(int M, int N, int NNZ, /* Allocate device memory for the matrix */ alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_colind, - sizeof(int) * NNZ, SUNMEMTYPE_DEVICE, + sizeof(int) * NNZ, SUN_MEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_rowptr, - sizeof(int) * (M + 1), SUNMEMTYPE_DEVICE, + sizeof(int) * (M + 1), SUN_MEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_values, sizeof(sunrealtype) * NNZ, - SUNMEMTYPE_DEVICE, nullptr); + SUN_MEMTYPE_DEVICE, nullptr); if (alloc_fail) { SUNMemoryHelper_Dealloc(SMCU_MEMHELP(A), d_colind, nullptr); @@ -330,11 +330,11 @@ SUNMatrix SUNMatrix_cuSparse_MakeCSR(cusparseMatDescr_t mat_descr, int M, int N, SMCU_CONTENT(A)->fixed_pattern = SUNFALSE; SMCU_CONTENT(A)->sparse_type = SUNMAT_CUSPARSE_CSR; SMCU_CONTENT(A)->colind = SUNMemoryHelper_Wrap(SMCU_MEMHELP(A), colind, - SUNMEMTYPE_DEVICE); + SUN_MEMTYPE_DEVICE); SMCU_CONTENT(A)->rowptrs = SUNMemoryHelper_Wrap(SMCU_MEMHELP(A), rowptrs, - SUNMEMTYPE_DEVICE); + SUN_MEMTYPE_DEVICE); SMCU_CONTENT(A)->data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(A), data, - SUNMEMTYPE_DEVICE); + SUN_MEMTYPE_DEVICE); SMCU_CONTENT(A)->mat_descr = mat_descr; SMCU_CONTENT(A)->cusp_handle = cusp; @@ -412,14 +412,14 @@ SUNMatrix SUNMatrix_cuSparse_NewBlockCSR(int nblocks, int blockrows, /* Allocate device memory for the matrix */ alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_colind, - sizeof(int) * blocknnz, SUNMEMTYPE_DEVICE, + sizeof(int) * blocknnz, SUN_MEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_rowptr, sizeof(int) * (blockrows + 1), - SUNMEMTYPE_DEVICE, nullptr); + SUN_MEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_values, sizeof(sunrealtype) * blocknnz * nblocks, - SUNMEMTYPE_DEVICE, nullptr); + SUN_MEMTYPE_DEVICE, nullptr); if (alloc_fail) { SUNMemoryHelper_Dealloc(SMCU_MEMHELP(A), d_colind, nullptr); @@ -610,7 +610,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, sunrealtype* h_data, if (h_data != NULL) { - _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUNMEMTYPE_HOST); + _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUN_MEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), SMCU_DATA(dA), _h_data, SMCU_NNZ(dA) * sizeof(sunrealtype), (void*)stream); @@ -637,7 +637,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxptrs != NULL) { _h_idxptrs = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxptrs, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), SMCU_INDEXPTRS(dA), _h_idxptrs, nidxptrs * sizeof(int), (void*)stream); @@ -648,7 +648,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxvals != NULL) { _h_idxvals = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxvals, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), SMCU_INDEXVALS(dA), _h_idxvals, nidxvals * sizeof(int), (void*)stream); @@ -673,7 +673,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, sunrealtype* h_data, if (h_data != NULL) { - _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUNMEMTYPE_HOST); + _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUN_MEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), _h_data, SMCU_DATA(dA), SMCU_NNZ(dA) * sizeof(sunrealtype), (void*)stream); @@ -694,7 +694,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxptrs != NULL) { _h_idxptrs = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxptrs, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), _h_idxptrs, SMCU_INDEXPTRS(dA), nidxptrs * sizeof(int), (void*)stream); @@ -705,7 +705,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxvals != NULL) { _h_idxvals = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxvals, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), _h_idxvals, SMCU_INDEXVALS(dA), nidxvals * sizeof(int), (void*)stream); @@ -1026,7 +1026,7 @@ SUNErrCode SUNMatMatvecSetup_cuSparse(SUNMatrix A) CUDA_R_XF, SPMV_ALG, &SMCU_CONTENT(A)->bufferSize)); if (SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &SMCU_CONTENT(A)->dBufferMem, - SMCU_CONTENT(A)->bufferSize, SUNMEMTYPE_DEVICE, + SMCU_CONTENT(A)->bufferSize, SUN_MEMTYPE_DEVICE, nullptr)) return (SUN_ERR_OP_FAIL); } diff --git a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp index 7bf187c307..a87e5e66cd 100644 --- a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp +++ b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp @@ -91,7 +91,7 @@ SUNMatrix SUNMatrix_MagmaDenseBlock(sunindextype nblocks, sunindextype M, if ((M <= 0) || (N <= 0) || (nblocks <= 0)) { return (NULL); } /* Check for valid memory type options */ - if ((memtype != SUNMEMTYPE_UVM) && (memtype != SUNMEMTYPE_DEVICE)) + if ((memtype != SUN_MEMTYPE_UVM) && (memtype != SUN_MEMTYPE_DEVICE)) { return (NULL); } @@ -292,7 +292,7 @@ SUNErrCode SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix Amat, sunrealtype* h_data int retval = 0; SUNMemory _h_data = SUNMemoryHelper_Wrap(SMLD_CONTENT(Amat)->memhelp, h_data, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); SUNDIALS_HIP_OR_CUDA(hipStream_t stream = magma_queue_get_hip_stream(A->q); , cudaStream_t stream = magma_queue_get_cuda_stream(A->q);) @@ -315,7 +315,7 @@ SUNErrCode SUNMatrix_MagmaDense_CopyFromDevice(SUNMatrix Amat, sunrealtype* h_da int retval = 0; SUNMemory _h_data = SUNMemoryHelper_Wrap(SMLD_CONTENT(Amat)->memhelp, h_data, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); SUNDIALS_HIP_OR_CUDA(hipStream_t stream = magma_queue_get_hip_stream(A->q); , cudaStream_t stream = magma_queue_get_cuda_stream(A->q);) diff --git a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp index ce75a62081..e8336752b1 100644 --- a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp +++ b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp @@ -86,7 +86,7 @@ SUNMatrix SUNMatrix_OneMklDenseBlock(sunindextype num_blocks, sunindextype M, // Check inputs if ((M <= 0) || (N <= 0) || (num_blocks <= 0) || (!mem_helper) || - ((mem_type != SUNMEMTYPE_UVM) && (mem_type != SUNMEMTYPE_DEVICE))) + ((mem_type != SUN_MEMTYPE_UVM) && (mem_type != SUN_MEMTYPE_DEVICE))) { SUNDIALS_DEBUG_ERROR("Illegal input\n"); return NULL; @@ -252,7 +252,7 @@ SUNErrCode SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, sunrealtype* h_data) // Wrap the input pointer SUNMemory _h_data = SUNMemoryHelper_Wrap(MAT_MEMHELPER(A), h_data, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); if (!_h_data) { SUNDIALS_DEBUG_ERROR("SUNMemory wrap failed\n"); @@ -286,7 +286,7 @@ SUNErrCode SUNMatrix_OneMklDense_CopyFromDevice(SUNMatrix A, sunrealtype* h_data } SUNMemory _h_data = SUNMemoryHelper_Wrap(MAT_MEMHELPER(A), h_data, - SUNMEMTYPE_HOST); + SUN_MEMTYPE_HOST); if (!_h_data) { SUNDIALS_DEBUG_ERROR("SUNMemory wrap failed\n"); diff --git a/src/sunmemory/cuda/sundials_cuda_memory.cu b/src/sunmemory/cuda/sundials_cuda_memory.cu index b0a2365e4a..7ce721e519 100644 --- a/src/sunmemory/cuda/sundials_cuda_memory.cu +++ b/src/sunmemory/cuda/sundials_cuda_memory.cu @@ -113,7 +113,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, mem->type = mem_type; mem->bytes = mem_size; - if (mem_type == SUNMEMTYPE_HOST) + if (mem_type == SUN_MEMTYPE_HOST) { mem->ptr = malloc(mem_size); SUNAssert(mem->ptr, SUN_ERR_MALLOC_FAIL); @@ -123,7 +123,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, SUNMAX(SUNHELPER_CONTENT(helper)->bytes_allocated_host, SUNHELPER_CONTENT(helper)->bytes_high_watermark_host); } - else if (mem_type == SUNMEMTYPE_PINNED) + else if (mem_type == SUN_MEMTYPE_PINNED) { if (!SUNDIALS_CUDA_VERIFY(cudaMallocHost(&(mem->ptr), mem_size))) { @@ -141,7 +141,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned); } } - else if (mem_type == SUNMEMTYPE_DEVICE) + else if (mem_type == SUN_MEMTYPE_DEVICE) { if (!SUNDIALS_CUDA_VERIFY(cudaMalloc(&(mem->ptr), mem_size))) { @@ -159,7 +159,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_device); } } - else if (mem_type == SUNMEMTYPE_UVM) + else if (mem_type == SUN_MEMTYPE_UVM) { if (!SUNDIALS_CUDA_VERIFY(cudaMallocManaged(&(mem->ptr), mem_size))) { @@ -211,14 +211,14 @@ SUNErrCode SUNMemoryHelper_Dealloc_Cuda(SUNMemoryHelper helper, SUNMemory mem, if (mem->ptr != NULL && mem->own) { - if (mem->type == SUNMEMTYPE_HOST) + if (mem->type == SUN_MEMTYPE_HOST) { SUNHELPER_CONTENT(helper)->num_deallocations_host++; SUNHELPER_CONTENT(helper)->bytes_allocated_host -= mem->bytes; free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE_PINNED) + else if (mem->type == SUN_MEMTYPE_PINNED) { SUNHELPER_CONTENT(helper)->num_deallocations_pinned++; SUNHELPER_CONTENT(helper)->bytes_allocated_pinned -= mem->bytes; @@ -230,7 +230,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Cuda(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE_DEVICE) + else if (mem->type == SUN_MEMTYPE_DEVICE) { SUNHELPER_CONTENT(helper)->num_deallocations_device++; SUNHELPER_CONTENT(helper)->bytes_allocated_device -= mem->bytes; @@ -242,7 +242,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Cuda(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE_UVM) + else if (mem->type == SUN_MEMTYPE_UVM) { SUNHELPER_CONTENT(helper)->num_deallocations_uvm++; SUNHELPER_CONTENT(helper)->bytes_allocated_uvm -= mem->bytes; @@ -275,25 +275,25 @@ SUNErrCode SUNMemoryHelper_Copy_Cuda(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUNMEMTYPE_HOST: - case SUNMEMTYPE_PINNED: - if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) + case SUN_MEMTYPE_HOST: + case SUN_MEMTYPE_PINNED: + if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) + else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) { cuerr = cudaMemcpy(dst->ptr, src->ptr, memory_size, cudaMemcpyHostToDevice); } if (!SUNDIALS_CUDA_VERIFY(cuerr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUNMEMTYPE_UVM: - case SUNMEMTYPE_DEVICE: - if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) + case SUN_MEMTYPE_UVM: + case SUN_MEMTYPE_DEVICE: + if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) { cuerr = cudaMemcpy(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToHost); } - else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) + else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) { cuerr = cudaMemcpy(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToDevice); @@ -322,27 +322,27 @@ SUNErrCode SUNMemoryHelper_CopyAsync_Cuda(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUNMEMTYPE_HOST: - case SUNMEMTYPE_PINNED: - if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) + case SUN_MEMTYPE_HOST: + case SUN_MEMTYPE_PINNED: + if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) + else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) { cuerr = cudaMemcpyAsync(dst->ptr, src->ptr, memory_size, cudaMemcpyHostToDevice, stream); } if (!SUNDIALS_CUDA_VERIFY(cuerr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUNMEMTYPE_UVM: - case SUNMEMTYPE_DEVICE: - if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) + case SUN_MEMTYPE_UVM: + case SUN_MEMTYPE_DEVICE: + if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) { cuerr = cudaMemcpyAsync(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToHost, stream); } - else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) + else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) { cuerr = cudaMemcpyAsync(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToDevice, stream); @@ -376,28 +376,28 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Cuda(SUNMemoryHelper helper, size_t* bytes_allocated, size_t* bytes_high_watermark) { - if (mem_type == SUNMEMTYPE_HOST) + if (mem_type == SUN_MEMTYPE_HOST) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_host; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_host; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_host; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_host; } - else if (mem_type == SUNMEMTYPE_PINNED) + else if (mem_type == SUN_MEMTYPE_PINNED) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_pinned; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_pinned; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_pinned; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned; } - else if (mem_type == SUNMEMTYPE_DEVICE) + else if (mem_type == SUN_MEMTYPE_DEVICE) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_device; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_device; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_device; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_device; } - else if (mem_type == SUNMEMTYPE_UVM) + else if (mem_type == SUN_MEMTYPE_UVM) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_uvm; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_uvm; diff --git a/src/sunmemory/hip/sundials_hip_memory.hip.cpp b/src/sunmemory/hip/sundials_hip_memory.hip.cpp index 5384c2acc6..216b6b15b3 100644 --- a/src/sunmemory/hip/sundials_hip_memory.hip.cpp +++ b/src/sunmemory/hip/sundials_hip_memory.hip.cpp @@ -113,7 +113,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, mem->type = mem_type; mem->bytes = mem_size; - if (mem_type == SUNMEMTYPE_HOST) + if (mem_type == SUN_MEMTYPE_HOST) { mem->ptr = malloc(mem_size); SUNAssert(mem->ptr, SUN_ERR_MALLOC_FAIL); @@ -123,7 +123,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, SUNMAX(SUNHELPER_CONTENT(helper)->bytes_allocated_host, SUNHELPER_CONTENT(helper)->bytes_high_watermark_host); } - else if (mem_type == SUNMEMTYPE_PINNED) + else if (mem_type == SUN_MEMTYPE_PINNED) { if (!SUNDIALS_HIP_VERIFY(hipMallocHost(&(mem->ptr), mem_size))) { @@ -141,7 +141,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned); } } - else if (mem_type == SUNMEMTYPE_DEVICE) + else if (mem_type == SUN_MEMTYPE_DEVICE) { if (!SUNDIALS_HIP_VERIFY(hipMalloc(&(mem->ptr), mem_size))) { @@ -159,7 +159,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_device); } } - else if (mem_type == SUNMEMTYPE_UVM) + else if (mem_type == SUN_MEMTYPE_UVM) { if (!SUNDIALS_HIP_VERIFY(hipMallocManaged(&(mem->ptr), mem_size))) { @@ -211,14 +211,14 @@ SUNErrCode SUNMemoryHelper_Dealloc_Hip(SUNMemoryHelper helper, SUNMemory mem, if (mem->ptr != NULL && mem->own) { - if (mem->type == SUNMEMTYPE_HOST) + if (mem->type == SUN_MEMTYPE_HOST) { SUNHELPER_CONTENT(helper)->num_deallocations_host++; SUNHELPER_CONTENT(helper)->bytes_allocated_host -= mem->bytes; free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE_PINNED) + else if (mem->type == SUN_MEMTYPE_PINNED) { SUNHELPER_CONTENT(helper)->num_deallocations_pinned++; SUNHELPER_CONTENT(helper)->bytes_allocated_pinned -= mem->bytes; @@ -230,7 +230,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Hip(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE_DEVICE) + else if (mem->type == SUN_MEMTYPE_DEVICE) { SUNHELPER_CONTENT(helper)->num_deallocations_device++; SUNHELPER_CONTENT(helper)->bytes_allocated_device -= mem->bytes; @@ -242,7 +242,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Hip(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE_UVM) + else if (mem->type == SUN_MEMTYPE_UVM) { SUNHELPER_CONTENT(helper)->num_deallocations_uvm++; SUNHELPER_CONTENT(helper)->bytes_allocated_uvm -= mem->bytes; @@ -275,25 +275,25 @@ SUNErrCode SUNMemoryHelper_Copy_Hip(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUNMEMTYPE_HOST: - case SUNMEMTYPE_PINNED: - if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) + case SUN_MEMTYPE_HOST: + case SUN_MEMTYPE_PINNED: + if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) + else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) { hiperr = hipMemcpy(dst->ptr, src->ptr, memory_size, hipMemcpyHostToDevice); } if (!SUNDIALS_HIP_VERIFY(hiperr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUNMEMTYPE_UVM: - case SUNMEMTYPE_DEVICE: - if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) + case SUN_MEMTYPE_UVM: + case SUN_MEMTYPE_DEVICE: + if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) { hiperr = hipMemcpy(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToHost); } - else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) + else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) { hiperr = hipMemcpy(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToDevice); @@ -322,27 +322,27 @@ SUNErrCode SUNMemoryHelper_CopyAsync_Hip(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUNMEMTYPE_HOST: - case SUNMEMTYPE_PINNED: - if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) + case SUN_MEMTYPE_HOST: + case SUN_MEMTYPE_PINNED: + if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) + else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) { hiperr = hipMemcpyAsync(dst->ptr, src->ptr, memory_size, hipMemcpyHostToDevice, stream); } if (!SUNDIALS_HIP_VERIFY(hiperr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUNMEMTYPE_UVM: - case SUNMEMTYPE_DEVICE: - if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) + case SUN_MEMTYPE_UVM: + case SUN_MEMTYPE_DEVICE: + if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) { hiperr = hipMemcpyAsync(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToHost, stream); } - else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) + else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) { hiperr = hipMemcpyAsync(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToDevice, stream); @@ -376,28 +376,28 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Hip(SUNMemoryHelper helper, size_t* bytes_allocated, size_t* bytes_high_watermark) { - if (mem_type == SUNMEMTYPE_HOST) + if (mem_type == SUN_MEMTYPE_HOST) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_host; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_host; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_host; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_host; } - else if (mem_type == SUNMEMTYPE_PINNED) + else if (mem_type == SUN_MEMTYPE_PINNED) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_pinned; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_pinned; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_pinned; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned; } - else if (mem_type == SUNMEMTYPE_DEVICE) + else if (mem_type == SUN_MEMTYPE_DEVICE) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_device; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_device; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_device; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_device; } - else if (mem_type == SUNMEMTYPE_UVM) + else if (mem_type == SUN_MEMTYPE_UVM) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_uvm; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_uvm; diff --git a/src/sunmemory/sycl/sundials_sycl_memory.cpp b/src/sunmemory/sycl/sundials_sycl_memory.cpp index 23fc21c335..db3b37f661 100644 --- a/src/sunmemory/sycl/sundials_sycl_memory.cpp +++ b/src/sunmemory/sycl/sundials_sycl_memory.cpp @@ -118,7 +118,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, mem->bytes = mem_size; // Allocate the data pointer - if (mem_type == SUNMEMTYPE_HOST) + if (mem_type == SUN_MEMTYPE_HOST) { mem->ptr = malloc(mem_size); if (!(mem->ptr)) @@ -137,7 +137,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_host); } } - else if (mem_type == SUNMEMTYPE_PINNED) + else if (mem_type == SUN_MEMTYPE_PINNED) { mem->ptr = ::sycl::malloc_host(mem_size, *sycl_queue); if (!(mem->ptr)) @@ -156,7 +156,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned); } } - else if (mem_type == SUNMEMTYPE_DEVICE) + else if (mem_type == SUN_MEMTYPE_DEVICE) { mem->ptr = ::sycl::malloc_device(mem_size, *sycl_queue); if (!(mem->ptr)) @@ -175,7 +175,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_device); } } - else if (mem_type == SUNMEMTYPE_UVM) + else if (mem_type == SUN_MEMTYPE_UVM) { mem->ptr = ::sycl::malloc_shared(mem_size, *sycl_queue); if (!(mem->ptr)) @@ -233,27 +233,27 @@ SUNErrCode SUNMemoryHelper_Dealloc_Sycl(SUNMemoryHelper helper, SUNMemory mem, ::sycl::queue* sycl_queue = GET_SYCL_QUEUE(helper, queue); SUNAssert(sycl_queue, SUN_ERR_ARG_CORRUPT); - if (mem->type == SUNMEMTYPE_HOST) + if (mem->type == SUN_MEMTYPE_HOST) { SUNHELPER_CONTENT(helper)->num_deallocations_host++; SUNHELPER_CONTENT(helper)->bytes_allocated_host -= mem->bytes; free(mem->ptr); mem->ptr = nullptr; } - else if (mem->type == SUNMEMTYPE_PINNED || mem->type == SUNMEMTYPE_DEVICE || - mem->type == SUNMEMTYPE_UVM) + else if (mem->type == SUN_MEMTYPE_PINNED || mem->type == SUN_MEMTYPE_DEVICE || + mem->type == SUN_MEMTYPE_UVM) { - if (mem->type == SUNMEMTYPE_PINNED) + if (mem->type == SUN_MEMTYPE_PINNED) { SUNHELPER_CONTENT(helper)->num_deallocations_pinned++; SUNHELPER_CONTENT(helper)->bytes_allocated_pinned -= mem->bytes; } - else if (mem->type == SUNMEMTYPE_DEVICE) + else if (mem->type == SUN_MEMTYPE_DEVICE) { SUNHELPER_CONTENT(helper)->num_deallocations_device++; SUNHELPER_CONTENT(helper)->bytes_allocated_device -= mem->bytes; } - else if (mem->type == SUNMEMTYPE_UVM) + else if (mem->type == SUN_MEMTYPE_UVM) { SUNHELPER_CONTENT(helper)->num_deallocations_uvm++; SUNHELPER_CONTENT(helper)->bytes_allocated_uvm -= mem->bytes; @@ -297,7 +297,7 @@ SUNErrCode SUNMemoryHelper_CopyAsync_Sycl(SUNMemoryHelper helper, SUNMemory dst, ::sycl::queue* sycl_queue = GET_SYCL_QUEUE(helper, queue); SUNAssert(sycl_queue, SUN_ERR_ARG_CORRUPT); - if (src->type == SUNMEMTYPE_HOST && dst->type == SUNMEMTYPE_HOST) + if (src->type == SUN_MEMTYPE_HOST && dst->type == SUN_MEMTYPE_HOST) { memcpy(dst->ptr, src->ptr, memory_size); } @@ -323,28 +323,28 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Sycl(SUNMemoryHelper helper, size_t* bytes_allocated, size_t* bytes_high_watermark) { - if (mem_type == SUNMEMTYPE_HOST) + if (mem_type == SUN_MEMTYPE_HOST) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_host; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_host; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_host; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_host; } - else if (mem_type == SUNMEMTYPE_PINNED) + else if (mem_type == SUN_MEMTYPE_PINNED) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_pinned; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_pinned; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_pinned; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned; } - else if (mem_type == SUNMEMTYPE_DEVICE) + else if (mem_type == SUN_MEMTYPE_DEVICE) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_device; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_device; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_device; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_device; } - else if (mem_type == SUNMEMTYPE_UVM) + else if (mem_type == SUN_MEMTYPE_UVM) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_uvm; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_uvm; diff --git a/src/sunmemory/system/sundials_system_memory.c b/src/sunmemory/system/sundials_system_memory.c index 2e0bc828cd..6f484c47f5 100644 --- a/src/sunmemory/system/sundials_system_memory.c +++ b/src/sunmemory/system/sundials_system_memory.c @@ -77,7 +77,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sys(SUNMemoryHelper helper, SUNMemory* memptr, { SUNFunctionBegin(helper->sunctx); - SUNAssert(mem_type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(mem_type == SUN_MEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); SUNMemory mem = SUNMemoryNewEmpty(helper->sunctx); SUNCheckLastErr(); @@ -87,7 +87,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sys(SUNMemoryHelper helper, SUNMemory* memptr, mem->type = mem_type; mem->bytes = mem_size; - if (mem_type == SUNMEMTYPE_HOST) + if (mem_type == SUN_MEMTYPE_HOST) { mem->ptr = malloc(mem_size); SUNAssert(mem->ptr, SUN_ERR_MALLOC_FAIL); @@ -124,11 +124,11 @@ SUNErrCode SUNMemoryHelper_Dealloc_Sys(SUNMemoryHelper helper, SUNMemory mem, if (mem == NULL) { return SUN_SUCCESS; } - SUNAssert(mem->type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(mem->type == SUN_MEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); if (mem->ptr != NULL && mem->own) { - if (mem->type == SUNMEMTYPE_HOST) + if (mem->type == SUN_MEMTYPE_HOST) { SUNHELPER_CONTENT(helper)->num_deallocations++; SUNHELPER_CONTENT(helper)->bytes_allocated -= mem->bytes; @@ -146,8 +146,8 @@ SUNErrCode SUNMemoryHelper_Copy_Sys(SUNMemoryHelper helper, SUNMemory dst, SUNDIALS_MAYBE_UNUSED void* queue) { SUNFunctionBegin(helper->sunctx); - SUNAssert(src->type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); - SUNAssert(dst->type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(src->type == SUN_MEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(dst->type == SUN_MEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); memcpy(dst->ptr, src->ptr, memory_size); return SUN_SUCCESS; } @@ -158,7 +158,7 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Sys( size_t* bytes_allocated, size_t* bytes_high_watermark) { SUNFunctionBegin(helper->sunctx); - SUNAssert(mem_type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(mem_type == SUN_MEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated; diff --git a/test/unit_tests/sundials/test_sundials_datanode.cpp b/test/unit_tests/sundials/test_sundials_datanode.cpp index efe76aa1f5..7aa1e3a39b 100644 --- a/test/unit_tests/sundials/test_sundials_datanode.cpp +++ b/test/unit_tests/sundials/test_sundials_datanode.cpp @@ -71,7 +71,7 @@ TEST_F(SUNDataNodeTest, CreateLeafWorks) err = SUNDataNode_CreateLeaf(SUNDATAIOMODE_INMEM, mem_helper, sunctx, &node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, + err = SUNDataNode_SetData(node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -162,7 +162,7 @@ TEST_F(SUNDataNodeTest, HasChildrenWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -193,7 +193,7 @@ TEST_F(SUNDataNodeTest, RemoveChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -232,7 +232,7 @@ TEST_F(SUNDataNodeTest, RemoveSameChildTwiceWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -267,7 +267,7 @@ TEST_F(SUNDataNodeTest, RemoveChildWorksWhenEmpty) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -295,7 +295,7 @@ TEST_F(SUNDataNodeTest, GetChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -327,7 +327,7 @@ TEST_F(SUNDataNodeTest, GetNamedChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -363,7 +363,7 @@ TEST_F(SUNDataNodeTest, RemoveNamedChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -398,7 +398,7 @@ TEST_F(SUNDataNodeTest, GetDataWorksWhenLeaf) &root_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(root_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, + err = SUNDataNode_SetData(root_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -427,7 +427,7 @@ TEST_F(SUNDataNodeTest, SetDataWorksWhenLeaf) EXPECT_EQ(err, SUN_SUCCESS); int new_integer_value = 3; - err = SUNDataNode_SetData(root_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, + err = SUNDataNode_SetData(root_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, (void*)&new_integer_value, sizeof(new_integer_value), sizeof(new_integer_value)); EXPECT_EQ(err, SUN_SUCCESS); diff --git a/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp b/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp index 6582a1816d..a5b1ae57b3 100644 --- a/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp +++ b/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp @@ -97,12 +97,12 @@ int main(int argc, char* argv[]) /* Create matrices and vectors */ if (nblocks > 1) { - A = SUNMatrix_MagmaDenseBlock(nblocks, rows, cols, SUNMEMTYPE_DEVICE, + A = SUNMatrix_MagmaDenseBlock(nblocks, rows, cols, SUN_MEMTYPE_DEVICE, memhelper, NULL, sunctx); } else { - A = SUNMatrix_MagmaDense(rows, cols, SUNMEMTYPE_DEVICE, memhelper, NULL, + A = SUNMatrix_MagmaDense(rows, cols, SUN_MEMTYPE_DEVICE, memhelper, NULL, sunctx); } I = SUNMatClone(A); diff --git a/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp b/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp index 557679d312..07fa925618 100644 --- a/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp +++ b/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp @@ -152,12 +152,12 @@ int main(int argc, char* argv[]) SUNMatrix A; if (nblocks > 1) { - A = SUNMatrix_OneMklDenseBlock(nblocks, rows, cols, SUNMEMTYPE_DEVICE, + A = SUNMatrix_OneMklDenseBlock(nblocks, rows, cols, SUN_MEMTYPE_DEVICE, memhelper, &myQueue, sunctx); } else { - A = SUNMatrix_OneMklDense(rows, cols, SUNMEMTYPE_DEVICE, memhelper, + A = SUNMatrix_OneMklDense(rows, cols, SUN_MEMTYPE_DEVICE, memhelper, &myQueue, sunctx); } diff --git a/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp b/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp index 7dfa3c5ff2..0b19d962f6 100644 --- a/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp +++ b/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp @@ -114,7 +114,7 @@ int main(int argc, char* argv[]) y = HIP_OR_CUDA(N_VNew_Hip(matrows * nblocks, sunctx); , N_VNew_Cuda(matrows * nblocks, sunctx);) A = SUNMatrix_MagmaDenseBlock(nblocks, matrows, matcols, - SUNMEMTYPE_DEVICE, memhelper, NULL, sunctx); + SUN_MEMTYPE_DEVICE, memhelper, NULL, sunctx); if (square) { I = SUNMatClone(A); } /* Allocate host data */ diff --git a/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp b/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp index 90f5650a6f..05d72b11b5 100644 --- a/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp +++ b/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp @@ -147,7 +147,7 @@ int main(int argc, char* argv[]) } SUNMatrix A = SUNMatrix_OneMklDenseBlock(nblocks, matrows, matcols, - SUNMEMTYPE_DEVICE, memhelper, + SUN_MEMTYPE_DEVICE, memhelper, &myQueue, sunctx); if (!A) { diff --git a/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu b/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu index 892c99eb0e..9f65eed8a9 100644 --- a/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu +++ b/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu @@ -37,7 +37,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, // Write to the memory sunrealtype host_arr[N]; sunrealtype* some_arr = static_cast(some_memory->ptr); - if (mem_type == SUNMEMTYPE_DEVICE) + if (mem_type == SUN_MEMTYPE_DEVICE) { for (int i = 0; i < N; i++) { host_arr[i] = i * sunrealtype{1.0}; } cudaMemcpy(some_memory->ptr, host_arr, bytes_to_alloc, @@ -64,7 +64,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, } return -1; } - if (mem_type == SUNMEMTYPE_DEVICE) + if (mem_type == SUN_MEMTYPE_DEVICE) { sunrealtype other_arr[N]; cudaMemcpy(other_arr, other_memory->ptr, bytes_to_alloc, @@ -208,17 +208,17 @@ int main(int argc, char* argv[]) std::cout << " SUNMemoryHelper_Cuda... PASSED\n"; std::cout << "With host memory... \n"; - test_instance(helper, SUNMEMTYPE_HOST, true); + test_instance(helper, SUN_MEMTYPE_HOST, true); std::cout << "With pinned memory... \n"; - test_instance(helper, SUNMEMTYPE_PINNED, true); + test_instance(helper, SUN_MEMTYPE_PINNED, true); std::cout << "With device memory... \n"; - test_instance(helper, SUNMEMTYPE_DEVICE, true); + test_instance(helper, SUN_MEMTYPE_DEVICE, true); std::cout << "With uvm memory... \n"; - test_instance(helper, SUNMEMTYPE_UVM, true); + test_instance(helper, SUN_MEMTYPE_UVM, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUNMEMTYPE_HOST, false)) + if (!helper || test_instance(helper2, SUN_MEMTYPE_HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; diff --git a/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp b/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp index 614a78c9fe..e71253b433 100644 --- a/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp +++ b/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp @@ -37,7 +37,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, // Write to the memory sunrealtype host_arr[N]; sunrealtype* some_arr = static_cast(some_memory->ptr); - if (mem_type == SUNMEMTYPE_DEVICE) + if (mem_type == SUN_MEMTYPE_DEVICE) { for (int i = 0; i < N; i++) { host_arr[i] = i * sunrealtype{1.0}; } hipMemcpy(some_memory->ptr, host_arr, bytes_to_alloc, hipMemcpyHostToDevice); @@ -63,7 +63,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, } return -1; } - if (mem_type == SUNMEMTYPE_DEVICE) + if (mem_type == SUN_MEMTYPE_DEVICE) { sunrealtype other_arr[N]; hipMemcpy(other_arr, other_memory->ptr, bytes_to_alloc, @@ -207,17 +207,17 @@ int main(int argc, char* argv[]) std::cout << " SUNMemoryHelper_Hip... PASSED\n"; std::cout << "With host memory... \n"; - test_instance(helper, SUNMEMTYPE_HOST, true); + test_instance(helper, SUN_MEMTYPE_HOST, true); std::cout << "With pinned memory... \n"; - test_instance(helper, SUNMEMTYPE_PINNED, true); + test_instance(helper, SUN_MEMTYPE_PINNED, true); std::cout << "With device memory... \n"; - test_instance(helper, SUNMEMTYPE_DEVICE, true); + test_instance(helper, SUN_MEMTYPE_DEVICE, true); std::cout << "With uvm memory... \n"; - test_instance(helper, SUNMEMTYPE_UVM, true); + test_instance(helper, SUN_MEMTYPE_UVM, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUNMEMTYPE_HOST, false)) + if (!helper || test_instance(helper2, SUN_MEMTYPE_HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; diff --git a/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp b/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp index 0a6cbc35f4..29c0233501 100644 --- a/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp +++ b/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp @@ -48,7 +48,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, // Write to the memory sunrealtype host_arr[N]; sunrealtype* some_arr = static_cast(some_memory->ptr); - if (mem_type == SUNMEMTYPE_DEVICE) + if (mem_type == SUN_MEMTYPE_DEVICE) { for (int i = 0; i < N; i++) { host_arr[i] = i * sunrealtype{1.0}; } myQueue.memcpy(some_memory->ptr, host_arr, bytes_to_alloc); @@ -84,7 +84,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, } return -1; } - if (mem_type == SUNMEMTYPE_DEVICE) + if (mem_type == SUN_MEMTYPE_DEVICE) { sunrealtype other_arr[N]; myQueue.memcpy(other_arr, other_memory->ptr, bytes_to_alloc); @@ -230,17 +230,17 @@ int main(int argc, char* argv[]) std::cout << " SUNMemoryHelper_Sycl... PASSED\n"; std::cout << "With host memory... \n"; - test_instance(helper, SUNMEMTYPE_HOST, true); + test_instance(helper, SUN_MEMTYPE_HOST, true); std::cout << "With pinned memory... \n"; - test_instance(helper, SUNMEMTYPE_PINNED, true); + test_instance(helper, SUN_MEMTYPE_PINNED, true); std::cout << "With device memory... \n"; - test_instance(helper, SUNMEMTYPE_DEVICE, true); + test_instance(helper, SUN_MEMTYPE_DEVICE, true); std::cout << "With uvm memory... \n"; - test_instance(helper, SUNMEMTYPE_UVM, true); + test_instance(helper, SUN_MEMTYPE_UVM, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUNMEMTYPE_HOST, false)) + if (!helper || test_instance(helper2, SUN_MEMTYPE_HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; diff --git a/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp b/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp index bd2e31e5a6..53eb48e388 100644 --- a/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp +++ b/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp @@ -179,11 +179,11 @@ int main(int argc, char* argv[]) } std::cout << " SUNMemoryHelper_Sys... PASSED\n"; - test_instance(helper, SUNMEMTYPE_HOST, true); + test_instance(helper, SUN_MEMTYPE_HOST, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUNMEMTYPE_HOST, false)) + if (!helper || test_instance(helper2, SUN_MEMTYPE_HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; From 7e6669bb13e0a941a676d80a7e6226f533a32dd0 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 10:33:01 -0700 Subject: [PATCH 10/26] newline --- include/arkode/arkode_arkstep_deprecated.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arkode/arkode_arkstep_deprecated.h b/include/arkode/arkode_arkstep_deprecated.h index 7abf53b5c1..b8773e856f 100644 --- a/include/arkode/arkode_arkstep_deprecated.h +++ b/include/arkode/arkode_arkstep_deprecated.h @@ -368,4 +368,4 @@ int ARKStepGetNumRhsEvals(void* arkode_mem, long int* nfe_evals, } #endif -#endif /* _ARKSTEP_DEPRECATED_H */ \ No newline at end of file +#endif /* _ARKSTEP_DEPRECATED_H */ From 56711a682a1097cd6904e6321c169438e73ff2b2 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 10:36:24 -0700 Subject: [PATCH 11/26] remove duplicate typedef from merge conflict --- include/kinsol/kinsol.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/include/kinsol/kinsol.h b/include/kinsol/kinsol.h index 23ca0b38e6..9e569e22a5 100644 --- a/include/kinsol/kinsol.h +++ b/include/kinsol/kinsol.h @@ -81,15 +81,6 @@ extern "C" { typedef int (*KINSysFn)(N_Vector uu, N_Vector fval, void* user_data); -typedef int (*KINDampingFn)(long int iter, N_Vector u_val, N_Vector g_val, - sunrealtype1d qt_fn, long int depth, - void* user_data, sunrealtype* damping_factor); - -typedef int (*KINDepthFn)(long int iter, N_Vector u_val, N_Vector g_val, - N_Vector f_val, N_Vector1d df, sunrealtype1d R_mat, - long int depth, void* user_data, long int* new_depth, - sunbooleantype* remove_indices); - typedef int (*KINDampingFn)(long int iter, N_Vector u_val, N_Vector g_val, sunrealtype* qt_fn, long int depth, void* user_data, sunrealtype* damping_factor); From 9df8b5aed78a3daaf9724f328be01ee9379d6eae Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 11:01:31 -0700 Subject: [PATCH 12/26] regen swig --- src/arkode/fmod_int32/farkode_arkstep_mod.c | 49 ++-- src/arkode/fmod_int32/farkode_arkstep_mod.f90 | 94 +++---- src/arkode/fmod_int32/farkode_erkstep_mod.c | 1 + src/arkode/fmod_int32/farkode_erkstep_mod.f90 | 2 +- src/arkode/fmod_int32/farkode_mod.c | 74 +++--- src/arkode/fmod_int32/farkode_mod.f90 | 2 +- src/arkode/fmod_int32/farkode_mristep_mod.c | 37 +-- src/arkode/fmod_int32/farkode_mristep_mod.f90 | 2 +- .../fmod_int32/farkode_splittingstep_mod.c | 24 +- .../fmod_int32/farkode_splittingstep_mod.f90 | 4 +- src/arkode/fmod_int32/farkode_sprkstep_mod.c | 1 + .../fmod_int32/farkode_sprkstep_mod.f90 | 2 +- src/arkode/fmod_int64/farkode_arkstep_mod.c | 49 ++-- src/arkode/fmod_int64/farkode_arkstep_mod.f90 | 94 +++---- src/arkode/fmod_int64/farkode_erkstep_mod.c | 1 + src/arkode/fmod_int64/farkode_erkstep_mod.f90 | 2 +- src/arkode/fmod_int64/farkode_mod.c | 74 +++--- src/arkode/fmod_int64/farkode_mod.f90 | 2 +- src/arkode/fmod_int64/farkode_mristep_mod.c | 37 +-- src/arkode/fmod_int64/farkode_mristep_mod.f90 | 2 +- .../fmod_int64/farkode_splittingstep_mod.c | 24 +- .../fmod_int64/farkode_splittingstep_mod.f90 | 4 +- src/arkode/fmod_int64/farkode_sprkstep_mod.c | 1 + .../fmod_int64/farkode_sprkstep_mod.f90 | 2 +- src/cvode/fmod_int32/fcvode_mod.c | 12 +- src/cvode/fmod_int32/fcvode_mod.f90 | 2 +- src/cvode/fmod_int64/fcvode_mod.c | 12 +- src/cvode/fmod_int64/fcvode_mod.f90 | 2 +- src/cvodes/fmod_int32/fcvodes_mod.c | 144 ++++++----- src/cvodes/fmod_int32/fcvodes_mod.f90 | 32 ++- src/cvodes/fmod_int64/fcvodes_mod.c | 144 ++++++----- src/cvodes/fmod_int64/fcvodes_mod.f90 | 32 ++- src/ida/fmod_int32/fida_mod.f90 | 2 +- src/ida/fmod_int64/fida_mod.f90 | 2 +- src/idas/fmod_int32/fidas_mod.c | 140 +++++----- src/idas/fmod_int32/fidas_mod.f90 | 32 ++- src/idas/fmod_int64/fidas_mod.c | 140 +++++----- src/idas/fmod_int64/fidas_mod.f90 | 32 ++- src/kinsol/fmod_int32/fkinsol_mod.f90 | 2 +- src/kinsol/fmod_int64/fkinsol_mod.f90 | 2 +- src/nvector/cuda/nvector_cuda.cu | 4 +- src/nvector/hip/nvector_hip.hip.cpp | 29 ++- src/nvector/raja/nvector_raja.cpp | 3 +- src/nvector/sycl/nvector_sycl.cpp | 4 +- .../fsunadjointcheckpointscheme_fixed_mod.f90 | 2 +- .../fsunadjointcheckpointscheme_fixed_mod.f90 | 2 +- src/sundials/fmod_int32/fsundials_core_mod.c | 244 ++++++++++-------- .../fmod_int32/fsundials_core_mod.f90 | 200 +++++++++----- src/sundials/fmod_int64/fsundials_core_mod.c | 244 ++++++++++-------- .../fmod_int64/fsundials_core_mod.f90 | 200 +++++++++----- src/sundials/sundials_profiler.c | 2 +- .../magmadense/sunlinsol_magmadense.cpp | 3 +- .../band/fmod_int32/fsunmatrix_band_mod.c | 4 +- .../band/fmod_int64/fsunmatrix_band_mod.c | 4 +- src/sunmatrix/cusparse/sunmatrix_cusparse.cu | 4 +- .../dense/fmod_int32/fsunmatrix_dense_mod.c | 4 +- .../dense/fmod_int64/fsunmatrix_dense_mod.c | 4 +- src/sunmemory/sycl/sundials_sycl_memory.cpp | 4 +- swig/arkode/farkode_arkstep_mod.i | 2 + swig/arkode/farkode_erkstep_mod.i | 3 + swig/arkode/farkode_mristep_mod.i | 2 + swig/arkode/farkode_sprkstep_mod.i | 2 + swig/sundials/fsundials.i | 1 + 63 files changed, 1338 insertions(+), 949 deletions(-) diff --git a/src/arkode/fmod_int32/farkode_arkstep_mod.c b/src/arkode/fmod_int32/farkode_arkstep_mod.c index 6a7f52aeeb..bf38271434 100644 --- a/src/arkode/fmod_int32/farkode_arkstep_mod.c +++ b/src/arkode/fmod_int32/farkode_arkstep_mod.c @@ -204,6 +204,7 @@ #include "arkode/arkode_arkstep.h" +#include "arkode/arkode_arkstep_deprecated.h" #include @@ -403,6 +404,30 @@ SWIGEXPORT int _wrap_FARKStepGetTimestepperStats(void *farg1, long *farg2, long } +SWIGEXPORT int _wrap_FARKStepCreateAdjointStepper(void *farg1, SUNAdjRhsFn farg2, SUNAdjRhsFn farg3, double const *farg4, N_Vector farg5, void *farg6, void *farg7) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNAdjRhsFn arg2 = (SUNAdjRhsFn) 0 ; + SUNAdjRhsFn arg3 = (SUNAdjRhsFn) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + SUNContext arg6 = (SUNContext) 0 ; + SUNAdjointStepper *arg7 = (SUNAdjointStepper *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNAdjRhsFn)(farg2); + arg3 = (SUNAdjRhsFn)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + arg6 = (SUNContext)(farg6); + arg7 = (SUNAdjointStepper *)(farg7); + result = (int)ARKStepCreateAdjointStepper(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKStepCreateMRIStepInnerStepper(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -2427,30 +2452,6 @@ SWIGEXPORT void _wrap_FARKStepPrintMem(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FARKStepCreateAdjointStepper(void *farg1, SUNAdjRhsFn farg2, SUNAdjRhsFn farg3, double const *farg4, N_Vector farg5, void *farg6, void *farg7) { - int fresult ; - void *arg1 = (void *) 0 ; - SUNAdjRhsFn arg2 = (SUNAdjRhsFn) 0 ; - SUNAdjRhsFn arg3 = (SUNAdjRhsFn) 0 ; - sunrealtype arg4 ; - N_Vector arg5 = (N_Vector) 0 ; - SUNContext arg6 = (SUNContext) 0 ; - SUNAdjointStepper *arg7 = (SUNAdjointStepper *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (SUNAdjRhsFn)(farg2); - arg3 = (SUNAdjRhsFn)(farg3); - arg4 = (sunrealtype)(*farg4); - arg5 = (N_Vector)(farg5); - arg6 = (SUNContext)(farg6); - arg7 = (SUNAdjointStepper *)(farg7); - result = (int)ARKStepCreateAdjointStepper(arg1,arg2,arg3,arg4,arg5,arg6,arg7); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepSetRelaxFn(void *farg1, ARKRelaxFn farg2, ARKRelaxJacFn farg3) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod_int32/farkode_arkstep_mod.f90 b/src/arkode/fmod_int32/farkode_arkstep_mod.f90 index c2b234d819..65fbb3c66e 100644 --- a/src/arkode/fmod_int32/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_arkstep_mod.f90 @@ -62,6 +62,7 @@ module farkode_arkstep_mod public :: FARKStepSetTableName public :: FARKStepGetCurrentButcherTables public :: FARKStepGetTimestepperStats + public :: FARKStepCreateAdjointStepper public :: FARKStepCreateMRIStepInnerStepper public :: FARKStepResize public :: FARKStepReset @@ -202,7 +203,6 @@ module farkode_arkstep_mod public :: FARKStepGetLinReturnFlagName public :: FARKStepFree public :: FARKStepPrintMem - public :: FARKStepCreateAdjointStepper public :: FARKStepSetRelaxFn public :: FARKStepSetRelaxEtaFail public :: FARKStepSetRelaxLowerBound @@ -328,6 +328,20 @@ function swigc_FARKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, fa integer(C_INT) :: fresult end function +function swigc_FARKStepCreateAdjointStepper(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FARKStepCreateAdjointStepper") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +integer(C_INT) :: fresult +end function + function swigc_FARKStepCreateMRIStepInnerStepper(farg1, farg2) & bind(C, name="_wrap_FARKStepCreateMRIStepInnerStepper") & result(fresult) @@ -1626,20 +1640,6 @@ subroutine swigc_FARKStepPrintMem(farg1, farg2) & type(C_PTR), value :: farg2 end subroutine -function swigc_FARKStepCreateAdjointStepper(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & -bind(C, name="_wrap_FARKStepCreateAdjointStepper") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 -type(C_FUNPTR), value :: farg3 -real(C_DOUBLE), intent(in) :: farg4 -type(C_PTR), value :: farg5 -type(C_PTR), value :: farg6 -type(C_PTR), value :: farg7 -integer(C_INT) :: fresult -end function - function swigc_FARKStepSetRelaxFn(farg1, farg2, farg3) & bind(C, name="_wrap_FARKStepSetRelaxFn") & result(fresult) @@ -2018,6 +2018,37 @@ function FARKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attemp swig_result = fresult end function +function FARKStepCreateAdjointStepper(arkode_mem, adj_fe, adj_fi, tf, sf, sunctx, adj_stepper_ptr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: adj_fe +type(C_FUNPTR), intent(in), value :: adj_fi +real(C_DOUBLE), intent(in) :: tf +type(N_Vector), target, intent(inout) :: sf +type(C_PTR) :: sunctx +type(C_PTR), target, intent(inout) :: adj_stepper_ptr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 + +farg1 = arkode_mem +farg2 = adj_fe +farg3 = adj_fi +farg4 = tf +farg5 = c_loc(sf) +farg6 = sunctx +farg7 = c_loc(adj_stepper_ptr) +fresult = swigc_FARKStepCreateAdjointStepper(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +swig_result = fresult +end function + function FARKStepCreateMRIStepInnerStepper(arkode_mem, stepper) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3744,7 +3775,7 @@ function FARKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -4371,37 +4402,6 @@ subroutine FARKStepPrintMem(arkode_mem, outfile) call swigc_FARKStepPrintMem(farg1, farg2) end subroutine -function FARKStepCreateAdjointStepper(arkode_mem, adj_fe, adj_fi, tf, sf, sunctx, adj_stepper_ptr) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: adj_fe -type(C_FUNPTR), intent(in), value :: adj_fi -real(C_DOUBLE), intent(in) :: tf -type(N_Vector), target, intent(inout) :: sf -type(C_PTR) :: sunctx -type(C_PTR), target, intent(inout) :: adj_stepper_ptr -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 -type(C_FUNPTR) :: farg3 -real(C_DOUBLE) :: farg4 -type(C_PTR) :: farg5 -type(C_PTR) :: farg6 -type(C_PTR) :: farg7 - -farg1 = arkode_mem -farg2 = adj_fe -farg3 = adj_fi -farg4 = tf -farg5 = c_loc(sf) -farg6 = sunctx -farg7 = c_loc(adj_stepper_ptr) -fresult = swigc_FARKStepCreateAdjointStepper(farg1, farg2, farg3, farg4, farg5, farg6, farg7) -swig_result = fresult -end function - function FARKStepSetRelaxFn(arkode_mem, rfn, rjac) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int32/farkode_erkstep_mod.c b/src/arkode/fmod_int32/farkode_erkstep_mod.c index 02404f1e1b..6497ea0802 100644 --- a/src/arkode/fmod_int32/farkode_erkstep_mod.c +++ b/src/arkode/fmod_int32/farkode_erkstep_mod.c @@ -204,6 +204,7 @@ #include "arkode/arkode_erkstep.h" +#include "arkode/arkode_erkstep_deprecated.h" #include diff --git a/src/arkode/fmod_int32/farkode_erkstep_mod.f90 b/src/arkode/fmod_int32/farkode_erkstep_mod.f90 index a9ae263da4..964e452c97 100644 --- a/src/arkode/fmod_int32/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_erkstep_mod.f90 @@ -2220,7 +2220,7 @@ function FERKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_mod.c b/src/arkode/fmod_int32/farkode_mod.c index e37559cad2..861d146ce2 100644 --- a/src/arkode/fmod_int32/farkode_mod.c +++ b/src/arkode/fmod_int32/farkode_mod.c @@ -2603,11 +2603,11 @@ SWIGEXPORT int _wrap_ARKodeButcherTableMem_stages_get(SwigClassWrapper const *fa SWIGEXPORT void _wrap_ARKodeButcherTableMem_A_set(SwigClassWrapper const *farg1, void *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; + sunrealtype2d arg2 = (sunrealtype2d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::A", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (sunrealtype **)(farg2); + arg2 = (sunrealtype2d)(farg2); if (arg1) (arg1)->A = arg2; } @@ -2615,11 +2615,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_A_set(SwigClassWrapper const *farg1, SWIGEXPORT void * _wrap_ARKodeButcherTableMem_A_get(SwigClassWrapper const *farg1) { void * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype **result = 0 ; + sunrealtype2d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::A", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (sunrealtype **) ((arg1)->A); + result = (sunrealtype2d) ((arg1)->A); fresult = result; return fresult; } @@ -2627,11 +2627,11 @@ SWIGEXPORT void * _wrap_ARKodeButcherTableMem_A_get(SwigClassWrapper const *farg SWIGEXPORT void _wrap_ARKodeButcherTableMem_c_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::c", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->c = arg2; } @@ -2639,11 +2639,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_c_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeButcherTableMem_c_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::c", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->c); + result = (sunrealtype1d) ((arg1)->c); fresult = result; return fresult; } @@ -2651,11 +2651,11 @@ SWIGEXPORT double * _wrap_ARKodeButcherTableMem_c_get(SwigClassWrapper const *fa SWIGEXPORT void _wrap_ARKodeButcherTableMem_b_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::b", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->b = arg2; } @@ -2663,11 +2663,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_b_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeButcherTableMem_b_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::b", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->b); + result = (sunrealtype1d) ((arg1)->b); fresult = result; return fresult; } @@ -2675,11 +2675,11 @@ SWIGEXPORT double * _wrap_ARKodeButcherTableMem_b_get(SwigClassWrapper const *fa SWIGEXPORT void _wrap_ARKodeButcherTableMem_d_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::d", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->d = arg2; } @@ -2687,11 +2687,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_d_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeButcherTableMem_d_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::d", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->d); + result = (sunrealtype1d) ((arg1)->d); fresult = result; return fresult; } @@ -2747,19 +2747,19 @@ SWIGEXPORT void * _wrap_FARKodeButcherTable_Create(int const *farg1, int const * int arg1 ; int arg2 ; int arg3 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; - sunrealtype *arg6 = (sunrealtype *) 0 ; - sunrealtype *arg7 = (sunrealtype *) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; + sunrealtype1d arg5 = (sunrealtype1d) 0 ; + sunrealtype1d arg6 = (sunrealtype1d) 0 ; + sunrealtype1d arg7 = (sunrealtype1d) 0 ; ARKodeButcherTable result; arg1 = (int)(*farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); - arg4 = (sunrealtype *)(farg4); - arg5 = (sunrealtype *)(farg5); - arg6 = (sunrealtype *)(farg6); - arg7 = (sunrealtype *)(farg7); + arg4 = (sunrealtype1d)(farg4); + arg5 = (sunrealtype1d)(farg5); + arg6 = (sunrealtype1d)(farg6); + arg7 = (sunrealtype1d)(farg7); result = (ARKodeButcherTable)ARKodeButcherTable_Create(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = result; return fresult; @@ -2982,11 +2982,11 @@ SWIGEXPORT int _wrap_ARKodeSPRKTableMem_stages_get(SwigClassWrapper const *farg1 SWIGEXPORT void _wrap_ARKodeSPRKTableMem_a_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::a", return ); arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->a = arg2; } @@ -2994,11 +2994,11 @@ SWIGEXPORT void _wrap_ARKodeSPRKTableMem_a_set(SwigClassWrapper const *farg1, do SWIGEXPORT double * _wrap_ARKodeSPRKTableMem_a_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::a", return 0); arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->a); + result = (sunrealtype1d) ((arg1)->a); fresult = result; return fresult; } @@ -3006,11 +3006,11 @@ SWIGEXPORT double * _wrap_ARKodeSPRKTableMem_a_get(SwigClassWrapper const *farg1 SWIGEXPORT void _wrap_ARKodeSPRKTableMem_ahat_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::ahat", return ); arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->ahat = arg2; } @@ -3018,11 +3018,11 @@ SWIGEXPORT void _wrap_ARKodeSPRKTableMem_ahat_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeSPRKTableMem_ahat_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::ahat", return 0); arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->ahat); + result = (sunrealtype1d) ((arg1)->ahat); fresult = result; return fresult; } @@ -3063,15 +3063,15 @@ SWIGEXPORT void * _wrap_FARKodeSPRKTable_Create(int const *farg1, int const *far void * fresult ; int arg1 ; int arg2 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; ARKodeSPRKTable result; arg1 = (int)(*farg1); arg2 = (int)(*farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (sunrealtype *)(farg4); - result = (ARKodeSPRKTable)ARKodeSPRKTable_Create(arg1,arg2,(double const *)arg3,(double const *)arg4); + arg3 = (sunrealtype1d)(farg3); + arg4 = (sunrealtype1d)(farg4); + result = (ARKodeSPRKTable)ARKodeSPRKTable_Create(arg1,arg2,arg3,arg4); fresult = result; return fresult; } diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 index 426332015a..5d5982c7e5 100644 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -3854,7 +3854,7 @@ function FARKodePrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.c b/src/arkode/fmod_int32/farkode_mristep_mod.c index b066acc94d..a1cbf7e308 100644 --- a/src/arkode/fmod_int32/farkode_mristep_mod.c +++ b/src/arkode/fmod_int32/farkode_mristep_mod.c @@ -233,6 +233,7 @@ enum { #include "arkode/arkode_mristep.h" +#include "arkode/arkode_mristep_deprecated.h" typedef struct { @@ -430,11 +431,11 @@ SWIGEXPORT int _wrap_MRIStepCouplingMem_p_get(SwigClassWrapper const *farg1) { SWIGEXPORT void _wrap_MRIStepCouplingMem_c_set(SwigClassWrapper const *farg1, double *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::c", return ); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->c = arg2; } @@ -442,11 +443,11 @@ SWIGEXPORT void _wrap_MRIStepCouplingMem_c_set(SwigClassWrapper const *farg1, do SWIGEXPORT double * _wrap_MRIStepCouplingMem_c_get(SwigClassWrapper const *farg1) { double * fresult ; struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::c", return 0); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->c); + result = (sunrealtype1d) ((arg1)->c); fresult = result; return fresult; } @@ -454,11 +455,11 @@ SWIGEXPORT double * _wrap_MRIStepCouplingMem_c_get(SwigClassWrapper const *farg1 SWIGEXPORT void _wrap_MRIStepCouplingMem_W_set(SwigClassWrapper const *farg1, void *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype ***arg2 = (sunrealtype ***) 0 ; + sunrealtype3d arg2 = (sunrealtype3d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::W", return ); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - arg2 = (sunrealtype ***)(farg2); + arg2 = (sunrealtype3d)(farg2); if (arg1) (arg1)->W = arg2; } @@ -466,11 +467,11 @@ SWIGEXPORT void _wrap_MRIStepCouplingMem_W_set(SwigClassWrapper const *farg1, vo SWIGEXPORT void * _wrap_MRIStepCouplingMem_W_get(SwigClassWrapper const *farg1) { void * fresult ; struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype ***result = 0 ; + sunrealtype3d result; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::W", return 0); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - result = (sunrealtype ***) ((arg1)->W); + result = (sunrealtype3d) ((arg1)->W); fresult = result; return fresult; } @@ -478,11 +479,11 @@ SWIGEXPORT void * _wrap_MRIStepCouplingMem_W_get(SwigClassWrapper const *farg1) SWIGEXPORT void _wrap_MRIStepCouplingMem_G_set(SwigClassWrapper const *farg1, void *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype ***arg2 = (sunrealtype ***) 0 ; + sunrealtype3d arg2 = (sunrealtype3d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::G", return ); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - arg2 = (sunrealtype ***)(farg2); + arg2 = (sunrealtype3d)(farg2); if (arg1) (arg1)->G = arg2; } @@ -490,11 +491,11 @@ SWIGEXPORT void _wrap_MRIStepCouplingMem_G_set(SwigClassWrapper const *farg1, vo SWIGEXPORT void * _wrap_MRIStepCouplingMem_G_get(SwigClassWrapper const *farg1) { void * fresult ; struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype ***result = 0 ; + sunrealtype3d result; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::G", return 0); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - result = (sunrealtype ***) ((arg1)->G); + result = (sunrealtype3d) ((arg1)->G); fresult = result; return fresult; } @@ -625,18 +626,18 @@ SWIGEXPORT void * _wrap_FMRIStepCoupling_Create(int const *farg1, int const *far int arg2 ; int arg3 ; int arg4 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; - sunrealtype *arg6 = (sunrealtype *) 0 ; - sunrealtype *arg7 = (sunrealtype *) 0 ; + sunrealtype1d arg5 = (sunrealtype1d) 0 ; + sunrealtype1d arg6 = (sunrealtype1d) 0 ; + sunrealtype1d arg7 = (sunrealtype1d) 0 ; MRIStepCoupling result; arg1 = (int)(*farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); - arg5 = (sunrealtype *)(farg5); - arg6 = (sunrealtype *)(farg6); - arg7 = (sunrealtype *)(farg7); + arg5 = (sunrealtype1d)(farg5); + arg6 = (sunrealtype1d)(farg6); + arg7 = (sunrealtype1d)(farg7); result = (MRIStepCoupling)MRIStepCoupling_Create(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = result; return fresult; diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.f90 b/src/arkode/fmod_int32/farkode_mristep_mod.f90 index 37c167ba05..57343e59eb 100644 --- a/src/arkode/fmod_int32/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mristep_mod.f90 @@ -3352,7 +3352,7 @@ function FMRIStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_splittingstep_mod.c b/src/arkode/fmod_int32/farkode_splittingstep_mod.c index 6e27365f0f..791ef3a906 100644 --- a/src/arkode/fmod_int32/farkode_splittingstep_mod.c +++ b/src/arkode/fmod_int32/farkode_splittingstep_mod.c @@ -310,11 +310,11 @@ SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_alpha_set(SwigClassWrapper const *farg1, double *farg2) { struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::alpha", return ); arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->alpha = arg2; } @@ -322,11 +322,11 @@ SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_alpha_set(SwigClassWrapper co SWIGEXPORT double * _wrap_SplittingStepCoefficientsMem_alpha_get(SwigClassWrapper const *farg1) { double * fresult ; struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::alpha", return 0); arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->alpha); + result = (sunrealtype1d) ((arg1)->alpha); fresult = result; return fresult; } @@ -334,11 +334,11 @@ SWIGEXPORT double * _wrap_SplittingStepCoefficientsMem_alpha_get(SwigClassWrappe SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_beta_set(SwigClassWrapper const *farg1, void *farg2) { struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; - sunrealtype ***arg2 = (sunrealtype ***) 0 ; + sunrealtype3d arg2 = (sunrealtype3d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::beta", return ); arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); - arg2 = (sunrealtype ***)(farg2); + arg2 = (sunrealtype3d)(farg2); if (arg1) (arg1)->beta = arg2; } @@ -346,11 +346,11 @@ SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_beta_set(SwigClassWrapper con SWIGEXPORT void * _wrap_SplittingStepCoefficientsMem_beta_get(SwigClassWrapper const *farg1) { void * fresult ; struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; - sunrealtype ***result = 0 ; + sunrealtype3d result; SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::beta", return 0); arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); - result = (sunrealtype ***) ((arg1)->beta); + result = (sunrealtype3d) ((arg1)->beta); fresult = result; return fresult; } @@ -506,16 +506,16 @@ SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Create(int const *f int arg2 ; int arg3 ; int arg4 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; - sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype1d arg5 = (sunrealtype1d) 0 ; + sunrealtype1d arg6 = (sunrealtype1d) 0 ; SplittingStepCoefficients result; arg1 = (int)(*farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); - arg5 = (sunrealtype *)(farg5); - arg6 = (sunrealtype *)(farg6); + arg5 = (sunrealtype1d)(farg5); + arg6 = (sunrealtype1d)(farg6); result = (SplittingStepCoefficients)SplittingStepCoefficients_Create(arg1,arg2,arg3,arg4,arg5,arg6); fresult.cptr = result; fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); diff --git a/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 b/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 index 7e73277f29..c8fdcc198c 100644 --- a/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_splittingstep_mod.f90 @@ -57,11 +57,11 @@ module farkode_splittingstep_mod interface SplittingStepCoefficientsMem module procedure swigf_create_SplittingStepCoefficientsMem end interface - ! typedef enum ARKODE_SplittingCoefficientsID + ! enum ARKODE_SplittingCoefficientsID enum, bind(c) enumerator :: ARKODE_SPLITTING_NONE = -1 enumerator :: ARKODE_MIN_SPLITTING_NUM = 0 - enumerator :: ARKODE_SPLITTING_LIE_TROTTER_1_1_2 = ARKODE_MIN_SPLITTING_NUM + enumerator :: ARKODE_SPLITTING_LIE_TROTTER_1_1_2 = 0 enumerator :: ARKODE_SPLITTING_STRANG_2_2_2 enumerator :: ARKODE_SPLITTING_BEST_2_2_2 enumerator :: ARKODE_SPLITTING_SUZUKI_3_3_2 diff --git a/src/arkode/fmod_int32/farkode_sprkstep_mod.c b/src/arkode/fmod_int32/farkode_sprkstep_mod.c index c73dfc0cbd..55eeb61972 100644 --- a/src/arkode/fmod_int32/farkode_sprkstep_mod.c +++ b/src/arkode/fmod_int32/farkode_sprkstep_mod.c @@ -204,6 +204,7 @@ #include "arkode/arkode_sprkstep.h" +#include "arkode/arkode_sprkstep_deprecated.h" #include diff --git a/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 b/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 index d0b1db875f..41fb5ee8fd 100644 --- a/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 @@ -992,7 +992,7 @@ function FSPRKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_arkstep_mod.c b/src/arkode/fmod_int64/farkode_arkstep_mod.c index 6a7f52aeeb..bf38271434 100644 --- a/src/arkode/fmod_int64/farkode_arkstep_mod.c +++ b/src/arkode/fmod_int64/farkode_arkstep_mod.c @@ -204,6 +204,7 @@ #include "arkode/arkode_arkstep.h" +#include "arkode/arkode_arkstep_deprecated.h" #include @@ -403,6 +404,30 @@ SWIGEXPORT int _wrap_FARKStepGetTimestepperStats(void *farg1, long *farg2, long } +SWIGEXPORT int _wrap_FARKStepCreateAdjointStepper(void *farg1, SUNAdjRhsFn farg2, SUNAdjRhsFn farg3, double const *farg4, N_Vector farg5, void *farg6, void *farg7) { + int fresult ; + void *arg1 = (void *) 0 ; + SUNAdjRhsFn arg2 = (SUNAdjRhsFn) 0 ; + SUNAdjRhsFn arg3 = (SUNAdjRhsFn) 0 ; + sunrealtype arg4 ; + N_Vector arg5 = (N_Vector) 0 ; + SUNContext arg6 = (SUNContext) 0 ; + SUNAdjointStepper *arg7 = (SUNAdjointStepper *) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (SUNAdjRhsFn)(farg2); + arg3 = (SUNAdjRhsFn)(farg3); + arg4 = (sunrealtype)(*farg4); + arg5 = (N_Vector)(farg5); + arg6 = (SUNContext)(farg6); + arg7 = (SUNAdjointStepper *)(farg7); + result = (int)ARKStepCreateAdjointStepper(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FARKStepCreateMRIStepInnerStepper(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -2427,30 +2452,6 @@ SWIGEXPORT void _wrap_FARKStepPrintMem(void *farg1, void *farg2) { } -SWIGEXPORT int _wrap_FARKStepCreateAdjointStepper(void *farg1, SUNAdjRhsFn farg2, SUNAdjRhsFn farg3, double const *farg4, N_Vector farg5, void *farg6, void *farg7) { - int fresult ; - void *arg1 = (void *) 0 ; - SUNAdjRhsFn arg2 = (SUNAdjRhsFn) 0 ; - SUNAdjRhsFn arg3 = (SUNAdjRhsFn) 0 ; - sunrealtype arg4 ; - N_Vector arg5 = (N_Vector) 0 ; - SUNContext arg6 = (SUNContext) 0 ; - SUNAdjointStepper *arg7 = (SUNAdjointStepper *) 0 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (SUNAdjRhsFn)(farg2); - arg3 = (SUNAdjRhsFn)(farg3); - arg4 = (sunrealtype)(*farg4); - arg5 = (N_Vector)(farg5); - arg6 = (SUNContext)(farg6); - arg7 = (SUNAdjointStepper *)(farg7); - result = (int)ARKStepCreateAdjointStepper(arg1,arg2,arg3,arg4,arg5,arg6,arg7); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FARKStepSetRelaxFn(void *farg1, ARKRelaxFn farg2, ARKRelaxJacFn farg3) { int fresult ; void *arg1 = (void *) 0 ; diff --git a/src/arkode/fmod_int64/farkode_arkstep_mod.f90 b/src/arkode/fmod_int64/farkode_arkstep_mod.f90 index c2b234d819..65fbb3c66e 100644 --- a/src/arkode/fmod_int64/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_arkstep_mod.f90 @@ -62,6 +62,7 @@ module farkode_arkstep_mod public :: FARKStepSetTableName public :: FARKStepGetCurrentButcherTables public :: FARKStepGetTimestepperStats + public :: FARKStepCreateAdjointStepper public :: FARKStepCreateMRIStepInnerStepper public :: FARKStepResize public :: FARKStepReset @@ -202,7 +203,6 @@ module farkode_arkstep_mod public :: FARKStepGetLinReturnFlagName public :: FARKStepFree public :: FARKStepPrintMem - public :: FARKStepCreateAdjointStepper public :: FARKStepSetRelaxFn public :: FARKStepSetRelaxEtaFail public :: FARKStepSetRelaxLowerBound @@ -328,6 +328,20 @@ function swigc_FARKStepGetTimestepperStats(farg1, farg2, farg3, farg4, farg5, fa integer(C_INT) :: fresult end function +function swigc_FARKStepCreateAdjointStepper(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & +bind(C, name="_wrap_FARKStepCreateAdjointStepper") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +type(C_FUNPTR), value :: farg2 +type(C_FUNPTR), value :: farg3 +real(C_DOUBLE), intent(in) :: farg4 +type(C_PTR), value :: farg5 +type(C_PTR), value :: farg6 +type(C_PTR), value :: farg7 +integer(C_INT) :: fresult +end function + function swigc_FARKStepCreateMRIStepInnerStepper(farg1, farg2) & bind(C, name="_wrap_FARKStepCreateMRIStepInnerStepper") & result(fresult) @@ -1626,20 +1640,6 @@ subroutine swigc_FARKStepPrintMem(farg1, farg2) & type(C_PTR), value :: farg2 end subroutine -function swigc_FARKStepCreateAdjointStepper(farg1, farg2, farg3, farg4, farg5, farg6, farg7) & -bind(C, name="_wrap_FARKStepCreateAdjointStepper") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -type(C_FUNPTR), value :: farg2 -type(C_FUNPTR), value :: farg3 -real(C_DOUBLE), intent(in) :: farg4 -type(C_PTR), value :: farg5 -type(C_PTR), value :: farg6 -type(C_PTR), value :: farg7 -integer(C_INT) :: fresult -end function - function swigc_FARKStepSetRelaxFn(farg1, farg2, farg3) & bind(C, name="_wrap_FARKStepSetRelaxFn") & result(fresult) @@ -2018,6 +2018,37 @@ function FARKStepGetTimestepperStats(arkode_mem, expsteps, accsteps, step_attemp swig_result = fresult end function +function FARKStepCreateAdjointStepper(arkode_mem, adj_fe, adj_fi, tf, sf, sunctx, adj_stepper_ptr) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +type(C_FUNPTR), intent(in), value :: adj_fe +type(C_FUNPTR), intent(in), value :: adj_fi +real(C_DOUBLE), intent(in) :: tf +type(N_Vector), target, intent(inout) :: sf +type(C_PTR) :: sunctx +type(C_PTR), target, intent(inout) :: adj_stepper_ptr +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +type(C_FUNPTR) :: farg2 +type(C_FUNPTR) :: farg3 +real(C_DOUBLE) :: farg4 +type(C_PTR) :: farg5 +type(C_PTR) :: farg6 +type(C_PTR) :: farg7 + +farg1 = arkode_mem +farg2 = adj_fe +farg3 = adj_fi +farg4 = tf +farg5 = c_loc(sf) +farg6 = sunctx +farg7 = c_loc(adj_stepper_ptr) +fresult = swigc_FARKStepCreateAdjointStepper(farg1, farg2, farg3, farg4, farg5, farg6, farg7) +swig_result = fresult +end function + function FARKStepCreateMRIStepInnerStepper(arkode_mem, stepper) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3744,7 +3775,7 @@ function FARKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -4371,37 +4402,6 @@ subroutine FARKStepPrintMem(arkode_mem, outfile) call swigc_FARKStepPrintMem(farg1, farg2) end subroutine -function FARKStepCreateAdjointStepper(arkode_mem, adj_fe, adj_fi, tf, sf, sunctx, adj_stepper_ptr) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -type(C_FUNPTR), intent(in), value :: adj_fe -type(C_FUNPTR), intent(in), value :: adj_fi -real(C_DOUBLE), intent(in) :: tf -type(N_Vector), target, intent(inout) :: sf -type(C_PTR) :: sunctx -type(C_PTR), target, intent(inout) :: adj_stepper_ptr -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -type(C_FUNPTR) :: farg2 -type(C_FUNPTR) :: farg3 -real(C_DOUBLE) :: farg4 -type(C_PTR) :: farg5 -type(C_PTR) :: farg6 -type(C_PTR) :: farg7 - -farg1 = arkode_mem -farg2 = adj_fe -farg3 = adj_fi -farg4 = tf -farg5 = c_loc(sf) -farg6 = sunctx -farg7 = c_loc(adj_stepper_ptr) -fresult = swigc_FARKStepCreateAdjointStepper(farg1, farg2, farg3, farg4, farg5, farg6, farg7) -swig_result = fresult -end function - function FARKStepSetRelaxFn(arkode_mem, rfn, rjac) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/arkode/fmod_int64/farkode_erkstep_mod.c b/src/arkode/fmod_int64/farkode_erkstep_mod.c index 02404f1e1b..6497ea0802 100644 --- a/src/arkode/fmod_int64/farkode_erkstep_mod.c +++ b/src/arkode/fmod_int64/farkode_erkstep_mod.c @@ -204,6 +204,7 @@ #include "arkode/arkode_erkstep.h" +#include "arkode/arkode_erkstep_deprecated.h" #include diff --git a/src/arkode/fmod_int64/farkode_erkstep_mod.f90 b/src/arkode/fmod_int64/farkode_erkstep_mod.f90 index a9ae263da4..964e452c97 100644 --- a/src/arkode/fmod_int64/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_erkstep_mod.f90 @@ -2220,7 +2220,7 @@ function FERKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_mod.c b/src/arkode/fmod_int64/farkode_mod.c index 2a73314fba..e80695216b 100644 --- a/src/arkode/fmod_int64/farkode_mod.c +++ b/src/arkode/fmod_int64/farkode_mod.c @@ -2603,11 +2603,11 @@ SWIGEXPORT int _wrap_ARKodeButcherTableMem_stages_get(SwigClassWrapper const *fa SWIGEXPORT void _wrap_ARKodeButcherTableMem_A_set(SwigClassWrapper const *farg1, void *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; + sunrealtype2d arg2 = (sunrealtype2d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::A", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (sunrealtype **)(farg2); + arg2 = (sunrealtype2d)(farg2); if (arg1) (arg1)->A = arg2; } @@ -2615,11 +2615,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_A_set(SwigClassWrapper const *farg1, SWIGEXPORT void * _wrap_ARKodeButcherTableMem_A_get(SwigClassWrapper const *farg1) { void * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype **result = 0 ; + sunrealtype2d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::A", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (sunrealtype **) ((arg1)->A); + result = (sunrealtype2d) ((arg1)->A); fresult = result; return fresult; } @@ -2627,11 +2627,11 @@ SWIGEXPORT void * _wrap_ARKodeButcherTableMem_A_get(SwigClassWrapper const *farg SWIGEXPORT void _wrap_ARKodeButcherTableMem_c_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::c", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->c = arg2; } @@ -2639,11 +2639,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_c_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeButcherTableMem_c_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::c", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->c); + result = (sunrealtype1d) ((arg1)->c); fresult = result; return fresult; } @@ -2651,11 +2651,11 @@ SWIGEXPORT double * _wrap_ARKodeButcherTableMem_c_get(SwigClassWrapper const *fa SWIGEXPORT void _wrap_ARKodeButcherTableMem_b_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::b", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->b = arg2; } @@ -2663,11 +2663,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_b_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeButcherTableMem_b_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::b", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->b); + result = (sunrealtype1d) ((arg1)->b); fresult = result; return fresult; } @@ -2675,11 +2675,11 @@ SWIGEXPORT double * _wrap_ARKodeButcherTableMem_b_get(SwigClassWrapper const *fa SWIGEXPORT void _wrap_ARKodeButcherTableMem_d_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::d", return ); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->d = arg2; } @@ -2687,11 +2687,11 @@ SWIGEXPORT void _wrap_ARKodeButcherTableMem_d_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeButcherTableMem_d_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeButcherTableMem *arg1 = (struct ARKodeButcherTableMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeButcherTableMem *", "ARKodeButcherTableMem", "ARKodeButcherTableMem::d", return 0); arg1 = (struct ARKodeButcherTableMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->d); + result = (sunrealtype1d) ((arg1)->d); fresult = result; return fresult; } @@ -2747,19 +2747,19 @@ SWIGEXPORT void * _wrap_FARKodeButcherTable_Create(int const *farg1, int const * int arg1 ; int arg2 ; int arg3 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; - sunrealtype *arg6 = (sunrealtype *) 0 ; - sunrealtype *arg7 = (sunrealtype *) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; + sunrealtype1d arg5 = (sunrealtype1d) 0 ; + sunrealtype1d arg6 = (sunrealtype1d) 0 ; + sunrealtype1d arg7 = (sunrealtype1d) 0 ; ARKodeButcherTable result; arg1 = (int)(*farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); - arg4 = (sunrealtype *)(farg4); - arg5 = (sunrealtype *)(farg5); - arg6 = (sunrealtype *)(farg6); - arg7 = (sunrealtype *)(farg7); + arg4 = (sunrealtype1d)(farg4); + arg5 = (sunrealtype1d)(farg5); + arg6 = (sunrealtype1d)(farg6); + arg7 = (sunrealtype1d)(farg7); result = (ARKodeButcherTable)ARKodeButcherTable_Create(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = result; return fresult; @@ -2982,11 +2982,11 @@ SWIGEXPORT int _wrap_ARKodeSPRKTableMem_stages_get(SwigClassWrapper const *farg1 SWIGEXPORT void _wrap_ARKodeSPRKTableMem_a_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::a", return ); arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->a = arg2; } @@ -2994,11 +2994,11 @@ SWIGEXPORT void _wrap_ARKodeSPRKTableMem_a_set(SwigClassWrapper const *farg1, do SWIGEXPORT double * _wrap_ARKodeSPRKTableMem_a_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::a", return 0); arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->a); + result = (sunrealtype1d) ((arg1)->a); fresult = result; return fresult; } @@ -3006,11 +3006,11 @@ SWIGEXPORT double * _wrap_ARKodeSPRKTableMem_a_get(SwigClassWrapper const *farg1 SWIGEXPORT void _wrap_ARKodeSPRKTableMem_ahat_set(SwigClassWrapper const *farg1, double *farg2) { struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::ahat", return ); arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->ahat = arg2; } @@ -3018,11 +3018,11 @@ SWIGEXPORT void _wrap_ARKodeSPRKTableMem_ahat_set(SwigClassWrapper const *farg1, SWIGEXPORT double * _wrap_ARKodeSPRKTableMem_ahat_get(SwigClassWrapper const *farg1) { double * fresult ; struct ARKodeSPRKTableMem *arg1 = (struct ARKodeSPRKTableMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct ARKodeSPRKTableMem *", "ARKodeSPRKTableMem", "ARKodeSPRKTableMem::ahat", return 0); arg1 = (struct ARKodeSPRKTableMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->ahat); + result = (sunrealtype1d) ((arg1)->ahat); fresult = result; return fresult; } @@ -3063,15 +3063,15 @@ SWIGEXPORT void * _wrap_FARKodeSPRKTable_Create(int const *farg1, int const *far void * fresult ; int arg1 ; int arg2 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; ARKodeSPRKTable result; arg1 = (int)(*farg1); arg2 = (int)(*farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (sunrealtype *)(farg4); - result = (ARKodeSPRKTable)ARKodeSPRKTable_Create(arg1,arg2,(double const *)arg3,(double const *)arg4); + arg3 = (sunrealtype1d)(farg3); + arg4 = (sunrealtype1d)(farg4); + result = (ARKodeSPRKTable)ARKodeSPRKTable_Create(arg1,arg2,arg3,arg4); fresult = result; return fresult; } diff --git a/src/arkode/fmod_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 index df2167c214..cc4927c61c 100644 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mod.f90 @@ -3854,7 +3854,7 @@ function FARKodePrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.c b/src/arkode/fmod_int64/farkode_mristep_mod.c index 733d62ecca..f805f0b9f9 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.c +++ b/src/arkode/fmod_int64/farkode_mristep_mod.c @@ -233,6 +233,7 @@ enum { #include "arkode/arkode_mristep.h" +#include "arkode/arkode_mristep_deprecated.h" typedef struct { @@ -430,11 +431,11 @@ SWIGEXPORT int _wrap_MRIStepCouplingMem_p_get(SwigClassWrapper const *farg1) { SWIGEXPORT void _wrap_MRIStepCouplingMem_c_set(SwigClassWrapper const *farg1, double *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::c", return ); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->c = arg2; } @@ -442,11 +443,11 @@ SWIGEXPORT void _wrap_MRIStepCouplingMem_c_set(SwigClassWrapper const *farg1, do SWIGEXPORT double * _wrap_MRIStepCouplingMem_c_get(SwigClassWrapper const *farg1) { double * fresult ; struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::c", return 0); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->c); + result = (sunrealtype1d) ((arg1)->c); fresult = result; return fresult; } @@ -454,11 +455,11 @@ SWIGEXPORT double * _wrap_MRIStepCouplingMem_c_get(SwigClassWrapper const *farg1 SWIGEXPORT void _wrap_MRIStepCouplingMem_W_set(SwigClassWrapper const *farg1, void *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype ***arg2 = (sunrealtype ***) 0 ; + sunrealtype3d arg2 = (sunrealtype3d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::W", return ); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - arg2 = (sunrealtype ***)(farg2); + arg2 = (sunrealtype3d)(farg2); if (arg1) (arg1)->W = arg2; } @@ -466,11 +467,11 @@ SWIGEXPORT void _wrap_MRIStepCouplingMem_W_set(SwigClassWrapper const *farg1, vo SWIGEXPORT void * _wrap_MRIStepCouplingMem_W_get(SwigClassWrapper const *farg1) { void * fresult ; struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype ***result = 0 ; + sunrealtype3d result; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::W", return 0); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - result = (sunrealtype ***) ((arg1)->W); + result = (sunrealtype3d) ((arg1)->W); fresult = result; return fresult; } @@ -478,11 +479,11 @@ SWIGEXPORT void * _wrap_MRIStepCouplingMem_W_get(SwigClassWrapper const *farg1) SWIGEXPORT void _wrap_MRIStepCouplingMem_G_set(SwigClassWrapper const *farg1, void *farg2) { struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype ***arg2 = (sunrealtype ***) 0 ; + sunrealtype3d arg2 = (sunrealtype3d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::G", return ); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - arg2 = (sunrealtype ***)(farg2); + arg2 = (sunrealtype3d)(farg2); if (arg1) (arg1)->G = arg2; } @@ -490,11 +491,11 @@ SWIGEXPORT void _wrap_MRIStepCouplingMem_G_set(SwigClassWrapper const *farg1, vo SWIGEXPORT void * _wrap_MRIStepCouplingMem_G_get(SwigClassWrapper const *farg1) { void * fresult ; struct MRIStepCouplingMem *arg1 = (struct MRIStepCouplingMem *) 0 ; - sunrealtype ***result = 0 ; + sunrealtype3d result; SWIG_check_mutable_nonnull(*farg1, "struct MRIStepCouplingMem *", "MRIStepCouplingMem", "MRIStepCouplingMem::G", return 0); arg1 = (struct MRIStepCouplingMem *)(farg1->cptr); - result = (sunrealtype ***) ((arg1)->G); + result = (sunrealtype3d) ((arg1)->G); fresult = result; return fresult; } @@ -625,18 +626,18 @@ SWIGEXPORT void * _wrap_FMRIStepCoupling_Create(int const *farg1, int const *far int arg2 ; int arg3 ; int arg4 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; - sunrealtype *arg6 = (sunrealtype *) 0 ; - sunrealtype *arg7 = (sunrealtype *) 0 ; + sunrealtype1d arg5 = (sunrealtype1d) 0 ; + sunrealtype1d arg6 = (sunrealtype1d) 0 ; + sunrealtype1d arg7 = (sunrealtype1d) 0 ; MRIStepCoupling result; arg1 = (int)(*farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); - arg5 = (sunrealtype *)(farg5); - arg6 = (sunrealtype *)(farg6); - arg7 = (sunrealtype *)(farg7); + arg5 = (sunrealtype1d)(farg5); + arg6 = (sunrealtype1d)(farg6); + arg7 = (sunrealtype1d)(farg7); result = (MRIStepCoupling)MRIStepCoupling_Create(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = result; return fresult; diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.f90 b/src/arkode/fmod_int64/farkode_mristep_mod.f90 index fe7521c877..8edd67d7c6 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mristep_mod.f90 @@ -3352,7 +3352,7 @@ function FMRIStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_splittingstep_mod.c b/src/arkode/fmod_int64/farkode_splittingstep_mod.c index 6e27365f0f..791ef3a906 100644 --- a/src/arkode/fmod_int64/farkode_splittingstep_mod.c +++ b/src/arkode/fmod_int64/farkode_splittingstep_mod.c @@ -310,11 +310,11 @@ SWIGINTERN SwigArrayWrapper SwigArrayWrapper_uninitialized() { SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_alpha_set(SwigClassWrapper const *farg1, double *farg2) { struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::alpha", return ); arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); if (arg1) (arg1)->alpha = arg2; } @@ -322,11 +322,11 @@ SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_alpha_set(SwigClassWrapper co SWIGEXPORT double * _wrap_SplittingStepCoefficientsMem_alpha_get(SwigClassWrapper const *farg1) { double * fresult ; struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; - sunrealtype *result = 0 ; + sunrealtype1d result; SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::alpha", return 0); arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); - result = (sunrealtype *) ((arg1)->alpha); + result = (sunrealtype1d) ((arg1)->alpha); fresult = result; return fresult; } @@ -334,11 +334,11 @@ SWIGEXPORT double * _wrap_SplittingStepCoefficientsMem_alpha_get(SwigClassWrappe SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_beta_set(SwigClassWrapper const *farg1, void *farg2) { struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; - sunrealtype ***arg2 = (sunrealtype ***) 0 ; + sunrealtype3d arg2 = (sunrealtype3d) 0 ; SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::beta", return ); arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); - arg2 = (sunrealtype ***)(farg2); + arg2 = (sunrealtype3d)(farg2); if (arg1) (arg1)->beta = arg2; } @@ -346,11 +346,11 @@ SWIGEXPORT void _wrap_SplittingStepCoefficientsMem_beta_set(SwigClassWrapper con SWIGEXPORT void * _wrap_SplittingStepCoefficientsMem_beta_get(SwigClassWrapper const *farg1) { void * fresult ; struct SplittingStepCoefficientsMem *arg1 = (struct SplittingStepCoefficientsMem *) 0 ; - sunrealtype ***result = 0 ; + sunrealtype3d result; SWIG_check_mutable_nonnull(*farg1, "struct SplittingStepCoefficientsMem *", "SplittingStepCoefficientsMem", "SplittingStepCoefficientsMem::beta", return 0); arg1 = (struct SplittingStepCoefficientsMem *)(farg1->cptr); - result = (sunrealtype ***) ((arg1)->beta); + result = (sunrealtype3d) ((arg1)->beta); fresult = result; return fresult; } @@ -506,16 +506,16 @@ SWIGEXPORT SwigClassWrapper _wrap_FSplittingStepCoefficients_Create(int const *f int arg2 ; int arg3 ; int arg4 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; - sunrealtype *arg6 = (sunrealtype *) 0 ; + sunrealtype1d arg5 = (sunrealtype1d) 0 ; + sunrealtype1d arg6 = (sunrealtype1d) 0 ; SplittingStepCoefficients result; arg1 = (int)(*farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); - arg5 = (sunrealtype *)(farg5); - arg6 = (sunrealtype *)(farg6); + arg5 = (sunrealtype1d)(farg5); + arg6 = (sunrealtype1d)(farg6); result = (SplittingStepCoefficients)SplittingStepCoefficients_Create(arg1,arg2,arg3,arg4,arg5,arg6); fresult.cptr = result; fresult.cmemflags = SWIG_MEM_RVALUE | (0 ? SWIG_MEM_OWN : 0); diff --git a/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 b/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 index 7e73277f29..c8fdcc198c 100644 --- a/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_splittingstep_mod.f90 @@ -57,11 +57,11 @@ module farkode_splittingstep_mod interface SplittingStepCoefficientsMem module procedure swigf_create_SplittingStepCoefficientsMem end interface - ! typedef enum ARKODE_SplittingCoefficientsID + ! enum ARKODE_SplittingCoefficientsID enum, bind(c) enumerator :: ARKODE_SPLITTING_NONE = -1 enumerator :: ARKODE_MIN_SPLITTING_NUM = 0 - enumerator :: ARKODE_SPLITTING_LIE_TROTTER_1_1_2 = ARKODE_MIN_SPLITTING_NUM + enumerator :: ARKODE_SPLITTING_LIE_TROTTER_1_1_2 = 0 enumerator :: ARKODE_SPLITTING_STRANG_2_2_2 enumerator :: ARKODE_SPLITTING_BEST_2_2_2 enumerator :: ARKODE_SPLITTING_SUZUKI_3_3_2 diff --git a/src/arkode/fmod_int64/farkode_sprkstep_mod.c b/src/arkode/fmod_int64/farkode_sprkstep_mod.c index c73dfc0cbd..55eeb61972 100644 --- a/src/arkode/fmod_int64/farkode_sprkstep_mod.c +++ b/src/arkode/fmod_int64/farkode_sprkstep_mod.c @@ -204,6 +204,7 @@ #include "arkode/arkode_sprkstep.h" +#include "arkode/arkode_sprkstep_deprecated.h" #include diff --git a/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 b/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 index d0b1db875f..41fb5ee8fd 100644 --- a/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 @@ -992,7 +992,7 @@ function FSPRKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/cvode/fmod_int32/fcvode_mod.c b/src/cvode/fmod_int32/fcvode_mod.c index bfd166d327..6ea17b0efa 100644 --- a/src/cvode/fmod_int32/fcvode_mod.c +++ b/src/cvode/fmod_int32/fcvode_mod.c @@ -289,17 +289,17 @@ SWIGEXPORT int _wrap_FCVodeReInit(void *farg1, double const *farg2, N_Vector far SWIGEXPORT int _wrap_FCVodeResizeHistory(void *farg1, double *farg2, void *farg3, void *farg4, int const *farg5, int const *farg6) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int arg5 ; int arg6 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (N_Vector *)(farg4); + arg2 = (sunrealtype1d)(farg2); + arg3 = (N_Vector1d)(farg3); + arg4 = (N_Vector1d)(farg4); arg5 = (int)(*farg5); arg6 = (int)(*farg6); result = (int)CVodeResizeHistory(arg1,arg2,arg3,arg4,arg5,arg6); diff --git a/src/cvode/fmod_int32/fcvode_mod.f90 b/src/cvode/fmod_int32/fcvode_mod.f90 index 4666447bf0..971c76af38 100644 --- a/src/cvode/fmod_int32/fcvode_mod.f90 +++ b/src/cvode/fmod_int32/fcvode_mod.f90 @@ -2620,7 +2620,7 @@ function FCVodePrintAllStats(cvode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: cvode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/cvode/fmod_int64/fcvode_mod.c b/src/cvode/fmod_int64/fcvode_mod.c index 199e1ae5da..57e4520d47 100644 --- a/src/cvode/fmod_int64/fcvode_mod.c +++ b/src/cvode/fmod_int64/fcvode_mod.c @@ -289,17 +289,17 @@ SWIGEXPORT int _wrap_FCVodeReInit(void *farg1, double const *farg2, N_Vector far SWIGEXPORT int _wrap_FCVodeResizeHistory(void *farg1, double *farg2, void *farg3, void *farg4, int const *farg5, int const *farg6) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int arg5 ; int arg6 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (N_Vector *)(farg4); + arg2 = (sunrealtype1d)(farg2); + arg3 = (N_Vector1d)(farg3); + arg4 = (N_Vector1d)(farg4); arg5 = (int)(*farg5); arg6 = (int)(*farg6); result = (int)CVodeResizeHistory(arg1,arg2,arg3,arg4,arg5,arg6); diff --git a/src/cvode/fmod_int64/fcvode_mod.f90 b/src/cvode/fmod_int64/fcvode_mod.f90 index 9e9b4d1f63..6e2f051d21 100644 --- a/src/cvode/fmod_int64/fcvode_mod.f90 +++ b/src/cvode/fmod_int64/fcvode_mod.f90 @@ -2620,7 +2620,7 @@ function FCVodePrintAllStats(cvode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: cvode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/cvodes/fmod_int32/fcvodes_mod.c b/src/cvodes/fmod_int32/fcvodes_mod.c index fe19fb2fcb..f219ee7e36 100644 --- a/src/cvodes/fmod_int32/fcvodes_mod.c +++ b/src/cvodes/fmod_int32/fcvodes_mod.c @@ -363,17 +363,17 @@ SWIGEXPORT int _wrap_FCVodeReInit(void *farg1, double const *farg2, N_Vector far SWIGEXPORT int _wrap_FCVodeResizeHistory(void *farg1, double *farg2, void *farg3, void *farg4, int const *farg5, int const *farg6) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int arg5 ; int arg6 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (N_Vector *)(farg4); + arg2 = (sunrealtype1d)(farg2); + arg3 = (N_Vector1d)(farg3); + arg4 = (N_Vector1d)(farg4); arg5 = (int)(*farg5); arg6 = (int)(*farg6); result = (int)CVodeResizeHistory(arg1,arg2,arg3,arg4,arg5,arg6); @@ -957,13 +957,13 @@ SWIGEXPORT int _wrap_FCVodeComputeState(void *farg1, N_Vector farg2, N_Vector fa SWIGEXPORT int _wrap_FCVodeComputeStateSens(void *farg1, void *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeComputeStateSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1179,11 +1179,11 @@ SWIGEXPORT int _wrap_FCVodeGetCurrentStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FCVodeGetCurrentState(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)CVodeGetCurrentState(arg1,arg2); fresult = (int)(result); return fresult; @@ -1193,11 +1193,11 @@ SWIGEXPORT int _wrap_FCVodeGetCurrentState(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FCVodeGetCurrentStateSens(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector **arg2 = (N_Vector **) 0 ; + N_Vector1d *arg2 = (N_Vector1d *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector **)(farg2); + arg2 = (N_Vector1d *)(farg2); result = (int)CVodeGetCurrentStateSens(arg1,arg2); fresult = (int)(result); return fresult; @@ -1338,23 +1338,23 @@ SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemData(void *farg1, double *farg2, vo int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; - N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; sunrealtype *arg6 = (sunrealtype *) 0 ; sunrealtype *arg7 = (sunrealtype *) 0 ; - N_Vector *arg8 = (N_Vector *) 0 ; + N_Vector1d arg8 = (N_Vector1d) 0 ; void **arg9 = (void **) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (N_Vector *)(farg4); - arg5 = (N_Vector *)(farg5); + arg3 = (N_Vector1d)(farg3); + arg4 = (N_Vector1d)(farg4); + arg5 = (N_Vector1d)(farg5); arg6 = (sunrealtype *)(farg6); arg7 = (sunrealtype *)(farg7); - arg8 = (N_Vector *)(farg8); + arg8 = (N_Vector1d)(farg8); arg9 = (void **)(farg9); result = (int)CVodeGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); fresult = (int)(result); @@ -1366,21 +1366,21 @@ SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemDataSens(void *farg1, double *farg2 int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector **arg3 = (N_Vector **) 0 ; - N_Vector **arg4 = (N_Vector **) 0 ; + N_Vector1d *arg3 = (N_Vector1d *) 0 ; + N_Vector1d *arg4 = (N_Vector1d *) 0 ; sunrealtype *arg5 = (sunrealtype *) 0 ; sunrealtype *arg6 = (sunrealtype *) 0 ; - N_Vector **arg7 = (N_Vector **) 0 ; + N_Vector1d *arg7 = (N_Vector1d *) 0 ; void **arg8 = (void **) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector **)(farg3); - arg4 = (N_Vector **)(farg4); + arg3 = (N_Vector1d *)(farg3); + arg4 = (N_Vector1d *)(farg4); arg5 = (sunrealtype *)(farg5); arg6 = (sunrealtype *)(farg6); - arg7 = (N_Vector **)(farg7); + arg7 = (N_Vector1d *)(farg7); arg8 = (void **)(farg8); result = (int)CVodeGetNonlinearSystemDataSens(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); fresult = (int)(result); @@ -1693,14 +1693,14 @@ SWIGEXPORT int _wrap_FCVodeSensInit(void *farg1, int const *farg2, int const *fa int arg2 ; int arg3 ; CVSensRhsFn arg4 = (CVSensRhsFn) 0 ; - N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (CVSensRhsFn)(farg4); - arg5 = (N_Vector *)(farg5); + arg5 = (N_Vector1d)(farg5); result = (int)CVodeSensInit(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -1713,14 +1713,14 @@ SWIGEXPORT int _wrap_FCVodeSensInit1(void *farg1, int const *farg2, int const *f int arg2 ; int arg3 ; CVSensRhs1Fn arg4 = (CVSensRhs1Fn) 0 ; - N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (CVSensRhs1Fn)(farg4); - arg5 = (N_Vector *)(farg5); + arg5 = (N_Vector1d)(farg5); result = (int)CVodeSensInit1(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -1731,12 +1731,12 @@ SWIGEXPORT int _wrap_FCVodeSensReInit(void *farg1, int const *farg2, void *farg3 int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeSensReInit(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1747,12 +1747,12 @@ SWIGEXPORT int _wrap_FCVodeSensSStolerances(void *farg1, double const *farg2, do int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (sunrealtype *)(farg3); + arg3 = (sunrealtype1d)(farg3); result = (int)CVodeSensSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1763,12 +1763,12 @@ SWIGEXPORT int _wrap_FCVodeSensSVtolerances(void *farg1, double const *farg2, vo int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeSensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1834,15 +1834,15 @@ SWIGEXPORT int _wrap_FCVodeSetSensMaxNonlinIters(void *farg1, int const *farg2) SWIGEXPORT int _wrap_FCVodeSetSensParams(void *farg1, double *farg2, double *farg3, int *farg4) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - int *arg4 = (int *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; + int1d arg4 = (int1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (int *)(farg4); + arg2 = (sunrealtype1d)(farg2); + arg3 = (sunrealtype1d)(farg3); + arg4 = (int1d)(farg4); result = (int)CVodeSetSensParams(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -1907,12 +1907,12 @@ SWIGEXPORT int _wrap_FCVodeGetSens(void *farg1, double *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeGetSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1942,13 +1942,13 @@ SWIGEXPORT int _wrap_FCVodeGetSensDky(void *farg1, double const *farg2, int cons void *arg1 = (void *) 0 ; sunrealtype arg2 ; int arg3 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); - arg4 = (N_Vector *)(farg4); + arg4 = (N_Vector1d)(farg4); result = (int)CVodeGetSensDky(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2034,11 +2034,11 @@ SWIGEXPORT int _wrap_FCVodeGetSensNumLinSolvSetups(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FCVodeGetSensErrWeights(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)CVodeGetSensErrWeights(arg1,arg2); fresult = (int)(result); return fresult; @@ -2193,12 +2193,12 @@ SWIGEXPORT int _wrap_FCVodeQuadSensInit(void *farg1, CVQuadSensRhsFn farg2, void int fresult ; void *arg1 = (void *) 0 ; CVQuadSensRhsFn arg2 = (CVQuadSensRhsFn) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (CVQuadSensRhsFn)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeQuadSensInit(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2208,11 +2208,11 @@ SWIGEXPORT int _wrap_FCVodeQuadSensInit(void *farg1, CVQuadSensRhsFn farg2, void SWIGEXPORT int _wrap_FCVodeQuadSensReInit(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)CVodeQuadSensReInit(arg1,arg2); fresult = (int)(result); return fresult; @@ -2223,12 +2223,12 @@ SWIGEXPORT int _wrap_FCVodeQuadSensSStolerances(void *farg1, double const *farg2 int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (sunrealtype *)(farg3); + arg3 = (sunrealtype1d)(farg3); result = (int)CVodeQuadSensSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2239,12 +2239,12 @@ SWIGEXPORT int _wrap_FCVodeQuadSensSVtolerances(void *farg1, double const *farg2 int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeQuadSensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2281,12 +2281,12 @@ SWIGEXPORT int _wrap_FCVodeGetQuadSens(void *farg1, double *farg2, void *farg3) int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeGetQuadSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2316,13 +2316,13 @@ SWIGEXPORT int _wrap_FCVodeGetQuadSensDky(void *farg1, double const *farg2, int void *arg1 = (void *) 0 ; sunrealtype arg2 ; int arg3 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); - arg4 = (N_Vector *)(farg4); + arg4 = (N_Vector1d)(farg4); result = (int)CVodeGetQuadSensDky(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2380,11 +2380,11 @@ SWIGEXPORT int _wrap_FCVodeGetQuadSensNumErrTestFails(void *farg1, long *farg2) SWIGEXPORT int _wrap_FCVodeGetQuadSensErrWeights(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)CVodeGetQuadSensErrWeights(arg1,arg2); fresult = (int)(result); return fresult; @@ -2895,6 +2895,22 @@ SWIGEXPORT int _wrap_FCVodeGetQuadB(void *farg1, int const *farg2, double *farg3 } +SWIGEXPORT int _wrap_FCVodeGetUserDataB(void *farg1, int const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + void **arg3 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (void **)(farg3); + result = (int)CVodeGetUserDataB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT void * _wrap_FCVodeGetAdjCVodeBmem(void *farg1, int const *farg2) { void * fresult ; void *arg1 = (void *) 0 ; diff --git a/src/cvodes/fmod_int32/fcvodes_mod.f90 b/src/cvodes/fmod_int32/fcvodes_mod.f90 index 6dfbe9bd7a..7b561b1ac6 100644 --- a/src/cvodes/fmod_int32/fcvodes_mod.f90 +++ b/src/cvodes/fmod_int32/fcvodes_mod.f90 @@ -267,6 +267,7 @@ module fcvodes_mod public :: FCVodeSetNonlinearSolverB public :: FCVodeGetB public :: FCVodeGetQuadB + public :: FCVodeGetUserDataB public :: FCVodeGetAdjCVodeBmem public :: FCVodeGetAdjY @@ -2019,6 +2020,16 @@ function swigc_FCVodeGetQuadB(farg1, farg2, farg3, farg4) & integer(C_INT) :: fresult end function +function swigc_FCVodeGetUserDataB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetUserDataB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + function swigc_FCVodeGetAdjCVodeBmem(farg1, farg2) & bind(C, name="_wrap_FCVodeGetAdjCVodeBmem") & result(fresult) @@ -4118,7 +4129,7 @@ function FCVodePrintAllStats(cvode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: cvode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -5823,6 +5834,25 @@ function FCVodeGetQuadB(cvode_mem, which, tbret, qb) & swig_result = fresult end function +function FCVodeGetUserDataB(cvode_mem, which, user_datab) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_PTR), target, intent(inout) :: user_datab +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = c_loc(user_datab) +fresult = swigc_FCVodeGetUserDataB(farg1, farg2, farg3) +swig_result = fresult +end function + function FCVodeGetAdjCVodeBmem(cvode_mem, which) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/cvodes/fmod_int64/fcvodes_mod.c b/src/cvodes/fmod_int64/fcvodes_mod.c index 9f76cd3e89..6954bfcace 100644 --- a/src/cvodes/fmod_int64/fcvodes_mod.c +++ b/src/cvodes/fmod_int64/fcvodes_mod.c @@ -363,17 +363,17 @@ SWIGEXPORT int _wrap_FCVodeReInit(void *farg1, double const *farg2, N_Vector far SWIGEXPORT int _wrap_FCVodeResizeHistory(void *farg1, double *farg2, void *farg3, void *farg4, int const *farg5, int const *farg6) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int arg5 ; int arg6 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (N_Vector *)(farg4); + arg2 = (sunrealtype1d)(farg2); + arg3 = (N_Vector1d)(farg3); + arg4 = (N_Vector1d)(farg4); arg5 = (int)(*farg5); arg6 = (int)(*farg6); result = (int)CVodeResizeHistory(arg1,arg2,arg3,arg4,arg5,arg6); @@ -957,13 +957,13 @@ SWIGEXPORT int _wrap_FCVodeComputeState(void *farg1, N_Vector farg2, N_Vector fa SWIGEXPORT int _wrap_FCVodeComputeStateSens(void *farg1, void *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeComputeStateSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1179,11 +1179,11 @@ SWIGEXPORT int _wrap_FCVodeGetCurrentStep(void *farg1, double *farg2) { SWIGEXPORT int _wrap_FCVodeGetCurrentState(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)CVodeGetCurrentState(arg1,arg2); fresult = (int)(result); return fresult; @@ -1193,11 +1193,11 @@ SWIGEXPORT int _wrap_FCVodeGetCurrentState(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FCVodeGetCurrentStateSens(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector **arg2 = (N_Vector **) 0 ; + N_Vector1d *arg2 = (N_Vector1d *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector **)(farg2); + arg2 = (N_Vector1d *)(farg2); result = (int)CVodeGetCurrentStateSens(arg1,arg2); fresult = (int)(result); return fresult; @@ -1338,23 +1338,23 @@ SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemData(void *farg1, double *farg2, vo int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; - N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; sunrealtype *arg6 = (sunrealtype *) 0 ; sunrealtype *arg7 = (sunrealtype *) 0 ; - N_Vector *arg8 = (N_Vector *) 0 ; + N_Vector1d arg8 = (N_Vector1d) 0 ; void **arg9 = (void **) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (N_Vector *)(farg4); - arg5 = (N_Vector *)(farg5); + arg3 = (N_Vector1d)(farg3); + arg4 = (N_Vector1d)(farg4); + arg5 = (N_Vector1d)(farg5); arg6 = (sunrealtype *)(farg6); arg7 = (sunrealtype *)(farg7); - arg8 = (N_Vector *)(farg8); + arg8 = (N_Vector1d)(farg8); arg9 = (void **)(farg9); result = (int)CVodeGetNonlinearSystemData(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); fresult = (int)(result); @@ -1366,21 +1366,21 @@ SWIGEXPORT int _wrap_FCVodeGetNonlinearSystemDataSens(void *farg1, double *farg2 int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector **arg3 = (N_Vector **) 0 ; - N_Vector **arg4 = (N_Vector **) 0 ; + N_Vector1d *arg3 = (N_Vector1d *) 0 ; + N_Vector1d *arg4 = (N_Vector1d *) 0 ; sunrealtype *arg5 = (sunrealtype *) 0 ; sunrealtype *arg6 = (sunrealtype *) 0 ; - N_Vector **arg7 = (N_Vector **) 0 ; + N_Vector1d *arg7 = (N_Vector1d *) 0 ; void **arg8 = (void **) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector **)(farg3); - arg4 = (N_Vector **)(farg4); + arg3 = (N_Vector1d *)(farg3); + arg4 = (N_Vector1d *)(farg4); arg5 = (sunrealtype *)(farg5); arg6 = (sunrealtype *)(farg6); - arg7 = (N_Vector **)(farg7); + arg7 = (N_Vector1d *)(farg7); arg8 = (void **)(farg8); result = (int)CVodeGetNonlinearSystemDataSens(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); fresult = (int)(result); @@ -1693,14 +1693,14 @@ SWIGEXPORT int _wrap_FCVodeSensInit(void *farg1, int const *farg2, int const *fa int arg2 ; int arg3 ; CVSensRhsFn arg4 = (CVSensRhsFn) 0 ; - N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (CVSensRhsFn)(farg4); - arg5 = (N_Vector *)(farg5); + arg5 = (N_Vector1d)(farg5); result = (int)CVodeSensInit(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -1713,14 +1713,14 @@ SWIGEXPORT int _wrap_FCVodeSensInit1(void *farg1, int const *farg2, int const *f int arg2 ; int arg3 ; CVSensRhs1Fn arg4 = (CVSensRhs1Fn) 0 ; - N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (CVSensRhs1Fn)(farg4); - arg5 = (N_Vector *)(farg5); + arg5 = (N_Vector1d)(farg5); result = (int)CVodeSensInit1(arg1,arg2,arg3,arg4,arg5); fresult = (int)(result); return fresult; @@ -1731,12 +1731,12 @@ SWIGEXPORT int _wrap_FCVodeSensReInit(void *farg1, int const *farg2, void *farg3 int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeSensReInit(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1747,12 +1747,12 @@ SWIGEXPORT int _wrap_FCVodeSensSStolerances(void *farg1, double const *farg2, do int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (sunrealtype *)(farg3); + arg3 = (sunrealtype1d)(farg3); result = (int)CVodeSensSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1763,12 +1763,12 @@ SWIGEXPORT int _wrap_FCVodeSensSVtolerances(void *farg1, double const *farg2, vo int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeSensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1834,15 +1834,15 @@ SWIGEXPORT int _wrap_FCVodeSetSensMaxNonlinIters(void *farg1, int const *farg2) SWIGEXPORT int _wrap_FCVodeSetSensParams(void *farg1, double *farg2, double *farg3, int *farg4) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - int *arg4 = (int *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; + int1d arg4 = (int1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (int *)(farg4); + arg2 = (sunrealtype1d)(farg2); + arg3 = (sunrealtype1d)(farg3); + arg4 = (int1d)(farg4); result = (int)CVodeSetSensParams(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -1907,12 +1907,12 @@ SWIGEXPORT int _wrap_FCVodeGetSens(void *farg1, double *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeGetSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1942,13 +1942,13 @@ SWIGEXPORT int _wrap_FCVodeGetSensDky(void *farg1, double const *farg2, int cons void *arg1 = (void *) 0 ; sunrealtype arg2 ; int arg3 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); - arg4 = (N_Vector *)(farg4); + arg4 = (N_Vector1d)(farg4); result = (int)CVodeGetSensDky(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2034,11 +2034,11 @@ SWIGEXPORT int _wrap_FCVodeGetSensNumLinSolvSetups(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FCVodeGetSensErrWeights(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)CVodeGetSensErrWeights(arg1,arg2); fresult = (int)(result); return fresult; @@ -2193,12 +2193,12 @@ SWIGEXPORT int _wrap_FCVodeQuadSensInit(void *farg1, CVQuadSensRhsFn farg2, void int fresult ; void *arg1 = (void *) 0 ; CVQuadSensRhsFn arg2 = (CVQuadSensRhsFn) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (CVQuadSensRhsFn)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeQuadSensInit(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2208,11 +2208,11 @@ SWIGEXPORT int _wrap_FCVodeQuadSensInit(void *farg1, CVQuadSensRhsFn farg2, void SWIGEXPORT int _wrap_FCVodeQuadSensReInit(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)CVodeQuadSensReInit(arg1,arg2); fresult = (int)(result); return fresult; @@ -2223,12 +2223,12 @@ SWIGEXPORT int _wrap_FCVodeQuadSensSStolerances(void *farg1, double const *farg2 int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (sunrealtype *)(farg3); + arg3 = (sunrealtype1d)(farg3); result = (int)CVodeQuadSensSStolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2239,12 +2239,12 @@ SWIGEXPORT int _wrap_FCVodeQuadSensSVtolerances(void *farg1, double const *farg2 int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeQuadSensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2281,12 +2281,12 @@ SWIGEXPORT int _wrap_FCVodeGetQuadSens(void *farg1, double *farg2, void *farg3) int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)CVodeGetQuadSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2316,13 +2316,13 @@ SWIGEXPORT int _wrap_FCVodeGetQuadSensDky(void *farg1, double const *farg2, int void *arg1 = (void *) 0 ; sunrealtype arg2 ; int arg3 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); - arg4 = (N_Vector *)(farg4); + arg4 = (N_Vector1d)(farg4); result = (int)CVodeGetQuadSensDky(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2380,11 +2380,11 @@ SWIGEXPORT int _wrap_FCVodeGetQuadSensNumErrTestFails(void *farg1, long *farg2) SWIGEXPORT int _wrap_FCVodeGetQuadSensErrWeights(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)CVodeGetQuadSensErrWeights(arg1,arg2); fresult = (int)(result); return fresult; @@ -2895,6 +2895,22 @@ SWIGEXPORT int _wrap_FCVodeGetQuadB(void *farg1, int const *farg2, double *farg3 } +SWIGEXPORT int _wrap_FCVodeGetUserDataB(void *farg1, int const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + void **arg3 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (void **)(farg3); + result = (int)CVodeGetUserDataB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT void * _wrap_FCVodeGetAdjCVodeBmem(void *farg1, int const *farg2) { void * fresult ; void *arg1 = (void *) 0 ; diff --git a/src/cvodes/fmod_int64/fcvodes_mod.f90 b/src/cvodes/fmod_int64/fcvodes_mod.f90 index 345d17dc55..a944a78759 100644 --- a/src/cvodes/fmod_int64/fcvodes_mod.f90 +++ b/src/cvodes/fmod_int64/fcvodes_mod.f90 @@ -267,6 +267,7 @@ module fcvodes_mod public :: FCVodeSetNonlinearSolverB public :: FCVodeGetB public :: FCVodeGetQuadB + public :: FCVodeGetUserDataB public :: FCVodeGetAdjCVodeBmem public :: FCVodeGetAdjY @@ -2019,6 +2020,16 @@ function swigc_FCVodeGetQuadB(farg1, farg2, farg3, farg4) & integer(C_INT) :: fresult end function +function swigc_FCVodeGetUserDataB(farg1, farg2, farg3) & +bind(C, name="_wrap_FCVodeGetUserDataB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + function swigc_FCVodeGetAdjCVodeBmem(farg1, farg2) & bind(C, name="_wrap_FCVodeGetAdjCVodeBmem") & result(fresult) @@ -4118,7 +4129,7 @@ function FCVodePrintAllStats(cvode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: cvode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -5823,6 +5834,25 @@ function FCVodeGetQuadB(cvode_mem, which, tbret, qb) & swig_result = fresult end function +function FCVodeGetUserDataB(cvode_mem, which, user_datab) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: cvode_mem +integer(C_INT), intent(in) :: which +type(C_PTR), target, intent(inout) :: user_datab +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = cvode_mem +farg2 = which +farg3 = c_loc(user_datab) +fresult = swigc_FCVodeGetUserDataB(farg1, farg2, farg3) +swig_result = fresult +end function + function FCVodeGetAdjCVodeBmem(cvode_mem, which) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/ida/fmod_int32/fida_mod.f90 b/src/ida/fmod_int32/fida_mod.f90 index 136521893f..ff51de2b5b 100644 --- a/src/ida/fmod_int32/fida_mod.f90 +++ b/src/ida/fmod_int32/fida_mod.f90 @@ -2450,7 +2450,7 @@ function FIDAPrintAllStats(ida_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: ida_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/ida/fmod_int64/fida_mod.f90 b/src/ida/fmod_int64/fida_mod.f90 index 5e3fee8ae6..0fe6de64fb 100644 --- a/src/ida/fmod_int64/fida_mod.f90 +++ b/src/ida/fmod_int64/fida_mod.f90 @@ -2450,7 +2450,7 @@ function FIDAPrintAllStats(ida_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: ida_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/idas/fmod_int32/fidas_mod.c b/src/idas/fmod_int32/fidas_mod.c index c39dff4a1f..d7bc720a9e 100644 --- a/src/idas/fmod_int32/fidas_mod.c +++ b/src/idas/fmod_int32/fidas_mod.c @@ -955,13 +955,13 @@ SWIGEXPORT int _wrap_FIDAComputeYp(void *farg1, N_Vector farg2, N_Vector farg3) SWIGEXPORT int _wrap_FIDAComputeYSens(void *farg1, void *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); result = (int)IDAComputeYSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -971,13 +971,13 @@ SWIGEXPORT int _wrap_FIDAComputeYSens(void *farg1, void *farg2, void *farg3) { SWIGEXPORT int _wrap_FIDAComputeYpSens(void *farg1, void *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); result = (int)IDAComputeYpSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1163,11 +1163,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentY(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FIDAGetCurrentYSens(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector **arg2 = (N_Vector **) 0 ; + N_Vector1d *arg2 = (N_Vector1d *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector **)(farg2); + arg2 = (N_Vector1d *)(farg2); result = (int)IDAGetCurrentYSens(arg1,arg2); fresult = (int)(result); return fresult; @@ -1191,11 +1191,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentYp(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FIDAGetCurrentYpSens(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector **arg2 = (N_Vector **) 0 ; + N_Vector1d *arg2 = (N_Vector1d *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector **)(farg2); + arg2 = (N_Vector1d *)(farg2); result = (int)IDAGetCurrentYpSens(arg1,arg2); fresult = (int)(result); return fresult; @@ -1392,20 +1392,20 @@ SWIGEXPORT int _wrap_FIDAGetNonlinearSystemDataSens(void *farg1, double *farg2, int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector **arg3 = (N_Vector **) 0 ; - N_Vector **arg4 = (N_Vector **) 0 ; - N_Vector **arg5 = (N_Vector **) 0 ; - N_Vector **arg6 = (N_Vector **) 0 ; + N_Vector1d *arg3 = (N_Vector1d *) 0 ; + N_Vector1d *arg4 = (N_Vector1d *) 0 ; + N_Vector1d *arg5 = (N_Vector1d *) 0 ; + N_Vector1d *arg6 = (N_Vector1d *) 0 ; sunrealtype *arg7 = (sunrealtype *) 0 ; void **arg8 = (void **) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector **)(farg3); - arg4 = (N_Vector **)(farg4); - arg5 = (N_Vector **)(farg5); - arg6 = (N_Vector **)(farg6); + arg3 = (N_Vector1d *)(farg3); + arg4 = (N_Vector1d *)(farg4); + arg5 = (N_Vector1d *)(farg5); + arg6 = (N_Vector1d *)(farg6); arg7 = (sunrealtype *)(farg7); arg8 = (void **)(farg8); result = (int)IDAGetNonlinearSystemDataSens(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); @@ -1719,16 +1719,16 @@ SWIGEXPORT int _wrap_FIDASensInit(void *farg1, int const *farg2, int const *farg int arg2 ; int arg3 ; IDASensResFn arg4 = (IDASensResFn) 0 ; - N_Vector *arg5 = (N_Vector *) 0 ; - N_Vector *arg6 = (N_Vector *) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; + N_Vector1d arg6 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (IDASensResFn)(farg4); - arg5 = (N_Vector *)(farg5); - arg6 = (N_Vector *)(farg6); + arg5 = (N_Vector1d)(farg5); + arg6 = (N_Vector1d)(farg6); result = (int)IDASensInit(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (int)(result); return fresult; @@ -1739,14 +1739,14 @@ SWIGEXPORT int _wrap_FIDASensReInit(void *farg1, int const *farg2, void *farg3, int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (N_Vector *)(farg4); + arg3 = (N_Vector1d)(farg3); + arg4 = (N_Vector1d)(farg4); result = (int)IDASensReInit(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -1773,12 +1773,12 @@ SWIGEXPORT int _wrap_FIDASensSVtolerances(void *farg1, double const *farg2, void int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)IDASensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1800,13 +1800,13 @@ SWIGEXPORT int _wrap_FIDASensEEtolerances(void *farg1) { SWIGEXPORT int _wrap_FIDAGetSensConsistentIC(void *farg1, void *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); result = (int)IDAGetSensConsistentIC(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1860,15 +1860,15 @@ SWIGEXPORT int _wrap_FIDASetSensMaxNonlinIters(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FIDASetSensParams(void *farg1, double *farg2, double *farg3, int *farg4) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - int *arg4 = (int *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; + int1d arg4 = (int1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (int *)(farg4); + arg2 = (sunrealtype1d)(farg2); + arg3 = (sunrealtype1d)(farg3); + arg4 = (int1d)(farg4); result = (int)IDASetSensParams(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -1919,12 +1919,12 @@ SWIGEXPORT int _wrap_FIDAGetSens(void *farg1, double *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)IDAGetSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1954,13 +1954,13 @@ SWIGEXPORT int _wrap_FIDAGetSensDky(void *farg1, double const *farg2, int const void *arg1 = (void *) 0 ; sunrealtype arg2 ; int arg3 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); - arg4 = (N_Vector *)(farg4); + arg4 = (N_Vector1d)(farg4); result = (int)IDAGetSensDky(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2046,11 +2046,11 @@ SWIGEXPORT int _wrap_FIDAGetSensNumLinSolvSetups(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FIDAGetSensErrWeights(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector_S arg2 = (N_Vector_S) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector_S)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)IDAGetSensErrWeights(arg1,arg2); fresult = (int)(result); return fresult; @@ -2147,12 +2147,12 @@ SWIGEXPORT int _wrap_FIDAQuadSensInit(void *farg1, IDAQuadSensRhsFn farg2, void int fresult ; void *arg1 = (void *) 0 ; IDAQuadSensRhsFn arg2 = (IDAQuadSensRhsFn) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (IDAQuadSensRhsFn)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)IDAQuadSensInit(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2162,11 +2162,11 @@ SWIGEXPORT int _wrap_FIDAQuadSensInit(void *farg1, IDAQuadSensRhsFn farg2, void SWIGEXPORT int _wrap_FIDAQuadSensReInit(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)IDAQuadSensReInit(arg1,arg2); fresult = (int)(result); return fresult; @@ -2193,12 +2193,12 @@ SWIGEXPORT int _wrap_FIDAQuadSensSVtolerances(void *farg1, double const *farg2, int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)IDAQuadSensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2235,12 +2235,12 @@ SWIGEXPORT int _wrap_FIDAGetQuadSens(void *farg1, double *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)IDAGetQuadSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2270,13 +2270,13 @@ SWIGEXPORT int _wrap_FIDAGetQuadSensDky(void *farg1, double const *farg2, int co void *arg1 = (void *) 0 ; sunrealtype arg2 ; int arg3 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); - arg4 = (N_Vector *)(farg4); + arg4 = (N_Vector1d)(farg4); result = (int)IDAGetQuadSensDky(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2334,11 +2334,11 @@ SWIGEXPORT int _wrap_FIDAGetQuadSensNumErrTestFails(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FIDAGetQuadSensErrWeights(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)IDAGetQuadSensErrWeights(arg1,arg2); fresult = (int)(result); return fresult; @@ -2634,8 +2634,8 @@ SWIGEXPORT int _wrap_FIDACalcICBS(void *farg1, int const *farg2, double const *f sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; - N_Vector *arg6 = (N_Vector *) 0 ; - N_Vector *arg7 = (N_Vector *) 0 ; + N_Vector1d arg6 = (N_Vector1d) 0 ; + N_Vector1d arg7 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); @@ -2643,8 +2643,8 @@ SWIGEXPORT int _wrap_FIDACalcICBS(void *farg1, int const *farg2, double const *f arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); - arg6 = (N_Vector *)(farg6); - arg7 = (N_Vector *)(farg7); + arg6 = (N_Vector1d)(farg6); + arg7 = (N_Vector1d)(farg7); result = (int)IDACalcICBS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = (int)(result); return fresult; @@ -2901,6 +2901,22 @@ SWIGEXPORT int _wrap_FIDAGetQuadB(void *farg1, int const *farg2, double *farg3, } +SWIGEXPORT int _wrap_FIDAGetUserDataB(void *farg1, int const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + void **arg3 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (void **)(farg3); + result = (int)IDAGetUserDataB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT void * _wrap_FIDAGetAdjIDABmem(void *farg1, int const *farg2) { void * fresult ; void *arg1 = (void *) 0 ; diff --git a/src/idas/fmod_int32/fidas_mod.f90 b/src/idas/fmod_int32/fidas_mod.f90 index db6f376bfc..35264d529a 100644 --- a/src/idas/fmod_int32/fidas_mod.f90 +++ b/src/idas/fmod_int32/fidas_mod.f90 @@ -258,6 +258,7 @@ module fidas_mod public :: FIDASetNonlinearSolverB public :: FIDAGetB public :: FIDAGetQuadB + public :: FIDAGetUserDataB public :: FIDAGetAdjIDABmem public :: FIDAGetConsistentICB public :: FIDAGetAdjY @@ -1991,6 +1992,16 @@ function swigc_FIDAGetQuadB(farg1, farg2, farg3, farg4) & integer(C_INT) :: fresult end function +function swigc_FIDAGetUserDataB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetUserDataB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + function swigc_FIDAGetAdjIDABmem(farg1, farg2) & bind(C, name="_wrap_FIDAGetAdjIDABmem") & result(fresult) @@ -4003,7 +4014,7 @@ function FIDAPrintAllStats(ida_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: ida_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -5693,6 +5704,25 @@ function FIDAGetQuadB(ida_mem, which, tret, qb) & swig_result = fresult end function +function FIDAGetUserDataB(ida_mem, which, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(user_data) +fresult = swigc_FIDAGetUserDataB(farg1, farg2, farg3) +swig_result = fresult +end function + function FIDAGetAdjIDABmem(ida_mem, which) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/idas/fmod_int64/fidas_mod.c b/src/idas/fmod_int64/fidas_mod.c index 196fd9f52b..a26e2b86bb 100644 --- a/src/idas/fmod_int64/fidas_mod.c +++ b/src/idas/fmod_int64/fidas_mod.c @@ -955,13 +955,13 @@ SWIGEXPORT int _wrap_FIDAComputeYp(void *farg1, N_Vector farg2, N_Vector farg3) SWIGEXPORT int _wrap_FIDAComputeYSens(void *farg1, void *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); result = (int)IDAComputeYSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -971,13 +971,13 @@ SWIGEXPORT int _wrap_FIDAComputeYSens(void *farg1, void *farg2, void *farg3) { SWIGEXPORT int _wrap_FIDAComputeYpSens(void *farg1, void *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); result = (int)IDAComputeYpSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1163,11 +1163,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentY(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FIDAGetCurrentYSens(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector **arg2 = (N_Vector **) 0 ; + N_Vector1d *arg2 = (N_Vector1d *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector **)(farg2); + arg2 = (N_Vector1d *)(farg2); result = (int)IDAGetCurrentYSens(arg1,arg2); fresult = (int)(result); return fresult; @@ -1191,11 +1191,11 @@ SWIGEXPORT int _wrap_FIDAGetCurrentYp(void *farg1, void *farg2) { SWIGEXPORT int _wrap_FIDAGetCurrentYpSens(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector **arg2 = (N_Vector **) 0 ; + N_Vector1d *arg2 = (N_Vector1d *) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector **)(farg2); + arg2 = (N_Vector1d *)(farg2); result = (int)IDAGetCurrentYpSens(arg1,arg2); fresult = (int)(result); return fresult; @@ -1392,20 +1392,20 @@ SWIGEXPORT int _wrap_FIDAGetNonlinearSystemDataSens(void *farg1, double *farg2, int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector **arg3 = (N_Vector **) 0 ; - N_Vector **arg4 = (N_Vector **) 0 ; - N_Vector **arg5 = (N_Vector **) 0 ; - N_Vector **arg6 = (N_Vector **) 0 ; + N_Vector1d *arg3 = (N_Vector1d *) 0 ; + N_Vector1d *arg4 = (N_Vector1d *) 0 ; + N_Vector1d *arg5 = (N_Vector1d *) 0 ; + N_Vector1d *arg6 = (N_Vector1d *) 0 ; sunrealtype *arg7 = (sunrealtype *) 0 ; void **arg8 = (void **) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector **)(farg3); - arg4 = (N_Vector **)(farg4); - arg5 = (N_Vector **)(farg5); - arg6 = (N_Vector **)(farg6); + arg3 = (N_Vector1d *)(farg3); + arg4 = (N_Vector1d *)(farg4); + arg5 = (N_Vector1d *)(farg5); + arg6 = (N_Vector1d *)(farg6); arg7 = (sunrealtype *)(farg7); arg8 = (void **)(farg8); result = (int)IDAGetNonlinearSystemDataSens(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); @@ -1719,16 +1719,16 @@ SWIGEXPORT int _wrap_FIDASensInit(void *farg1, int const *farg2, int const *farg int arg2 ; int arg3 ; IDASensResFn arg4 = (IDASensResFn) 0 ; - N_Vector *arg5 = (N_Vector *) 0 ; - N_Vector *arg6 = (N_Vector *) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; + N_Vector1d arg6 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); arg3 = (int)(*farg3); arg4 = (IDASensResFn)(farg4); - arg5 = (N_Vector *)(farg5); - arg6 = (N_Vector *)(farg6); + arg5 = (N_Vector1d)(farg5); + arg6 = (N_Vector1d)(farg6); result = (int)IDASensInit(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (int)(result); return fresult; @@ -1739,14 +1739,14 @@ SWIGEXPORT int _wrap_FIDASensReInit(void *farg1, int const *farg2, void *farg3, int fresult ; void *arg1 = (void *) 0 ; int arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (int)(*farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (N_Vector *)(farg4); + arg3 = (N_Vector1d)(farg3); + arg4 = (N_Vector1d)(farg4); result = (int)IDASensReInit(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -1773,12 +1773,12 @@ SWIGEXPORT int _wrap_FIDASensSVtolerances(void *farg1, double const *farg2, void int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)IDASensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1800,13 +1800,13 @@ SWIGEXPORT int _wrap_FIDASensEEtolerances(void *farg1) { SWIGEXPORT int _wrap_FIDAGetSensConsistentIC(void *farg1, void *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); result = (int)IDAGetSensConsistentIC(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1860,15 +1860,15 @@ SWIGEXPORT int _wrap_FIDASetSensMaxNonlinIters(void *farg1, int const *farg2) { SWIGEXPORT int _wrap_FIDASetSensParams(void *farg1, double *farg2, double *farg3, int *farg4) { int fresult ; void *arg1 = (void *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - int *arg4 = (int *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; + int1d arg4 = (int1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (int *)(farg4); + arg2 = (sunrealtype1d)(farg2); + arg3 = (sunrealtype1d)(farg3); + arg4 = (int1d)(farg4); result = (int)IDASetSensParams(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -1919,12 +1919,12 @@ SWIGEXPORT int _wrap_FIDAGetSens(void *farg1, double *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)IDAGetSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -1954,13 +1954,13 @@ SWIGEXPORT int _wrap_FIDAGetSensDky(void *farg1, double const *farg2, int const void *arg1 = (void *) 0 ; sunrealtype arg2 ; int arg3 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); - arg4 = (N_Vector *)(farg4); + arg4 = (N_Vector1d)(farg4); result = (int)IDAGetSensDky(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2046,11 +2046,11 @@ SWIGEXPORT int _wrap_FIDAGetSensNumLinSolvSetups(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FIDAGetSensErrWeights(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector_S arg2 = (N_Vector_S) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector_S)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)IDAGetSensErrWeights(arg1,arg2); fresult = (int)(result); return fresult; @@ -2147,12 +2147,12 @@ SWIGEXPORT int _wrap_FIDAQuadSensInit(void *farg1, IDAQuadSensRhsFn farg2, void int fresult ; void *arg1 = (void *) 0 ; IDAQuadSensRhsFn arg2 = (IDAQuadSensRhsFn) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (IDAQuadSensRhsFn)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)IDAQuadSensInit(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2162,11 +2162,11 @@ SWIGEXPORT int _wrap_FIDAQuadSensInit(void *farg1, IDAQuadSensRhsFn farg2, void SWIGEXPORT int _wrap_FIDAQuadSensReInit(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)IDAQuadSensReInit(arg1,arg2); fresult = (int)(result); return fresult; @@ -2193,12 +2193,12 @@ SWIGEXPORT int _wrap_FIDAQuadSensSVtolerances(void *farg1, double const *farg2, int fresult ; void *arg1 = (void *) 0 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)IDAQuadSensSVtolerances(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2235,12 +2235,12 @@ SWIGEXPORT int _wrap_FIDAGetQuadSens(void *farg1, double *farg2, void *farg3) { int fresult ; void *arg1 = (void *) 0 ; sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (int)IDAGetQuadSens(arg1,arg2,arg3); fresult = (int)(result); return fresult; @@ -2270,13 +2270,13 @@ SWIGEXPORT int _wrap_FIDAGetQuadSensDky(void *farg1, double const *farg2, int co void *arg1 = (void *) 0 ; sunrealtype arg2 ; int arg3 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); arg2 = (sunrealtype)(*farg2); arg3 = (int)(*farg3); - arg4 = (N_Vector *)(farg4); + arg4 = (N_Vector1d)(farg4); result = (int)IDAGetQuadSensDky(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -2334,11 +2334,11 @@ SWIGEXPORT int _wrap_FIDAGetQuadSensNumErrTestFails(void *farg1, long *farg2) { SWIGEXPORT int _wrap_FIDAGetQuadSensErrWeights(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; - N_Vector *arg2 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); - arg2 = (N_Vector *)(farg2); + arg2 = (N_Vector1d)(farg2); result = (int)IDAGetQuadSensErrWeights(arg1,arg2); fresult = (int)(result); return fresult; @@ -2634,8 +2634,8 @@ SWIGEXPORT int _wrap_FIDACalcICBS(void *farg1, int const *farg2, double const *f sunrealtype arg3 ; N_Vector arg4 = (N_Vector) 0 ; N_Vector arg5 = (N_Vector) 0 ; - N_Vector *arg6 = (N_Vector *) 0 ; - N_Vector *arg7 = (N_Vector *) 0 ; + N_Vector1d arg6 = (N_Vector1d) 0 ; + N_Vector1d arg7 = (N_Vector1d) 0 ; int result; arg1 = (void *)(farg1); @@ -2643,8 +2643,8 @@ SWIGEXPORT int _wrap_FIDACalcICBS(void *farg1, int const *farg2, double const *f arg3 = (sunrealtype)(*farg3); arg4 = (N_Vector)(farg4); arg5 = (N_Vector)(farg5); - arg6 = (N_Vector *)(farg6); - arg7 = (N_Vector *)(farg7); + arg6 = (N_Vector1d)(farg6); + arg7 = (N_Vector1d)(farg7); result = (int)IDACalcICBS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = (int)(result); return fresult; @@ -2901,6 +2901,22 @@ SWIGEXPORT int _wrap_FIDAGetQuadB(void *farg1, int const *farg2, double *farg3, } +SWIGEXPORT int _wrap_FIDAGetUserDataB(void *farg1, int const *farg2, void *farg3) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + void **arg3 = (void **) 0 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + arg3 = (void **)(farg3); + result = (int)IDAGetUserDataB(arg1,arg2,arg3); + fresult = (int)(result); + return fresult; +} + + SWIGEXPORT void * _wrap_FIDAGetAdjIDABmem(void *farg1, int const *farg2) { void * fresult ; void *arg1 = (void *) 0 ; diff --git a/src/idas/fmod_int64/fidas_mod.f90 b/src/idas/fmod_int64/fidas_mod.f90 index b379e13d36..86ed943313 100644 --- a/src/idas/fmod_int64/fidas_mod.f90 +++ b/src/idas/fmod_int64/fidas_mod.f90 @@ -258,6 +258,7 @@ module fidas_mod public :: FIDASetNonlinearSolverB public :: FIDAGetB public :: FIDAGetQuadB + public :: FIDAGetUserDataB public :: FIDAGetAdjIDABmem public :: FIDAGetConsistentICB public :: FIDAGetAdjY @@ -1991,6 +1992,16 @@ function swigc_FIDAGetQuadB(farg1, farg2, farg3, farg4) & integer(C_INT) :: fresult end function +function swigc_FIDAGetUserDataB(farg1, farg2, farg3) & +bind(C, name="_wrap_FIDAGetUserDataB") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + function swigc_FIDAGetAdjIDABmem(farg1, farg2) & bind(C, name="_wrap_FIDAGetAdjIDABmem") & result(fresult) @@ -4003,7 +4014,7 @@ function FIDAPrintAllStats(ida_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: ida_mem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -5693,6 +5704,25 @@ function FIDAGetQuadB(ida_mem, which, tret, qb) & swig_result = fresult end function +function FIDAGetUserDataB(ida_mem, which, user_data) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: ida_mem +integer(C_INT), intent(in) :: which +type(C_PTR), target, intent(inout) :: user_data +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 +type(C_PTR) :: farg3 + +farg1 = ida_mem +farg2 = which +farg3 = c_loc(user_data) +fresult = swigc_FIDAGetUserDataB(farg1, farg2, farg3) +swig_result = fresult +end function + function FIDAGetAdjIDABmem(ida_mem, which) & result(swig_result) use, intrinsic :: ISO_C_BINDING diff --git a/src/kinsol/fmod_int32/fkinsol_mod.f90 b/src/kinsol/fmod_int32/fkinsol_mod.f90 index 15a5083d9b..a5b33f5f2a 100644 --- a/src/kinsol/fmod_int32/fkinsol_mod.f90 +++ b/src/kinsol/fmod_int32/fkinsol_mod.f90 @@ -1345,7 +1345,7 @@ function FKINPrintAllStats(kinmem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: kinmem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/kinsol/fmod_int64/fkinsol_mod.f90 b/src/kinsol/fmod_int64/fkinsol_mod.f90 index e22feeb1f7..7ec6c6ef14 100644 --- a/src/kinsol/fmod_int64/fkinsol_mod.f90 +++ b/src/kinsol/fmod_int64/fkinsol_mod.f90 @@ -1345,7 +1345,7 @@ function FKINPrintAllStats(kinmem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: kinmem type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/nvector/cuda/nvector_cuda.cu b/src/nvector/cuda/nvector_cuda.cu index c7cd45475b..6986e1e87d 100644 --- a/src/nvector/cuda/nvector_cuda.cu +++ b/src/nvector/cuda/nvector_cuda.cu @@ -394,8 +394,8 @@ N_Vector N_VMakeManaged_Cuda(sunindextype length, sunrealtype* vdata, NVEC_CUDA_CONTENT(v)->length = length; NVEC_CUDA_CONTENT(v)->mem_helper = SUNMemoryHelper_Cuda(sunctx); - NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), - vdata, SUN_MEMTYPE_UVM); + NVEC_CUDA_CONTENT(v)->host_data = + SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), vdata, SUN_MEMTYPE_UVM); NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->host_data); NVEC_CUDA_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); diff --git a/src/nvector/hip/nvector_hip.hip.cpp b/src/nvector/hip/nvector_hip.hip.cpp index 0af285641c..9c745cbdc8 100644 --- a/src/nvector/hip/nvector_hip.hip.cpp +++ b/src/nvector/hip/nvector_hip.hip.cpp @@ -409,8 +409,9 @@ void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v) } else { - NVEC_HIP_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)h_vdata, SUN_MEMTYPE_UVM); + NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), + (void*)h_vdata, + SUN_MEMTYPE_UVM); NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->host_data); @@ -447,7 +448,8 @@ void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v) else { NVEC_HIP_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, SUN_MEMTYPE_UVM); + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, + SUN_MEMTYPE_UVM); NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->device_data); @@ -2327,9 +2329,10 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) if (alloc_mem) { // Allocate pinned memory on the host - alloc_fail = - SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_host), - bytes, SUN_MEMTYPE_PINNED, (void*)NVEC_HIP_STREAM(v)); + alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), + &(vcp->reduce_buffer_host), bytes, + SUN_MEMTYPE_PINNED, + (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( @@ -2337,9 +2340,10 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) "alloc SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); // If pinned alloc failed, allocate plain host memory - alloc_fail = - SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_host), - bytes, SUN_MEMTYPE_HOST, (void*)NVEC_HIP_STREAM(v)); + alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), + &(vcp->reduce_buffer_host), bytes, + SUN_MEMTYPE_HOST, + (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( @@ -2349,9 +2353,10 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) } // Allocate device memory - alloc_fail = - SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_dev), - bytes, SUN_MEMTYPE_DEVICE, (void*)NVEC_HIP_STREAM(v)); + alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), + &(vcp->reduce_buffer_dev), bytes, + SUN_MEMTYPE_DEVICE, + (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( diff --git a/src/nvector/raja/nvector_raja.cpp b/src/nvector/raja/nvector_raja.cpp index a19afea937..9455a2781c 100644 --- a/src/nvector/raja/nvector_raja.cpp +++ b/src/nvector/raja/nvector_raja.cpp @@ -398,7 +398,8 @@ N_Vector N_VMakeManaged_Raja(sunindextype length, sunrealtype* vdata, NVEC_RAJA_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); #endif NVEC_RAJA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_RAJA_CONTENT(v)->mem_helper, vdata, SUN_MEMTYPE_UVM); + SUNMemoryHelper_Wrap(NVEC_RAJA_CONTENT(v)->mem_helper, vdata, + SUN_MEMTYPE_UVM); NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_RAJA_CONTENT(v)->mem_helper, NVEC_RAJA_CONTENT(v)->host_data); diff --git a/src/nvector/sycl/nvector_sycl.cpp b/src/nvector/sycl/nvector_sycl.cpp index c52ea9a52c..e385effd3a 100644 --- a/src/nvector/sycl/nvector_sycl.cpp +++ b/src/nvector/sycl/nvector_sycl.cpp @@ -501,8 +501,8 @@ N_Vector N_VMakeManaged_Sycl(sunindextype length, sunrealtype* vdata, NVEC_SYCL_CONTENT(v)->length = length; NVEC_SYCL_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); NVEC_SYCL_CONTENT(v)->own_helper = SUNTRUE; - NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), - vdata, SUN_MEMTYPE_UVM); + NVEC_SYCL_CONTENT(v)->host_data = + SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), vdata, SUN_MEMTYPE_UVM); NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->host_data); NVEC_SYCL_CONTENT(v)->stream_exec_policy = diff --git a/src/sunadjointcheckpointscheme/fixed/fmod_int32/fsunadjointcheckpointscheme_fixed_mod.f90 b/src/sunadjointcheckpointscheme/fixed/fmod_int32/fsunadjointcheckpointscheme_fixed_mod.f90 index bf5bc26ff1..eeed683776 100644 --- a/src/sunadjointcheckpointscheme/fixed/fmod_int32/fsunadjointcheckpointscheme_fixed_mod.f90 +++ b/src/sunadjointcheckpointscheme/fixed/fmod_int32/fsunadjointcheckpointscheme_fixed_mod.f90 @@ -111,7 +111,7 @@ function FSUNAdjointCheckpointScheme_Create_Fixed(io_mode, mem_helper, interval, result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result -integer(SUNDataIOMode), intent(in) :: io_mode +integer(SUNDataIOMode_), intent(in) :: io_mode type(SUNMemoryHelper_), target, intent(inout) :: mem_helper integer(C_LONG), intent(in) :: interval integer(C_LONG), intent(in) :: estimate diff --git a/src/sunadjointcheckpointscheme/fixed/fmod_int64/fsunadjointcheckpointscheme_fixed_mod.f90 b/src/sunadjointcheckpointscheme/fixed/fmod_int64/fsunadjointcheckpointscheme_fixed_mod.f90 index bf5bc26ff1..eeed683776 100644 --- a/src/sunadjointcheckpointscheme/fixed/fmod_int64/fsunadjointcheckpointscheme_fixed_mod.f90 +++ b/src/sunadjointcheckpointscheme/fixed/fmod_int64/fsunadjointcheckpointscheme_fixed_mod.f90 @@ -111,7 +111,7 @@ function FSUNAdjointCheckpointScheme_Create_Fixed(io_mode, mem_helper, interval, result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result -integer(SUNDataIOMode), intent(in) :: io_mode +integer(SUNDataIOMode_), intent(in) :: io_mode type(SUNMemoryHelper_), target, intent(inout) :: mem_helper integer(C_LONG), intent(in) :: interval integer(C_LONG), intent(in) :: estimate diff --git a/src/sundials/fmod_int32/fsundials_core_mod.c b/src/sundials/fmod_int32/fsundials_core_mod.c index 991e20ba54..6e35234e76 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.c +++ b/src/sundials/fmod_int32/fsundials_core_mod.c @@ -802,6 +802,22 @@ SWIGEXPORT int _wrap_FSUNLogger_Destroy(void *farg1) { } +SWIGEXPORT int _wrap_FSUNFileOpen(SwigArrayWrapper *farg1, SwigArrayWrapper *farg2, void *farg3) { + int fresult ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + FILE **arg3 = (FILE **) 0 ; + SUNErrCode result; + + arg1 = (char *)(farg1->data); + arg2 = (char *)(farg2->data); + arg3 = (FILE **)(farg3); + result = (SUNErrCode)SUNFileOpen((char const *)arg1,(char const *)arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNDIALSFileOpen(SwigArrayWrapper *farg1, SwigArrayWrapper *farg2, void *farg3) { int fresult ; char *arg1 = (char *) 0 ; @@ -818,6 +834,18 @@ SWIGEXPORT int _wrap_FSUNDIALSFileOpen(SwigArrayWrapper *farg1, SwigArrayWrapper } +SWIGEXPORT int _wrap_FSUNFileClose(void *farg1) { + int fresult ; + FILE **arg1 = (FILE **) 0 ; + SUNErrCode result; + + arg1 = (FILE **)(farg1); + result = (SUNErrCode)SUNFileClose(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNDIALSFileClose(void *farg1) { int fresult ; FILE **arg1 = (FILE **) 0 ; @@ -921,10 +949,10 @@ SWIGEXPORT void _wrap_FN_VSpace(N_Vector farg1, int32_t *farg2, int32_t *farg3) SWIGEXPORT void _wrap_FN_VSetArrayPointer(double *farg1, N_Vector farg2) { - sunrealtype *arg1 = (sunrealtype *) 0 ; + sunrealtype1d arg1 = (sunrealtype1d) 0 ; N_Vector arg2 = (N_Vector) 0 ; - arg1 = (sunrealtype *)(farg1); + arg1 = (sunrealtype1d)(farg1); arg2 = (N_Vector)(farg2); N_VSetArrayPointer(arg1,arg2); } @@ -1223,14 +1251,14 @@ SWIGEXPORT double _wrap_FN_VMinQuotient(N_Vector farg1, N_Vector farg2) { SWIGEXPORT int _wrap_FN_VLinearCombination(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { int fresult ; int arg1 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; N_Vector arg4 = (N_Vector) 0 ; SUNErrCode result; arg1 = (int)(*farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (sunrealtype1d)(farg2); + arg3 = (N_Vector1d)(farg3); arg4 = (N_Vector)(farg4); result = (SUNErrCode)N_VLinearCombination(arg1,arg2,arg3,arg4); fresult = (SUNErrCode)(result); @@ -1241,17 +1269,17 @@ SWIGEXPORT int _wrap_FN_VLinearCombination(int const *farg1, double *farg2, void SWIGEXPORT int _wrap_FN_VScaleAddMulti(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { int fresult ; int arg1 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; - N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); - arg4 = (N_Vector *)(farg4); - arg5 = (N_Vector *)(farg5); + arg4 = (N_Vector1d)(farg4); + arg5 = (N_Vector1d)(farg5); result = (SUNErrCode)N_VScaleAddMulti(arg1,arg2,arg3,arg4,arg5); fresult = (SUNErrCode)(result); return fresult; @@ -1262,14 +1290,14 @@ SWIGEXPORT int _wrap_FN_VDotProdMulti(int const *farg1, N_Vector farg2, void *fa int fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (sunrealtype *)(farg4); + arg3 = (N_Vector1d)(farg3); + arg4 = (sunrealtype1d)(farg4); result = (SUNErrCode)N_VDotProdMulti(arg1,arg2,arg3,arg4); fresult = (SUNErrCode)(result); return fresult; @@ -1280,18 +1308,18 @@ SWIGEXPORT int _wrap_FN_VLinearSumVectorArray(int const *farg1, double const *fa int fresult ; int arg1 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; sunrealtype arg4 ; - N_Vector *arg5 = (N_Vector *) 0 ; - N_Vector *arg6 = (N_Vector *) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; + N_Vector1d arg6 = (N_Vector1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); arg4 = (sunrealtype)(*farg4); - arg5 = (N_Vector *)(farg5); - arg6 = (N_Vector *)(farg6); + arg5 = (N_Vector1d)(farg5); + arg6 = (N_Vector1d)(farg6); result = (SUNErrCode)N_VLinearSumVectorArray(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (SUNErrCode)(result); return fresult; @@ -1301,15 +1329,15 @@ SWIGEXPORT int _wrap_FN_VLinearSumVectorArray(int const *farg1, double const *fa SWIGEXPORT int _wrap_FN_VScaleVectorArray(int const *farg1, double *farg2, void *farg3, void *farg4) { int fresult ; int arg1 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (N_Vector *)(farg4); + arg2 = (sunrealtype1d)(farg2); + arg3 = (N_Vector1d)(farg3); + arg4 = (N_Vector1d)(farg4); result = (SUNErrCode)N_VScaleVectorArray(arg1,arg2,arg3,arg4); fresult = (SUNErrCode)(result); return fresult; @@ -1320,12 +1348,12 @@ SWIGEXPORT int _wrap_FN_VConstVectorArray(int const *farg1, double const *farg2, int fresult ; int arg1 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (SUNErrCode)N_VConstVectorArray(arg1,arg2,arg3); fresult = (SUNErrCode)(result); return fresult; @@ -1335,15 +1363,15 @@ SWIGEXPORT int _wrap_FN_VConstVectorArray(int const *farg1, double const *farg2, SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray(int const *farg1, void *farg2, void *farg3, double *farg4) { int fresult ; int arg1 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (sunrealtype *)(farg4); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); + arg4 = (sunrealtype1d)(farg4); result = (SUNErrCode)N_VWrmsNormVectorArray(arg1,arg2,arg3,arg4); fresult = (SUNErrCode)(result); return fresult; @@ -1353,17 +1381,17 @@ SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray(int const *farg1, void *farg2, void SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray(int const *farg1, void *farg2, void *farg3, N_Vector farg4, double *farg5) { int fresult ; int arg1 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; N_Vector arg4 = (N_Vector) 0 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype1d arg5 = (sunrealtype1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (sunrealtype *)(farg5); + arg5 = (sunrealtype1d)(farg5); result = (SUNErrCode)N_VWrmsNormMaskVectorArray(arg1,arg2,arg3,arg4,arg5); fresult = (SUNErrCode)(result); return fresult; @@ -1498,14 +1526,14 @@ SWIGEXPORT int _wrap_FN_VDotProdMultiLocal(int const *farg1, N_Vector farg2, voi int fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (sunrealtype *)(farg4); + arg3 = (N_Vector1d)(farg3); + arg4 = (sunrealtype1d)(farg4); result = (SUNErrCode)N_VDotProdMultiLocal(arg1,arg2,arg3,arg4); fresult = (SUNErrCode)(result); return fresult; @@ -1516,12 +1544,12 @@ SWIGEXPORT int _wrap_FN_VDotProdMultiAllReduce(int const *farg1, N_Vector farg2, int fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (sunrealtype *)(farg3); + arg3 = (sunrealtype1d)(farg3); result = (SUNErrCode)N_VDotProdMultiAllReduce(arg1,arg2,arg3); fresult = (SUNErrCode)(result); return fresult; @@ -1574,11 +1602,11 @@ SWIGEXPORT void * _wrap_FN_VNewVectorArray(int const *farg1, void *farg2) { void * fresult ; int arg1 ; SUNContext arg2 = (SUNContext) 0 ; - N_Vector *result = 0 ; + N_Vector1d result; arg1 = (int)(*farg1); arg2 = (SUNContext)(farg2); - result = (N_Vector *)N_VNewVectorArray(arg1,arg2); + result = (N_Vector1d)N_VNewVectorArray(arg1,arg2); fresult = result; return fresult; } @@ -1588,11 +1616,11 @@ SWIGEXPORT void * _wrap_FN_VCloneEmptyVectorArray(int const *farg1, N_Vector far void * fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; + N_Vector1d result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneEmptyVectorArray(arg1,arg2); + result = (N_Vector1d)N_VCloneEmptyVectorArray(arg1,arg2); fresult = result; return fresult; } @@ -1602,21 +1630,21 @@ SWIGEXPORT void * _wrap_FN_VCloneVectorArray(int const *farg1, N_Vector farg2) { void * fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; + N_Vector1d result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray(arg1,arg2); + result = (N_Vector1d)N_VCloneVectorArray(arg1,arg2); fresult = result; return fresult; } SWIGEXPORT void _wrap_FN_VDestroyVectorArray(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; int arg2 ; - arg1 = (N_Vector *)(farg1); + arg1 = (N_Vector1d)(farg1); arg2 = (int)(*farg2); N_VDestroyVectorArray(arg1,arg2); } @@ -1624,11 +1652,11 @@ SWIGEXPORT void _wrap_FN_VDestroyVectorArray(void *farg1, int const *farg2) { SWIGEXPORT N_Vector _wrap_FN_VGetVecAtIndexVectorArray(void *farg1, int const *farg2) { N_Vector fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; int arg2 ; N_Vector result; - arg1 = (N_Vector *)(farg1); + arg1 = (N_Vector1d)(farg1); arg2 = (int)(*farg2); result = (N_Vector)N_VGetVecAtIndexVectorArray(arg1,arg2); fresult = result; @@ -1637,11 +1665,11 @@ SWIGEXPORT N_Vector _wrap_FN_VGetVecAtIndexVectorArray(void *farg1, int const *f SWIGEXPORT void _wrap_FN_VSetVecAtIndexVectorArray(void *farg1, int const *farg2, N_Vector farg3) { - N_Vector *arg1 = (N_Vector *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; int arg2 ; N_Vector arg3 = (N_Vector) 0 ; - arg1 = (N_Vector *)(farg1); + arg1 = (N_Vector1d)(farg1); arg2 = (int)(*farg2); arg3 = (N_Vector)(farg3); N_VSetVecAtIndexVectorArray(arg1,arg2,arg3); @@ -1872,15 +1900,15 @@ SWIGEXPORT int _wrap_FSUNMatSpace(SUNMatrix farg1, long *farg2, long *farg3) { SWIGEXPORT int _wrap_FSUNModifiedGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype2d arg2 = (sunrealtype2d) 0 ; int arg3 ; int arg4 ; sunrealtype *arg5 = (sunrealtype *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype **)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype2d)(farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); arg5 = (sunrealtype *)(farg5); @@ -1892,22 +1920,22 @@ SWIGEXPORT int _wrap_FSUNModifiedGS(void *farg1, void *farg2, int const *farg3, SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype2d arg2 = (sunrealtype2d) 0 ; int arg3 ; int arg4 ; sunrealtype *arg5 = (sunrealtype *) 0 ; - sunrealtype *arg6 = (sunrealtype *) 0 ; - N_Vector *arg7 = (N_Vector *) 0 ; + sunrealtype1d arg6 = (sunrealtype1d) 0 ; + N_Vector1d arg7 = (N_Vector1d) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype **)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype2d)(farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); arg5 = (sunrealtype *)(farg5); - arg6 = (sunrealtype *)(farg6); - arg7 = (N_Vector *)(farg7); + arg6 = (sunrealtype1d)(farg6); + arg7 = (N_Vector1d)(farg7); result = (SUNErrCode)SUNClassicalGS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = (SUNErrCode)(result); return fresult; @@ -1917,14 +1945,14 @@ SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { int fresult ; int arg1 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype2d arg2 = (sunrealtype2d) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; int arg4 ; int result; arg1 = (int)(*farg1); - arg2 = (sunrealtype **)(farg2); - arg3 = (sunrealtype *)(farg3); + arg2 = (sunrealtype2d)(farg2); + arg3 = (sunrealtype1d)(farg3); arg4 = (int)(*farg4); result = (int)SUNQRfact(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -1935,15 +1963,15 @@ SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, in SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { int fresult ; int arg1 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype2d arg2 = (sunrealtype2d) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (sunrealtype **)(farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (sunrealtype *)(farg4); + arg2 = (sunrealtype2d)(farg2); + arg3 = (sunrealtype1d)(farg3); + arg4 = (sunrealtype1d)(farg4); result = (int)SUNQRsol(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -1952,16 +1980,16 @@ SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, dou SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -1974,16 +2002,16 @@ SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, i SWIGEXPORT int _wrap_FSUNQRAdd_ICWY(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -1996,16 +2024,16 @@ SWIGEXPORT int _wrap_FSUNQRAdd_ICWY(void *farg1, double *farg2, N_Vector farg3, SWIGEXPORT int _wrap_FSUNQRAdd_ICWY_SB(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -2018,16 +2046,16 @@ SWIGEXPORT int _wrap_FSUNQRAdd_ICWY_SB(void *farg1, double *farg2, N_Vector farg SWIGEXPORT int _wrap_FSUNQRAdd_CGS2(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -2040,16 +2068,16 @@ SWIGEXPORT int _wrap_FSUNQRAdd_CGS2(void *farg1, double *farg2, N_Vector farg3, SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -2062,16 +2090,16 @@ SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2(void *farg1, double *farg2, N_Vector farg3, SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2_SB(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -2877,14 +2905,14 @@ SWIGEXPORT int _wrap_FSUNStepper_SetForcing(void *farg1, double const *farg2, do SUNStepper arg1 = (SUNStepper) 0 ; sunrealtype arg2 ; sunrealtype arg3 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int arg5 ; SUNErrCode result; arg1 = (SUNStepper)(farg1); arg2 = (sunrealtype)(*farg2); arg3 = (sunrealtype)(*farg3); - arg4 = (N_Vector *)(farg4); + arg4 = (N_Vector1d)(farg4); arg5 = (int)(*farg5); result = (SUNErrCode)SUNStepper_SetForcing(arg1,arg2,arg3,arg4,arg5); fresult = (SUNErrCode)(result); diff --git a/src/sundials/fmod_int32/fsundials_core_mod.f90 b/src/sundials/fmod_int32/fsundials_core_mod.f90 index 0c360c7ae3..72f089875f 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int32/fsundials_core_mod.f90 @@ -49,19 +49,20 @@ module fsundials_core_mod integer(C_INT), parameter, public :: SUNFALSE = 0_C_INT integer(C_INT), parameter, public :: SUNTRUE = 1_C_INT - ! typedef enum SUNOutputFormat + ! enum SUNOutputFormat_ enum, bind(c) enumerator :: SUN_OUTPUTFORMAT_TABLE enumerator :: SUN_OUTPUTFORMAT_CSV end enum - integer, parameter, public :: SUNOutputFormat = kind(SUN_OUTPUTFORMAT_TABLE) + integer, parameter, public :: SUNOutputFormat_ = kind(SUN_OUTPUTFORMAT_TABLE) public :: SUN_OUTPUTFORMAT_TABLE, SUN_OUTPUTFORMAT_CSV - ! typedef enum SUNDataIOMode + ! enum SUNDataIOMode_ enum, bind(c) - enumerator :: SUNDATAIOMODE_INMEM + enumerator :: SUN_DATAIOMODE_INMEM end enum - integer, parameter, public :: SUNDataIOMode = kind(SUNDATAIOMODE_INMEM) - public :: SUNDATAIOMODE_INMEM + integer, parameter, public :: SUNDataIOMode_ = kind(SUN_DATAIOMODE_INMEM) + public :: SUN_DATAIOMODE_INMEM + ! enum SUNErrCode_ enum, bind(c) enumerator :: SUN_ERR_MINIMUM = -10000 enumerator :: SUN_ERR_ARG_CORRUPT @@ -97,6 +98,7 @@ module fsundials_core_mod enumerator :: SUN_ERR_MAXIMUM = -1000 enumerator :: SUN_SUCCESS = 0 end enum + integer, parameter, public :: SUNErrCode_ = kind(SUN_ERR_MINIMUM) public :: SUN_ERR_MINIMUM, SUN_ERR_ARG_CORRUPT, SUN_ERR_ARG_INCOMPATIBLE, SUN_ERR_ARG_OUTOFRANGE, SUN_ERR_ARG_WRONGTYPE, & SUN_ERR_ARG_DIMSMISMATCH, SUN_ERR_GENERIC, SUN_ERR_CORRUPT, SUN_ERR_OUTOFRANGE, SUN_ERR_FILE_OPEN, SUN_ERR_OP_FAIL, & SUN_ERR_MEM_FAIL, SUN_ERR_MALLOC_FAIL, SUN_ERR_EXT_FAIL, SUN_ERR_DESTROY_FAIL, SUN_ERR_NOT_IMPLEMENTED, & @@ -152,9 +154,11 @@ module fsundials_core_mod public :: FSUNLogger_Flush public :: FSUNLogger_GetOutputRank public :: FSUNLogger_Destroy + public :: FSUNFileOpen public :: FSUNDIALSFileOpen + public :: FSUNFileClose public :: FSUNDIALSFileClose - ! typedef enum N_Vector_ID + ! enum N_Vector_ID enum, bind(c) enumerator :: SUNDIALS_NVEC_SERIAL enumerator :: SUNDIALS_NVEC_PARALLEL @@ -359,17 +363,21 @@ module fsundials_core_mod public :: FSUNMatMatvec public :: FSUNMatHermitianTransposeVec public :: FSUNMatSpace + ! enum SUN_PREC_ID enum, bind(c) enumerator :: SUN_PREC_NONE enumerator :: SUN_PREC_LEFT enumerator :: SUN_PREC_RIGHT enumerator :: SUN_PREC_BOTH end enum + integer, parameter, public :: SUN_PREC_ID = kind(SUN_PREC_NONE) public :: SUN_PREC_NONE, SUN_PREC_LEFT, SUN_PREC_RIGHT, SUN_PREC_BOTH + ! enum SUN_GRAMSCHMIDT_ID enum, bind(c) enumerator :: SUN_MODIFIED_GS = 1 enumerator :: SUN_CLASSICAL_GS = 2 end enum + integer, parameter, public :: SUN_GRAMSCHMIDT_ID = kind(SUN_MODIFIED_GS) public :: SUN_MODIFIED_GS, SUN_CLASSICAL_GS public :: FSUNModifiedGS public :: FSUNClassicalGS @@ -600,15 +608,15 @@ module fsundials_core_mod public :: FSUNStepper_SetForcingFn public :: FSUNStepper_SetGetNumStepsFn public :: FSUNStepper_SetDestroyFn - ! typedef enum SUNMemoryType + ! enum SUNMemoryType_ enum, bind(c) - enumerator :: SUNMEMTYPE_HOST - enumerator :: SUNMEMTYPE_PINNED - enumerator :: SUNMEMTYPE_DEVICE - enumerator :: SUNMEMTYPE_UVM + enumerator :: SUN_MEMTYPE_HOST + enumerator :: SUN_MEMTYPE_PINNED + enumerator :: SUN_MEMTYPE_DEVICE + enumerator :: SUN_MEMTYPE_UVM end enum - integer, parameter, public :: SUNMemoryType = kind(SUNMEMTYPE_HOST) - public :: SUNMEMTYPE_HOST, SUNMEMTYPE_PINNED, SUNMEMTYPE_DEVICE, SUNMEMTYPE_UVM + integer, parameter, public :: SUNMemoryType_ = kind(SUN_MEMTYPE_HOST) + public :: SUN_MEMTYPE_HOST, SUN_MEMTYPE_PINNED, SUN_MEMTYPE_DEVICE, SUN_MEMTYPE_UVM public :: FSUNMemoryNewEmpty ! struct struct SUNMemoryHelper_ type, bind(C), public :: SUNMemoryHelper_ @@ -684,6 +692,7 @@ module fsundials_core_mod ! struct struct SUNDomEigEstimator_ type, bind(C), public :: SUNDomEigEstimator type(C_PTR), public :: content + type(C_PTR), public :: python type(C_PTR), public :: ops type(C_PTR), public :: sunctx end type SUNDomEigEstimator @@ -1013,6 +1022,17 @@ function swigc_FSUNLogger_Destroy(farg1) & integer(C_INT) :: fresult end function +function swigc_FSUNFileOpen(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNFileOpen") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + function swigc_FSUNDIALSFileOpen(farg1, farg2, farg3) & bind(C, name="_wrap_FSUNDIALSFileOpen") & result(fresult) @@ -1024,6 +1044,14 @@ function swigc_FSUNDIALSFileOpen(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FSUNFileClose(farg1) & +bind(C, name="_wrap_FSUNFileClose") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + function swigc_FSUNDIALSFileClose(farg1) & bind(C, name="_wrap_FSUNDIALSFileClose") & result(fresult) @@ -3578,6 +3606,27 @@ function FSUNLogger_Destroy(logger) & swig_result = fresult end function +function FSUNFileOpen(filename, modes, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +character(kind=C_CHAR, len=*), target :: filename +character(kind=C_CHAR), dimension(:), allocatable, target :: farg1_chars +character(kind=C_CHAR, len=*), target :: modes +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +type(C_PTR), target, intent(inout) :: fp +integer(C_INT) :: fresult +type(SwigArrayWrapper) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR) :: farg3 + +call SWIG_string_to_chararray(filename, farg1_chars, farg1) +call SWIG_string_to_chararray(modes, farg2_chars, farg2) +farg3 = c_loc(fp) +fresult = swigc_FSUNFileOpen(farg1, farg2, farg3) +swig_result = fresult +end function + function FSUNDIALSFileOpen(filename, modes, fp) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3599,6 +3648,19 @@ function FSUNDIALSFileOpen(filename, modes, fp) & swig_result = fresult end function +function FSUNFileClose(fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR), target, intent(inout) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(fp) +fresult = swigc_FSUNFileClose(farg1) +swig_result = fresult +end function + function FSUNDIALSFileClose(fp) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -4053,13 +4115,13 @@ function FN_VMinQuotient(num, denom) & swig_result = fresult end function -function FN_VLinearCombination(nvec, c, x, z) & +function FN_VLinearCombination(nvec, c_arr, x_arr, z) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec -real(C_DOUBLE), dimension(*), target, intent(inout) :: c -type(C_PTR) :: x +real(C_DOUBLE), dimension(*), target, intent(inout) :: c_arr +type(C_PTR) :: x_arr type(N_Vector), target, intent(inout) :: z integer(C_INT) :: fresult integer(C_INT) :: farg1 @@ -4068,22 +4130,22 @@ function FN_VLinearCombination(nvec, c, x, z) & type(C_PTR) :: farg4 farg1 = nvec -farg2 = c_loc(c(1)) -farg3 = x +farg2 = c_loc(c_arr(1)) +farg3 = x_arr farg4 = c_loc(z) fresult = swigc_FN_VLinearCombination(farg1, farg2, farg3, farg4) swig_result = fresult end function -function FN_VScaleAddMulti(nvec, a, x, y, z) & +function FN_VScaleAddMulti(nvec, a, x, y_arr, z_arr) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec real(C_DOUBLE), dimension(*), target, intent(inout) :: a type(N_Vector), target, intent(inout) :: x -type(C_PTR) :: y -type(C_PTR) :: z +type(C_PTR) :: y_arr +type(C_PTR) :: z_arr integer(C_INT) :: fresult integer(C_INT) :: farg1 type(C_PTR) :: farg2 @@ -4094,19 +4156,19 @@ function FN_VScaleAddMulti(nvec, a, x, y, z) & farg1 = nvec farg2 = c_loc(a(1)) farg3 = c_loc(x) -farg4 = y -farg5 = z +farg4 = y_arr +farg5 = z_arr fresult = swigc_FN_VScaleAddMulti(farg1, farg2, farg3, farg4, farg5) swig_result = fresult end function -function FN_VDotProdMulti(nvec, x, y, dotprods) & +function FN_VDotProdMulti(nvec, x, y_arr, dotprods) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec type(N_Vector), target, intent(inout) :: x -type(C_PTR) :: y +type(C_PTR) :: y_arr real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods integer(C_INT) :: fresult integer(C_INT) :: farg1 @@ -4116,22 +4178,22 @@ function FN_VDotProdMulti(nvec, x, y, dotprods) & farg1 = nvec farg2 = c_loc(x) -farg3 = y +farg3 = y_arr farg4 = c_loc(dotprods(1)) fresult = swigc_FN_VDotProdMulti(farg1, farg2, farg3, farg4) swig_result = fresult end function -function FN_VLinearSumVectorArray(nvec, a, x, b, y, z) & +function FN_VLinearSumVectorArray(nvec, a, x_arr, b, y_arr, z_arr) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec real(C_DOUBLE), intent(in) :: a -type(C_PTR) :: x +type(C_PTR) :: x_arr real(C_DOUBLE), intent(in) :: b -type(C_PTR) :: y -type(C_PTR) :: z +type(C_PTR) :: y_arr +type(C_PTR) :: z_arr integer(C_INT) :: fresult integer(C_INT) :: farg1 real(C_DOUBLE) :: farg2 @@ -4142,22 +4204,22 @@ function FN_VLinearSumVectorArray(nvec, a, x, b, y, z) & farg1 = nvec farg2 = a -farg3 = x +farg3 = x_arr farg4 = b -farg5 = y -farg6 = z +farg5 = y_arr +farg6 = z_arr fresult = swigc_FN_VLinearSumVectorArray(farg1, farg2, farg3, farg4, farg5, farg6) swig_result = fresult end function -function FN_VScaleVectorArray(nvec, c, x, z) & +function FN_VScaleVectorArray(nvec, c, x_arr, z_arr) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec real(C_DOUBLE), dimension(*), target, intent(inout) :: c -type(C_PTR) :: x -type(C_PTR) :: z +type(C_PTR) :: x_arr +type(C_PTR) :: z_arr integer(C_INT) :: fresult integer(C_INT) :: farg1 type(C_PTR) :: farg2 @@ -4166,19 +4228,19 @@ function FN_VScaleVectorArray(nvec, c, x, z) & farg1 = nvec farg2 = c_loc(c(1)) -farg3 = x -farg4 = z +farg3 = x_arr +farg4 = z_arr fresult = swigc_FN_VScaleVectorArray(farg1, farg2, farg3, farg4) swig_result = fresult end function -function FN_VConstVectorArray(nvec, c, z) & +function FN_VConstVectorArray(nvec, c, z_arr) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec real(C_DOUBLE), intent(in) :: c -type(C_PTR) :: z +type(C_PTR) :: z_arr integer(C_INT) :: fresult integer(C_INT) :: farg1 real(C_DOUBLE) :: farg2 @@ -4186,18 +4248,18 @@ function FN_VConstVectorArray(nvec, c, z) & farg1 = nvec farg2 = c -farg3 = z +farg3 = z_arr fresult = swigc_FN_VConstVectorArray(farg1, farg2, farg3) swig_result = fresult end function -function FN_VWrmsNormVectorArray(nvec, x, w, nrm) & +function FN_VWrmsNormVectorArray(nvec, x_arr, w_arr, nrm) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec -type(C_PTR) :: x -type(C_PTR) :: w +type(C_PTR) :: x_arr +type(C_PTR) :: w_arr real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm integer(C_INT) :: fresult integer(C_INT) :: farg1 @@ -4206,20 +4268,20 @@ function FN_VWrmsNormVectorArray(nvec, x, w, nrm) & type(C_PTR) :: farg4 farg1 = nvec -farg2 = x -farg3 = w +farg2 = x_arr +farg3 = w_arr farg4 = c_loc(nrm(1)) fresult = swigc_FN_VWrmsNormVectorArray(farg1, farg2, farg3, farg4) swig_result = fresult end function -function FN_VWrmsNormMaskVectorArray(nvec, x, w, id, nrm) & +function FN_VWrmsNormMaskVectorArray(nvec, x_arr, w_arr, id, nrm) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec -type(C_PTR) :: x -type(C_PTR) :: w +type(C_PTR) :: x_arr +type(C_PTR) :: w_arr type(N_Vector), target, intent(inout) :: id real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm integer(C_INT) :: fresult @@ -4230,8 +4292,8 @@ function FN_VWrmsNormMaskVectorArray(nvec, x, w, id, nrm) & type(C_PTR) :: farg5 farg1 = nvec -farg2 = x -farg3 = w +farg2 = x_arr +farg3 = w_arr farg4 = c_loc(id) farg5 = c_loc(nrm(1)) fresult = swigc_FN_VWrmsNormMaskVectorArray(farg1, farg2, farg3, farg4, farg5) @@ -4379,13 +4441,13 @@ function FN_VMinQuotientLocal(num, denom) & swig_result = fresult end function -function FN_VDotProdMultiLocal(nvec, x, y, dotprods) & +function FN_VDotProdMultiLocal(nvec, x, y_arr, dotprods) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec type(N_Vector), target, intent(inout) :: x -type(C_PTR) :: y +type(C_PTR) :: y_arr real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods integer(C_INT) :: fresult integer(C_INT) :: farg1 @@ -4395,7 +4457,7 @@ function FN_VDotProdMultiLocal(nvec, x, y, dotprods) & farg1 = nvec farg2 = c_loc(x) -farg3 = y +farg3 = y_arr farg4 = c_loc(dotprods(1)) fresult = swigc_FN_VDotProdMultiLocal(farg1, farg2, farg3, farg4) swig_result = fresult @@ -4516,44 +4578,44 @@ function FN_VCloneVectorArray(count, w) & swig_result = fresult end function -subroutine FN_VDestroyVectorArray(vs, count) +subroutine FN_VDestroyVectorArray(vs_arr, count) use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs +type(C_PTR) :: vs_arr integer(C_INT), intent(in) :: count type(C_PTR) :: farg1 integer(C_INT) :: farg2 -farg1 = vs +farg1 = vs_arr farg2 = count call swigc_FN_VDestroyVectorArray(farg1, farg2) end subroutine -function FN_VGetVecAtIndexVectorArray(vs, index) & +function FN_VGetVecAtIndexVectorArray(vs_arr, index) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(N_Vector), pointer :: swig_result -type(C_PTR) :: vs +type(C_PTR) :: vs_arr integer(C_INT), intent(in) :: index type(C_PTR) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 -farg1 = vs +farg1 = vs_arr farg2 = index fresult = swigc_FN_VGetVecAtIndexVectorArray(farg1, farg2) call c_f_pointer(fresult, swig_result) end function -subroutine FN_VSetVecAtIndexVectorArray(vs, index, w) +subroutine FN_VSetVecAtIndexVectorArray(vs_arr, index, w) use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs +type(C_PTR) :: vs_arr integer(C_INT), intent(in) :: index type(N_Vector), target, intent(inout) :: w type(C_PTR) :: farg1 integer(C_INT) :: farg2 type(C_PTR) :: farg3 -farg1 = vs +farg1 = vs_arr farg2 = index farg3 = c_loc(w) call swigc_FN_VSetVecAtIndexVectorArray(farg1, farg2, farg3) @@ -6314,7 +6376,7 @@ function FSUNMemoryHelper_Wrap(arg0, ptr, mem_type) & type(C_PTR) :: swig_result type(SUNMemoryHelper_), target, intent(inout) :: arg0 type(C_PTR) :: ptr -integer(SUNMemoryType), intent(in) :: mem_type +integer(SUNMemoryType_), intent(in) :: mem_type type(C_PTR) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -6334,7 +6396,7 @@ function FSUNMemoryHelper_Alloc(arg0, memptr, mem_size, mem_type, queue) & type(SUNMemoryHelper_), target, intent(inout) :: arg0 type(C_PTR), target, intent(inout) :: memptr integer(C_SIZE_T), intent(in) :: mem_size -integer(SUNMemoryType), intent(in) :: mem_type +integer(SUNMemoryType_), intent(in) :: mem_type type(C_PTR) :: queue integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -6360,7 +6422,7 @@ function FSUNMemoryHelper_AllocStrided(arg0, memptr, mem_size, stride, mem_type, type(C_PTR), target, intent(inout) :: memptr integer(C_SIZE_T), intent(in) :: mem_size integer(C_SIZE_T), intent(in) :: stride -integer(SUNMemoryType), intent(in) :: mem_type +integer(SUNMemoryType_), intent(in) :: mem_type type(C_PTR) :: queue integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -6455,7 +6517,7 @@ function FSUNMemoryHelper_GetAllocStats(arg0, mem_type, num_allocations, num_dea use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(SUNMemoryHelper_), target, intent(inout) :: arg0 -integer(SUNMemoryType), intent(in) :: mem_type +integer(SUNMemoryType_), intent(in) :: mem_type integer(C_LONG), target, intent(inout) :: num_allocations integer(C_LONG), target, intent(inout) :: num_deallocations integer(C_SIZE_T), target, intent(inout) :: bytes_allocated @@ -6986,7 +7048,7 @@ function FSUNAdjointStepper_PrintAllStats(adj_stepper, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: adj_stepper type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/sundials/fmod_int64/fsundials_core_mod.c b/src/sundials/fmod_int64/fsundials_core_mod.c index d64a069203..96ae9cb679 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.c +++ b/src/sundials/fmod_int64/fsundials_core_mod.c @@ -802,6 +802,22 @@ SWIGEXPORT int _wrap_FSUNLogger_Destroy(void *farg1) { } +SWIGEXPORT int _wrap_FSUNFileOpen(SwigArrayWrapper *farg1, SwigArrayWrapper *farg2, void *farg3) { + int fresult ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + FILE **arg3 = (FILE **) 0 ; + SUNErrCode result; + + arg1 = (char *)(farg1->data); + arg2 = (char *)(farg2->data); + arg3 = (FILE **)(farg3); + result = (SUNErrCode)SUNFileOpen((char const *)arg1,(char const *)arg2,arg3); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNDIALSFileOpen(SwigArrayWrapper *farg1, SwigArrayWrapper *farg2, void *farg3) { int fresult ; char *arg1 = (char *) 0 ; @@ -818,6 +834,18 @@ SWIGEXPORT int _wrap_FSUNDIALSFileOpen(SwigArrayWrapper *farg1, SwigArrayWrapper } +SWIGEXPORT int _wrap_FSUNFileClose(void *farg1) { + int fresult ; + FILE **arg1 = (FILE **) 0 ; + SUNErrCode result; + + arg1 = (FILE **)(farg1); + result = (SUNErrCode)SUNFileClose(arg1); + fresult = (SUNErrCode)(result); + return fresult; +} + + SWIGEXPORT int _wrap_FSUNDIALSFileClose(void *farg1) { int fresult ; FILE **arg1 = (FILE **) 0 ; @@ -921,10 +949,10 @@ SWIGEXPORT void _wrap_FN_VSpace(N_Vector farg1, int64_t *farg2, int64_t *farg3) SWIGEXPORT void _wrap_FN_VSetArrayPointer(double *farg1, N_Vector farg2) { - sunrealtype *arg1 = (sunrealtype *) 0 ; + sunrealtype1d arg1 = (sunrealtype1d) 0 ; N_Vector arg2 = (N_Vector) 0 ; - arg1 = (sunrealtype *)(farg1); + arg1 = (sunrealtype1d)(farg1); arg2 = (N_Vector)(farg2); N_VSetArrayPointer(arg1,arg2); } @@ -1223,14 +1251,14 @@ SWIGEXPORT double _wrap_FN_VMinQuotient(N_Vector farg1, N_Vector farg2) { SWIGEXPORT int _wrap_FN_VLinearCombination(int const *farg1, double *farg2, void *farg3, N_Vector farg4) { int fresult ; int arg1 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; N_Vector arg4 = (N_Vector) 0 ; SUNErrCode result; arg1 = (int)(*farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (sunrealtype1d)(farg2); + arg3 = (N_Vector1d)(farg3); arg4 = (N_Vector)(farg4); result = (SUNErrCode)N_VLinearCombination(arg1,arg2,arg3,arg4); fresult = (SUNErrCode)(result); @@ -1241,17 +1269,17 @@ SWIGEXPORT int _wrap_FN_VLinearCombination(int const *farg1, double *farg2, void SWIGEXPORT int _wrap_FN_VScaleAddMulti(int const *farg1, double *farg2, N_Vector farg3, void *farg4, void *farg5) { int fresult ; int arg1 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; - N_Vector *arg5 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); - arg2 = (sunrealtype *)(farg2); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); - arg4 = (N_Vector *)(farg4); - arg5 = (N_Vector *)(farg5); + arg4 = (N_Vector1d)(farg4); + arg5 = (N_Vector1d)(farg5); result = (SUNErrCode)N_VScaleAddMulti(arg1,arg2,arg3,arg4,arg5); fresult = (SUNErrCode)(result); return fresult; @@ -1262,14 +1290,14 @@ SWIGEXPORT int _wrap_FN_VDotProdMulti(int const *farg1, N_Vector farg2, void *fa int fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (sunrealtype *)(farg4); + arg3 = (N_Vector1d)(farg3); + arg4 = (sunrealtype1d)(farg4); result = (SUNErrCode)N_VDotProdMulti(arg1,arg2,arg3,arg4); fresult = (SUNErrCode)(result); return fresult; @@ -1280,18 +1308,18 @@ SWIGEXPORT int _wrap_FN_VLinearSumVectorArray(int const *farg1, double const *fa int fresult ; int arg1 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; sunrealtype arg4 ; - N_Vector *arg5 = (N_Vector *) 0 ; - N_Vector *arg6 = (N_Vector *) 0 ; + N_Vector1d arg5 = (N_Vector1d) 0 ; + N_Vector1d arg6 = (N_Vector1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); arg4 = (sunrealtype)(*farg4); - arg5 = (N_Vector *)(farg5); - arg6 = (N_Vector *)(farg6); + arg5 = (N_Vector1d)(farg5); + arg6 = (N_Vector1d)(farg6); result = (SUNErrCode)N_VLinearSumVectorArray(arg1,arg2,arg3,arg4,arg5,arg6); fresult = (SUNErrCode)(result); return fresult; @@ -1301,15 +1329,15 @@ SWIGEXPORT int _wrap_FN_VLinearSumVectorArray(int const *farg1, double const *fa SWIGEXPORT int _wrap_FN_VScaleVectorArray(int const *farg1, double *farg2, void *farg3, void *farg4) { int fresult ; int arg1 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - N_Vector *arg4 = (N_Vector *) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); - arg2 = (sunrealtype *)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (N_Vector *)(farg4); + arg2 = (sunrealtype1d)(farg2); + arg3 = (N_Vector1d)(farg3); + arg4 = (N_Vector1d)(farg4); result = (SUNErrCode)N_VScaleVectorArray(arg1,arg2,arg3,arg4); fresult = (SUNErrCode)(result); return fresult; @@ -1320,12 +1348,12 @@ SWIGEXPORT int _wrap_FN_VConstVectorArray(int const *farg1, double const *farg2, int fresult ; int arg1 ; sunrealtype arg2 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); arg2 = (sunrealtype)(*farg2); - arg3 = (N_Vector *)(farg3); + arg3 = (N_Vector1d)(farg3); result = (SUNErrCode)N_VConstVectorArray(arg1,arg2,arg3); fresult = (SUNErrCode)(result); return fresult; @@ -1335,15 +1363,15 @@ SWIGEXPORT int _wrap_FN_VConstVectorArray(int const *farg1, double const *farg2, SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray(int const *farg1, void *farg2, void *farg3, double *farg4) { int fresult ; int arg1 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (sunrealtype *)(farg4); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); + arg4 = (sunrealtype1d)(farg4); result = (SUNErrCode)N_VWrmsNormVectorArray(arg1,arg2,arg3,arg4); fresult = (SUNErrCode)(result); return fresult; @@ -1353,17 +1381,17 @@ SWIGEXPORT int _wrap_FN_VWrmsNormVectorArray(int const *farg1, void *farg2, void SWIGEXPORT int _wrap_FN_VWrmsNormMaskVectorArray(int const *farg1, void *farg2, void *farg3, N_Vector farg4, double *farg5) { int fresult ; int arg1 ; - N_Vector *arg2 = (N_Vector *) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; + N_Vector1d arg2 = (N_Vector1d) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; N_Vector arg4 = (N_Vector) 0 ; - sunrealtype *arg5 = (sunrealtype *) 0 ; + sunrealtype1d arg5 = (sunrealtype1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); - arg2 = (N_Vector *)(farg2); - arg3 = (N_Vector *)(farg3); + arg2 = (N_Vector1d)(farg2); + arg3 = (N_Vector1d)(farg3); arg4 = (N_Vector)(farg4); - arg5 = (sunrealtype *)(farg5); + arg5 = (sunrealtype1d)(farg5); result = (SUNErrCode)N_VWrmsNormMaskVectorArray(arg1,arg2,arg3,arg4,arg5); fresult = (SUNErrCode)(result); return fresult; @@ -1498,14 +1526,14 @@ SWIGEXPORT int _wrap_FN_VDotProdMultiLocal(int const *farg1, N_Vector farg2, voi int fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - N_Vector *arg3 = (N_Vector *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; + N_Vector1d arg3 = (N_Vector1d) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (N_Vector *)(farg3); - arg4 = (sunrealtype *)(farg4); + arg3 = (N_Vector1d)(farg3); + arg4 = (sunrealtype1d)(farg4); result = (SUNErrCode)N_VDotProdMultiLocal(arg1,arg2,arg3,arg4); fresult = (SUNErrCode)(result); return fresult; @@ -1516,12 +1544,12 @@ SWIGEXPORT int _wrap_FN_VDotProdMultiAllReduce(int const *farg1, N_Vector farg2, int fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; SUNErrCode result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - arg3 = (sunrealtype *)(farg3); + arg3 = (sunrealtype1d)(farg3); result = (SUNErrCode)N_VDotProdMultiAllReduce(arg1,arg2,arg3); fresult = (SUNErrCode)(result); return fresult; @@ -1574,11 +1602,11 @@ SWIGEXPORT void * _wrap_FN_VNewVectorArray(int const *farg1, void *farg2) { void * fresult ; int arg1 ; SUNContext arg2 = (SUNContext) 0 ; - N_Vector *result = 0 ; + N_Vector1d result; arg1 = (int)(*farg1); arg2 = (SUNContext)(farg2); - result = (N_Vector *)N_VNewVectorArray(arg1,arg2); + result = (N_Vector1d)N_VNewVectorArray(arg1,arg2); fresult = result; return fresult; } @@ -1588,11 +1616,11 @@ SWIGEXPORT void * _wrap_FN_VCloneEmptyVectorArray(int const *farg1, N_Vector far void * fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; + N_Vector1d result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneEmptyVectorArray(arg1,arg2); + result = (N_Vector1d)N_VCloneEmptyVectorArray(arg1,arg2); fresult = result; return fresult; } @@ -1602,21 +1630,21 @@ SWIGEXPORT void * _wrap_FN_VCloneVectorArray(int const *farg1, N_Vector farg2) { void * fresult ; int arg1 ; N_Vector arg2 = (N_Vector) 0 ; - N_Vector *result = 0 ; + N_Vector1d result; arg1 = (int)(*farg1); arg2 = (N_Vector)(farg2); - result = (N_Vector *)N_VCloneVectorArray(arg1,arg2); + result = (N_Vector1d)N_VCloneVectorArray(arg1,arg2); fresult = result; return fresult; } SWIGEXPORT void _wrap_FN_VDestroyVectorArray(void *farg1, int const *farg2) { - N_Vector *arg1 = (N_Vector *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; int arg2 ; - arg1 = (N_Vector *)(farg1); + arg1 = (N_Vector1d)(farg1); arg2 = (int)(*farg2); N_VDestroyVectorArray(arg1,arg2); } @@ -1624,11 +1652,11 @@ SWIGEXPORT void _wrap_FN_VDestroyVectorArray(void *farg1, int const *farg2) { SWIGEXPORT N_Vector _wrap_FN_VGetVecAtIndexVectorArray(void *farg1, int const *farg2) { N_Vector fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; int arg2 ; N_Vector result; - arg1 = (N_Vector *)(farg1); + arg1 = (N_Vector1d)(farg1); arg2 = (int)(*farg2); result = (N_Vector)N_VGetVecAtIndexVectorArray(arg1,arg2); fresult = result; @@ -1637,11 +1665,11 @@ SWIGEXPORT N_Vector _wrap_FN_VGetVecAtIndexVectorArray(void *farg1, int const *f SWIGEXPORT void _wrap_FN_VSetVecAtIndexVectorArray(void *farg1, int const *farg2, N_Vector farg3) { - N_Vector *arg1 = (N_Vector *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; int arg2 ; N_Vector arg3 = (N_Vector) 0 ; - arg1 = (N_Vector *)(farg1); + arg1 = (N_Vector1d)(farg1); arg2 = (int)(*farg2); arg3 = (N_Vector)(farg3); N_VSetVecAtIndexVectorArray(arg1,arg2,arg3); @@ -1872,15 +1900,15 @@ SWIGEXPORT int _wrap_FSUNMatSpace(SUNMatrix farg1, long *farg2, long *farg3) { SWIGEXPORT int _wrap_FSUNModifiedGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype2d arg2 = (sunrealtype2d) 0 ; int arg3 ; int arg4 ; sunrealtype *arg5 = (sunrealtype *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype **)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype2d)(farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); arg5 = (sunrealtype *)(farg5); @@ -1892,22 +1920,22 @@ SWIGEXPORT int _wrap_FSUNModifiedGS(void *farg1, void *farg2, int const *farg3, SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, int const *farg4, double *farg5, double *farg6, void *farg7) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype2d arg2 = (sunrealtype2d) 0 ; int arg3 ; int arg4 ; sunrealtype *arg5 = (sunrealtype *) 0 ; - sunrealtype *arg6 = (sunrealtype *) 0 ; - N_Vector *arg7 = (N_Vector *) 0 ; + sunrealtype1d arg6 = (sunrealtype1d) 0 ; + N_Vector1d arg7 = (N_Vector1d) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype **)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype2d)(farg2); arg3 = (int)(*farg3); arg4 = (int)(*farg4); arg5 = (sunrealtype *)(farg5); - arg6 = (sunrealtype *)(farg6); - arg7 = (N_Vector *)(farg7); + arg6 = (sunrealtype1d)(farg6); + arg7 = (N_Vector1d)(farg7); result = (SUNErrCode)SUNClassicalGS(arg1,arg2,arg3,arg4,arg5,arg6,arg7); fresult = (SUNErrCode)(result); return fresult; @@ -1917,14 +1945,14 @@ SWIGEXPORT int _wrap_FSUNClassicalGS(void *farg1, void *farg2, int const *farg3, SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, int const *farg4) { int fresult ; int arg1 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; + sunrealtype2d arg2 = (sunrealtype2d) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; int arg4 ; int result; arg1 = (int)(*farg1); - arg2 = (sunrealtype **)(farg2); - arg3 = (sunrealtype *)(farg3); + arg2 = (sunrealtype2d)(farg2); + arg3 = (sunrealtype1d)(farg3); arg4 = (int)(*farg4); result = (int)SUNQRfact(arg1,arg2,arg3,arg4); fresult = (int)(result); @@ -1935,15 +1963,15 @@ SWIGEXPORT int _wrap_FSUNQRfact(int const *farg1, void *farg2, double *farg3, in SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, double *farg4) { int fresult ; int arg1 ; - sunrealtype **arg2 = (sunrealtype **) 0 ; - sunrealtype *arg3 = (sunrealtype *) 0 ; - sunrealtype *arg4 = (sunrealtype *) 0 ; + sunrealtype2d arg2 = (sunrealtype2d) 0 ; + sunrealtype1d arg3 = (sunrealtype1d) 0 ; + sunrealtype1d arg4 = (sunrealtype1d) 0 ; int result; arg1 = (int)(*farg1); - arg2 = (sunrealtype **)(farg2); - arg3 = (sunrealtype *)(farg3); - arg4 = (sunrealtype *)(farg4); + arg2 = (sunrealtype2d)(farg2); + arg3 = (sunrealtype1d)(farg3); + arg4 = (sunrealtype1d)(farg4); result = (int)SUNQRsol(arg1,arg2,arg3,arg4); fresult = (int)(result); return fresult; @@ -1952,16 +1980,16 @@ SWIGEXPORT int _wrap_FSUNQRsol(int const *farg1, void *farg2, double *farg3, dou SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -1974,16 +2002,16 @@ SWIGEXPORT int _wrap_FSUNQRAdd_MGS(void *farg1, double *farg2, N_Vector farg3, i SWIGEXPORT int _wrap_FSUNQRAdd_ICWY(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -1996,16 +2024,16 @@ SWIGEXPORT int _wrap_FSUNQRAdd_ICWY(void *farg1, double *farg2, N_Vector farg3, SWIGEXPORT int _wrap_FSUNQRAdd_ICWY_SB(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -2018,16 +2046,16 @@ SWIGEXPORT int _wrap_FSUNQRAdd_ICWY_SB(void *farg1, double *farg2, N_Vector farg SWIGEXPORT int _wrap_FSUNQRAdd_CGS2(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -2040,16 +2068,16 @@ SWIGEXPORT int _wrap_FSUNQRAdd_CGS2(void *farg1, double *farg2, N_Vector farg3, SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -2062,16 +2090,16 @@ SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2(void *farg1, double *farg2, N_Vector farg3, SWIGEXPORT int _wrap_FSUNQRAdd_DCGS2_SB(void *farg1, double *farg2, N_Vector farg3, int const *farg4, int const *farg5, void *farg6) { int fresult ; - N_Vector *arg1 = (N_Vector *) 0 ; - sunrealtype *arg2 = (sunrealtype *) 0 ; + N_Vector1d arg1 = (N_Vector1d) 0 ; + sunrealtype1d arg2 = (sunrealtype1d) 0 ; N_Vector arg3 = (N_Vector) 0 ; int arg4 ; int arg5 ; void *arg6 = (void *) 0 ; SUNErrCode result; - arg1 = (N_Vector *)(farg1); - arg2 = (sunrealtype *)(farg2); + arg1 = (N_Vector1d)(farg1); + arg2 = (sunrealtype1d)(farg2); arg3 = (N_Vector)(farg3); arg4 = (int)(*farg4); arg5 = (int)(*farg5); @@ -2877,14 +2905,14 @@ SWIGEXPORT int _wrap_FSUNStepper_SetForcing(void *farg1, double const *farg2, do SUNStepper arg1 = (SUNStepper) 0 ; sunrealtype arg2 ; sunrealtype arg3 ; - N_Vector *arg4 = (N_Vector *) 0 ; + N_Vector1d arg4 = (N_Vector1d) 0 ; int arg5 ; SUNErrCode result; arg1 = (SUNStepper)(farg1); arg2 = (sunrealtype)(*farg2); arg3 = (sunrealtype)(*farg3); - arg4 = (N_Vector *)(farg4); + arg4 = (N_Vector1d)(farg4); arg5 = (int)(*farg5); result = (SUNErrCode)SUNStepper_SetForcing(arg1,arg2,arg3,arg4,arg5); fresult = (SUNErrCode)(result); diff --git a/src/sundials/fmod_int64/fsundials_core_mod.f90 b/src/sundials/fmod_int64/fsundials_core_mod.f90 index 9106345ac9..46bf39e5a5 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int64/fsundials_core_mod.f90 @@ -49,19 +49,20 @@ module fsundials_core_mod integer(C_INT), parameter, public :: SUNFALSE = 0_C_INT integer(C_INT), parameter, public :: SUNTRUE = 1_C_INT - ! typedef enum SUNOutputFormat + ! enum SUNOutputFormat_ enum, bind(c) enumerator :: SUN_OUTPUTFORMAT_TABLE enumerator :: SUN_OUTPUTFORMAT_CSV end enum - integer, parameter, public :: SUNOutputFormat = kind(SUN_OUTPUTFORMAT_TABLE) + integer, parameter, public :: SUNOutputFormat_ = kind(SUN_OUTPUTFORMAT_TABLE) public :: SUN_OUTPUTFORMAT_TABLE, SUN_OUTPUTFORMAT_CSV - ! typedef enum SUNDataIOMode + ! enum SUNDataIOMode_ enum, bind(c) - enumerator :: SUNDATAIOMODE_INMEM + enumerator :: SUN_DATAIOMODE_INMEM end enum - integer, parameter, public :: SUNDataIOMode = kind(SUNDATAIOMODE_INMEM) - public :: SUNDATAIOMODE_INMEM + integer, parameter, public :: SUNDataIOMode_ = kind(SUN_DATAIOMODE_INMEM) + public :: SUN_DATAIOMODE_INMEM + ! enum SUNErrCode_ enum, bind(c) enumerator :: SUN_ERR_MINIMUM = -10000 enumerator :: SUN_ERR_ARG_CORRUPT @@ -97,6 +98,7 @@ module fsundials_core_mod enumerator :: SUN_ERR_MAXIMUM = -1000 enumerator :: SUN_SUCCESS = 0 end enum + integer, parameter, public :: SUNErrCode_ = kind(SUN_ERR_MINIMUM) public :: SUN_ERR_MINIMUM, SUN_ERR_ARG_CORRUPT, SUN_ERR_ARG_INCOMPATIBLE, SUN_ERR_ARG_OUTOFRANGE, SUN_ERR_ARG_WRONGTYPE, & SUN_ERR_ARG_DIMSMISMATCH, SUN_ERR_GENERIC, SUN_ERR_CORRUPT, SUN_ERR_OUTOFRANGE, SUN_ERR_FILE_OPEN, SUN_ERR_OP_FAIL, & SUN_ERR_MEM_FAIL, SUN_ERR_MALLOC_FAIL, SUN_ERR_EXT_FAIL, SUN_ERR_DESTROY_FAIL, SUN_ERR_NOT_IMPLEMENTED, & @@ -152,9 +154,11 @@ module fsundials_core_mod public :: FSUNLogger_Flush public :: FSUNLogger_GetOutputRank public :: FSUNLogger_Destroy + public :: FSUNFileOpen public :: FSUNDIALSFileOpen + public :: FSUNFileClose public :: FSUNDIALSFileClose - ! typedef enum N_Vector_ID + ! enum N_Vector_ID enum, bind(c) enumerator :: SUNDIALS_NVEC_SERIAL enumerator :: SUNDIALS_NVEC_PARALLEL @@ -359,17 +363,21 @@ module fsundials_core_mod public :: FSUNMatMatvec public :: FSUNMatHermitianTransposeVec public :: FSUNMatSpace + ! enum SUN_PREC_ID enum, bind(c) enumerator :: SUN_PREC_NONE enumerator :: SUN_PREC_LEFT enumerator :: SUN_PREC_RIGHT enumerator :: SUN_PREC_BOTH end enum + integer, parameter, public :: SUN_PREC_ID = kind(SUN_PREC_NONE) public :: SUN_PREC_NONE, SUN_PREC_LEFT, SUN_PREC_RIGHT, SUN_PREC_BOTH + ! enum SUN_GRAMSCHMIDT_ID enum, bind(c) enumerator :: SUN_MODIFIED_GS = 1 enumerator :: SUN_CLASSICAL_GS = 2 end enum + integer, parameter, public :: SUN_GRAMSCHMIDT_ID = kind(SUN_MODIFIED_GS) public :: SUN_MODIFIED_GS, SUN_CLASSICAL_GS public :: FSUNModifiedGS public :: FSUNClassicalGS @@ -600,15 +608,15 @@ module fsundials_core_mod public :: FSUNStepper_SetForcingFn public :: FSUNStepper_SetGetNumStepsFn public :: FSUNStepper_SetDestroyFn - ! typedef enum SUNMemoryType + ! enum SUNMemoryType_ enum, bind(c) - enumerator :: SUNMEMTYPE_HOST - enumerator :: SUNMEMTYPE_PINNED - enumerator :: SUNMEMTYPE_DEVICE - enumerator :: SUNMEMTYPE_UVM + enumerator :: SUN_MEMTYPE_HOST + enumerator :: SUN_MEMTYPE_PINNED + enumerator :: SUN_MEMTYPE_DEVICE + enumerator :: SUN_MEMTYPE_UVM end enum - integer, parameter, public :: SUNMemoryType = kind(SUNMEMTYPE_HOST) - public :: SUNMEMTYPE_HOST, SUNMEMTYPE_PINNED, SUNMEMTYPE_DEVICE, SUNMEMTYPE_UVM + integer, parameter, public :: SUNMemoryType_ = kind(SUN_MEMTYPE_HOST) + public :: SUN_MEMTYPE_HOST, SUN_MEMTYPE_PINNED, SUN_MEMTYPE_DEVICE, SUN_MEMTYPE_UVM public :: FSUNMemoryNewEmpty ! struct struct SUNMemoryHelper_ type, bind(C), public :: SUNMemoryHelper_ @@ -684,6 +692,7 @@ module fsundials_core_mod ! struct struct SUNDomEigEstimator_ type, bind(C), public :: SUNDomEigEstimator type(C_PTR), public :: content + type(C_PTR), public :: python type(C_PTR), public :: ops type(C_PTR), public :: sunctx end type SUNDomEigEstimator @@ -1013,6 +1022,17 @@ function swigc_FSUNLogger_Destroy(farg1) & integer(C_INT) :: fresult end function +function swigc_FSUNFileOpen(farg1, farg2, farg3) & +bind(C, name="_wrap_FSUNFileOpen") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +import :: swigarraywrapper +type(SwigArrayWrapper) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR), value :: farg3 +integer(C_INT) :: fresult +end function + function swigc_FSUNDIALSFileOpen(farg1, farg2, farg3) & bind(C, name="_wrap_FSUNDIALSFileOpen") & result(fresult) @@ -1024,6 +1044,14 @@ function swigc_FSUNDIALSFileOpen(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FSUNFileClose(farg1) & +bind(C, name="_wrap_FSUNFileClose") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT) :: fresult +end function + function swigc_FSUNDIALSFileClose(farg1) & bind(C, name="_wrap_FSUNDIALSFileClose") & result(fresult) @@ -3578,6 +3606,27 @@ function FSUNLogger_Destroy(logger) & swig_result = fresult end function +function FSUNFileOpen(filename, modes, fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +character(kind=C_CHAR, len=*), target :: filename +character(kind=C_CHAR), dimension(:), allocatable, target :: farg1_chars +character(kind=C_CHAR, len=*), target :: modes +character(kind=C_CHAR), dimension(:), allocatable, target :: farg2_chars +type(C_PTR), target, intent(inout) :: fp +integer(C_INT) :: fresult +type(SwigArrayWrapper) :: farg1 +type(SwigArrayWrapper) :: farg2 +type(C_PTR) :: farg3 + +call SWIG_string_to_chararray(filename, farg1_chars, farg1) +call SWIG_string_to_chararray(modes, farg2_chars, farg2) +farg3 = c_loc(fp) +fresult = swigc_FSUNFileOpen(farg1, farg2, farg3) +swig_result = fresult +end function + function FSUNDIALSFileOpen(filename, modes, fp) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -3599,6 +3648,19 @@ function FSUNDIALSFileOpen(filename, modes, fp) & swig_result = fresult end function +function FSUNFileClose(fp) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR), target, intent(inout) :: fp +integer(C_INT) :: fresult +type(C_PTR) :: farg1 + +farg1 = c_loc(fp) +fresult = swigc_FSUNFileClose(farg1) +swig_result = fresult +end function + function FSUNDIALSFileClose(fp) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -4053,13 +4115,13 @@ function FN_VMinQuotient(num, denom) & swig_result = fresult end function -function FN_VLinearCombination(nvec, c, x, z) & +function FN_VLinearCombination(nvec, c_arr, x_arr, z) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec -real(C_DOUBLE), dimension(*), target, intent(inout) :: c -type(C_PTR) :: x +real(C_DOUBLE), dimension(*), target, intent(inout) :: c_arr +type(C_PTR) :: x_arr type(N_Vector), target, intent(inout) :: z integer(C_INT) :: fresult integer(C_INT) :: farg1 @@ -4068,22 +4130,22 @@ function FN_VLinearCombination(nvec, c, x, z) & type(C_PTR) :: farg4 farg1 = nvec -farg2 = c_loc(c(1)) -farg3 = x +farg2 = c_loc(c_arr(1)) +farg3 = x_arr farg4 = c_loc(z) fresult = swigc_FN_VLinearCombination(farg1, farg2, farg3, farg4) swig_result = fresult end function -function FN_VScaleAddMulti(nvec, a, x, y, z) & +function FN_VScaleAddMulti(nvec, a, x, y_arr, z_arr) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec real(C_DOUBLE), dimension(*), target, intent(inout) :: a type(N_Vector), target, intent(inout) :: x -type(C_PTR) :: y -type(C_PTR) :: z +type(C_PTR) :: y_arr +type(C_PTR) :: z_arr integer(C_INT) :: fresult integer(C_INT) :: farg1 type(C_PTR) :: farg2 @@ -4094,19 +4156,19 @@ function FN_VScaleAddMulti(nvec, a, x, y, z) & farg1 = nvec farg2 = c_loc(a(1)) farg3 = c_loc(x) -farg4 = y -farg5 = z +farg4 = y_arr +farg5 = z_arr fresult = swigc_FN_VScaleAddMulti(farg1, farg2, farg3, farg4, farg5) swig_result = fresult end function -function FN_VDotProdMulti(nvec, x, y, dotprods) & +function FN_VDotProdMulti(nvec, x, y_arr, dotprods) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec type(N_Vector), target, intent(inout) :: x -type(C_PTR) :: y +type(C_PTR) :: y_arr real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods integer(C_INT) :: fresult integer(C_INT) :: farg1 @@ -4116,22 +4178,22 @@ function FN_VDotProdMulti(nvec, x, y, dotprods) & farg1 = nvec farg2 = c_loc(x) -farg3 = y +farg3 = y_arr farg4 = c_loc(dotprods(1)) fresult = swigc_FN_VDotProdMulti(farg1, farg2, farg3, farg4) swig_result = fresult end function -function FN_VLinearSumVectorArray(nvec, a, x, b, y, z) & +function FN_VLinearSumVectorArray(nvec, a, x_arr, b, y_arr, z_arr) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec real(C_DOUBLE), intent(in) :: a -type(C_PTR) :: x +type(C_PTR) :: x_arr real(C_DOUBLE), intent(in) :: b -type(C_PTR) :: y -type(C_PTR) :: z +type(C_PTR) :: y_arr +type(C_PTR) :: z_arr integer(C_INT) :: fresult integer(C_INT) :: farg1 real(C_DOUBLE) :: farg2 @@ -4142,22 +4204,22 @@ function FN_VLinearSumVectorArray(nvec, a, x, b, y, z) & farg1 = nvec farg2 = a -farg3 = x +farg3 = x_arr farg4 = b -farg5 = y -farg6 = z +farg5 = y_arr +farg6 = z_arr fresult = swigc_FN_VLinearSumVectorArray(farg1, farg2, farg3, farg4, farg5, farg6) swig_result = fresult end function -function FN_VScaleVectorArray(nvec, c, x, z) & +function FN_VScaleVectorArray(nvec, c, x_arr, z_arr) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec real(C_DOUBLE), dimension(*), target, intent(inout) :: c -type(C_PTR) :: x -type(C_PTR) :: z +type(C_PTR) :: x_arr +type(C_PTR) :: z_arr integer(C_INT) :: fresult integer(C_INT) :: farg1 type(C_PTR) :: farg2 @@ -4166,19 +4228,19 @@ function FN_VScaleVectorArray(nvec, c, x, z) & farg1 = nvec farg2 = c_loc(c(1)) -farg3 = x -farg4 = z +farg3 = x_arr +farg4 = z_arr fresult = swigc_FN_VScaleVectorArray(farg1, farg2, farg3, farg4) swig_result = fresult end function -function FN_VConstVectorArray(nvec, c, z) & +function FN_VConstVectorArray(nvec, c, z_arr) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec real(C_DOUBLE), intent(in) :: c -type(C_PTR) :: z +type(C_PTR) :: z_arr integer(C_INT) :: fresult integer(C_INT) :: farg1 real(C_DOUBLE) :: farg2 @@ -4186,18 +4248,18 @@ function FN_VConstVectorArray(nvec, c, z) & farg1 = nvec farg2 = c -farg3 = z +farg3 = z_arr fresult = swigc_FN_VConstVectorArray(farg1, farg2, farg3) swig_result = fresult end function -function FN_VWrmsNormVectorArray(nvec, x, w, nrm) & +function FN_VWrmsNormVectorArray(nvec, x_arr, w_arr, nrm) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec -type(C_PTR) :: x -type(C_PTR) :: w +type(C_PTR) :: x_arr +type(C_PTR) :: w_arr real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm integer(C_INT) :: fresult integer(C_INT) :: farg1 @@ -4206,20 +4268,20 @@ function FN_VWrmsNormVectorArray(nvec, x, w, nrm) & type(C_PTR) :: farg4 farg1 = nvec -farg2 = x -farg3 = w +farg2 = x_arr +farg3 = w_arr farg4 = c_loc(nrm(1)) fresult = swigc_FN_VWrmsNormVectorArray(farg1, farg2, farg3, farg4) swig_result = fresult end function -function FN_VWrmsNormMaskVectorArray(nvec, x, w, id, nrm) & +function FN_VWrmsNormMaskVectorArray(nvec, x_arr, w_arr, id, nrm) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec -type(C_PTR) :: x -type(C_PTR) :: w +type(C_PTR) :: x_arr +type(C_PTR) :: w_arr type(N_Vector), target, intent(inout) :: id real(C_DOUBLE), dimension(*), target, intent(inout) :: nrm integer(C_INT) :: fresult @@ -4230,8 +4292,8 @@ function FN_VWrmsNormMaskVectorArray(nvec, x, w, id, nrm) & type(C_PTR) :: farg5 farg1 = nvec -farg2 = x -farg3 = w +farg2 = x_arr +farg3 = w_arr farg4 = c_loc(id) farg5 = c_loc(nrm(1)) fresult = swigc_FN_VWrmsNormMaskVectorArray(farg1, farg2, farg3, farg4, farg5) @@ -4379,13 +4441,13 @@ function FN_VMinQuotientLocal(num, denom) & swig_result = fresult end function -function FN_VDotProdMultiLocal(nvec, x, y, dotprods) & +function FN_VDotProdMultiLocal(nvec, x, y_arr, dotprods) & result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result integer(C_INT), intent(in) :: nvec type(N_Vector), target, intent(inout) :: x -type(C_PTR) :: y +type(C_PTR) :: y_arr real(C_DOUBLE), dimension(*), target, intent(inout) :: dotprods integer(C_INT) :: fresult integer(C_INT) :: farg1 @@ -4395,7 +4457,7 @@ function FN_VDotProdMultiLocal(nvec, x, y, dotprods) & farg1 = nvec farg2 = c_loc(x) -farg3 = y +farg3 = y_arr farg4 = c_loc(dotprods(1)) fresult = swigc_FN_VDotProdMultiLocal(farg1, farg2, farg3, farg4) swig_result = fresult @@ -4516,44 +4578,44 @@ function FN_VCloneVectorArray(count, w) & swig_result = fresult end function -subroutine FN_VDestroyVectorArray(vs, count) +subroutine FN_VDestroyVectorArray(vs_arr, count) use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs +type(C_PTR) :: vs_arr integer(C_INT), intent(in) :: count type(C_PTR) :: farg1 integer(C_INT) :: farg2 -farg1 = vs +farg1 = vs_arr farg2 = count call swigc_FN_VDestroyVectorArray(farg1, farg2) end subroutine -function FN_VGetVecAtIndexVectorArray(vs, index) & +function FN_VGetVecAtIndexVectorArray(vs_arr, index) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(N_Vector), pointer :: swig_result -type(C_PTR) :: vs +type(C_PTR) :: vs_arr integer(C_INT), intent(in) :: index type(C_PTR) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 -farg1 = vs +farg1 = vs_arr farg2 = index fresult = swigc_FN_VGetVecAtIndexVectorArray(farg1, farg2) call c_f_pointer(fresult, swig_result) end function -subroutine FN_VSetVecAtIndexVectorArray(vs, index, w) +subroutine FN_VSetVecAtIndexVectorArray(vs_arr, index, w) use, intrinsic :: ISO_C_BINDING -type(C_PTR) :: vs +type(C_PTR) :: vs_arr integer(C_INT), intent(in) :: index type(N_Vector), target, intent(inout) :: w type(C_PTR) :: farg1 integer(C_INT) :: farg2 type(C_PTR) :: farg3 -farg1 = vs +farg1 = vs_arr farg2 = index farg3 = c_loc(w) call swigc_FN_VSetVecAtIndexVectorArray(farg1, farg2, farg3) @@ -6314,7 +6376,7 @@ function FSUNMemoryHelper_Wrap(arg0, ptr, mem_type) & type(C_PTR) :: swig_result type(SUNMemoryHelper_), target, intent(inout) :: arg0 type(C_PTR) :: ptr -integer(SUNMemoryType), intent(in) :: mem_type +integer(SUNMemoryType_), intent(in) :: mem_type type(C_PTR) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -6334,7 +6396,7 @@ function FSUNMemoryHelper_Alloc(arg0, memptr, mem_size, mem_type, queue) & type(SUNMemoryHelper_), target, intent(inout) :: arg0 type(C_PTR), target, intent(inout) :: memptr integer(C_SIZE_T), intent(in) :: mem_size -integer(SUNMemoryType), intent(in) :: mem_type +integer(SUNMemoryType_), intent(in) :: mem_type type(C_PTR) :: queue integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -6360,7 +6422,7 @@ function FSUNMemoryHelper_AllocStrided(arg0, memptr, mem_size, stride, mem_type, type(C_PTR), target, intent(inout) :: memptr integer(C_SIZE_T), intent(in) :: mem_size integer(C_SIZE_T), intent(in) :: stride -integer(SUNMemoryType), intent(in) :: mem_type +integer(SUNMemoryType_), intent(in) :: mem_type type(C_PTR) :: queue integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -6455,7 +6517,7 @@ function FSUNMemoryHelper_GetAllocStats(arg0, mem_type, num_allocations, num_dea use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(SUNMemoryHelper_), target, intent(inout) :: arg0 -integer(SUNMemoryType), intent(in) :: mem_type +integer(SUNMemoryType_), intent(in) :: mem_type integer(C_LONG), target, intent(inout) :: num_allocations integer(C_LONG), target, intent(inout) :: num_deallocations integer(C_SIZE_T), target, intent(inout) :: bytes_allocated @@ -6986,7 +7048,7 @@ function FSUNAdjointStepper_PrintAllStats(adj_stepper, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: adj_stepper type(C_PTR) :: outfile -integer(SUNOutputFormat), intent(in) :: fmt +integer(SUNOutputFormat_), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/sundials/sundials_profiler.c b/src/sundials/sundials_profiler.c index ec0e6ef96a..687e656100 100644 --- a/src/sundials/sundials_profiler.c +++ b/src/sundials/sundials_profiler.c @@ -26,8 +26,8 @@ #include "sundials_debug.h" #include "sundials_hashmap_impl.h" -#include "sundials_profiler_impl.h" #include "sundials_macros.h" +#include "sundials_profiler_impl.h" static sunTimerStruct* sunTimerStructNew(void) { diff --git a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp index 60da238f20..ec87b13167 100644 --- a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp +++ b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp @@ -164,7 +164,8 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc but in device memory for the batched methods. */ retval = SUNMemoryHelper_Alloc(content->memhelp, &content->pivots, M * nblocks * sizeof(sunindextype), - nblocks > 1 ? SUN_MEMTYPE_DEVICE : SUN_MEMTYPE_HOST, + nblocks > 1 ? SUN_MEMTYPE_DEVICE + : SUN_MEMTYPE_HOST, nullptr); if (retval) { diff --git a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c index 75462c2232..7533456409 100644 --- a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c +++ b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.c @@ -343,10 +343,10 @@ SWIGEXPORT int32_t _wrap_FSUNBandMatrix_LData(SUNMatrix farg1) { SWIGEXPORT void * _wrap_FSUNBandMatrix_Cols(SUNMatrix farg1) { void * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - sunrealtype **result = 0 ; + sunrealtype2d result; arg1 = (SUNMatrix)(farg1); - result = (sunrealtype **)SUNBandMatrix_Cols(arg1); + result = (sunrealtype2d)SUNBandMatrix_Cols(arg1); fresult = result; return fresult; } diff --git a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c index 2ba986188f..71ca49acc0 100644 --- a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c +++ b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.c @@ -343,10 +343,10 @@ SWIGEXPORT int64_t _wrap_FSUNBandMatrix_LData(SUNMatrix farg1) { SWIGEXPORT void * _wrap_FSUNBandMatrix_Cols(SUNMatrix farg1) { void * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - sunrealtype **result = 0 ; + sunrealtype2d result; arg1 = (SUNMatrix)(farg1); - result = (sunrealtype **)SUNBandMatrix_Cols(arg1); + result = (sunrealtype2d)SUNBandMatrix_Cols(arg1); fresult = result; return fresult; } diff --git a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu index 02007f0cba..214eaf6807 100644 --- a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu +++ b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu @@ -412,8 +412,8 @@ SUNMatrix SUNMatrix_cuSparse_NewBlockCSR(int nblocks, int blockrows, /* Allocate device memory for the matrix */ alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_colind, - sizeof(int) * blocknnz, SUN_MEMTYPE_DEVICE, - nullptr); + sizeof(int) * blocknnz, + SUN_MEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_rowptr, sizeof(int) * (blockrows + 1), SUN_MEMTYPE_DEVICE, nullptr); diff --git a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c index e1f3bcf860..d5a745b0e2 100644 --- a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c +++ b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.c @@ -273,10 +273,10 @@ SWIGEXPORT int32_t _wrap_FSUNDenseMatrix_LData(SUNMatrix farg1) { SWIGEXPORT void * _wrap_FSUNDenseMatrix_Cols(SUNMatrix farg1) { void * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - sunrealtype **result = 0 ; + sunrealtype2d result; arg1 = (SUNMatrix)(farg1); - result = (sunrealtype **)SUNDenseMatrix_Cols(arg1); + result = (sunrealtype2d)SUNDenseMatrix_Cols(arg1); fresult = result; return fresult; } diff --git a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c index 7c24c28d1e..0e6810623d 100644 --- a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c +++ b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.c @@ -273,10 +273,10 @@ SWIGEXPORT int64_t _wrap_FSUNDenseMatrix_LData(SUNMatrix farg1) { SWIGEXPORT void * _wrap_FSUNDenseMatrix_Cols(SUNMatrix farg1) { void * fresult ; SUNMatrix arg1 = (SUNMatrix) 0 ; - sunrealtype **result = 0 ; + sunrealtype2d result; arg1 = (SUNMatrix)(farg1); - result = (sunrealtype **)SUNDenseMatrix_Cols(arg1); + result = (sunrealtype2d)SUNDenseMatrix_Cols(arg1); fresult = result; return fresult; } diff --git a/src/sunmemory/sycl/sundials_sycl_memory.cpp b/src/sunmemory/sycl/sundials_sycl_memory.cpp index db3b37f661..681d3ea82e 100644 --- a/src/sunmemory/sycl/sundials_sycl_memory.cpp +++ b/src/sunmemory/sycl/sundials_sycl_memory.cpp @@ -240,8 +240,8 @@ SUNErrCode SUNMemoryHelper_Dealloc_Sycl(SUNMemoryHelper helper, SUNMemory mem, free(mem->ptr); mem->ptr = nullptr; } - else if (mem->type == SUN_MEMTYPE_PINNED || mem->type == SUN_MEMTYPE_DEVICE || - mem->type == SUN_MEMTYPE_UVM) + else if (mem->type == SUN_MEMTYPE_PINNED || + mem->type == SUN_MEMTYPE_DEVICE || mem->type == SUN_MEMTYPE_UVM) { if (mem->type == SUN_MEMTYPE_PINNED) { diff --git a/swig/arkode/farkode_arkstep_mod.i b/swig/arkode/farkode_arkstep_mod.i index a60e41b7d4..b8c0535502 100644 --- a/swig/arkode/farkode_arkstep_mod.i +++ b/swig/arkode/farkode_arkstep_mod.i @@ -21,6 +21,7 @@ // include the header file(s) in the c wrapper that is generated %{ #include "arkode/arkode_arkstep.h" +#include "arkode/arkode_arkstep_deprecated.h" %} // Load the typedefs and generate a "use" statements in the module @@ -28,3 +29,4 @@ // Process definitions from these files %include "arkode/arkode_arkstep.h" +%include "arkode/arkode_arkstep_deprecated.h" diff --git a/swig/arkode/farkode_erkstep_mod.i b/swig/arkode/farkode_erkstep_mod.i index 3bc8b9bb4b..f78455595d 100644 --- a/swig/arkode/farkode_erkstep_mod.i +++ b/swig/arkode/farkode_erkstep_mod.i @@ -21,6 +21,7 @@ // include the header file(s) in the c wrapper that is generated %{ #include "arkode/arkode_erkstep.h" +#include "arkode/arkode_erkstep_deprecated.h" %} // Load the typedefs and generate a "use" statements in the module @@ -28,3 +29,5 @@ // Process definitions from these files %include "arkode/arkode_erkstep.h" +%include "arkode/arkode_erkstep_deprecated.h" + diff --git a/swig/arkode/farkode_mristep_mod.i b/swig/arkode/farkode_mristep_mod.i index 5a5b5b5ca7..34e9a737ac 100644 --- a/swig/arkode/farkode_mristep_mod.i +++ b/swig/arkode/farkode_mristep_mod.i @@ -21,6 +21,7 @@ // include the header file(s) in the c wrapper that is generated %{ #include "arkode/arkode_mristep.h" +#include "arkode/arkode_mristep_deprecated.h" %} // Load the typedefs and generate a "use" statements in the module @@ -32,4 +33,5 @@ // Process definitions from these files %include "arkode/arkode_mristep.h" +%include "arkode/arkode_mristep_deprecated.h" diff --git a/swig/arkode/farkode_sprkstep_mod.i b/swig/arkode/farkode_sprkstep_mod.i index d688a180ca..cae0335ea0 100644 --- a/swig/arkode/farkode_sprkstep_mod.i +++ b/swig/arkode/farkode_sprkstep_mod.i @@ -21,6 +21,7 @@ // include the header file(s) in the c wrapper that is generated %{ #include "arkode/arkode_sprkstep.h" +#include "arkode/arkode_sprkstep_deprecated.h" %} // Load the typedefs and generate a "use" statements in the module @@ -28,3 +29,4 @@ // Process definitions from these files %include "arkode/arkode_sprkstep.h" +%include "arkode/arkode_sprkstep_deprecated.h" diff --git a/swig/sundials/fsundials.i b/swig/sundials/fsundials.i index 3c10557466..3b6ef67665 100644 --- a/swig/sundials/fsundials.i +++ b/swig/sundials/fsundials.i @@ -52,6 +52,7 @@ // Assume sunrealtype* is an array of doubles %apply double[] { sunrealtype* }; +%apply double[] { sunrealtype1d }; #ifdef GENERATE_INT32 %apply int[] { sunindextype* }; From b5d8c191eeb80a604d741eba29270529255a1db0 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 13:42:57 -0700 Subject: [PATCH 13/26] no anonymous enums --- include/arkode/arkode.h | 13 ++++++++----- include/arkode/arkode_butcher_dirk.h | 6 ++++-- include/arkode/arkode_butcher_erk.h | 6 ++++-- include/arkode/arkode_lsrkstep.h | 6 ++++-- include/arkode/arkode_mristep.h | 14 +++++++++----- include/arkode/arkode_sprk.h | 8 +++++--- include/sundials/sundials_adaptcontroller.h | 8 +++++--- include/sundials/sundials_linearsolver.h | 12 ++++++++---- include/sundials/sundials_logger.h | 6 ++++-- include/sundials/sundials_matrix.h | 8 +++++--- include/sundials/sundials_nonlinearsolver.h | 6 ++++-- include/sundials/sundials_stepper.h | 6 ++++-- src/sundials/sundials_datanode.h | 8 +++++--- 13 files changed, 69 insertions(+), 38 deletions(-) diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index 82520a6e1d..7b1c80c6fa 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -197,24 +197,27 @@ typedef _SUNDIALS_STRUCT_ _MRIStepInnerStepper* MRIStepInnerStepper; /* -------------------------- * Relaxation Solver Options * -------------------------- */ - -typedef enum +enum ARKRelaxSolver_ { ARK_RELAX_BRENT, ARK_RELAX_NEWTON -} ARKRelaxSolver; +}; + +typedef enum ARKRelaxSolver_ ARKRelaxSolver; /* -------------------------- * Error Accumulation Options * -------------------------- */ -typedef enum +enum ARKAccumError { ARK_ACCUMERROR_NONE, ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, ARK_ACCUMERROR_AVG -} ARKAccumError; +}; + +typedef enum ARKAccumError_ ARKAccumError; /* -------------------------- * Shared API routines diff --git a/include/arkode/arkode_butcher_dirk.h b/include/arkode/arkode_butcher_dirk.h index 9aa37dddfe..7239c516bf 100644 --- a/include/arkode/arkode_butcher_dirk.h +++ b/include/arkode/arkode_butcher_dirk.h @@ -23,7 +23,7 @@ extern "C" { #endif -typedef enum +enum ARKODE_DIRKTableID_ { ARKODE_DIRK_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_DIRK_NUM = 100, @@ -55,7 +55,9 @@ typedef enum ARKODE_IMPLICIT_MIDPOINT_1_2, ARKODE_IMPLICIT_TRAPEZOIDAL_2_2, ARKODE_MAX_DIRK_NUM = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 -} ARKODE_DIRKTableID; +}; + +typedef enum ARKODE_DIRKTableID_ ARKODE_DIRKTableID; /* Accessor routine to load built-in DIRK table */ SUNDIALS_EXPORT ARKodeButcherTable diff --git a/include/arkode/arkode_butcher_erk.h b/include/arkode/arkode_butcher_erk.h index ec96c050c6..4fcda9b330 100644 --- a/include/arkode/arkode_butcher_erk.h +++ b/include/arkode/arkode_butcher_erk.h @@ -23,7 +23,7 @@ extern "C" { #endif -typedef enum +enum ARKODE_ERKTableID_ { ARKODE_ERK_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_ERK_NUM = 0, @@ -55,7 +55,9 @@ typedef enum ARKODE_RALSTON_3_1_2, ARKODE_TSITOURAS_7_4_5, ARKODE_MAX_ERK_NUM = ARKODE_TSITOURAS_7_4_5 -} ARKODE_ERKTableID; +}; + +typedef enum ARKODE_ERKTableID_ ARKODE_ERKTableID; /* Accessor routine to load built-in ERK table */ SUNDIALS_EXPORT ARKodeButcherTable diff --git a/include/arkode/arkode_lsrkstep.h b/include/arkode/arkode_lsrkstep.h index a8262b2344..9994a8760d 100644 --- a/include/arkode/arkode_lsrkstep.h +++ b/include/arkode/arkode_lsrkstep.h @@ -32,14 +32,16 @@ typedef int (*ARKDomEigFn)(sunrealtype t, N_Vector y, N_Vector fn, * LSRKStep Constants * ------------------ */ -typedef enum +enum ARKODE_LSRKMethodType_ { ARKODE_LSRK_RKC_2, ARKODE_LSRK_RKL_2, ARKODE_LSRK_SSP_S_2, ARKODE_LSRK_SSP_S_3, ARKODE_LSRK_SSP_10_4 -} ARKODE_LSRKMethodType; +}; + +typedef enum ARKODE_LSRKMethodType_ ARKODE_LSRKMethodType; /* ------------------- * Exported Functions diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index a229ec56c3..2ac5c228df 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -35,21 +35,23 @@ extern "C" { * ----------------- */ /* MRIStep method types */ -typedef enum +enum MRISTEP_METHOD_TYPE_ { MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX, MRISTEP_MERK, MRISTEP_SR -} MRISTEP_METHOD_TYPE; +}; + +typedef enum MRISTEP_METHOD_TYPE_ MRISTEP_METHOD_TYPE; /* MRI coupling table IDs */ -typedef enum +enum ARKODE_MRITableID_ { ARKODE_MRI_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_MRI_NUM = 200, - ARKODE_MIS_KW3 = ARKODE_MIN_MRI_NUM, + ARKODE_MIS_KW3 = 200, ARKODE_MRI_GARK_ERK33a, ARKODE_MRI_GARK_ERK45a, ARKODE_MRI_GARK_IRK21a, @@ -76,7 +78,9 @@ typedef enum ARKODE_IMEX_MRI_SR32, ARKODE_IMEX_MRI_SR43, ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_SR43 -} ARKODE_MRITableID; +}; + +typedef enum ARKODE_MRITableID_ ARKODE_MRITableID; /* Default MRI coupling tables for each order and type */ static const int MRISTEP_DEFAULT_EXPL_1 = ARKODE_MRI_GARK_FORWARD_EULER; diff --git a/include/arkode/arkode_sprk.h b/include/arkode/arkode_sprk.h index 0c517a819d..f5bdb90c30 100644 --- a/include/arkode/arkode_sprk.h +++ b/include/arkode/arkode_sprk.h @@ -24,11 +24,11 @@ extern "C" { #endif -typedef enum +enum ARKODE_SPRKMethodID_ { ARKODE_SPRK_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_SPRK_NUM = 0, - ARKODE_SPRK_EULER_1_1 = ARKODE_MIN_SPRK_NUM, + ARKODE_SPRK_EULER_1_1 = 0, ARKODE_SPRK_LEAPFROG_2_2, ARKODE_SPRK_PSEUDO_LEAPFROG_2_2, ARKODE_SPRK_RUTH_3_3, @@ -41,7 +41,9 @@ typedef enum ARKODE_SPRK_SUZUKI_UMENO_8_16, ARKODE_SPRK_SOFRONIOU_10_36, ARKODE_MAX_SPRK_NUM = ARKODE_SPRK_SOFRONIOU_10_36 -} ARKODE_SPRKMethodID; +}; + +typedef enum ARKODE_SPRKMethodID_ ARKODE_SPRKMethodID; struct ARKodeSPRKTableMem { diff --git a/include/sundials/sundials_adaptcontroller.h b/include/sundials/sundials_adaptcontroller.h index 86eb1a5ece..8078dfa9d4 100644 --- a/include/sundials/sundials_adaptcontroller.h +++ b/include/sundials/sundials_adaptcontroller.h @@ -36,13 +36,15 @@ extern "C" { * H - controls a single-rate step size * MRI_H_TOL - controls slow step and fast relative tolerances * ----------------------------------------------------------------- */ - -typedef enum + +enum SUNAdaptController_Type_ { SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H, SUN_ADAPTCONTROLLER_MRI_H_TOL -} SUNAdaptController_Type; +}; + +typedef enum SUNAdaptController_Type_ SUNAdaptController_Type; /* ----------------------------------------------------------------- * Generic definition of SUNAdaptController diff --git a/include/sundials/sundials_linearsolver.h b/include/sundials/sundials_linearsolver.h index c3cd942c29..d31e4b0a1a 100644 --- a/include/sundials/sundials_linearsolver.h +++ b/include/sundials/sundials_linearsolver.h @@ -69,15 +69,17 @@ extern "C" { * Implemented SUNLinearSolver types and IDs: * ----------------------------------------------------------------- */ -typedef enum +enum SUNLinearSolver_Type_ { SUNLINEARSOLVER_DIRECT, SUNLINEARSOLVER_ITERATIVE, SUNLINEARSOLVER_MATRIX_ITERATIVE, SUNLINEARSOLVER_MATRIX_EMBEDDED -} SUNLinearSolver_Type; +}; + +typedef enum SUNLinearSolver_Type_ SUNLinearSolver_Type; -typedef enum +enum SUNLinearSolver_ID_ { SUNLINEARSOLVER_BAND, SUNLINEARSOLVER_DENSE, @@ -97,7 +99,9 @@ typedef enum SUNLINEARSOLVER_GINKGO, SUNLINEARSOLVER_KOKKOSDENSE, SUNLINEARSOLVER_CUSTOM -} SUNLinearSolver_ID; +}; + +typedef enum SUNLinearSolver_ID_ SUNLinearSolver_ID; /* ----------------------------------------------------------------- * Generic definition of SUNLinearSolver diff --git a/include/sundials/sundials_logger.h b/include/sundials/sundials_logger.h index 45ddd923a9..2297204c0d 100644 --- a/include/sundials/sundials_logger.h +++ b/include/sundials/sundials_logger.h @@ -23,7 +23,7 @@ extern "C" { #endif -typedef enum +enum SUNLogLevel_ { SUN_LOGLEVEL_ALL = -1, SUN_LOGLEVEL_NONE = 0, @@ -31,7 +31,9 @@ typedef enum SUN_LOGLEVEL_WARNING = 2, SUN_LOGLEVEL_INFO = 3, SUN_LOGLEVEL_DEBUG = 4 -} SUNLogLevel; +}; + +typedef enum SUNLogLevel_ SUNLogLevel; SUNDIALS_EXPORT SUNErrCode SUNLogger_Create(SUNComm comm, int output_rank, SUNLogger* logger); diff --git a/include/sundials/sundials_matrix.h b/include/sundials/sundials_matrix.h index 1acb16fd86..d244d15fb0 100644 --- a/include/sundials/sundials_matrix.h +++ b/include/sundials/sundials_matrix.h @@ -56,8 +56,8 @@ extern "C" { /* ----------------------------------------------------------------- * Implemented SUNMatrix types * ----------------------------------------------------------------- */ - -typedef enum + +enum SUNMatrix_ID_ { SUNMATRIX_DENSE, SUNMATRIX_MAGMADENSE, @@ -69,7 +69,9 @@ typedef enum SUNMATRIX_GINKGO, SUNMATRIX_KOKKOSDENSE, SUNMATRIX_CUSTOM -} SUNMatrix_ID; +}; + +typedef enum SUNMatrix_ID_ SUNMatrix_ID; /* ----------------------------------------------------------------- * Generic definition of SUNMatrix diff --git a/include/sundials/sundials_nonlinearsolver.h b/include/sundials/sundials_nonlinearsolver.h index ca1566cd8e..f95537b9b3 100644 --- a/include/sundials/sundials_nonlinearsolver.h +++ b/include/sundials/sundials_nonlinearsolver.h @@ -86,11 +86,13 @@ typedef int (*SUNNonlinSolConvTestFn)(SUNNonlinearSolver NLS, N_Vector y, * SUNNonlinearSolver types * ---------------------------------------------------------------------------*/ -typedef enum +enum SUNNonlinearSolver_Type_ { SUNNONLINEARSOLVER_ROOTFIND, SUNNONLINEARSOLVER_FIXEDPOINT -} SUNNonlinearSolver_Type; +}; + +typedef enum SUNNonlinearSolver_Type_ SUNNonlinearSolver_Type; /* ----------------------------------------------------------------------------- * Generic definition of SUNNonlinearSolver diff --git a/include/sundials/sundials_stepper.h b/include/sundials/sundials_stepper.h index cba8f37f8f..56421df7a2 100644 --- a/include/sundials/sundials_stepper.h +++ b/include/sundials/sundials_stepper.h @@ -21,12 +21,14 @@ extern "C" { #endif -typedef enum +enum SUNFullRhsMode_ { SUN_FULLRHS_START, SUN_FULLRHS_END, SUN_FULLRHS_OTHER -} SUNFullRhsMode; +}; + +typedef enum SUNFullRhsMode_ SUNFullRhsMode; typedef int (*SUNRhsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void* user_data, N_Vector tmp1, diff --git a/src/sundials/sundials_datanode.h b/src/sundials/sundials_datanode.h index f6dd6cd359..e7a1672b11 100644 --- a/src/sundials/sundials_datanode.h +++ b/src/sundials/sundials_datanode.h @@ -30,12 +30,14 @@ extern "C" { typedef int64_t sundataindex; -typedef enum -{ +enum SUNDataNodeType_ +{ SUNDATANODE_LEAF, SUNDATANODE_LIST, SUNDATANODE_OBJECT -} SUNDataNodeType; +}; + +typedef enum SUNDataNodeType_ SUNDataNodeType; typedef struct SUNDataNode_Ops_* SUNDataNode_Ops; typedef struct SUNDataNode_* SUNDataNode; From 4e0d03ed29dcfde8fe1f068378c4aeff95b8cd24 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 13:43:54 -0700 Subject: [PATCH 14/26] move SPRKStepSetUseCompensatedSums --- include/arkode/arkode_sprkstep.h | 2 -- include/arkode/arkode_sprkstep_deprecated.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/arkode/arkode_sprkstep.h b/include/arkode/arkode_sprkstep.h index 084461ac55..7b3ee486f5 100644 --- a/include/arkode/arkode_sprkstep.h +++ b/include/arkode/arkode_sprkstep.h @@ -49,8 +49,6 @@ SUNDIALS_EXPORT int SPRKStepReInit(void* arkode_mem, ARKRhsFn f1, ARKRhsFn f2, sunrealtype t0, N_Vector y0); /* Optional input functions -- must be called AFTER SPRKStepCreate */ -SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUseCompensatedSums instead") -int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff); SUNDIALS_EXPORT int SPRKStepSetMethod(void* arkode_mem, ARKodeSPRKTable sprk_storage); SUNDIALS_EXPORT int SPRKStepSetMethodName(void* arkode_mem, const char* method); diff --git a/include/arkode/arkode_sprkstep_deprecated.h b/include/arkode/arkode_sprkstep_deprecated.h index ca40fcd05e..50566df9db 100644 --- a/include/arkode/arkode_sprkstep_deprecated.h +++ b/include/arkode/arkode_sprkstep_deprecated.h @@ -89,6 +89,8 @@ SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeFree instead") void SPRKStepFree(void** arkode_mem); SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeGetNumRhsEvals instead") int SPRKStepGetNumRhsEvals(void* arkode_mem, long int* nf1, long int* nf2); +SUNDIALS_DEPRECATED_EXPORT_MSG("use ARKodeSetUseCompensatedSums instead") +int SPRKStepSetUseCompensatedSums(void* arkode_mem, sunbooleantype onoff); #ifdef __cplusplus } From 3fd9b27b89ca0c2eb470ba1a90492e0b780cdb5b Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 13:49:02 -0700 Subject: [PATCH 15/26] undo SUN_MEMTYPE / SUN_DATAIOMODE switch --- .../raja/ParallelGrid.hpp | 14 ++--- .../sunadjoint/SUNAdjointCheckpointScheme.rst | 2 +- doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst | 4 +- .../sunmatrix/SUNMatrix_OneMklDense.rst | 4 +- doc/shared/sunmemory/SUNMemory_CUDA.rst | 8 +-- .../sunmemory/SUNMemory_Description.rst | 8 +-- doc/shared/sunmemory/SUNMemory_HIP.rst | 8 +-- doc/shared/sunmemory/SUNMemory_SYCL.rst | 8 +-- .../arkode/C_serial/ark_lotka_volterra_ASA.c | 2 +- .../CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp | 2 +- .../cvode/magma/cv_bruss_batched_magma.cpp | 4 +- examples/utilities/custom_memory_helper_gpu.h | 24 ++++---- .../utilities/custom_memory_helper_sycl.h | 14 ++--- include/sundials/sundials_memory.h | 15 ++--- include/sundials/sundials_types.h | 5 +- src/nvector/cuda/nvector_cuda.cu | 56 +++++++++---------- src/nvector/hip/nvector_hip.hip.cpp | 44 +++++++-------- src/nvector/raja/nvector_raja.cpp | 42 +++++++------- src/nvector/sycl/nvector_sycl.cpp | 56 +++++++++---------- src/sundials/sundatanode/sundatanode_inmem.c | 6 +- src/sundials/sundials_datanode.c | 6 +- src/sundials/sundials_memory.c | 4 +- .../magmadense/sunlinsol_magmadense.cpp | 10 ++-- src/sunmatrix/cusparse/sunmatrix_cusparse.cu | 32 +++++------ .../magmadense/sunmatrix_magmadense.cpp | 6 +- .../onemkldense/sunmatrix_onemkldense.cpp | 6 +- src/sunmemory/cuda/sundials_cuda_memory.cu | 56 +++++++++---------- src/sunmemory/hip/sundials_hip_memory.hip.cpp | 56 +++++++++---------- src/sunmemory/sycl/sundials_sycl_memory.cpp | 30 +++++----- src/sunmemory/system/sundials_system_memory.c | 14 ++--- .../sundials/test_sundials_datanode.cpp | 20 +++---- .../magmadense/test_sunlinsol_magmadense.cpp | 4 +- .../test_sunlinsol_onemkldense.cpp | 4 +- .../magmadense/test_sunmatrix_magmadense.cpp | 2 +- .../test_sunmatrix_onemkldense.cpp | 2 +- .../sunmemory/cuda/test_sunmemory_cuda.cu | 14 ++--- .../sunmemory/hip/test_sunmemory_hip.cpp | 14 ++--- .../sunmemory/sycl/test_sunmemory_sycl.cpp | 14 ++--- .../sunmemory/sys/test_sunmemory_sys.cpp | 4 +- 39 files changed, 307 insertions(+), 317 deletions(-) diff --git a/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp b/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp index 951552be61..50e32e8a6c 100644 --- a/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp +++ b/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp @@ -549,25 +549,25 @@ class ParallelGrid SUNMemoryType memoryType() { SUNMemory test; - if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUN_MEMTYPE_PINNED, + if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE__PINNED, nullptr)) { SUNMemoryHelper_Dealloc(memhelp, test, nullptr); - return (SUN_MEMTYPE_PINNED); + return (SUNMEMTYPE__PINNED); } - if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUN_MEMTYPE_DEVICE, + if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE__DEVICE, nullptr)) { SUNMemoryHelper_Dealloc(memhelp, test, nullptr); - return (SUN_MEMTYPE_DEVICE); + return (SUNMEMTYPE__DEVICE); } - if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUN_MEMTYPE_UVM, + if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE__UVM, nullptr)) { SUNMemoryHelper_Dealloc(memhelp, test, nullptr); - return (SUN_MEMTYPE_UVM); + return (SUNMEMTYPE__UVM); } - else { return (SUN_MEMTYPE_HOST); } + else { return (SUNMEMTYPE__HOST); } } }; diff --git a/doc/shared/sunadjoint/SUNAdjointCheckpointScheme.rst b/doc/shared/sunadjoint/SUNAdjointCheckpointScheme.rst index 2fc9daf810..66bfc603d5 100644 --- a/doc/shared/sunadjoint/SUNAdjointCheckpointScheme.rst +++ b/doc/shared/sunadjoint/SUNAdjointCheckpointScheme.rst @@ -29,7 +29,7 @@ and a structure of function pointers to the derived class implementations of the .. c:enum:: SUNDataIOMode - .. c:enumerator:: SUN_DATAIOMODE_INMEM + .. c:enumerator:: SUNDATAIOMODE_INMEM The IO mode for data that is stored in addressable random access memory. The location of the memory (e.g., CPU or GPU) is not specified by this mode. diff --git a/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst b/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst index 6cfd8d0447..a3586996af 100644 --- a/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst @@ -80,7 +80,7 @@ implementation specific functions: * *M* -- the number of matrix rows. * *N* -- the number of matrix columns. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUN_MEMTYPE_UVM`` or ``SUN_MEMTYPE_DEVICE``. + ``SUNMEMTYPE__UVM`` or ``SUNMEMTYPE__DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- a ``cudaStream_t`` when using CUDA or a ``hipStream_t`` when using HIP. @@ -100,7 +100,7 @@ implementation specific functions: * *M_block* -- the number of matrix rows in each block. * *N_block* -- the number of matrix columns in each block. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUN_MEMTYPE_UVM`` or ``SUN_MEMTYPE_DEVICE``. + ``SUNMEMTYPE__UVM`` or ``SUNMEMTYPE__DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- a ``cudaStream_t`` when using CUDA or a ``hipStream_t`` when using HIP. diff --git a/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst b/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst index 0c62f4c246..04562f277a 100644 --- a/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst @@ -80,7 +80,7 @@ Constructors * *M* -- the number of matrix rows. * *N* -- the number of matrix columns. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUN_MEMTYPE_UVM`` or ``SUN_MEMTYPE_DEVICE``. + ``SUNMEMTYPE__UVM`` or ``SUNMEMTYPE__DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- the SYCL queue to which operations will be submitted. * *sunctx* -- the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) @@ -100,7 +100,7 @@ Constructors * *M_block* -- the number of matrix rows in each block. * *N_block* -- the number of matrix columns in each block. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUN_MEMTYPE_UVM`` or ``SUN_MEMTYPE_DEVICE``. + ``SUNMEMTYPE__UVM`` or ``SUNMEMTYPE__DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- the SYCL queue to which operations will be submitted. * *sunctx* -- the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) diff --git a/doc/shared/sunmemory/SUNMemory_CUDA.rst b/doc/shared/sunmemory/SUNMemory_CUDA.rst index ca475a9b92..2ebec7c0df 100644 --- a/doc/shared/sunmemory/SUNMemory_CUDA.rst +++ b/doc/shared/sunmemory/SUNMemory_CUDA.rst @@ -52,10 +52,10 @@ The implementation provides the following operations defined by the :param memptr: pointer to the allocated ``SUNMemory``. :param mem_size: the size in bytes of the ``ptr``. :param mem_type: the ``SUNMemoryType`` of the ``ptr``. Supported values are: - * ``SUN_MEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. - * ``SUN_MEMTYPE_PINNED`` -- memory is allocated with a call to ``cudaMallocHost``. - * ``SUN_MEMTYPE_DEVICE`` -- memory is allocated with a call to ``cudaMalloc``. - * ``SUN_MEMTYPE_UVM`` -- memory is allocated with a call to ``cudaMallocManaged``. + * ``SUNMEMTYPE__HOST`` -- memory is allocated with a call to ``malloc``. + * ``SUNMEMTYPE__PINNED`` -- memory is allocated with a call to ``cudaMallocHost``. + * ``SUNMEMTYPE__DEVICE`` -- memory is allocated with a call to ``cudaMalloc``. + * ``SUNMEMTYPE__UVM`` -- memory is allocated with a call to ``cudaMallocManaged``. :param queue: currently unused. :return: A new :c:type:`SUNMemory` object. diff --git a/doc/shared/sunmemory/SUNMemory_Description.rst b/doc/shared/sunmemory/SUNMemory_Description.rst index 2699100a6e..760a30e7c0 100644 --- a/doc/shared/sunmemory/SUNMemory_Description.rst +++ b/doc/shared/sunmemory/SUNMemory_Description.rst @@ -66,19 +66,19 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, The :c:type:`SUNMemoryType` type is an enumeration that defines the supported memory types: - .. c:enumerator:: SUN_MEMTYPE_HOST + .. c:enumerator:: SUNMEMTYPE__HOST Pageable memory accessible on the host - .. c:enumerator:: SUN_MEMTYPE_PINNED + .. c:enumerator:: SUNMEMTYPE__PINNED Page-locked memory accessible on the host - .. c:enumerator:: SUN_MEMTYPE_DEVICE + .. c:enumerator:: SUNMEMTYPE__DEVICE Memory accessible from the device - .. c:enumerator:: SUN_MEMTYPE_UVM + .. c:enumerator:: SUNMEMTYPE__UVM Memory accessible from the host or device diff --git a/doc/shared/sunmemory/SUNMemory_HIP.rst b/doc/shared/sunmemory/SUNMemory_HIP.rst index 98d62b22c4..ecf929f70c 100644 --- a/doc/shared/sunmemory/SUNMemory_HIP.rst +++ b/doc/shared/sunmemory/SUNMemory_HIP.rst @@ -52,10 +52,10 @@ The implementation provides the following operations defined by the :param memptr: pointer to the allocated ``SUNMemory``. :param mem_size: the size in bytes of the ``ptr``. :param mem_type: the ``SUNMemoryType`` of the ``ptr``. Supported values are: - * ``SUN_MEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. - * ``SUN_MEMTYPE_PINNED`` -- memory is allocated with a call to ``hipMallocHost``. - * ``SUN_MEMTYPE_DEVICE`` -- memory is allocated with a call to ``hipMalloc``. - * ``SUN_MEMTYPE_UVM`` -- memory is allocated with a call to ``hipMallocManaged``. + * ``SUNMEMTYPE__HOST`` -- memory is allocated with a call to ``malloc``. + * ``SUNMEMTYPE__PINNED`` -- memory is allocated with a call to ``hipMallocHost``. + * ``SUNMEMTYPE__DEVICE`` -- memory is allocated with a call to ``hipMalloc``. + * ``SUNMEMTYPE__UVM`` -- memory is allocated with a call to ``hipMallocManaged``. :param queue: currently unused. :return: A new :c:type:`SUNMemory` object. diff --git a/doc/shared/sunmemory/SUNMemory_SYCL.rst b/doc/shared/sunmemory/SUNMemory_SYCL.rst index 091fb1c345..006c55be3c 100644 --- a/doc/shared/sunmemory/SUNMemory_SYCL.rst +++ b/doc/shared/sunmemory/SUNMemory_SYCL.rst @@ -52,10 +52,10 @@ The implementation provides the following operations defined by the :param memptr: pointer to the allocated ``SUNMemory``. :param mem_size: the size in bytes of the ``ptr``. :param mem_type: the ``SUNMemoryType`` of the ``ptr``. Supported values are: - * ``SUN_MEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. - * ``SUN_MEMTYPE_PINNED`` -- memory is allocated with a call to ``sycl::malloc_host``. - * ``SUN_MEMTYPE_DEVICE`` -- memory is allocated with a call to ``sycl::malloc_device``. - * ``SUN_MEMTYPE_UVM`` -- memory is allocated with a call to ``sycl::malloc_shared``. + * ``SUNMEMTYPE__HOST`` -- memory is allocated with a call to ``malloc``. + * ``SUNMEMTYPE__PINNED`` -- memory is allocated with a call to ``sycl::malloc_host``. + * ``SUNMEMTYPE__DEVICE`` -- memory is allocated with a call to ``sycl::malloc_device``. + * ``SUNMEMTYPE__UVM`` -- memory is allocated with a call to ``sycl::malloc_shared``. :param queue: the ``sycl::queue`` handle for the stream that the allocation will be performed on. :return: A new :c:type:`SUNMemory` object. diff --git a/examples/arkode/C_serial/ark_lotka_volterra_ASA.c b/examples/arkode/C_serial/ark_lotka_volterra_ASA.c index cae86a3a1a..f3ac027d7c 100644 --- a/examples/arkode/C_serial/ark_lotka_volterra_ASA.c +++ b/examples/arkode/C_serial/ark_lotka_volterra_ASA.c @@ -131,7 +131,7 @@ int main(int argc, char* argv[]) SUNAdjointCheckpointScheme checkpoint_scheme = NULL; SUNMemoryHelper mem_helper = SUNMemoryHelper_Sys(sunctx); - retval = SUNAdjointCheckpointScheme_Create_Fixed(SUN_DATAIOMODE_INMEM, + retval = SUNAdjointCheckpointScheme_Create_Fixed(SUNDATAIOMODE_INMEM, mem_helper, check_interval, ncheck, keep_check, sunctx, &checkpoint_scheme); diff --git a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp index ab598b577e..d0b0ae2eea 100644 --- a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp +++ b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp @@ -208,7 +208,7 @@ int main(int argc, char* argv[]) { // Create SUNMatrix for use in linear solves A = SUNMatrix_OneMklDenseBlock(ngroups, GROUPSIZE, GROUPSIZE, - SUN_MEMTYPE_DEVICE, memhelper, &myQueue, + SUNMEMTYPE__DEVICE, memhelper, &myQueue, sunctx); if (check_retval((void*)A, "SUNMatrix_OneMklDenseBlock", 0)) { return 1; } diff --git a/examples/cvode/magma/cv_bruss_batched_magma.cpp b/examples/cvode/magma/cv_bruss_batched_magma.cpp index ab9387c9a1..deee81514f 100644 --- a/examples/cvode/magma/cv_bruss_batched_magma.cpp +++ b/examples/cvode/magma/cv_bruss_batched_magma.cpp @@ -131,7 +131,7 @@ class Array public: Array(I size, SUNMemoryHelper helper) : helper_(helper), mem_(nullptr) { - SUNMemoryHelper_Alloc(helper, &mem_, size * sizeof(T), SUN_MEMTYPE_UVM, NULL); + SUNMemoryHelper_Alloc(helper, &mem_, size * sizeof(T), SUNMEMTYPE__UVM, NULL); } Array(SUNMemory mem, SUNMemoryHelper helper) : helper_(helper), mem_(mem) {} @@ -301,7 +301,7 @@ int main(int argc, char* argv[]) { /* Create SUNMatrix for use in linear solves */ A = SUNMatrix_MagmaDenseBlock(udata.nbatches, udata.batchSize, - udata.batchSize, SUN_MEMTYPE_DEVICE, memhelper, + udata.batchSize, SUNMEMTYPE__DEVICE, memhelper, NULL, sunctx); if (check_retval((void*)A, "SUNMatrix_MagmaDenseBlock", 0)) { return (1); } diff --git a/examples/utilities/custom_memory_helper_gpu.h b/examples/utilities/custom_memory_helper_gpu.h index ef9bb219d5..4418ebe421 100644 --- a/examples/utilities/custom_memory_helper_gpu.h +++ b/examples/utilities/custom_memory_helper_gpu.h @@ -59,7 +59,7 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, mem->ptr = NULL; mem->own = SUNTRUE; - if (mem_type == SUN_MEMTYPE_HOST) + if (mem_type == SUNMEMTYPE__HOST) { mem->ptr = malloc(mem_size); if (mem->ptr == NULL) @@ -67,12 +67,12 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, free(mem); return (-1); } - mem->type = SUN_MEMTYPE_HOST; + mem->type = SUNMEMTYPE__HOST; } - else if (mem_type == SUN_MEMTYPE_UVM || mem_type == SUN_MEMTYPE_DEVICE) + else if (mem_type == SUNMEMTYPE__UVM || mem_type == SUNMEMTYPE__DEVICE) { MY_GPUCHK(MY_GPU(Malloc)(&(mem->ptr), mem_size)); - mem->type = SUN_MEMTYPE_DEVICE; + mem->type = SUNMEMTYPE__DEVICE; } else { @@ -90,12 +90,12 @@ int MyMemoryHelper_Dealloc(SUNMemoryHelper helper, SUNMemory mem, void* queue) if (mem->ptr && mem->own) { - if (mem->type == SUN_MEMTYPE_HOST) + if (mem->type == SUNMEMTYPE__HOST) { free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUN_MEMTYPE_DEVICE) + else if (mem->type == SUNMEMTYPE__DEVICE) { MY_GPUCHK(MY_GPU(Free)(mem->ptr)); mem->ptr = NULL; @@ -113,24 +113,24 @@ int MyMemoryHelper_Copy(SUNMemoryHelper helper, SUNMemory dst, SUNMemory src, { switch (src->type) { - case SUN_MEMTYPE_HOST: - if (dst->type == SUN_MEMTYPE_HOST) + case SUNMEMTYPE__HOST: + if (dst->type == SUNMEMTYPE__HOST) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUN_MEMTYPE_DEVICE) + else if (dst->type == SUNMEMTYPE__DEVICE) { MY_GPUCHK(MY_GPU(Memcpy)(dst->ptr, src->ptr, memory_size, MY_GPU(MemcpyHostToDevice))); } break; - case SUN_MEMTYPE_DEVICE: - if (dst->type == SUN_MEMTYPE_HOST) + case SUNMEMTYPE__DEVICE: + if (dst->type == SUNMEMTYPE__HOST) { MY_GPUCHK(MY_GPU(Memcpy)(dst->ptr, src->ptr, memory_size, MY_GPU(MemcpyDeviceToHost))); } - else if (dst->type == SUN_MEMTYPE_DEVICE) + else if (dst->type == SUNMEMTYPE__DEVICE) { MY_GPUCHK(MY_GPU(Memcpy)(dst->ptr, src->ptr, memory_size, MY_GPU(MemcpyDeviceToDevice))); diff --git a/examples/utilities/custom_memory_helper_sycl.h b/examples/utilities/custom_memory_helper_sycl.h index d6ae839487..2d26e9f1a5 100644 --- a/examples/utilities/custom_memory_helper_sycl.h +++ b/examples/utilities/custom_memory_helper_sycl.h @@ -34,7 +34,7 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, mem->ptr = NULL; mem->own = SUNTRUE; - if (mem_type == SUN_MEMTYPE_HOST) + if (mem_type == SUNMEMTYPE__HOST) { mem->ptr = malloc(mem_size); if (mem->ptr == NULL) @@ -42,9 +42,9 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, free(mem); return -1; } - mem->type = SUN_MEMTYPE_HOST; + mem->type = SUNMEMTYPE__HOST; } - else if (mem_type == SUN_MEMTYPE_DEVICE) + else if (mem_type == SUNMEMTYPE__DEVICE) { mem->ptr = sycl::malloc_device(mem_size, *sycl_queue); if (mem->ptr == NULL) @@ -52,7 +52,7 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, free(mem); return -1; } - mem->type = SUN_MEMTYPE_DEVICE; + mem->type = SUNMEMTYPE__DEVICE; } else { @@ -74,12 +74,12 @@ int MyMemoryHelper_Dealloc(SUNMemoryHelper helper, SUNMemory mem, void* queue) sycl::queue* sycl_queue = static_cast(queue); - if (mem->type == SUN_MEMTYPE_HOST) + if (mem->type == SUNMEMTYPE__HOST) { free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUN_MEMTYPE_DEVICE) + else if (mem->type == SUNMEMTYPE__DEVICE) { sycl::free(mem->ptr, *sycl_queue); mem->ptr = NULL; @@ -98,7 +98,7 @@ int MyMemoryHelper_Copy(SUNMemoryHelper helper, SUNMemory dst, SUNMemory src, if (!queue) return -1; sycl::queue* sycl_queue = static_cast(queue); - if (src->type == SUN_MEMTYPE_HOST && dst->type == SUN_MEMTYPE_HOST) + if (src->type == SUNMEMTYPE__HOST && dst->type == SUNMEMTYPE__HOST) { memcpy(dst->ptr, src->ptr, memory_size); } diff --git a/include/sundials/sundials_memory.h b/include/sundials/sundials_memory.h index a856b0b962..a629005698 100644 --- a/include/sundials/sundials_memory.h +++ b/include/sundials/sundials_memory.h @@ -27,20 +27,13 @@ extern "C" { enum SUNMemoryType_ { - SUN_MEMTYPE_HOST, /* pageable memory accessible on the host */ - SUN_MEMTYPE_PINNED, /* page-locked memory accessible on the host */ - SUN_MEMTYPE_DEVICE, /* memory accessible from the device */ - SUN_MEMTYPE_UVM /* memory accessible from the host or device */ + SUNMEMTYPE_HOST, /* pageable memory accessible on the host */ + SUNMEMTYPE_PINNED, /* page-locked memory accessible on the host */ + SUNMEMTYPE_DEVICE, /* memory accessible from the device */ + SUNMEMTYPE_UVM /* memory accessible from the host or device */ }; typedef enum SUNMemoryType_ SUNMemoryType; - -/* For backwards compatibility with the old name */ -#define SUN_MEMTYPE_HOST SUN_MEMTYPE_HOST -#define SUN_MEMTYPE_PINNED SUN_MEMTYPE_PINNED -#define SUN_MEMTYPE_DEVICE SUN_MEMTYPE_DEVICE -#define SUN_MEMTYPE_UVM SUN_MEMTYPE_UVM - /* * SUNMemory is a simple abstraction of a pointer to some * contiguous memory, so that we can keep track of its type diff --git a/include/sundials/sundials_types.h b/include/sundials/sundials_types.h index b4beaef939..d43f3343b6 100644 --- a/include/sundials/sundials_types.h +++ b/include/sundials/sundials_types.h @@ -305,12 +305,9 @@ typedef int SUNComm; enum SUNDataIOMode_ { - SUN_DATAIOMODE_INMEM, + SUNDATAIOMODE_INMEM, }; -/* For backwards compatibility with the old name */ -#define SUNDATAIOMODE_INMEM SUN_DATAIOMODE_INMEM - typedef enum SUNDataIOMode_ SUNDataIOMode; #endif /* _SUNDIALS_TYPES_H */ diff --git a/src/nvector/cuda/nvector_cuda.cu b/src/nvector/cuda/nvector_cuda.cu index 6986e1e87d..a78c3630a4 100644 --- a/src/nvector/cuda/nvector_cuda.cu +++ b/src/nvector/cuda/nvector_cuda.cu @@ -354,9 +354,9 @@ N_Vector N_VMake_Cuda(sunindextype length, sunrealtype* h_vdata, NVEC_CUDA_CONTENT(v)->length = length; NVEC_CUDA_CONTENT(v)->mem_helper = SUNMemoryHelper_Cuda(sunctx); NVEC_CUDA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), h_vdata, SUN_MEMTYPE_HOST); + SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), h_vdata, SUNMEMTYPE__HOST); NVEC_CUDA_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), d_vdata, SUN_MEMTYPE_DEVICE); + SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), d_vdata, SUNMEMTYPE__DEVICE); NVEC_CUDA_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); NVEC_CUDA_CONTENT(v)->reduce_exec_policy = DEFAULT_REDUCTION_EXECPOLICY.clone(); NVEC_CUDA_CONTENT(v)->own_helper = SUNTRUE; @@ -395,7 +395,7 @@ N_Vector N_VMakeManaged_Cuda(sunindextype length, sunrealtype* vdata, NVEC_CUDA_CONTENT(v)->length = length; NVEC_CUDA_CONTENT(v)->mem_helper = SUNMemoryHelper_Cuda(sunctx); NVEC_CUDA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), vdata, SUN_MEMTYPE_UVM); + SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), vdata, SUNMEMTYPE__UVM); NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->host_data); NVEC_CUDA_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); @@ -440,7 +440,7 @@ void N_VSetHostArrayPointer_Cuda(sunrealtype* h_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)h_vdata, - SUN_MEMTYPE_UVM); + SUNMEMTYPE__UVM); NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->host_data); @@ -456,7 +456,7 @@ void N_VSetHostArrayPointer_Cuda(sunrealtype* h_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)h_vdata, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); } } } @@ -478,7 +478,7 @@ void N_VSetDeviceArrayPointer_Cuda(sunrealtype* d_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)d_vdata, - SUN_MEMTYPE_UVM); + SUNMEMTYPE__UVM); NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->device_data); @@ -494,7 +494,7 @@ void N_VSetDeviceArrayPointer_Cuda(sunrealtype* d_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)d_vdata, - SUN_MEMTYPE_DEVICE); + SUNMEMTYPE__DEVICE); } } } @@ -2033,7 +2033,7 @@ SUNErrCode N_VBufPack_Cuda(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(x), buf, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_CUDA_MEMHELP(x), buf_mem, @@ -2059,7 +2059,7 @@ SUNErrCode N_VBufUnpack_Cuda(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(x), buf, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_CUDA_MEMHELP(x), @@ -2231,33 +2231,33 @@ static int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vc->device_data), - NVEC_CUDA_MEMSIZE(v), SUN_MEMTYPE_UVM, + NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE__UVM, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUN_MEMTYPE_UVM\n"); + "failed for SUNMEMTYPE__UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vc->host_data), - NVEC_CUDA_MEMSIZE(v), SUN_MEMTYPE_HOST, + NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE__HOST, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_HOST\n"); + "failed to alloc SUNMEMTYPE__HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vc->device_data), - NVEC_CUDA_MEMSIZE(v), SUN_MEMTYPE_DEVICE, + NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE__DEVICE, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_DEVICE\n"); + "failed to alloc SUNMEMTYPE__DEVICE\n"); } } @@ -2293,37 +2293,37 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) // Allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUN_MEMTYPE_PINNED, + SUNMEMTYPE__PINNED, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); + "alloc SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); // If pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUN_MEMTYPE_HOST, + SUNMEMTYPE__HOST, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUN_MEMTYPE_HOST\n"); + "alloc SUNMEMTYPE__HOST\n"); } } // Allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->reduce_buffer_dev), bytes, - SUN_MEMTYPE_DEVICE, + SUNMEMTYPE__DEVICE, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUN_MEMTYPE_DEVICE\n"); + "alloc SUNMEMTYPE__DEVICE\n"); } } @@ -2436,23 +2436,23 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // Allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUN_MEMTYPE_PINNED, + SUNMEMTYPE__PINNED, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in FusedBuffer_Init: SUNMemoryHelper_Alloc failed to alloc " - "SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); + "SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); // If pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUN_MEMTYPE_HOST, + SUNMEMTYPE__HOST, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_HOST\n"); + "failed to alloc SUNMEMTYPE__HOST\n"); return SUN_ERR_GENERIC; } } @@ -2460,12 +2460,12 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // Allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->fused_buffer_dev), bytes, - SUN_MEMTYPE_DEVICE, + SUNMEMTYPE__DEVICE, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_DEVICE\n"); + "failed to alloc SUNMEMTYPE__DEVICE\n"); return SUN_ERR_GENERIC; } @@ -2633,7 +2633,7 @@ static int InitializeDeviceCounter(N_Vector v) { retval = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(NVEC_CUDA_PRIVATE(v)->device_counter), - sizeof(unsigned int), SUN_MEMTYPE_DEVICE, + sizeof(unsigned int), SUNMEMTYPE__DEVICE, (void*)NVEC_CUDA_STREAM(v)); } cudaMemsetAsync(NVEC_CUDA_DCOUNTERp(v), 0, sizeof(unsigned int), diff --git a/src/nvector/hip/nvector_hip.hip.cpp b/src/nvector/hip/nvector_hip.hip.cpp index 9c745cbdc8..24b8f28d36 100644 --- a/src/nvector/hip/nvector_hip.hip.cpp +++ b/src/nvector/hip/nvector_hip.hip.cpp @@ -325,9 +325,9 @@ N_Vector N_VMake_Hip(sunindextype length, sunrealtype* h_vdata, NVEC_HIP_CONTENT(v)->length = length; NVEC_HIP_CONTENT(v)->mem_helper = SUNMemoryHelper_Hip(sunctx); NVEC_HIP_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), h_vdata, SUN_MEMTYPE_HOST); + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), h_vdata, SUNMEMTYPE__HOST); NVEC_HIP_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), d_vdata, SUN_MEMTYPE_DEVICE); + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), d_vdata, SUNMEMTYPE__DEVICE); NVEC_HIP_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); NVEC_HIP_CONTENT(v)->reduce_exec_policy = DEFAULT_REDUCTION_EXECPOLICY.clone(); NVEC_HIP_CONTENT(v)->own_helper = SUNTRUE; @@ -366,7 +366,7 @@ N_Vector N_VMakeManaged_Hip(sunindextype length, sunrealtype* vdata, NVEC_HIP_CONTENT(v)->length = length; NVEC_HIP_CONTENT(v)->mem_helper = SUNMemoryHelper_Hip(sunctx); NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), - vdata, SUN_MEMTYPE_UVM); + vdata, SUNMEMTYPE__UVM); NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->host_data); NVEC_HIP_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); @@ -411,7 +411,7 @@ void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v) { NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)h_vdata, - SUN_MEMTYPE_UVM); + SUNMEMTYPE__UVM); NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->host_data); @@ -427,7 +427,7 @@ void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v) { NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)h_vdata, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); } } } @@ -449,7 +449,7 @@ void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v) { NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, - SUN_MEMTYPE_UVM); + SUNMEMTYPE__UVM); NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->device_data); @@ -465,7 +465,7 @@ void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v) { NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, - SUN_MEMTYPE_DEVICE); + SUNMEMTYPE__DEVICE); } } } @@ -1978,7 +1978,7 @@ SUNErrCode N_VBufPack_Hip(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(x), buf, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_HIP_MEMHELP(x), buf_mem, @@ -2004,7 +2004,7 @@ SUNErrCode N_VBufUnpack_Hip(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(x), buf, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_HIP_MEMHELP(x), @@ -2269,33 +2269,33 @@ int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vc->device_data), - NVEC_HIP_MEMSIZE(v), SUN_MEMTYPE_UVM, + NVEC_HIP_MEMSIZE(v), SUNMEMTYPE__UVM, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUN_MEMTYPE_UVM\n"); + "failed for SUNMEMTYPE__UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vc->host_data), - NVEC_HIP_MEMSIZE(v), SUN_MEMTYPE_HOST, + NVEC_HIP_MEMSIZE(v), SUNMEMTYPE__HOST, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_HOST\n"); + "failed to alloc SUNMEMTYPE__HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vc->device_data), - NVEC_HIP_MEMSIZE(v), SUN_MEMTYPE_DEVICE, + NVEC_HIP_MEMSIZE(v), SUNMEMTYPE__DEVICE, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_DEVICE\n"); + "failed to alloc SUNMEMTYPE__DEVICE\n"); } } @@ -2331,37 +2331,37 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) // Allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUN_MEMTYPE_PINNED, + SUNMEMTYPE__PINNED, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); + "alloc SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); // If pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUN_MEMTYPE_HOST, + SUNMEMTYPE__HOST, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUN_MEMTYPE_HOST\n"); + "alloc SUNMEMTYPE__HOST\n"); } } // Allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_dev), bytes, - SUN_MEMTYPE_DEVICE, + SUNMEMTYPE__DEVICE, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUN_MEMTYPE_DEVICE\n"); + "alloc SUNMEMTYPE__DEVICE\n"); } } @@ -2453,7 +2453,7 @@ static int InitializeDeviceCounter(N_Vector v) { retval = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(NVEC_HIP_PRIVATE(v)->device_counter), - sizeof(unsigned int), SUN_MEMTYPE_DEVICE, + sizeof(unsigned int), SUNMEMTYPE__DEVICE, (void*)NVEC_HIP_STREAM(v)); } hipMemsetAsync(NVEC_HIP_DCOUNTERp(v), 0, sizeof(unsigned int), diff --git a/src/nvector/raja/nvector_raja.cpp b/src/nvector/raja/nvector_raja.cpp index 9455a2781c..715e2b9067 100644 --- a/src/nvector/raja/nvector_raja.cpp +++ b/src/nvector/raja/nvector_raja.cpp @@ -354,9 +354,9 @@ N_Vector N_VMake_Raja(sunindextype length, sunrealtype* h_vdata, #endif NVEC_RAJA_CONTENT(v)->own_helper = SUNTRUE; NVEC_RAJA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), h_vdata, SUN_MEMTYPE_HOST); + SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), h_vdata, SUNMEMTYPE__HOST); NVEC_RAJA_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), d_vdata, SUN_MEMTYPE_DEVICE); + SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), d_vdata, SUNMEMTYPE__DEVICE); NVEC_RAJA_PRIVATE(v)->use_managed_mem = SUNFALSE; if (NVEC_RAJA_MEMHELP(v) == NULL) @@ -399,7 +399,7 @@ N_Vector N_VMakeManaged_Raja(sunindextype length, sunrealtype* vdata, #endif NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_RAJA_CONTENT(v)->mem_helper, vdata, - SUN_MEMTYPE_UVM); + SUNMEMTYPE__UVM); NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_RAJA_CONTENT(v)->mem_helper, NVEC_RAJA_CONTENT(v)->host_data); @@ -466,7 +466,7 @@ void N_VSetHostArrayPointer_Raja(sunrealtype* h_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)h_vdata, - SUN_MEMTYPE_UVM); + SUNMEMTYPE__UVM); NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_RAJA_MEMHELP(v), NVEC_RAJA_CONTENT(v)->host_data); @@ -482,7 +482,7 @@ void N_VSetHostArrayPointer_Raja(sunrealtype* h_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)h_vdata, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); } } } @@ -504,7 +504,7 @@ void N_VSetDeviceArrayPointer_Raja(sunrealtype* d_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)d_vdata, - SUN_MEMTYPE_UVM); + SUNMEMTYPE__UVM); NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_RAJA_MEMHELP(v), NVEC_RAJA_CONTENT(v)->device_data); @@ -520,7 +520,7 @@ void N_VSetDeviceArrayPointer_Raja(sunrealtype* d_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)d_vdata, - SUN_MEMTYPE_DEVICE); + SUNMEMTYPE__DEVICE); } } } @@ -1453,7 +1453,7 @@ SUNErrCode N_VBufPack_Raja(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(x), buf, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } #if defined(SUNDIALS_RAJA_BACKENDS_SYCL) @@ -1494,7 +1494,7 @@ SUNErrCode N_VBufUnpack_Raja(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(x), buf, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } #if defined(SUNDIALS_RAJA_BACKENDS_SYCL) @@ -1716,33 +1716,33 @@ int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vc->device_data), - NVEC_RAJA_MEMSIZE(v), SUN_MEMTYPE_UVM, + NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE__UVM, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUN_MEMTYPE_UVM\n"); + "failed for SUNMEMTYPE__UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_RAJA_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vc->host_data), - NVEC_RAJA_MEMSIZE(v), SUN_MEMTYPE_HOST, + NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE__HOST, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_HOST\n"); + "failed to alloc SUNMEMTYPE__HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vc->device_data), - NVEC_RAJA_MEMSIZE(v), SUN_MEMTYPE_DEVICE, + NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE__DEVICE, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_DEVICE\n"); + "failed to alloc SUNMEMTYPE__DEVICE\n"); } } @@ -1776,21 +1776,21 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUN_MEMTYPE_PINNED, queue); + SUNMEMTYPE__PINNED, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in FusedBuffer_Init: SUNMemoryHelper_Alloc failed to alloc " - "SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); + "SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); // if pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUN_MEMTYPE_HOST, queue); + SUNMEMTYPE__HOST, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_HOST\n"); + "failed to alloc SUNMEMTYPE__HOST\n"); return SUN_ERR_GENERIC; } } @@ -1798,11 +1798,11 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vcp->fused_buffer_dev), bytes, - SUN_MEMTYPE_DEVICE, queue); + SUNMEMTYPE__DEVICE, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_DEVICE\n"); + "failed to alloc SUNMEMTYPE__DEVICE\n"); return SUN_ERR_GENERIC; } diff --git a/src/nvector/sycl/nvector_sycl.cpp b/src/nvector/sycl/nvector_sycl.cpp index e385effd3a..b032f1ec1f 100644 --- a/src/nvector/sycl/nvector_sycl.cpp +++ b/src/nvector/sycl/nvector_sycl.cpp @@ -435,9 +435,9 @@ N_Vector N_VMake_Sycl(sunindextype length, sunrealtype* h_vdata, NVEC_SYCL_CONTENT(v)->own_helper = SUNTRUE; NVEC_SYCL_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); NVEC_SYCL_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), h_vdata, SUN_MEMTYPE_HOST); + SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), h_vdata, SUNMEMTYPE__HOST); NVEC_SYCL_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), d_vdata, SUN_MEMTYPE_DEVICE); + SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), d_vdata, SUNMEMTYPE__DEVICE); NVEC_SYCL_CONTENT(v)->stream_exec_policy = new ThreadDirectExecPolicy(SYCL_BLOCKDIM(Q)); NVEC_SYCL_CONTENT(v)->reduce_exec_policy = @@ -502,7 +502,7 @@ N_Vector N_VMakeManaged_Sycl(sunindextype length, sunrealtype* vdata, NVEC_SYCL_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); NVEC_SYCL_CONTENT(v)->own_helper = SUNTRUE; NVEC_SYCL_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), vdata, SUN_MEMTYPE_UVM); + SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), vdata, SUNMEMTYPE__UVM); NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->host_data); NVEC_SYCL_CONTENT(v)->stream_exec_policy = @@ -562,7 +562,7 @@ void N_VSetHostArrayPointer_Sycl(sunrealtype* h_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)h_vdata, - SUN_MEMTYPE_UVM); + SUNMEMTYPE__UVM); NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->host_data); @@ -578,7 +578,7 @@ void N_VSetHostArrayPointer_Sycl(sunrealtype* h_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)h_vdata, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); } } } @@ -597,7 +597,7 @@ void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)d_vdata, - SUN_MEMTYPE_UVM); + SUNMEMTYPE__UVM); NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->device_data); @@ -613,7 +613,7 @@ void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)d_vdata, - SUN_MEMTYPE_DEVICE); + SUNMEMTYPE__DEVICE); } } } @@ -1878,7 +1878,7 @@ SUNErrCode N_VBufPack_Sycl(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(x), buf, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_Copy(NVEC_SYCL_MEMHELP(x), buf_mem, @@ -1900,7 +1900,7 @@ SUNErrCode N_VBufUnpack_Sycl(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(x), buf, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_Copy(NVEC_SYCL_MEMHELP(x), @@ -2036,33 +2036,33 @@ static int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vc->device_data), - NVEC_SYCL_MEMSIZE(v), SUN_MEMTYPE_UVM, + NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE__UVM, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUN_MEMTYPE_UVM\n"); + "failed for SUNMEMTYPE__UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vc->host_data), - NVEC_SYCL_MEMSIZE(v), SUN_MEMTYPE_HOST, + NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE__HOST, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_HOST\n"); + "failed to alloc SUNMEMTYPE__HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vc->device_data), - NVEC_SYCL_MEMSIZE(v), SUN_MEMTYPE_DEVICE, + NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE__DEVICE, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_DEVICE\n"); + "failed to alloc SUNMEMTYPE__DEVICE\n"); } } @@ -2082,7 +2082,7 @@ static int InitializeReductionBuffer(N_Vector v, const sunrealtype value, size_t /* Wrap the initial value as SUNMemory object */ SUNMemory value_mem = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), - (void*)&value, SUN_MEMTYPE_HOST); + (void*)&value, SUNMEMTYPE__HOST); /* check if the existing reduction memory is not large enough */ if (vcp->reduce_buffer_bytes < bytes) @@ -2096,34 +2096,34 @@ static int InitializeReductionBuffer(N_Vector v, const sunrealtype value, size_t /* allocate pinned memory on the host */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUN_MEMTYPE_PINNED, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE__PINNED, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); + "alloc SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); /* if pinned alloc failed, allocate plain host memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUN_MEMTYPE_HOST, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE__HOST, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUN_MEMTYPE_HOST\n"); + "alloc SUNMEMTYPE__HOST\n"); } } /* allocate device memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->reduce_buffer_dev), bytes, - SUN_MEMTYPE_DEVICE, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE__DEVICE, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUN_MEMTYPE_DEVICE\n"); + "alloc SUNMEMTYPE__DEVICE\n"); } } @@ -2224,21 +2224,21 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) /* allocate pinned memory on the host */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUN_MEMTYPE_PINNED, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE__PINNED, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in FusedBuffer_Init: SUNMemoryHelper_Alloc failed to alloc " - "SUN_MEMTYPE_PINNED, using SUN_MEMTYPE_HOST instead\n"); + "SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); /* if pinned alloc failed, allocate plain host memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUN_MEMTYPE_HOST, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE__HOST, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_HOST\n"); + "failed to alloc SUNMEMTYPE__HOST\n"); return SUN_ERR_GENERIC; } } @@ -2246,11 +2246,11 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) /* allocate device memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->fused_buffer_dev), bytes, - SUN_MEMTYPE_DEVICE, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE__DEVICE, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUN_MEMTYPE_DEVICE\n"); + "failed to alloc SUNMEMTYPE__DEVICE\n"); return SUN_ERR_GENERIC; } diff --git a/src/sundials/sundatanode/sundatanode_inmem.c b/src/sundials/sundatanode/sundatanode_inmem.c index bb22d962ed..de90eccb01 100644 --- a/src/sundials/sundatanode/sundatanode_inmem.c +++ b/src/sundials/sundatanode/sundatanode_inmem.c @@ -330,14 +330,14 @@ SUNErrCode SUNDataNode_GetDataNvector_InMem(const SUNDataNode self, N_Vector v, SUNAssert((buffer_size + sizeof(sunrealtype)) == leaf_data->bytes, SUN_ERR_ARG_INCOMPATIBLE); - if (leaf_mem_type != SUN_MEMTYPE_HOST) + if (leaf_mem_type != SUNMEMTYPE__HOST) { /* BufUnpack assumes the data is on the host. So if the leaf has it elsewhere, we need to move it to the host first. */ SUNMemory leaf_host_data = NULL; SUNCheckCall(SUNMemoryHelper_Alloc(IMPL_MEMBER(self, mem_helper), &leaf_host_data, leaf_data->bytes, - SUN_MEMTYPE_HOST, queue)); + SUNMEMTYPE__HOST, queue)); SUNCheckCall(SUNMemoryHelper_Copy(IMPL_MEMBER(self, mem_helper), leaf_host_data, leaf_data, buffer_size, @@ -398,7 +398,7 @@ SUNErrCode SUNDataNode_SetDataNvector_InMem(SUNDataNode self, N_Vector v, /* Use the default queue for the memory helper */ void* queue = NULL; - SUNMemoryType leaf_mem_type = SUN_MEMTYPE_HOST; + SUNMemoryType leaf_mem_type = SUNMEMTYPE__HOST; sunindextype buffer_size = 0; SUNCheckCall(N_VBufSize(v, &buffer_size)); diff --git a/src/sundials/sundials_datanode.c b/src/sundials/sundials_datanode.c index 6eb5935bdc..abda9b876d 100644 --- a/src/sundials/sundials_datanode.c +++ b/src/sundials/sundials_datanode.c @@ -92,7 +92,7 @@ SUNErrCode SUNDataNode_CreateLeaf(SUNDataIOMode io_mode, SUNErrCode err = SUN_SUCCESS; switch (io_mode) { - case (SUN_DATAIOMODE_INMEM): + case (SUNDATAIOMODE_INMEM): err = SUNDataNode_CreateLeaf_InMem(mem_helper, sunctx, node_out); break; default: err = SUN_ERR_ARG_OUTOFRANGE; @@ -123,7 +123,7 @@ SUNErrCode SUNDataNode_CreateList(SUNDataIOMode io_mode, SUNErrCode err = SUN_SUCCESS; switch (io_mode) { - case (SUN_DATAIOMODE_INMEM): + case (SUNDATAIOMODE_INMEM): err = SUNDataNode_CreateList_InMem(num_elements, sunctx, node_out); break; default: err = SUN_ERR_ARG_OUTOFRANGE; @@ -154,7 +154,7 @@ SUNErrCode SUNDataNode_CreateObject(SUNDataIOMode io_mode, SUNErrCode err = SUN_SUCCESS; switch (io_mode) { - case (SUN_DATAIOMODE_INMEM): + case (SUNDATAIOMODE_INMEM): err = SUNDataNode_CreateObject_InMem(num_elements, sunctx, node_out); break; default: err = SUN_ERR_ARG_OUTOFRANGE; diff --git a/src/sundials/sundials_memory.c b/src/sundials/sundials_memory.c index e9cd7971ad..acfbb30c11 100644 --- a/src/sundials/sundials_memory.c +++ b/src/sundials/sundials_memory.c @@ -103,8 +103,8 @@ SUNMemory SUNMemoryHelper_Wrap(SUNMemoryHelper helper, void* ptr, { SUNFunctionBegin(helper->sunctx); - SUNCheckNull(mem_type == SUN_MEMTYPE_HOST || mem_type == SUN_MEMTYPE_PINNED || - mem_type == SUN_MEMTYPE_DEVICE || mem_type == SUN_MEMTYPE_UVM, + SUNCheckNull(mem_type == SUNMEMTYPE__HOST || mem_type == SUNMEMTYPE__PINNED || + mem_type == SUNMEMTYPE__DEVICE || mem_type == SUNMEMTYPE__UVM, SUN_ERR_ARG_OUTOFRANGE); SUNMemory mem = SUNMemoryNewEmpty(helper->sunctx); diff --git a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp index ec87b13167..08862a1422 100644 --- a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp +++ b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp @@ -164,8 +164,8 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc but in device memory for the batched methods. */ retval = SUNMemoryHelper_Alloc(content->memhelp, &content->pivots, M * nblocks * sizeof(sunindextype), - nblocks > 1 ? SUN_MEMTYPE_DEVICE - : SUN_MEMTYPE_HOST, + nblocks > 1 ? SUNMEMTYPE__DEVICE + : SUNMEMTYPE__HOST, nullptr); if (retval) { @@ -179,7 +179,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc { retval = SUNMemoryHelper_Alloc(content->memhelp, &content->pivotsarr, nblocks * sizeof(sunindextype*), - SUN_MEMTYPE_DEVICE, nullptr); + SUNMEMTYPE__DEVICE, nullptr); if (retval) { SUNLinSolFree(S); @@ -200,7 +200,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc check its values on the host and we need it to have fast transfers. */ retval = SUNMemoryHelper_Alloc(content->memhelp, &content->infoarr, nblocks * sizeof(sunindextype), - SUN_MEMTYPE_PINNED, nullptr); + SUNMEMTYPE__PINNED, nullptr); if (retval) { SUNLinSolFree(S); @@ -209,7 +209,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc retval = SUNMemoryHelper_Alloc(content->memhelp, &content->rhsarr, nblocks * sizeof(sunrealtype*), - SUN_MEMTYPE_DEVICE, nullptr); + SUNMEMTYPE__DEVICE, nullptr); if (retval) { SUNLinSolFree(S); diff --git a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu index 214eaf6807..078d171402 100644 --- a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu +++ b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu @@ -166,14 +166,14 @@ SUNMatrix SUNMatrix_cuSparse_NewCSR(int M, int N, int NNZ, /* Allocate device memory for the matrix */ alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_colind, - sizeof(int) * NNZ, SUN_MEMTYPE_DEVICE, + sizeof(int) * NNZ, SUNMEMTYPE__DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_rowptr, - sizeof(int) * (M + 1), SUN_MEMTYPE_DEVICE, + sizeof(int) * (M + 1), SUNMEMTYPE__DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_values, sizeof(sunrealtype) * NNZ, - SUN_MEMTYPE_DEVICE, nullptr); + SUNMEMTYPE__DEVICE, nullptr); if (alloc_fail) { SUNMemoryHelper_Dealloc(SMCU_MEMHELP(A), d_colind, nullptr); @@ -330,11 +330,11 @@ SUNMatrix SUNMatrix_cuSparse_MakeCSR(cusparseMatDescr_t mat_descr, int M, int N, SMCU_CONTENT(A)->fixed_pattern = SUNFALSE; SMCU_CONTENT(A)->sparse_type = SUNMAT_CUSPARSE_CSR; SMCU_CONTENT(A)->colind = SUNMemoryHelper_Wrap(SMCU_MEMHELP(A), colind, - SUN_MEMTYPE_DEVICE); + SUNMEMTYPE__DEVICE); SMCU_CONTENT(A)->rowptrs = SUNMemoryHelper_Wrap(SMCU_MEMHELP(A), rowptrs, - SUN_MEMTYPE_DEVICE); + SUNMEMTYPE__DEVICE); SMCU_CONTENT(A)->data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(A), data, - SUN_MEMTYPE_DEVICE); + SUNMEMTYPE__DEVICE); SMCU_CONTENT(A)->mat_descr = mat_descr; SMCU_CONTENT(A)->cusp_handle = cusp; @@ -413,13 +413,13 @@ SUNMatrix SUNMatrix_cuSparse_NewBlockCSR(int nblocks, int blockrows, /* Allocate device memory for the matrix */ alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_colind, sizeof(int) * blocknnz, - SUN_MEMTYPE_DEVICE, nullptr); + SUNMEMTYPE__DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_rowptr, sizeof(int) * (blockrows + 1), - SUN_MEMTYPE_DEVICE, nullptr); + SUNMEMTYPE__DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_values, sizeof(sunrealtype) * blocknnz * nblocks, - SUN_MEMTYPE_DEVICE, nullptr); + SUNMEMTYPE__DEVICE, nullptr); if (alloc_fail) { SUNMemoryHelper_Dealloc(SMCU_MEMHELP(A), d_colind, nullptr); @@ -610,7 +610,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, sunrealtype* h_data, if (h_data != NULL) { - _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUN_MEMTYPE_HOST); + _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUNMEMTYPE__HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), SMCU_DATA(dA), _h_data, SMCU_NNZ(dA) * sizeof(sunrealtype), (void*)stream); @@ -637,7 +637,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxptrs != NULL) { _h_idxptrs = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxptrs, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), SMCU_INDEXPTRS(dA), _h_idxptrs, nidxptrs * sizeof(int), (void*)stream); @@ -648,7 +648,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxvals != NULL) { _h_idxvals = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxvals, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), SMCU_INDEXVALS(dA), _h_idxvals, nidxvals * sizeof(int), (void*)stream); @@ -673,7 +673,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, sunrealtype* h_data, if (h_data != NULL) { - _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUN_MEMTYPE_HOST); + _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUNMEMTYPE__HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), _h_data, SMCU_DATA(dA), SMCU_NNZ(dA) * sizeof(sunrealtype), (void*)stream); @@ -694,7 +694,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxptrs != NULL) { _h_idxptrs = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxptrs, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), _h_idxptrs, SMCU_INDEXPTRS(dA), nidxptrs * sizeof(int), (void*)stream); @@ -705,7 +705,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxvals != NULL) { _h_idxvals = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxvals, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), _h_idxvals, SMCU_INDEXVALS(dA), nidxvals * sizeof(int), (void*)stream); @@ -1026,7 +1026,7 @@ SUNErrCode SUNMatMatvecSetup_cuSparse(SUNMatrix A) CUDA_R_XF, SPMV_ALG, &SMCU_CONTENT(A)->bufferSize)); if (SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &SMCU_CONTENT(A)->dBufferMem, - SMCU_CONTENT(A)->bufferSize, SUN_MEMTYPE_DEVICE, + SMCU_CONTENT(A)->bufferSize, SUNMEMTYPE__DEVICE, nullptr)) return (SUN_ERR_OP_FAIL); } diff --git a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp index a87e5e66cd..65f36f90e2 100644 --- a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp +++ b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp @@ -91,7 +91,7 @@ SUNMatrix SUNMatrix_MagmaDenseBlock(sunindextype nblocks, sunindextype M, if ((M <= 0) || (N <= 0) || (nblocks <= 0)) { return (NULL); } /* Check for valid memory type options */ - if ((memtype != SUN_MEMTYPE_UVM) && (memtype != SUN_MEMTYPE_DEVICE)) + if ((memtype != SUNMEMTYPE__UVM) && (memtype != SUNMEMTYPE__DEVICE)) { return (NULL); } @@ -292,7 +292,7 @@ SUNErrCode SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix Amat, sunrealtype* h_data int retval = 0; SUNMemory _h_data = SUNMemoryHelper_Wrap(SMLD_CONTENT(Amat)->memhelp, h_data, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); SUNDIALS_HIP_OR_CUDA(hipStream_t stream = magma_queue_get_hip_stream(A->q); , cudaStream_t stream = magma_queue_get_cuda_stream(A->q);) @@ -315,7 +315,7 @@ SUNErrCode SUNMatrix_MagmaDense_CopyFromDevice(SUNMatrix Amat, sunrealtype* h_da int retval = 0; SUNMemory _h_data = SUNMemoryHelper_Wrap(SMLD_CONTENT(Amat)->memhelp, h_data, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); SUNDIALS_HIP_OR_CUDA(hipStream_t stream = magma_queue_get_hip_stream(A->q); , cudaStream_t stream = magma_queue_get_cuda_stream(A->q);) diff --git a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp index e8336752b1..c000efed4b 100644 --- a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp +++ b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp @@ -86,7 +86,7 @@ SUNMatrix SUNMatrix_OneMklDenseBlock(sunindextype num_blocks, sunindextype M, // Check inputs if ((M <= 0) || (N <= 0) || (num_blocks <= 0) || (!mem_helper) || - ((mem_type != SUN_MEMTYPE_UVM) && (mem_type != SUN_MEMTYPE_DEVICE))) + ((mem_type != SUNMEMTYPE__UVM) && (mem_type != SUNMEMTYPE__DEVICE))) { SUNDIALS_DEBUG_ERROR("Illegal input\n"); return NULL; @@ -252,7 +252,7 @@ SUNErrCode SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, sunrealtype* h_data) // Wrap the input pointer SUNMemory _h_data = SUNMemoryHelper_Wrap(MAT_MEMHELPER(A), h_data, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); if (!_h_data) { SUNDIALS_DEBUG_ERROR("SUNMemory wrap failed\n"); @@ -286,7 +286,7 @@ SUNErrCode SUNMatrix_OneMklDense_CopyFromDevice(SUNMatrix A, sunrealtype* h_data } SUNMemory _h_data = SUNMemoryHelper_Wrap(MAT_MEMHELPER(A), h_data, - SUN_MEMTYPE_HOST); + SUNMEMTYPE__HOST); if (!_h_data) { SUNDIALS_DEBUG_ERROR("SUNMemory wrap failed\n"); diff --git a/src/sunmemory/cuda/sundials_cuda_memory.cu b/src/sunmemory/cuda/sundials_cuda_memory.cu index 7ce721e519..eee1d73daa 100644 --- a/src/sunmemory/cuda/sundials_cuda_memory.cu +++ b/src/sunmemory/cuda/sundials_cuda_memory.cu @@ -113,7 +113,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, mem->type = mem_type; mem->bytes = mem_size; - if (mem_type == SUN_MEMTYPE_HOST) + if (mem_type == SUNMEMTYPE__HOST) { mem->ptr = malloc(mem_size); SUNAssert(mem->ptr, SUN_ERR_MALLOC_FAIL); @@ -123,7 +123,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, SUNMAX(SUNHELPER_CONTENT(helper)->bytes_allocated_host, SUNHELPER_CONTENT(helper)->bytes_high_watermark_host); } - else if (mem_type == SUN_MEMTYPE_PINNED) + else if (mem_type == SUNMEMTYPE__PINNED) { if (!SUNDIALS_CUDA_VERIFY(cudaMallocHost(&(mem->ptr), mem_size))) { @@ -141,7 +141,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned); } } - else if (mem_type == SUN_MEMTYPE_DEVICE) + else if (mem_type == SUNMEMTYPE__DEVICE) { if (!SUNDIALS_CUDA_VERIFY(cudaMalloc(&(mem->ptr), mem_size))) { @@ -159,7 +159,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_device); } } - else if (mem_type == SUN_MEMTYPE_UVM) + else if (mem_type == SUNMEMTYPE__UVM) { if (!SUNDIALS_CUDA_VERIFY(cudaMallocManaged(&(mem->ptr), mem_size))) { @@ -211,14 +211,14 @@ SUNErrCode SUNMemoryHelper_Dealloc_Cuda(SUNMemoryHelper helper, SUNMemory mem, if (mem->ptr != NULL && mem->own) { - if (mem->type == SUN_MEMTYPE_HOST) + if (mem->type == SUNMEMTYPE__HOST) { SUNHELPER_CONTENT(helper)->num_deallocations_host++; SUNHELPER_CONTENT(helper)->bytes_allocated_host -= mem->bytes; free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUN_MEMTYPE_PINNED) + else if (mem->type == SUNMEMTYPE__PINNED) { SUNHELPER_CONTENT(helper)->num_deallocations_pinned++; SUNHELPER_CONTENT(helper)->bytes_allocated_pinned -= mem->bytes; @@ -230,7 +230,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Cuda(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUN_MEMTYPE_DEVICE) + else if (mem->type == SUNMEMTYPE__DEVICE) { SUNHELPER_CONTENT(helper)->num_deallocations_device++; SUNHELPER_CONTENT(helper)->bytes_allocated_device -= mem->bytes; @@ -242,7 +242,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Cuda(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUN_MEMTYPE_UVM) + else if (mem->type == SUNMEMTYPE__UVM) { SUNHELPER_CONTENT(helper)->num_deallocations_uvm++; SUNHELPER_CONTENT(helper)->bytes_allocated_uvm -= mem->bytes; @@ -275,25 +275,25 @@ SUNErrCode SUNMemoryHelper_Copy_Cuda(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUN_MEMTYPE_HOST: - case SUN_MEMTYPE_PINNED: - if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) + case SUNMEMTYPE__HOST: + case SUNMEMTYPE__PINNED: + if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) + else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) { cuerr = cudaMemcpy(dst->ptr, src->ptr, memory_size, cudaMemcpyHostToDevice); } if (!SUNDIALS_CUDA_VERIFY(cuerr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUN_MEMTYPE_UVM: - case SUN_MEMTYPE_DEVICE: - if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) + case SUNMEMTYPE__UVM: + case SUNMEMTYPE__DEVICE: + if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) { cuerr = cudaMemcpy(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToHost); } - else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) + else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) { cuerr = cudaMemcpy(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToDevice); @@ -322,27 +322,27 @@ SUNErrCode SUNMemoryHelper_CopyAsync_Cuda(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUN_MEMTYPE_HOST: - case SUN_MEMTYPE_PINNED: - if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) + case SUNMEMTYPE__HOST: + case SUNMEMTYPE__PINNED: + if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) + else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) { cuerr = cudaMemcpyAsync(dst->ptr, src->ptr, memory_size, cudaMemcpyHostToDevice, stream); } if (!SUNDIALS_CUDA_VERIFY(cuerr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUN_MEMTYPE_UVM: - case SUN_MEMTYPE_DEVICE: - if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) + case SUNMEMTYPE__UVM: + case SUNMEMTYPE__DEVICE: + if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) { cuerr = cudaMemcpyAsync(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToHost, stream); } - else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) + else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) { cuerr = cudaMemcpyAsync(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToDevice, stream); @@ -376,28 +376,28 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Cuda(SUNMemoryHelper helper, size_t* bytes_allocated, size_t* bytes_high_watermark) { - if (mem_type == SUN_MEMTYPE_HOST) + if (mem_type == SUNMEMTYPE__HOST) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_host; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_host; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_host; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_host; } - else if (mem_type == SUN_MEMTYPE_PINNED) + else if (mem_type == SUNMEMTYPE__PINNED) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_pinned; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_pinned; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_pinned; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned; } - else if (mem_type == SUN_MEMTYPE_DEVICE) + else if (mem_type == SUNMEMTYPE__DEVICE) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_device; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_device; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_device; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_device; } - else if (mem_type == SUN_MEMTYPE_UVM) + else if (mem_type == SUNMEMTYPE__UVM) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_uvm; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_uvm; diff --git a/src/sunmemory/hip/sundials_hip_memory.hip.cpp b/src/sunmemory/hip/sundials_hip_memory.hip.cpp index 216b6b15b3..8b69bc3166 100644 --- a/src/sunmemory/hip/sundials_hip_memory.hip.cpp +++ b/src/sunmemory/hip/sundials_hip_memory.hip.cpp @@ -113,7 +113,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, mem->type = mem_type; mem->bytes = mem_size; - if (mem_type == SUN_MEMTYPE_HOST) + if (mem_type == SUNMEMTYPE__HOST) { mem->ptr = malloc(mem_size); SUNAssert(mem->ptr, SUN_ERR_MALLOC_FAIL); @@ -123,7 +123,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, SUNMAX(SUNHELPER_CONTENT(helper)->bytes_allocated_host, SUNHELPER_CONTENT(helper)->bytes_high_watermark_host); } - else if (mem_type == SUN_MEMTYPE_PINNED) + else if (mem_type == SUNMEMTYPE__PINNED) { if (!SUNDIALS_HIP_VERIFY(hipMallocHost(&(mem->ptr), mem_size))) { @@ -141,7 +141,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned); } } - else if (mem_type == SUN_MEMTYPE_DEVICE) + else if (mem_type == SUNMEMTYPE__DEVICE) { if (!SUNDIALS_HIP_VERIFY(hipMalloc(&(mem->ptr), mem_size))) { @@ -159,7 +159,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_device); } } - else if (mem_type == SUN_MEMTYPE_UVM) + else if (mem_type == SUNMEMTYPE__UVM) { if (!SUNDIALS_HIP_VERIFY(hipMallocManaged(&(mem->ptr), mem_size))) { @@ -211,14 +211,14 @@ SUNErrCode SUNMemoryHelper_Dealloc_Hip(SUNMemoryHelper helper, SUNMemory mem, if (mem->ptr != NULL && mem->own) { - if (mem->type == SUN_MEMTYPE_HOST) + if (mem->type == SUNMEMTYPE__HOST) { SUNHELPER_CONTENT(helper)->num_deallocations_host++; SUNHELPER_CONTENT(helper)->bytes_allocated_host -= mem->bytes; free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUN_MEMTYPE_PINNED) + else if (mem->type == SUNMEMTYPE__PINNED) { SUNHELPER_CONTENT(helper)->num_deallocations_pinned++; SUNHELPER_CONTENT(helper)->bytes_allocated_pinned -= mem->bytes; @@ -230,7 +230,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Hip(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUN_MEMTYPE_DEVICE) + else if (mem->type == SUNMEMTYPE__DEVICE) { SUNHELPER_CONTENT(helper)->num_deallocations_device++; SUNHELPER_CONTENT(helper)->bytes_allocated_device -= mem->bytes; @@ -242,7 +242,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Hip(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUN_MEMTYPE_UVM) + else if (mem->type == SUNMEMTYPE__UVM) { SUNHELPER_CONTENT(helper)->num_deallocations_uvm++; SUNHELPER_CONTENT(helper)->bytes_allocated_uvm -= mem->bytes; @@ -275,25 +275,25 @@ SUNErrCode SUNMemoryHelper_Copy_Hip(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUN_MEMTYPE_HOST: - case SUN_MEMTYPE_PINNED: - if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) + case SUNMEMTYPE__HOST: + case SUNMEMTYPE__PINNED: + if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) + else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) { hiperr = hipMemcpy(dst->ptr, src->ptr, memory_size, hipMemcpyHostToDevice); } if (!SUNDIALS_HIP_VERIFY(hiperr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUN_MEMTYPE_UVM: - case SUN_MEMTYPE_DEVICE: - if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) + case SUNMEMTYPE__UVM: + case SUNMEMTYPE__DEVICE: + if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) { hiperr = hipMemcpy(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToHost); } - else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) + else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) { hiperr = hipMemcpy(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToDevice); @@ -322,27 +322,27 @@ SUNErrCode SUNMemoryHelper_CopyAsync_Hip(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUN_MEMTYPE_HOST: - case SUN_MEMTYPE_PINNED: - if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) + case SUNMEMTYPE__HOST: + case SUNMEMTYPE__PINNED: + if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) + else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) { hiperr = hipMemcpyAsync(dst->ptr, src->ptr, memory_size, hipMemcpyHostToDevice, stream); } if (!SUNDIALS_HIP_VERIFY(hiperr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUN_MEMTYPE_UVM: - case SUN_MEMTYPE_DEVICE: - if (dst->type == SUN_MEMTYPE_HOST || dst->type == SUN_MEMTYPE_PINNED) + case SUNMEMTYPE__UVM: + case SUNMEMTYPE__DEVICE: + if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) { hiperr = hipMemcpyAsync(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToHost, stream); } - else if (dst->type == SUN_MEMTYPE_DEVICE || dst->type == SUN_MEMTYPE_UVM) + else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) { hiperr = hipMemcpyAsync(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToDevice, stream); @@ -376,28 +376,28 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Hip(SUNMemoryHelper helper, size_t* bytes_allocated, size_t* bytes_high_watermark) { - if (mem_type == SUN_MEMTYPE_HOST) + if (mem_type == SUNMEMTYPE__HOST) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_host; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_host; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_host; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_host; } - else if (mem_type == SUN_MEMTYPE_PINNED) + else if (mem_type == SUNMEMTYPE__PINNED) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_pinned; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_pinned; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_pinned; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned; } - else if (mem_type == SUN_MEMTYPE_DEVICE) + else if (mem_type == SUNMEMTYPE__DEVICE) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_device; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_device; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_device; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_device; } - else if (mem_type == SUN_MEMTYPE_UVM) + else if (mem_type == SUNMEMTYPE__UVM) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_uvm; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_uvm; diff --git a/src/sunmemory/sycl/sundials_sycl_memory.cpp b/src/sunmemory/sycl/sundials_sycl_memory.cpp index 681d3ea82e..31375dda7a 100644 --- a/src/sunmemory/sycl/sundials_sycl_memory.cpp +++ b/src/sunmemory/sycl/sundials_sycl_memory.cpp @@ -118,7 +118,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, mem->bytes = mem_size; // Allocate the data pointer - if (mem_type == SUN_MEMTYPE_HOST) + if (mem_type == SUNMEMTYPE__HOST) { mem->ptr = malloc(mem_size); if (!(mem->ptr)) @@ -137,7 +137,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_host); } } - else if (mem_type == SUN_MEMTYPE_PINNED) + else if (mem_type == SUNMEMTYPE__PINNED) { mem->ptr = ::sycl::malloc_host(mem_size, *sycl_queue); if (!(mem->ptr)) @@ -156,7 +156,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned); } } - else if (mem_type == SUN_MEMTYPE_DEVICE) + else if (mem_type == SUNMEMTYPE__DEVICE) { mem->ptr = ::sycl::malloc_device(mem_size, *sycl_queue); if (!(mem->ptr)) @@ -175,7 +175,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_device); } } - else if (mem_type == SUN_MEMTYPE_UVM) + else if (mem_type == SUNMEMTYPE__UVM) { mem->ptr = ::sycl::malloc_shared(mem_size, *sycl_queue); if (!(mem->ptr)) @@ -233,27 +233,27 @@ SUNErrCode SUNMemoryHelper_Dealloc_Sycl(SUNMemoryHelper helper, SUNMemory mem, ::sycl::queue* sycl_queue = GET_SYCL_QUEUE(helper, queue); SUNAssert(sycl_queue, SUN_ERR_ARG_CORRUPT); - if (mem->type == SUN_MEMTYPE_HOST) + if (mem->type == SUNMEMTYPE__HOST) { SUNHELPER_CONTENT(helper)->num_deallocations_host++; SUNHELPER_CONTENT(helper)->bytes_allocated_host -= mem->bytes; free(mem->ptr); mem->ptr = nullptr; } - else if (mem->type == SUN_MEMTYPE_PINNED || - mem->type == SUN_MEMTYPE_DEVICE || mem->type == SUN_MEMTYPE_UVM) + else if (mem->type == SUNMEMTYPE__PINNED || + mem->type == SUNMEMTYPE__DEVICE || mem->type == SUNMEMTYPE__UVM) { - if (mem->type == SUN_MEMTYPE_PINNED) + if (mem->type == SUNMEMTYPE__PINNED) { SUNHELPER_CONTENT(helper)->num_deallocations_pinned++; SUNHELPER_CONTENT(helper)->bytes_allocated_pinned -= mem->bytes; } - else if (mem->type == SUN_MEMTYPE_DEVICE) + else if (mem->type == SUNMEMTYPE__DEVICE) { SUNHELPER_CONTENT(helper)->num_deallocations_device++; SUNHELPER_CONTENT(helper)->bytes_allocated_device -= mem->bytes; } - else if (mem->type == SUN_MEMTYPE_UVM) + else if (mem->type == SUNMEMTYPE__UVM) { SUNHELPER_CONTENT(helper)->num_deallocations_uvm++; SUNHELPER_CONTENT(helper)->bytes_allocated_uvm -= mem->bytes; @@ -297,7 +297,7 @@ SUNErrCode SUNMemoryHelper_CopyAsync_Sycl(SUNMemoryHelper helper, SUNMemory dst, ::sycl::queue* sycl_queue = GET_SYCL_QUEUE(helper, queue); SUNAssert(sycl_queue, SUN_ERR_ARG_CORRUPT); - if (src->type == SUN_MEMTYPE_HOST && dst->type == SUN_MEMTYPE_HOST) + if (src->type == SUNMEMTYPE__HOST && dst->type == SUNMEMTYPE__HOST) { memcpy(dst->ptr, src->ptr, memory_size); } @@ -323,28 +323,28 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Sycl(SUNMemoryHelper helper, size_t* bytes_allocated, size_t* bytes_high_watermark) { - if (mem_type == SUN_MEMTYPE_HOST) + if (mem_type == SUNMEMTYPE__HOST) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_host; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_host; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_host; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_host; } - else if (mem_type == SUN_MEMTYPE_PINNED) + else if (mem_type == SUNMEMTYPE__PINNED) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_pinned; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_pinned; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_pinned; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned; } - else if (mem_type == SUN_MEMTYPE_DEVICE) + else if (mem_type == SUNMEMTYPE__DEVICE) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_device; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_device; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_device; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_device; } - else if (mem_type == SUN_MEMTYPE_UVM) + else if (mem_type == SUNMEMTYPE__UVM) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_uvm; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_uvm; diff --git a/src/sunmemory/system/sundials_system_memory.c b/src/sunmemory/system/sundials_system_memory.c index 6f484c47f5..41ef06d544 100644 --- a/src/sunmemory/system/sundials_system_memory.c +++ b/src/sunmemory/system/sundials_system_memory.c @@ -77,7 +77,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sys(SUNMemoryHelper helper, SUNMemory* memptr, { SUNFunctionBegin(helper->sunctx); - SUNAssert(mem_type == SUN_MEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(mem_type == SUNMEMTYPE__HOST, SUN_ERR_ARG_INCOMPATIBLE); SUNMemory mem = SUNMemoryNewEmpty(helper->sunctx); SUNCheckLastErr(); @@ -87,7 +87,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sys(SUNMemoryHelper helper, SUNMemory* memptr, mem->type = mem_type; mem->bytes = mem_size; - if (mem_type == SUN_MEMTYPE_HOST) + if (mem_type == SUNMEMTYPE__HOST) { mem->ptr = malloc(mem_size); SUNAssert(mem->ptr, SUN_ERR_MALLOC_FAIL); @@ -124,11 +124,11 @@ SUNErrCode SUNMemoryHelper_Dealloc_Sys(SUNMemoryHelper helper, SUNMemory mem, if (mem == NULL) { return SUN_SUCCESS; } - SUNAssert(mem->type == SUN_MEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(mem->type == SUNMEMTYPE__HOST, SUN_ERR_ARG_INCOMPATIBLE); if (mem->ptr != NULL && mem->own) { - if (mem->type == SUN_MEMTYPE_HOST) + if (mem->type == SUNMEMTYPE__HOST) { SUNHELPER_CONTENT(helper)->num_deallocations++; SUNHELPER_CONTENT(helper)->bytes_allocated -= mem->bytes; @@ -146,8 +146,8 @@ SUNErrCode SUNMemoryHelper_Copy_Sys(SUNMemoryHelper helper, SUNMemory dst, SUNDIALS_MAYBE_UNUSED void* queue) { SUNFunctionBegin(helper->sunctx); - SUNAssert(src->type == SUN_MEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); - SUNAssert(dst->type == SUN_MEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(src->type == SUNMEMTYPE__HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(dst->type == SUNMEMTYPE__HOST, SUN_ERR_ARG_INCOMPATIBLE); memcpy(dst->ptr, src->ptr, memory_size); return SUN_SUCCESS; } @@ -158,7 +158,7 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Sys( size_t* bytes_allocated, size_t* bytes_high_watermark) { SUNFunctionBegin(helper->sunctx); - SUNAssert(mem_type == SUN_MEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(mem_type == SUNMEMTYPE__HOST, SUN_ERR_ARG_INCOMPATIBLE); *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated; diff --git a/test/unit_tests/sundials/test_sundials_datanode.cpp b/test/unit_tests/sundials/test_sundials_datanode.cpp index 7aa1e3a39b..2e4a6f65e5 100644 --- a/test/unit_tests/sundials/test_sundials_datanode.cpp +++ b/test/unit_tests/sundials/test_sundials_datanode.cpp @@ -71,7 +71,7 @@ TEST_F(SUNDataNodeTest, CreateLeafWorks) err = SUNDataNode_CreateLeaf(SUNDATAIOMODE_INMEM, mem_helper, sunctx, &node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, + err = SUNDataNode_SetData(node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -162,7 +162,7 @@ TEST_F(SUNDataNodeTest, HasChildrenWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -193,7 +193,7 @@ TEST_F(SUNDataNodeTest, RemoveChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -232,7 +232,7 @@ TEST_F(SUNDataNodeTest, RemoveSameChildTwiceWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -267,7 +267,7 @@ TEST_F(SUNDataNodeTest, RemoveChildWorksWhenEmpty) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -295,7 +295,7 @@ TEST_F(SUNDataNodeTest, GetChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -327,7 +327,7 @@ TEST_F(SUNDataNodeTest, GetNamedChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -363,7 +363,7 @@ TEST_F(SUNDataNodeTest, RemoveNamedChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -398,7 +398,7 @@ TEST_F(SUNDataNodeTest, GetDataWorksWhenLeaf) &root_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(root_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, + err = SUNDataNode_SetData(root_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -427,7 +427,7 @@ TEST_F(SUNDataNodeTest, SetDataWorksWhenLeaf) EXPECT_EQ(err, SUN_SUCCESS); int new_integer_value = 3; - err = SUNDataNode_SetData(root_node, SUN_MEMTYPE_HOST, SUN_MEMTYPE_HOST, + err = SUNDataNode_SetData(root_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, (void*)&new_integer_value, sizeof(new_integer_value), sizeof(new_integer_value)); EXPECT_EQ(err, SUN_SUCCESS); diff --git a/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp b/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp index a5b1ae57b3..10c87270d0 100644 --- a/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp +++ b/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp @@ -97,12 +97,12 @@ int main(int argc, char* argv[]) /* Create matrices and vectors */ if (nblocks > 1) { - A = SUNMatrix_MagmaDenseBlock(nblocks, rows, cols, SUN_MEMTYPE_DEVICE, + A = SUNMatrix_MagmaDenseBlock(nblocks, rows, cols, SUNMEMTYPE__DEVICE, memhelper, NULL, sunctx); } else { - A = SUNMatrix_MagmaDense(rows, cols, SUN_MEMTYPE_DEVICE, memhelper, NULL, + A = SUNMatrix_MagmaDense(rows, cols, SUNMEMTYPE__DEVICE, memhelper, NULL, sunctx); } I = SUNMatClone(A); diff --git a/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp b/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp index 07fa925618..2f8ff692ef 100644 --- a/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp +++ b/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp @@ -152,12 +152,12 @@ int main(int argc, char* argv[]) SUNMatrix A; if (nblocks > 1) { - A = SUNMatrix_OneMklDenseBlock(nblocks, rows, cols, SUN_MEMTYPE_DEVICE, + A = SUNMatrix_OneMklDenseBlock(nblocks, rows, cols, SUNMEMTYPE__DEVICE, memhelper, &myQueue, sunctx); } else { - A = SUNMatrix_OneMklDense(rows, cols, SUN_MEMTYPE_DEVICE, memhelper, + A = SUNMatrix_OneMklDense(rows, cols, SUNMEMTYPE__DEVICE, memhelper, &myQueue, sunctx); } diff --git a/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp b/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp index 0b19d962f6..9b66d6d5f2 100644 --- a/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp +++ b/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp @@ -114,7 +114,7 @@ int main(int argc, char* argv[]) y = HIP_OR_CUDA(N_VNew_Hip(matrows * nblocks, sunctx); , N_VNew_Cuda(matrows * nblocks, sunctx);) A = SUNMatrix_MagmaDenseBlock(nblocks, matrows, matcols, - SUN_MEMTYPE_DEVICE, memhelper, NULL, sunctx); + SUNMEMTYPE__DEVICE, memhelper, NULL, sunctx); if (square) { I = SUNMatClone(A); } /* Allocate host data */ diff --git a/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp b/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp index 05d72b11b5..c423df6371 100644 --- a/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp +++ b/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp @@ -147,7 +147,7 @@ int main(int argc, char* argv[]) } SUNMatrix A = SUNMatrix_OneMklDenseBlock(nblocks, matrows, matcols, - SUN_MEMTYPE_DEVICE, memhelper, + SUNMEMTYPE__DEVICE, memhelper, &myQueue, sunctx); if (!A) { diff --git a/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu b/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu index 9f65eed8a9..d6b0c81fb6 100644 --- a/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu +++ b/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu @@ -37,7 +37,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, // Write to the memory sunrealtype host_arr[N]; sunrealtype* some_arr = static_cast(some_memory->ptr); - if (mem_type == SUN_MEMTYPE_DEVICE) + if (mem_type == SUNMEMTYPE__DEVICE) { for (int i = 0; i < N; i++) { host_arr[i] = i * sunrealtype{1.0}; } cudaMemcpy(some_memory->ptr, host_arr, bytes_to_alloc, @@ -64,7 +64,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, } return -1; } - if (mem_type == SUN_MEMTYPE_DEVICE) + if (mem_type == SUNMEMTYPE__DEVICE) { sunrealtype other_arr[N]; cudaMemcpy(other_arr, other_memory->ptr, bytes_to_alloc, @@ -208,17 +208,17 @@ int main(int argc, char* argv[]) std::cout << " SUNMemoryHelper_Cuda... PASSED\n"; std::cout << "With host memory... \n"; - test_instance(helper, SUN_MEMTYPE_HOST, true); + test_instance(helper, SUNMEMTYPE__HOST, true); std::cout << "With pinned memory... \n"; - test_instance(helper, SUN_MEMTYPE_PINNED, true); + test_instance(helper, SUNMEMTYPE__PINNED, true); std::cout << "With device memory... \n"; - test_instance(helper, SUN_MEMTYPE_DEVICE, true); + test_instance(helper, SUNMEMTYPE__DEVICE, true); std::cout << "With uvm memory... \n"; - test_instance(helper, SUN_MEMTYPE_UVM, true); + test_instance(helper, SUNMEMTYPE__UVM, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUN_MEMTYPE_HOST, false)) + if (!helper || test_instance(helper2, SUNMEMTYPE__HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; diff --git a/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp b/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp index e71253b433..9af63b0fdd 100644 --- a/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp +++ b/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp @@ -37,7 +37,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, // Write to the memory sunrealtype host_arr[N]; sunrealtype* some_arr = static_cast(some_memory->ptr); - if (mem_type == SUN_MEMTYPE_DEVICE) + if (mem_type == SUNMEMTYPE__DEVICE) { for (int i = 0; i < N; i++) { host_arr[i] = i * sunrealtype{1.0}; } hipMemcpy(some_memory->ptr, host_arr, bytes_to_alloc, hipMemcpyHostToDevice); @@ -63,7 +63,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, } return -1; } - if (mem_type == SUN_MEMTYPE_DEVICE) + if (mem_type == SUNMEMTYPE__DEVICE) { sunrealtype other_arr[N]; hipMemcpy(other_arr, other_memory->ptr, bytes_to_alloc, @@ -207,17 +207,17 @@ int main(int argc, char* argv[]) std::cout << " SUNMemoryHelper_Hip... PASSED\n"; std::cout << "With host memory... \n"; - test_instance(helper, SUN_MEMTYPE_HOST, true); + test_instance(helper, SUNMEMTYPE__HOST, true); std::cout << "With pinned memory... \n"; - test_instance(helper, SUN_MEMTYPE_PINNED, true); + test_instance(helper, SUNMEMTYPE__PINNED, true); std::cout << "With device memory... \n"; - test_instance(helper, SUN_MEMTYPE_DEVICE, true); + test_instance(helper, SUNMEMTYPE__DEVICE, true); std::cout << "With uvm memory... \n"; - test_instance(helper, SUN_MEMTYPE_UVM, true); + test_instance(helper, SUNMEMTYPE__UVM, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUN_MEMTYPE_HOST, false)) + if (!helper || test_instance(helper2, SUNMEMTYPE__HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; diff --git a/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp b/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp index 29c0233501..eb760ca976 100644 --- a/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp +++ b/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp @@ -48,7 +48,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, // Write to the memory sunrealtype host_arr[N]; sunrealtype* some_arr = static_cast(some_memory->ptr); - if (mem_type == SUN_MEMTYPE_DEVICE) + if (mem_type == SUNMEMTYPE__DEVICE) { for (int i = 0; i < N; i++) { host_arr[i] = i * sunrealtype{1.0}; } myQueue.memcpy(some_memory->ptr, host_arr, bytes_to_alloc); @@ -84,7 +84,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, } return -1; } - if (mem_type == SUN_MEMTYPE_DEVICE) + if (mem_type == SUNMEMTYPE__DEVICE) { sunrealtype other_arr[N]; myQueue.memcpy(other_arr, other_memory->ptr, bytes_to_alloc); @@ -230,17 +230,17 @@ int main(int argc, char* argv[]) std::cout << " SUNMemoryHelper_Sycl... PASSED\n"; std::cout << "With host memory... \n"; - test_instance(helper, SUN_MEMTYPE_HOST, true); + test_instance(helper, SUNMEMTYPE__HOST, true); std::cout << "With pinned memory... \n"; - test_instance(helper, SUN_MEMTYPE_PINNED, true); + test_instance(helper, SUNMEMTYPE__PINNED, true); std::cout << "With device memory... \n"; - test_instance(helper, SUN_MEMTYPE_DEVICE, true); + test_instance(helper, SUNMEMTYPE__DEVICE, true); std::cout << "With uvm memory... \n"; - test_instance(helper, SUN_MEMTYPE_UVM, true); + test_instance(helper, SUNMEMTYPE__UVM, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUN_MEMTYPE_HOST, false)) + if (!helper || test_instance(helper2, SUNMEMTYPE__HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; diff --git a/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp b/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp index 53eb48e388..5b6ea96120 100644 --- a/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp +++ b/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp @@ -179,11 +179,11 @@ int main(int argc, char* argv[]) } std::cout << " SUNMemoryHelper_Sys... PASSED\n"; - test_instance(helper, SUN_MEMTYPE_HOST, true); + test_instance(helper, SUNMEMTYPE__HOST, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUN_MEMTYPE_HOST, false)) + if (!helper || test_instance(helper2, SUNMEMTYPE__HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; From 73fe7712d2ceade68b9863d1355d1dc3ff167b08 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 13:56:57 -0700 Subject: [PATCH 16/26] find/replace double underscore SUNMEMTYPE__ --- .../raja/ParallelGrid.hpp | 14 ++--- doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst | 4 +- .../sunmatrix/SUNMatrix_OneMklDense.rst | 4 +- doc/shared/sunmemory/SUNMemory_CUDA.rst | 8 +-- .../sunmemory/SUNMemory_Description.rst | 8 +-- doc/shared/sunmemory/SUNMemory_HIP.rst | 8 +-- doc/shared/sunmemory/SUNMemory_SYCL.rst | 8 +-- .../CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp | 2 +- .../cvode/magma/cv_bruss_batched_magma.cpp | 4 +- examples/utilities/custom_memory_helper_gpu.h | 24 ++++---- .../utilities/custom_memory_helper_sycl.h | 14 ++--- src/nvector/cuda/nvector_cuda.cu | 56 +++++++++---------- src/nvector/hip/nvector_hip.hip.cpp | 44 +++++++-------- src/nvector/raja/nvector_raja.cpp | 42 +++++++------- src/nvector/sycl/nvector_sycl.cpp | 56 +++++++++---------- src/sundials/sundatanode/sundatanode_inmem.c | 6 +- src/sundials/sundials_memory.c | 4 +- .../magmadense/sunlinsol_magmadense.cpp | 10 ++-- src/sunmatrix/cusparse/sunmatrix_cusparse.cu | 32 +++++------ .../magmadense/sunmatrix_magmadense.cpp | 6 +- .../onemkldense/sunmatrix_onemkldense.cpp | 6 +- src/sunmemory/cuda/sundials_cuda_memory.cu | 56 +++++++++---------- src/sunmemory/hip/sundials_hip_memory.hip.cpp | 56 +++++++++---------- src/sunmemory/sycl/sundials_sycl_memory.cpp | 30 +++++----- src/sunmemory/system/sundials_system_memory.c | 14 ++--- .../sundials/test_sundials_datanode.cpp | 20 +++---- .../magmadense/test_sunlinsol_magmadense.cpp | 4 +- .../test_sunlinsol_onemkldense.cpp | 4 +- .../magmadense/test_sunmatrix_magmadense.cpp | 2 +- .../test_sunmatrix_onemkldense.cpp | 2 +- .../sunmemory/cuda/test_sunmemory_cuda.cu | 14 ++--- .../sunmemory/hip/test_sunmemory_hip.cpp | 14 ++--- .../sunmemory/sycl/test_sunmemory_sycl.cpp | 14 ++--- .../sunmemory/sys/test_sunmemory_sys.cpp | 4 +- 34 files changed, 297 insertions(+), 297 deletions(-) diff --git a/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp b/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp index 50e32e8a6c..c5c06d214c 100644 --- a/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp +++ b/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp @@ -549,25 +549,25 @@ class ParallelGrid SUNMemoryType memoryType() { SUNMemory test; - if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE__PINNED, + if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE_PINNED, nullptr)) { SUNMemoryHelper_Dealloc(memhelp, test, nullptr); - return (SUNMEMTYPE__PINNED); + return (SUNMEMTYPE_PINNED); } - if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE__DEVICE, + if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE_DEVICE, nullptr)) { SUNMemoryHelper_Dealloc(memhelp, test, nullptr); - return (SUNMEMTYPE__DEVICE); + return (SUNMEMTYPE_DEVICE); } - if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE__UVM, + if (!SUNMemoryHelper_Alloc(memhelp, &test, sizeof(REAL), SUNMEMTYPE_UVM, nullptr)) { SUNMemoryHelper_Dealloc(memhelp, test, nullptr); - return (SUNMEMTYPE__UVM); + return (SUNMEMTYPE_UVM); } - else { return (SUNMEMTYPE__HOST); } + else { return (SUNMEMTYPE_HOST); } } }; diff --git a/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst b/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst index a3586996af..7c39b4e2ef 100644 --- a/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_MagmaDense.rst @@ -80,7 +80,7 @@ implementation specific functions: * *M* -- the number of matrix rows. * *N* -- the number of matrix columns. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUNMEMTYPE__UVM`` or ``SUNMEMTYPE__DEVICE``. + ``SUNMEMTYPE_UVM`` or ``SUNMEMTYPE_DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- a ``cudaStream_t`` when using CUDA or a ``hipStream_t`` when using HIP. @@ -100,7 +100,7 @@ implementation specific functions: * *M_block* -- the number of matrix rows in each block. * *N_block* -- the number of matrix columns in each block. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUNMEMTYPE__UVM`` or ``SUNMEMTYPE__DEVICE``. + ``SUNMEMTYPE_UVM`` or ``SUNMEMTYPE_DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- a ``cudaStream_t`` when using CUDA or a ``hipStream_t`` when using HIP. diff --git a/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst b/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst index 04562f277a..5dc17353c0 100644 --- a/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_OneMklDense.rst @@ -80,7 +80,7 @@ Constructors * *M* -- the number of matrix rows. * *N* -- the number of matrix columns. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUNMEMTYPE__UVM`` or ``SUNMEMTYPE__DEVICE``. + ``SUNMEMTYPE_UVM`` or ``SUNMEMTYPE_DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- the SYCL queue to which operations will be submitted. * *sunctx* -- the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) @@ -100,7 +100,7 @@ Constructors * *M_block* -- the number of matrix rows in each block. * *N_block* -- the number of matrix columns in each block. * *memtype* -- the type of memory to use for the matrix data; can be - ``SUNMEMTYPE__UVM`` or ``SUNMEMTYPE__DEVICE``. + ``SUNMEMTYPE_UVM`` or ``SUNMEMTYPE_DEVICE``. * *memhelper* -- the memory helper used for allocating data. * *queue* -- the SYCL queue to which operations will be submitted. * *sunctx* -- the :c:type:`SUNContext` object (see :numref:`SUNDIALS.SUNContext`) diff --git a/doc/shared/sunmemory/SUNMemory_CUDA.rst b/doc/shared/sunmemory/SUNMemory_CUDA.rst index 2ebec7c0df..cdb5478151 100644 --- a/doc/shared/sunmemory/SUNMemory_CUDA.rst +++ b/doc/shared/sunmemory/SUNMemory_CUDA.rst @@ -52,10 +52,10 @@ The implementation provides the following operations defined by the :param memptr: pointer to the allocated ``SUNMemory``. :param mem_size: the size in bytes of the ``ptr``. :param mem_type: the ``SUNMemoryType`` of the ``ptr``. Supported values are: - * ``SUNMEMTYPE__HOST`` -- memory is allocated with a call to ``malloc``. - * ``SUNMEMTYPE__PINNED`` -- memory is allocated with a call to ``cudaMallocHost``. - * ``SUNMEMTYPE__DEVICE`` -- memory is allocated with a call to ``cudaMalloc``. - * ``SUNMEMTYPE__UVM`` -- memory is allocated with a call to ``cudaMallocManaged``. + * ``SUNMEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. + * ``SUNMEMTYPE_PINNED`` -- memory is allocated with a call to ``cudaMallocHost``. + * ``SUNMEMTYPE_DEVICE`` -- memory is allocated with a call to ``cudaMalloc``. + * ``SUNMEMTYPE_UVM`` -- memory is allocated with a call to ``cudaMallocManaged``. :param queue: currently unused. :return: A new :c:type:`SUNMemory` object. diff --git a/doc/shared/sunmemory/SUNMemory_Description.rst b/doc/shared/sunmemory/SUNMemory_Description.rst index 760a30e7c0..144b0d38f6 100644 --- a/doc/shared/sunmemory/SUNMemory_Description.rst +++ b/doc/shared/sunmemory/SUNMemory_Description.rst @@ -66,19 +66,19 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, The :c:type:`SUNMemoryType` type is an enumeration that defines the supported memory types: - .. c:enumerator:: SUNMEMTYPE__HOST + .. c:enumerator:: SUNMEMTYPE_HOST Pageable memory accessible on the host - .. c:enumerator:: SUNMEMTYPE__PINNED + .. c:enumerator:: SUNMEMTYPE_PINNED Page-locked memory accessible on the host - .. c:enumerator:: SUNMEMTYPE__DEVICE + .. c:enumerator:: SUNMEMTYPE_DEVICE Memory accessible from the device - .. c:enumerator:: SUNMEMTYPE__UVM + .. c:enumerator:: SUNMEMTYPE_UVM Memory accessible from the host or device diff --git a/doc/shared/sunmemory/SUNMemory_HIP.rst b/doc/shared/sunmemory/SUNMemory_HIP.rst index ecf929f70c..5936fba525 100644 --- a/doc/shared/sunmemory/SUNMemory_HIP.rst +++ b/doc/shared/sunmemory/SUNMemory_HIP.rst @@ -52,10 +52,10 @@ The implementation provides the following operations defined by the :param memptr: pointer to the allocated ``SUNMemory``. :param mem_size: the size in bytes of the ``ptr``. :param mem_type: the ``SUNMemoryType`` of the ``ptr``. Supported values are: - * ``SUNMEMTYPE__HOST`` -- memory is allocated with a call to ``malloc``. - * ``SUNMEMTYPE__PINNED`` -- memory is allocated with a call to ``hipMallocHost``. - * ``SUNMEMTYPE__DEVICE`` -- memory is allocated with a call to ``hipMalloc``. - * ``SUNMEMTYPE__UVM`` -- memory is allocated with a call to ``hipMallocManaged``. + * ``SUNMEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. + * ``SUNMEMTYPE_PINNED`` -- memory is allocated with a call to ``hipMallocHost``. + * ``SUNMEMTYPE_DEVICE`` -- memory is allocated with a call to ``hipMalloc``. + * ``SUNMEMTYPE_UVM`` -- memory is allocated with a call to ``hipMallocManaged``. :param queue: currently unused. :return: A new :c:type:`SUNMemory` object. diff --git a/doc/shared/sunmemory/SUNMemory_SYCL.rst b/doc/shared/sunmemory/SUNMemory_SYCL.rst index 006c55be3c..7d9a62e254 100644 --- a/doc/shared/sunmemory/SUNMemory_SYCL.rst +++ b/doc/shared/sunmemory/SUNMemory_SYCL.rst @@ -52,10 +52,10 @@ The implementation provides the following operations defined by the :param memptr: pointer to the allocated ``SUNMemory``. :param mem_size: the size in bytes of the ``ptr``. :param mem_type: the ``SUNMemoryType`` of the ``ptr``. Supported values are: - * ``SUNMEMTYPE__HOST`` -- memory is allocated with a call to ``malloc``. - * ``SUNMEMTYPE__PINNED`` -- memory is allocated with a call to ``sycl::malloc_host``. - * ``SUNMEMTYPE__DEVICE`` -- memory is allocated with a call to ``sycl::malloc_device``. - * ``SUNMEMTYPE__UVM`` -- memory is allocated with a call to ``sycl::malloc_shared``. + * ``SUNMEMTYPE_HOST`` -- memory is allocated with a call to ``malloc``. + * ``SUNMEMTYPE_PINNED`` -- memory is allocated with a call to ``sycl::malloc_host``. + * ``SUNMEMTYPE_DEVICE`` -- memory is allocated with a call to ``sycl::malloc_device``. + * ``SUNMEMTYPE_UVM`` -- memory is allocated with a call to ``sycl::malloc_shared``. :param queue: the ``sycl::queue`` handle for the stream that the allocation will be performed on. :return: A new :c:type:`SUNMemory` object. diff --git a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp index d0b0ae2eea..429aaf4313 100644 --- a/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp +++ b/examples/cvode/CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp @@ -208,7 +208,7 @@ int main(int argc, char* argv[]) { // Create SUNMatrix for use in linear solves A = SUNMatrix_OneMklDenseBlock(ngroups, GROUPSIZE, GROUPSIZE, - SUNMEMTYPE__DEVICE, memhelper, &myQueue, + SUNMEMTYPE_DEVICE, memhelper, &myQueue, sunctx); if (check_retval((void*)A, "SUNMatrix_OneMklDenseBlock", 0)) { return 1; } diff --git a/examples/cvode/magma/cv_bruss_batched_magma.cpp b/examples/cvode/magma/cv_bruss_batched_magma.cpp index deee81514f..e7e007d2e0 100644 --- a/examples/cvode/magma/cv_bruss_batched_magma.cpp +++ b/examples/cvode/magma/cv_bruss_batched_magma.cpp @@ -131,7 +131,7 @@ class Array public: Array(I size, SUNMemoryHelper helper) : helper_(helper), mem_(nullptr) { - SUNMemoryHelper_Alloc(helper, &mem_, size * sizeof(T), SUNMEMTYPE__UVM, NULL); + SUNMemoryHelper_Alloc(helper, &mem_, size * sizeof(T), SUNMEMTYPE_UVM, NULL); } Array(SUNMemory mem, SUNMemoryHelper helper) : helper_(helper), mem_(mem) {} @@ -301,7 +301,7 @@ int main(int argc, char* argv[]) { /* Create SUNMatrix for use in linear solves */ A = SUNMatrix_MagmaDenseBlock(udata.nbatches, udata.batchSize, - udata.batchSize, SUNMEMTYPE__DEVICE, memhelper, + udata.batchSize, SUNMEMTYPE_DEVICE, memhelper, NULL, sunctx); if (check_retval((void*)A, "SUNMatrix_MagmaDenseBlock", 0)) { return (1); } diff --git a/examples/utilities/custom_memory_helper_gpu.h b/examples/utilities/custom_memory_helper_gpu.h index 4418ebe421..f9677bd274 100644 --- a/examples/utilities/custom_memory_helper_gpu.h +++ b/examples/utilities/custom_memory_helper_gpu.h @@ -59,7 +59,7 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, mem->ptr = NULL; mem->own = SUNTRUE; - if (mem_type == SUNMEMTYPE__HOST) + if (mem_type == SUNMEMTYPE_HOST) { mem->ptr = malloc(mem_size); if (mem->ptr == NULL) @@ -67,12 +67,12 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, free(mem); return (-1); } - mem->type = SUNMEMTYPE__HOST; + mem->type = SUNMEMTYPE_HOST; } - else if (mem_type == SUNMEMTYPE__UVM || mem_type == SUNMEMTYPE__DEVICE) + else if (mem_type == SUNMEMTYPE_UVM || mem_type == SUNMEMTYPE_DEVICE) { MY_GPUCHK(MY_GPU(Malloc)(&(mem->ptr), mem_size)); - mem->type = SUNMEMTYPE__DEVICE; + mem->type = SUNMEMTYPE_DEVICE; } else { @@ -90,12 +90,12 @@ int MyMemoryHelper_Dealloc(SUNMemoryHelper helper, SUNMemory mem, void* queue) if (mem->ptr && mem->own) { - if (mem->type == SUNMEMTYPE__HOST) + if (mem->type == SUNMEMTYPE_HOST) { free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE__DEVICE) + else if (mem->type == SUNMEMTYPE_DEVICE) { MY_GPUCHK(MY_GPU(Free)(mem->ptr)); mem->ptr = NULL; @@ -113,24 +113,24 @@ int MyMemoryHelper_Copy(SUNMemoryHelper helper, SUNMemory dst, SUNMemory src, { switch (src->type) { - case SUNMEMTYPE__HOST: - if (dst->type == SUNMEMTYPE__HOST) + case SUNMEMTYPE_HOST: + if (dst->type == SUNMEMTYPE_HOST) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUNMEMTYPE__DEVICE) + else if (dst->type == SUNMEMTYPE_DEVICE) { MY_GPUCHK(MY_GPU(Memcpy)(dst->ptr, src->ptr, memory_size, MY_GPU(MemcpyHostToDevice))); } break; - case SUNMEMTYPE__DEVICE: - if (dst->type == SUNMEMTYPE__HOST) + case SUNMEMTYPE_DEVICE: + if (dst->type == SUNMEMTYPE_HOST) { MY_GPUCHK(MY_GPU(Memcpy)(dst->ptr, src->ptr, memory_size, MY_GPU(MemcpyDeviceToHost))); } - else if (dst->type == SUNMEMTYPE__DEVICE) + else if (dst->type == SUNMEMTYPE_DEVICE) { MY_GPUCHK(MY_GPU(Memcpy)(dst->ptr, src->ptr, memory_size, MY_GPU(MemcpyDeviceToDevice))); diff --git a/examples/utilities/custom_memory_helper_sycl.h b/examples/utilities/custom_memory_helper_sycl.h index 2d26e9f1a5..bd6bf233b2 100644 --- a/examples/utilities/custom_memory_helper_sycl.h +++ b/examples/utilities/custom_memory_helper_sycl.h @@ -34,7 +34,7 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, mem->ptr = NULL; mem->own = SUNTRUE; - if (mem_type == SUNMEMTYPE__HOST) + if (mem_type == SUNMEMTYPE_HOST) { mem->ptr = malloc(mem_size); if (mem->ptr == NULL) @@ -42,9 +42,9 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, free(mem); return -1; } - mem->type = SUNMEMTYPE__HOST; + mem->type = SUNMEMTYPE_HOST; } - else if (mem_type == SUNMEMTYPE__DEVICE) + else if (mem_type == SUNMEMTYPE_DEVICE) { mem->ptr = sycl::malloc_device(mem_size, *sycl_queue); if (mem->ptr == NULL) @@ -52,7 +52,7 @@ int MyMemoryHelper_Alloc(SUNMemoryHelper helper, SUNMemory* memptr, free(mem); return -1; } - mem->type = SUNMEMTYPE__DEVICE; + mem->type = SUNMEMTYPE_DEVICE; } else { @@ -74,12 +74,12 @@ int MyMemoryHelper_Dealloc(SUNMemoryHelper helper, SUNMemory mem, void* queue) sycl::queue* sycl_queue = static_cast(queue); - if (mem->type == SUNMEMTYPE__HOST) + if (mem->type == SUNMEMTYPE_HOST) { free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE__DEVICE) + else if (mem->type == SUNMEMTYPE_DEVICE) { sycl::free(mem->ptr, *sycl_queue); mem->ptr = NULL; @@ -98,7 +98,7 @@ int MyMemoryHelper_Copy(SUNMemoryHelper helper, SUNMemory dst, SUNMemory src, if (!queue) return -1; sycl::queue* sycl_queue = static_cast(queue); - if (src->type == SUNMEMTYPE__HOST && dst->type == SUNMEMTYPE__HOST) + if (src->type == SUNMEMTYPE_HOST && dst->type == SUNMEMTYPE_HOST) { memcpy(dst->ptr, src->ptr, memory_size); } diff --git a/src/nvector/cuda/nvector_cuda.cu b/src/nvector/cuda/nvector_cuda.cu index a78c3630a4..b312a33973 100644 --- a/src/nvector/cuda/nvector_cuda.cu +++ b/src/nvector/cuda/nvector_cuda.cu @@ -354,9 +354,9 @@ N_Vector N_VMake_Cuda(sunindextype length, sunrealtype* h_vdata, NVEC_CUDA_CONTENT(v)->length = length; NVEC_CUDA_CONTENT(v)->mem_helper = SUNMemoryHelper_Cuda(sunctx); NVEC_CUDA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), h_vdata, SUNMEMTYPE__HOST); + SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), h_vdata, SUNMEMTYPE_HOST); NVEC_CUDA_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), d_vdata, SUNMEMTYPE__DEVICE); + SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), d_vdata, SUNMEMTYPE_DEVICE); NVEC_CUDA_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); NVEC_CUDA_CONTENT(v)->reduce_exec_policy = DEFAULT_REDUCTION_EXECPOLICY.clone(); NVEC_CUDA_CONTENT(v)->own_helper = SUNTRUE; @@ -395,7 +395,7 @@ N_Vector N_VMakeManaged_Cuda(sunindextype length, sunrealtype* vdata, NVEC_CUDA_CONTENT(v)->length = length; NVEC_CUDA_CONTENT(v)->mem_helper = SUNMemoryHelper_Cuda(sunctx); NVEC_CUDA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), vdata, SUNMEMTYPE__UVM); + SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), vdata, SUNMEMTYPE_UVM); NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->host_data); NVEC_CUDA_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); @@ -440,7 +440,7 @@ void N_VSetHostArrayPointer_Cuda(sunrealtype* h_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE__UVM); + SUNMEMTYPE_UVM); NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->host_data); @@ -456,7 +456,7 @@ void N_VSetHostArrayPointer_Cuda(sunrealtype* h_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); } } } @@ -478,7 +478,7 @@ void N_VSetDeviceArrayPointer_Cuda(sunrealtype* d_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE__UVM); + SUNMEMTYPE_UVM); NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->device_data); @@ -494,7 +494,7 @@ void N_VSetDeviceArrayPointer_Cuda(sunrealtype* d_vdata, N_Vector v) { NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE__DEVICE); + SUNMEMTYPE_DEVICE); } } } @@ -2033,7 +2033,7 @@ SUNErrCode N_VBufPack_Cuda(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(x), buf, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_CUDA_MEMHELP(x), buf_mem, @@ -2059,7 +2059,7 @@ SUNErrCode N_VBufUnpack_Cuda(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(x), buf, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_CUDA_MEMHELP(x), @@ -2231,33 +2231,33 @@ static int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vc->device_data), - NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE__UVM, + NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE_UVM, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUNMEMTYPE__UVM\n"); + "failed for SUNMEMTYPE_UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vc->host_data), - NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE__HOST, + NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE_HOST, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__HOST\n"); + "failed to alloc SUNMEMTYPE_HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vc->device_data), - NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE__DEVICE, + NVEC_CUDA_MEMSIZE(v), SUNMEMTYPE_DEVICE, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__DEVICE\n"); + "failed to alloc SUNMEMTYPE_DEVICE\n"); } } @@ -2293,37 +2293,37 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) // Allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE__PINNED, + SUNMEMTYPE_PINNED, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); + "alloc SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); // If pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE__HOST, + SUNMEMTYPE_HOST, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE__HOST\n"); + "alloc SUNMEMTYPE_HOST\n"); } } // Allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->reduce_buffer_dev), bytes, - SUNMEMTYPE__DEVICE, + SUNMEMTYPE_DEVICE, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE__DEVICE\n"); + "alloc SUNMEMTYPE_DEVICE\n"); } } @@ -2436,23 +2436,23 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // Allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE__PINNED, + SUNMEMTYPE_PINNED, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in FusedBuffer_Init: SUNMemoryHelper_Alloc failed to alloc " - "SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); + "SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); // If pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE__HOST, + SUNMEMTYPE_HOST, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__HOST\n"); + "failed to alloc SUNMEMTYPE_HOST\n"); return SUN_ERR_GENERIC; } } @@ -2460,12 +2460,12 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // Allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(vcp->fused_buffer_dev), bytes, - SUNMEMTYPE__DEVICE, + SUNMEMTYPE_DEVICE, (void*)NVEC_CUDA_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__DEVICE\n"); + "failed to alloc SUNMEMTYPE_DEVICE\n"); return SUN_ERR_GENERIC; } @@ -2633,7 +2633,7 @@ static int InitializeDeviceCounter(N_Vector v) { retval = SUNMemoryHelper_Alloc(NVEC_CUDA_MEMHELP(v), &(NVEC_CUDA_PRIVATE(v)->device_counter), - sizeof(unsigned int), SUNMEMTYPE__DEVICE, + sizeof(unsigned int), SUNMEMTYPE_DEVICE, (void*)NVEC_CUDA_STREAM(v)); } cudaMemsetAsync(NVEC_CUDA_DCOUNTERp(v), 0, sizeof(unsigned int), diff --git a/src/nvector/hip/nvector_hip.hip.cpp b/src/nvector/hip/nvector_hip.hip.cpp index 24b8f28d36..5fbe7f16f3 100644 --- a/src/nvector/hip/nvector_hip.hip.cpp +++ b/src/nvector/hip/nvector_hip.hip.cpp @@ -325,9 +325,9 @@ N_Vector N_VMake_Hip(sunindextype length, sunrealtype* h_vdata, NVEC_HIP_CONTENT(v)->length = length; NVEC_HIP_CONTENT(v)->mem_helper = SUNMemoryHelper_Hip(sunctx); NVEC_HIP_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), h_vdata, SUNMEMTYPE__HOST); + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), h_vdata, SUNMEMTYPE_HOST); NVEC_HIP_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), d_vdata, SUNMEMTYPE__DEVICE); + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), d_vdata, SUNMEMTYPE_DEVICE); NVEC_HIP_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); NVEC_HIP_CONTENT(v)->reduce_exec_policy = DEFAULT_REDUCTION_EXECPOLICY.clone(); NVEC_HIP_CONTENT(v)->own_helper = SUNTRUE; @@ -366,7 +366,7 @@ N_Vector N_VMakeManaged_Hip(sunindextype length, sunrealtype* vdata, NVEC_HIP_CONTENT(v)->length = length; NVEC_HIP_CONTENT(v)->mem_helper = SUNMemoryHelper_Hip(sunctx); NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), - vdata, SUNMEMTYPE__UVM); + vdata, SUNMEMTYPE_UVM); NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->host_data); NVEC_HIP_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); @@ -411,7 +411,7 @@ void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v) { NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE__UVM); + SUNMEMTYPE_UVM); NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->host_data); @@ -427,7 +427,7 @@ void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v) { NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); } } } @@ -449,7 +449,7 @@ void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v) { NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE__UVM); + SUNMEMTYPE_UVM); NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->device_data); @@ -465,7 +465,7 @@ void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v) { NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE__DEVICE); + SUNMEMTYPE_DEVICE); } } } @@ -1978,7 +1978,7 @@ SUNErrCode N_VBufPack_Hip(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(x), buf, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_HIP_MEMHELP(x), buf_mem, @@ -2004,7 +2004,7 @@ SUNErrCode N_VBufUnpack_Hip(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(x), buf, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_CopyAsync(NVEC_HIP_MEMHELP(x), @@ -2269,33 +2269,33 @@ int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vc->device_data), - NVEC_HIP_MEMSIZE(v), SUNMEMTYPE__UVM, + NVEC_HIP_MEMSIZE(v), SUNMEMTYPE_UVM, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUNMEMTYPE__UVM\n"); + "failed for SUNMEMTYPE_UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vc->host_data), - NVEC_HIP_MEMSIZE(v), SUNMEMTYPE__HOST, + NVEC_HIP_MEMSIZE(v), SUNMEMTYPE_HOST, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__HOST\n"); + "failed to alloc SUNMEMTYPE_HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vc->device_data), - NVEC_HIP_MEMSIZE(v), SUNMEMTYPE__DEVICE, + NVEC_HIP_MEMSIZE(v), SUNMEMTYPE_DEVICE, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__DEVICE\n"); + "failed to alloc SUNMEMTYPE_DEVICE\n"); } } @@ -2331,37 +2331,37 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) // Allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE__PINNED, + SUNMEMTYPE_PINNED, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); + "alloc SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); // If pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE__HOST, + SUNMEMTYPE_HOST, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE__HOST\n"); + "alloc SUNMEMTYPE_HOST\n"); } } // Allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_dev), bytes, - SUNMEMTYPE__DEVICE, + SUNMEMTYPE_DEVICE, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE__DEVICE\n"); + "alloc SUNMEMTYPE_DEVICE\n"); } } @@ -2453,7 +2453,7 @@ static int InitializeDeviceCounter(N_Vector v) { retval = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(NVEC_HIP_PRIVATE(v)->device_counter), - sizeof(unsigned int), SUNMEMTYPE__DEVICE, + sizeof(unsigned int), SUNMEMTYPE_DEVICE, (void*)NVEC_HIP_STREAM(v)); } hipMemsetAsync(NVEC_HIP_DCOUNTERp(v), 0, sizeof(unsigned int), diff --git a/src/nvector/raja/nvector_raja.cpp b/src/nvector/raja/nvector_raja.cpp index 715e2b9067..4e0f131a75 100644 --- a/src/nvector/raja/nvector_raja.cpp +++ b/src/nvector/raja/nvector_raja.cpp @@ -354,9 +354,9 @@ N_Vector N_VMake_Raja(sunindextype length, sunrealtype* h_vdata, #endif NVEC_RAJA_CONTENT(v)->own_helper = SUNTRUE; NVEC_RAJA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), h_vdata, SUNMEMTYPE__HOST); + SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), h_vdata, SUNMEMTYPE_HOST); NVEC_RAJA_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), d_vdata, SUNMEMTYPE__DEVICE); + SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), d_vdata, SUNMEMTYPE_DEVICE); NVEC_RAJA_PRIVATE(v)->use_managed_mem = SUNFALSE; if (NVEC_RAJA_MEMHELP(v) == NULL) @@ -399,7 +399,7 @@ N_Vector N_VMakeManaged_Raja(sunindextype length, sunrealtype* vdata, #endif NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_RAJA_CONTENT(v)->mem_helper, vdata, - SUNMEMTYPE__UVM); + SUNMEMTYPE_UVM); NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_RAJA_CONTENT(v)->mem_helper, NVEC_RAJA_CONTENT(v)->host_data); @@ -466,7 +466,7 @@ void N_VSetHostArrayPointer_Raja(sunrealtype* h_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE__UVM); + SUNMEMTYPE_UVM); NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_RAJA_MEMHELP(v), NVEC_RAJA_CONTENT(v)->host_data); @@ -482,7 +482,7 @@ void N_VSetHostArrayPointer_Raja(sunrealtype* h_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); } } } @@ -504,7 +504,7 @@ void N_VSetDeviceArrayPointer_Raja(sunrealtype* d_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE__UVM); + SUNMEMTYPE_UVM); NVEC_RAJA_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_RAJA_MEMHELP(v), NVEC_RAJA_CONTENT(v)->device_data); @@ -520,7 +520,7 @@ void N_VSetDeviceArrayPointer_Raja(sunrealtype* d_vdata, N_Vector v) { NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE__DEVICE); + SUNMEMTYPE_DEVICE); } } } @@ -1453,7 +1453,7 @@ SUNErrCode N_VBufPack_Raja(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(x), buf, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } #if defined(SUNDIALS_RAJA_BACKENDS_SYCL) @@ -1494,7 +1494,7 @@ SUNErrCode N_VBufUnpack_Raja(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_RAJA_MEMHELP(x), buf, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } #if defined(SUNDIALS_RAJA_BACKENDS_SYCL) @@ -1716,33 +1716,33 @@ int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vc->device_data), - NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE__UVM, + NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE_UVM, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUNMEMTYPE__UVM\n"); + "failed for SUNMEMTYPE_UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_RAJA_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vc->host_data), - NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE__HOST, + NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE_HOST, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__HOST\n"); + "failed to alloc SUNMEMTYPE_HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vc->device_data), - NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE__DEVICE, + NVEC_RAJA_MEMSIZE(v), SUNMEMTYPE_DEVICE, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__DEVICE\n"); + "failed to alloc SUNMEMTYPE_DEVICE\n"); } } @@ -1776,21 +1776,21 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // allocate pinned memory on the host alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE__PINNED, queue); + SUNMEMTYPE_PINNED, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in FusedBuffer_Init: SUNMemoryHelper_Alloc failed to alloc " - "SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); + "SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); // if pinned alloc failed, allocate plain host memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE__HOST, queue); + SUNMEMTYPE_HOST, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__HOST\n"); + "failed to alloc SUNMEMTYPE_HOST\n"); return SUN_ERR_GENERIC; } } @@ -1798,11 +1798,11 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) // allocate device memory alloc_fail = SUNMemoryHelper_Alloc(NVEC_RAJA_MEMHELP(v), &(vcp->fused_buffer_dev), bytes, - SUNMEMTYPE__DEVICE, queue); + SUNMEMTYPE_DEVICE, queue); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__DEVICE\n"); + "failed to alloc SUNMEMTYPE_DEVICE\n"); return SUN_ERR_GENERIC; } diff --git a/src/nvector/sycl/nvector_sycl.cpp b/src/nvector/sycl/nvector_sycl.cpp index b032f1ec1f..27d709c765 100644 --- a/src/nvector/sycl/nvector_sycl.cpp +++ b/src/nvector/sycl/nvector_sycl.cpp @@ -435,9 +435,9 @@ N_Vector N_VMake_Sycl(sunindextype length, sunrealtype* h_vdata, NVEC_SYCL_CONTENT(v)->own_helper = SUNTRUE; NVEC_SYCL_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); NVEC_SYCL_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), h_vdata, SUNMEMTYPE__HOST); + SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), h_vdata, SUNMEMTYPE_HOST); NVEC_SYCL_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), d_vdata, SUNMEMTYPE__DEVICE); + SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), d_vdata, SUNMEMTYPE_DEVICE); NVEC_SYCL_CONTENT(v)->stream_exec_policy = new ThreadDirectExecPolicy(SYCL_BLOCKDIM(Q)); NVEC_SYCL_CONTENT(v)->reduce_exec_policy = @@ -502,7 +502,7 @@ N_Vector N_VMakeManaged_Sycl(sunindextype length, sunrealtype* vdata, NVEC_SYCL_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); NVEC_SYCL_CONTENT(v)->own_helper = SUNTRUE; NVEC_SYCL_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), vdata, SUNMEMTYPE__UVM); + SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), vdata, SUNMEMTYPE_UVM); NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->host_data); NVEC_SYCL_CONTENT(v)->stream_exec_policy = @@ -562,7 +562,7 @@ void N_VSetHostArrayPointer_Sycl(sunrealtype* h_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE__UVM); + SUNMEMTYPE_UVM); NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->host_data); @@ -578,7 +578,7 @@ void N_VSetHostArrayPointer_Sycl(sunrealtype* h_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)h_vdata, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); } } } @@ -597,7 +597,7 @@ void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE__UVM); + SUNMEMTYPE_UVM); NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->device_data); @@ -613,7 +613,7 @@ void N_VSetDeviceArrayPointer_Sycl(sunrealtype* d_vdata, N_Vector v) { NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE__DEVICE); + SUNMEMTYPE_DEVICE); } } } @@ -1878,7 +1878,7 @@ SUNErrCode N_VBufPack_Sycl(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(x), buf, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_Copy(NVEC_SYCL_MEMHELP(x), buf_mem, @@ -1900,7 +1900,7 @@ SUNErrCode N_VBufUnpack_Sycl(N_Vector x, void* buf) if (x == NULL || buf == NULL) { return SUN_ERR_GENERIC; } SUNMemory buf_mem = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(x), buf, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); if (buf_mem == NULL) { return SUN_ERR_GENERIC; } copy_fail = SUNMemoryHelper_Copy(NVEC_SYCL_MEMHELP(x), @@ -2036,33 +2036,33 @@ static int AllocateData(N_Vector v) if (vcp->use_managed_mem) { alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vc->device_data), - NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE__UVM, + NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE_UVM, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed for SUNMEMTYPE__UVM\n"); + "failed for SUNMEMTYPE_UVM\n"); } vc->host_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), vc->device_data); } else { alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vc->host_data), - NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE__HOST, + NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE_HOST, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__HOST\n"); + "failed to alloc SUNMEMTYPE_HOST\n"); } alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vc->device_data), - NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE__DEVICE, + NVEC_SYCL_MEMSIZE(v), SUNMEMTYPE_DEVICE, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in AllocateData: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__DEVICE\n"); + "failed to alloc SUNMEMTYPE_DEVICE\n"); } } @@ -2082,7 +2082,7 @@ static int InitializeReductionBuffer(N_Vector v, const sunrealtype value, size_t /* Wrap the initial value as SUNMemory object */ SUNMemory value_mem = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), - (void*)&value, SUNMEMTYPE__HOST); + (void*)&value, SUNMEMTYPE_HOST); /* check if the existing reduction memory is not large enough */ if (vcp->reduce_buffer_bytes < bytes) @@ -2096,34 +2096,34 @@ static int InitializeReductionBuffer(N_Vector v, const sunrealtype value, size_t /* allocate pinned memory on the host */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE__PINNED, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE_PINNED, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); + "alloc SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); /* if pinned alloc failed, allocate plain host memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE__HOST, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE_HOST, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE__HOST\n"); + "alloc SUNMEMTYPE_HOST\n"); } } /* allocate device memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->reduce_buffer_dev), bytes, - SUNMEMTYPE__DEVICE, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE_DEVICE, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "ERROR in InitializeReductionBuffer: SUNMemoryHelper_Alloc failed to " - "alloc SUNMEMTYPE__DEVICE\n"); + "alloc SUNMEMTYPE_DEVICE\n"); } } @@ -2224,21 +2224,21 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) /* allocate pinned memory on the host */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE__PINNED, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE_PINNED, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( "WARNING in FusedBuffer_Init: SUNMemoryHelper_Alloc failed to alloc " - "SUNMEMTYPE__PINNED, using SUNMEMTYPE__HOST instead\n"); + "SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); /* if pinned alloc failed, allocate plain host memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->fused_buffer_host), bytes, - SUNMEMTYPE__HOST, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE_HOST, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__HOST\n"); + "failed to alloc SUNMEMTYPE_HOST\n"); return SUN_ERR_GENERIC; } } @@ -2246,11 +2246,11 @@ static int FusedBuffer_Init(N_Vector v, int nreal, int nptr) /* allocate device memory */ alloc_fail = SUNMemoryHelper_Alloc(NVEC_SYCL_MEMHELP(v), &(vcp->fused_buffer_dev), bytes, - SUNMEMTYPE__DEVICE, NVEC_SYCL_QUEUE(v)); + SUNMEMTYPE_DEVICE, NVEC_SYCL_QUEUE(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT("ERROR in FusedBuffer_Init: SUNMemoryHelper_Alloc " - "failed to alloc SUNMEMTYPE__DEVICE\n"); + "failed to alloc SUNMEMTYPE_DEVICE\n"); return SUN_ERR_GENERIC; } diff --git a/src/sundials/sundatanode/sundatanode_inmem.c b/src/sundials/sundatanode/sundatanode_inmem.c index de90eccb01..0c6fcf1d7a 100644 --- a/src/sundials/sundatanode/sundatanode_inmem.c +++ b/src/sundials/sundatanode/sundatanode_inmem.c @@ -330,14 +330,14 @@ SUNErrCode SUNDataNode_GetDataNvector_InMem(const SUNDataNode self, N_Vector v, SUNAssert((buffer_size + sizeof(sunrealtype)) == leaf_data->bytes, SUN_ERR_ARG_INCOMPATIBLE); - if (leaf_mem_type != SUNMEMTYPE__HOST) + if (leaf_mem_type != SUNMEMTYPE_HOST) { /* BufUnpack assumes the data is on the host. So if the leaf has it elsewhere, we need to move it to the host first. */ SUNMemory leaf_host_data = NULL; SUNCheckCall(SUNMemoryHelper_Alloc(IMPL_MEMBER(self, mem_helper), &leaf_host_data, leaf_data->bytes, - SUNMEMTYPE__HOST, queue)); + SUNMEMTYPE_HOST, queue)); SUNCheckCall(SUNMemoryHelper_Copy(IMPL_MEMBER(self, mem_helper), leaf_host_data, leaf_data, buffer_size, @@ -398,7 +398,7 @@ SUNErrCode SUNDataNode_SetDataNvector_InMem(SUNDataNode self, N_Vector v, /* Use the default queue for the memory helper */ void* queue = NULL; - SUNMemoryType leaf_mem_type = SUNMEMTYPE__HOST; + SUNMemoryType leaf_mem_type = SUNMEMTYPE_HOST; sunindextype buffer_size = 0; SUNCheckCall(N_VBufSize(v, &buffer_size)); diff --git a/src/sundials/sundials_memory.c b/src/sundials/sundials_memory.c index acfbb30c11..fa12b5bcf6 100644 --- a/src/sundials/sundials_memory.c +++ b/src/sundials/sundials_memory.c @@ -103,8 +103,8 @@ SUNMemory SUNMemoryHelper_Wrap(SUNMemoryHelper helper, void* ptr, { SUNFunctionBegin(helper->sunctx); - SUNCheckNull(mem_type == SUNMEMTYPE__HOST || mem_type == SUNMEMTYPE__PINNED || - mem_type == SUNMEMTYPE__DEVICE || mem_type == SUNMEMTYPE__UVM, + SUNCheckNull(mem_type == SUNMEMTYPE_HOST || mem_type == SUNMEMTYPE_PINNED || + mem_type == SUNMEMTYPE_DEVICE || mem_type == SUNMEMTYPE_UVM, SUN_ERR_ARG_OUTOFRANGE); SUNMemory mem = SUNMemoryNewEmpty(helper->sunctx); diff --git a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp index 08862a1422..fa88d98829 100644 --- a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp +++ b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp @@ -164,8 +164,8 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc but in device memory for the batched methods. */ retval = SUNMemoryHelper_Alloc(content->memhelp, &content->pivots, M * nblocks * sizeof(sunindextype), - nblocks > 1 ? SUNMEMTYPE__DEVICE - : SUNMEMTYPE__HOST, + nblocks > 1 ? SUNMEMTYPE_DEVICE + : SUNMEMTYPE_HOST, nullptr); if (retval) { @@ -179,7 +179,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc { retval = SUNMemoryHelper_Alloc(content->memhelp, &content->pivotsarr, nblocks * sizeof(sunindextype*), - SUNMEMTYPE__DEVICE, nullptr); + SUNMEMTYPE_DEVICE, nullptr); if (retval) { SUNLinSolFree(S); @@ -200,7 +200,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc check its values on the host and we need it to have fast transfers. */ retval = SUNMemoryHelper_Alloc(content->memhelp, &content->infoarr, nblocks * sizeof(sunindextype), - SUNMEMTYPE__PINNED, nullptr); + SUNMEMTYPE_PINNED, nullptr); if (retval) { SUNLinSolFree(S); @@ -209,7 +209,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc retval = SUNMemoryHelper_Alloc(content->memhelp, &content->rhsarr, nblocks * sizeof(sunrealtype*), - SUNMEMTYPE__DEVICE, nullptr); + SUNMEMTYPE_DEVICE, nullptr); if (retval) { SUNLinSolFree(S); diff --git a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu index 078d171402..5119c2aac7 100644 --- a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu +++ b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu @@ -166,14 +166,14 @@ SUNMatrix SUNMatrix_cuSparse_NewCSR(int M, int N, int NNZ, /* Allocate device memory for the matrix */ alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_colind, - sizeof(int) * NNZ, SUNMEMTYPE__DEVICE, + sizeof(int) * NNZ, SUNMEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_rowptr, - sizeof(int) * (M + 1), SUNMEMTYPE__DEVICE, + sizeof(int) * (M + 1), SUNMEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_values, sizeof(sunrealtype) * NNZ, - SUNMEMTYPE__DEVICE, nullptr); + SUNMEMTYPE_DEVICE, nullptr); if (alloc_fail) { SUNMemoryHelper_Dealloc(SMCU_MEMHELP(A), d_colind, nullptr); @@ -330,11 +330,11 @@ SUNMatrix SUNMatrix_cuSparse_MakeCSR(cusparseMatDescr_t mat_descr, int M, int N, SMCU_CONTENT(A)->fixed_pattern = SUNFALSE; SMCU_CONTENT(A)->sparse_type = SUNMAT_CUSPARSE_CSR; SMCU_CONTENT(A)->colind = SUNMemoryHelper_Wrap(SMCU_MEMHELP(A), colind, - SUNMEMTYPE__DEVICE); + SUNMEMTYPE_DEVICE); SMCU_CONTENT(A)->rowptrs = SUNMemoryHelper_Wrap(SMCU_MEMHELP(A), rowptrs, - SUNMEMTYPE__DEVICE); + SUNMEMTYPE_DEVICE); SMCU_CONTENT(A)->data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(A), data, - SUNMEMTYPE__DEVICE); + SUNMEMTYPE_DEVICE); SMCU_CONTENT(A)->mat_descr = mat_descr; SMCU_CONTENT(A)->cusp_handle = cusp; @@ -413,13 +413,13 @@ SUNMatrix SUNMatrix_cuSparse_NewBlockCSR(int nblocks, int blockrows, /* Allocate device memory for the matrix */ alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_colind, sizeof(int) * blocknnz, - SUNMEMTYPE__DEVICE, nullptr); + SUNMEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_rowptr, sizeof(int) * (blockrows + 1), - SUNMEMTYPE__DEVICE, nullptr); + SUNMEMTYPE_DEVICE, nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_values, sizeof(sunrealtype) * blocknnz * nblocks, - SUNMEMTYPE__DEVICE, nullptr); + SUNMEMTYPE_DEVICE, nullptr); if (alloc_fail) { SUNMemoryHelper_Dealloc(SMCU_MEMHELP(A), d_colind, nullptr); @@ -610,7 +610,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, sunrealtype* h_data, if (h_data != NULL) { - _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUNMEMTYPE__HOST); + _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUNMEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), SMCU_DATA(dA), _h_data, SMCU_NNZ(dA) * sizeof(sunrealtype), (void*)stream); @@ -637,7 +637,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxptrs != NULL) { _h_idxptrs = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxptrs, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), SMCU_INDEXPTRS(dA), _h_idxptrs, nidxptrs * sizeof(int), (void*)stream); @@ -648,7 +648,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyToDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxvals != NULL) { _h_idxvals = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxvals, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), SMCU_INDEXVALS(dA), _h_idxvals, nidxvals * sizeof(int), (void*)stream); @@ -673,7 +673,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, sunrealtype* h_data, if (h_data != NULL) { - _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUNMEMTYPE__HOST); + _h_data = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_data, SUNMEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), _h_data, SMCU_DATA(dA), SMCU_NNZ(dA) * sizeof(sunrealtype), (void*)stream); @@ -694,7 +694,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxptrs != NULL) { _h_idxptrs = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxptrs, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), _h_idxptrs, SMCU_INDEXPTRS(dA), nidxptrs * sizeof(int), (void*)stream); @@ -705,7 +705,7 @@ SUNErrCode SUNMatrix_cuSparse_CopyFromDevice(SUNMatrix dA, sunrealtype* h_data, if (h_idxvals != NULL) { _h_idxvals = SUNMemoryHelper_Wrap(SMCU_MEMHELP(dA), h_idxvals, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); retval = SUNMemoryHelper_CopyAsync(SMCU_MEMHELP(dA), _h_idxvals, SMCU_INDEXVALS(dA), nidxvals * sizeof(int), (void*)stream); @@ -1026,7 +1026,7 @@ SUNErrCode SUNMatMatvecSetup_cuSparse(SUNMatrix A) CUDA_R_XF, SPMV_ALG, &SMCU_CONTENT(A)->bufferSize)); if (SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &SMCU_CONTENT(A)->dBufferMem, - SMCU_CONTENT(A)->bufferSize, SUNMEMTYPE__DEVICE, + SMCU_CONTENT(A)->bufferSize, SUNMEMTYPE_DEVICE, nullptr)) return (SUN_ERR_OP_FAIL); } diff --git a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp index 65f36f90e2..7bf187c307 100644 --- a/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp +++ b/src/sunmatrix/magmadense/sunmatrix_magmadense.cpp @@ -91,7 +91,7 @@ SUNMatrix SUNMatrix_MagmaDenseBlock(sunindextype nblocks, sunindextype M, if ((M <= 0) || (N <= 0) || (nblocks <= 0)) { return (NULL); } /* Check for valid memory type options */ - if ((memtype != SUNMEMTYPE__UVM) && (memtype != SUNMEMTYPE__DEVICE)) + if ((memtype != SUNMEMTYPE_UVM) && (memtype != SUNMEMTYPE_DEVICE)) { return (NULL); } @@ -292,7 +292,7 @@ SUNErrCode SUNMatrix_MagmaDense_CopyToDevice(SUNMatrix Amat, sunrealtype* h_data int retval = 0; SUNMemory _h_data = SUNMemoryHelper_Wrap(SMLD_CONTENT(Amat)->memhelp, h_data, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); SUNDIALS_HIP_OR_CUDA(hipStream_t stream = magma_queue_get_hip_stream(A->q); , cudaStream_t stream = magma_queue_get_cuda_stream(A->q);) @@ -315,7 +315,7 @@ SUNErrCode SUNMatrix_MagmaDense_CopyFromDevice(SUNMatrix Amat, sunrealtype* h_da int retval = 0; SUNMemory _h_data = SUNMemoryHelper_Wrap(SMLD_CONTENT(Amat)->memhelp, h_data, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); SUNDIALS_HIP_OR_CUDA(hipStream_t stream = magma_queue_get_hip_stream(A->q); , cudaStream_t stream = magma_queue_get_cuda_stream(A->q);) diff --git a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp index c000efed4b..ce75a62081 100644 --- a/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp +++ b/src/sunmatrix/onemkldense/sunmatrix_onemkldense.cpp @@ -86,7 +86,7 @@ SUNMatrix SUNMatrix_OneMklDenseBlock(sunindextype num_blocks, sunindextype M, // Check inputs if ((M <= 0) || (N <= 0) || (num_blocks <= 0) || (!mem_helper) || - ((mem_type != SUNMEMTYPE__UVM) && (mem_type != SUNMEMTYPE__DEVICE))) + ((mem_type != SUNMEMTYPE_UVM) && (mem_type != SUNMEMTYPE_DEVICE))) { SUNDIALS_DEBUG_ERROR("Illegal input\n"); return NULL; @@ -252,7 +252,7 @@ SUNErrCode SUNMatrix_OneMklDense_CopyToDevice(SUNMatrix A, sunrealtype* h_data) // Wrap the input pointer SUNMemory _h_data = SUNMemoryHelper_Wrap(MAT_MEMHELPER(A), h_data, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); if (!_h_data) { SUNDIALS_DEBUG_ERROR("SUNMemory wrap failed\n"); @@ -286,7 +286,7 @@ SUNErrCode SUNMatrix_OneMklDense_CopyFromDevice(SUNMatrix A, sunrealtype* h_data } SUNMemory _h_data = SUNMemoryHelper_Wrap(MAT_MEMHELPER(A), h_data, - SUNMEMTYPE__HOST); + SUNMEMTYPE_HOST); if (!_h_data) { SUNDIALS_DEBUG_ERROR("SUNMemory wrap failed\n"); diff --git a/src/sunmemory/cuda/sundials_cuda_memory.cu b/src/sunmemory/cuda/sundials_cuda_memory.cu index eee1d73daa..b0a2365e4a 100644 --- a/src/sunmemory/cuda/sundials_cuda_memory.cu +++ b/src/sunmemory/cuda/sundials_cuda_memory.cu @@ -113,7 +113,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, mem->type = mem_type; mem->bytes = mem_size; - if (mem_type == SUNMEMTYPE__HOST) + if (mem_type == SUNMEMTYPE_HOST) { mem->ptr = malloc(mem_size); SUNAssert(mem->ptr, SUN_ERR_MALLOC_FAIL); @@ -123,7 +123,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, SUNMAX(SUNHELPER_CONTENT(helper)->bytes_allocated_host, SUNHELPER_CONTENT(helper)->bytes_high_watermark_host); } - else if (mem_type == SUNMEMTYPE__PINNED) + else if (mem_type == SUNMEMTYPE_PINNED) { if (!SUNDIALS_CUDA_VERIFY(cudaMallocHost(&(mem->ptr), mem_size))) { @@ -141,7 +141,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned); } } - else if (mem_type == SUNMEMTYPE__DEVICE) + else if (mem_type == SUNMEMTYPE_DEVICE) { if (!SUNDIALS_CUDA_VERIFY(cudaMalloc(&(mem->ptr), mem_size))) { @@ -159,7 +159,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Cuda(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_device); } } - else if (mem_type == SUNMEMTYPE__UVM) + else if (mem_type == SUNMEMTYPE_UVM) { if (!SUNDIALS_CUDA_VERIFY(cudaMallocManaged(&(mem->ptr), mem_size))) { @@ -211,14 +211,14 @@ SUNErrCode SUNMemoryHelper_Dealloc_Cuda(SUNMemoryHelper helper, SUNMemory mem, if (mem->ptr != NULL && mem->own) { - if (mem->type == SUNMEMTYPE__HOST) + if (mem->type == SUNMEMTYPE_HOST) { SUNHELPER_CONTENT(helper)->num_deallocations_host++; SUNHELPER_CONTENT(helper)->bytes_allocated_host -= mem->bytes; free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE__PINNED) + else if (mem->type == SUNMEMTYPE_PINNED) { SUNHELPER_CONTENT(helper)->num_deallocations_pinned++; SUNHELPER_CONTENT(helper)->bytes_allocated_pinned -= mem->bytes; @@ -230,7 +230,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Cuda(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE__DEVICE) + else if (mem->type == SUNMEMTYPE_DEVICE) { SUNHELPER_CONTENT(helper)->num_deallocations_device++; SUNHELPER_CONTENT(helper)->bytes_allocated_device -= mem->bytes; @@ -242,7 +242,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Cuda(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE__UVM) + else if (mem->type == SUNMEMTYPE_UVM) { SUNHELPER_CONTENT(helper)->num_deallocations_uvm++; SUNHELPER_CONTENT(helper)->bytes_allocated_uvm -= mem->bytes; @@ -275,25 +275,25 @@ SUNErrCode SUNMemoryHelper_Copy_Cuda(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUNMEMTYPE__HOST: - case SUNMEMTYPE__PINNED: - if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) + case SUNMEMTYPE_HOST: + case SUNMEMTYPE_PINNED: + if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) + else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) { cuerr = cudaMemcpy(dst->ptr, src->ptr, memory_size, cudaMemcpyHostToDevice); } if (!SUNDIALS_CUDA_VERIFY(cuerr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUNMEMTYPE__UVM: - case SUNMEMTYPE__DEVICE: - if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) + case SUNMEMTYPE_UVM: + case SUNMEMTYPE_DEVICE: + if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) { cuerr = cudaMemcpy(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToHost); } - else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) + else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) { cuerr = cudaMemcpy(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToDevice); @@ -322,27 +322,27 @@ SUNErrCode SUNMemoryHelper_CopyAsync_Cuda(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUNMEMTYPE__HOST: - case SUNMEMTYPE__PINNED: - if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) + case SUNMEMTYPE_HOST: + case SUNMEMTYPE_PINNED: + if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) + else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) { cuerr = cudaMemcpyAsync(dst->ptr, src->ptr, memory_size, cudaMemcpyHostToDevice, stream); } if (!SUNDIALS_CUDA_VERIFY(cuerr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUNMEMTYPE__UVM: - case SUNMEMTYPE__DEVICE: - if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) + case SUNMEMTYPE_UVM: + case SUNMEMTYPE_DEVICE: + if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) { cuerr = cudaMemcpyAsync(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToHost, stream); } - else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) + else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) { cuerr = cudaMemcpyAsync(dst->ptr, src->ptr, memory_size, cudaMemcpyDeviceToDevice, stream); @@ -376,28 +376,28 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Cuda(SUNMemoryHelper helper, size_t* bytes_allocated, size_t* bytes_high_watermark) { - if (mem_type == SUNMEMTYPE__HOST) + if (mem_type == SUNMEMTYPE_HOST) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_host; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_host; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_host; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_host; } - else if (mem_type == SUNMEMTYPE__PINNED) + else if (mem_type == SUNMEMTYPE_PINNED) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_pinned; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_pinned; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_pinned; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned; } - else if (mem_type == SUNMEMTYPE__DEVICE) + else if (mem_type == SUNMEMTYPE_DEVICE) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_device; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_device; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_device; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_device; } - else if (mem_type == SUNMEMTYPE__UVM) + else if (mem_type == SUNMEMTYPE_UVM) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_uvm; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_uvm; diff --git a/src/sunmemory/hip/sundials_hip_memory.hip.cpp b/src/sunmemory/hip/sundials_hip_memory.hip.cpp index 8b69bc3166..5384c2acc6 100644 --- a/src/sunmemory/hip/sundials_hip_memory.hip.cpp +++ b/src/sunmemory/hip/sundials_hip_memory.hip.cpp @@ -113,7 +113,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, mem->type = mem_type; mem->bytes = mem_size; - if (mem_type == SUNMEMTYPE__HOST) + if (mem_type == SUNMEMTYPE_HOST) { mem->ptr = malloc(mem_size); SUNAssert(mem->ptr, SUN_ERR_MALLOC_FAIL); @@ -123,7 +123,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, SUNMAX(SUNHELPER_CONTENT(helper)->bytes_allocated_host, SUNHELPER_CONTENT(helper)->bytes_high_watermark_host); } - else if (mem_type == SUNMEMTYPE__PINNED) + else if (mem_type == SUNMEMTYPE_PINNED) { if (!SUNDIALS_HIP_VERIFY(hipMallocHost(&(mem->ptr), mem_size))) { @@ -141,7 +141,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned); } } - else if (mem_type == SUNMEMTYPE__DEVICE) + else if (mem_type == SUNMEMTYPE_DEVICE) { if (!SUNDIALS_HIP_VERIFY(hipMalloc(&(mem->ptr), mem_size))) { @@ -159,7 +159,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Hip(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_device); } } - else if (mem_type == SUNMEMTYPE__UVM) + else if (mem_type == SUNMEMTYPE_UVM) { if (!SUNDIALS_HIP_VERIFY(hipMallocManaged(&(mem->ptr), mem_size))) { @@ -211,14 +211,14 @@ SUNErrCode SUNMemoryHelper_Dealloc_Hip(SUNMemoryHelper helper, SUNMemory mem, if (mem->ptr != NULL && mem->own) { - if (mem->type == SUNMEMTYPE__HOST) + if (mem->type == SUNMEMTYPE_HOST) { SUNHELPER_CONTENT(helper)->num_deallocations_host++; SUNHELPER_CONTENT(helper)->bytes_allocated_host -= mem->bytes; free(mem->ptr); mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE__PINNED) + else if (mem->type == SUNMEMTYPE_PINNED) { SUNHELPER_CONTENT(helper)->num_deallocations_pinned++; SUNHELPER_CONTENT(helper)->bytes_allocated_pinned -= mem->bytes; @@ -230,7 +230,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Hip(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE__DEVICE) + else if (mem->type == SUNMEMTYPE_DEVICE) { SUNHELPER_CONTENT(helper)->num_deallocations_device++; SUNHELPER_CONTENT(helper)->bytes_allocated_device -= mem->bytes; @@ -242,7 +242,7 @@ SUNErrCode SUNMemoryHelper_Dealloc_Hip(SUNMemoryHelper helper, SUNMemory mem, } mem->ptr = NULL; } - else if (mem->type == SUNMEMTYPE__UVM) + else if (mem->type == SUNMEMTYPE_UVM) { SUNHELPER_CONTENT(helper)->num_deallocations_uvm++; SUNHELPER_CONTENT(helper)->bytes_allocated_uvm -= mem->bytes; @@ -275,25 +275,25 @@ SUNErrCode SUNMemoryHelper_Copy_Hip(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUNMEMTYPE__HOST: - case SUNMEMTYPE__PINNED: - if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) + case SUNMEMTYPE_HOST: + case SUNMEMTYPE_PINNED: + if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) + else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) { hiperr = hipMemcpy(dst->ptr, src->ptr, memory_size, hipMemcpyHostToDevice); } if (!SUNDIALS_HIP_VERIFY(hiperr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUNMEMTYPE__UVM: - case SUNMEMTYPE__DEVICE: - if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) + case SUNMEMTYPE_UVM: + case SUNMEMTYPE_DEVICE: + if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) { hiperr = hipMemcpy(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToHost); } - else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) + else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) { hiperr = hipMemcpy(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToDevice); @@ -322,27 +322,27 @@ SUNErrCode SUNMemoryHelper_CopyAsync_Hip(SUNMemoryHelper helper, SUNMemory dst, switch (src->type) { - case SUNMEMTYPE__HOST: - case SUNMEMTYPE__PINNED: - if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) + case SUNMEMTYPE_HOST: + case SUNMEMTYPE_PINNED: + if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) { memcpy(dst->ptr, src->ptr, memory_size); } - else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) + else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) { hiperr = hipMemcpyAsync(dst->ptr, src->ptr, memory_size, hipMemcpyHostToDevice, stream); } if (!SUNDIALS_HIP_VERIFY(hiperr)) { retval = SUN_ERR_EXT_FAIL; } break; - case SUNMEMTYPE__UVM: - case SUNMEMTYPE__DEVICE: - if (dst->type == SUNMEMTYPE__HOST || dst->type == SUNMEMTYPE__PINNED) + case SUNMEMTYPE_UVM: + case SUNMEMTYPE_DEVICE: + if (dst->type == SUNMEMTYPE_HOST || dst->type == SUNMEMTYPE_PINNED) { hiperr = hipMemcpyAsync(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToHost, stream); } - else if (dst->type == SUNMEMTYPE__DEVICE || dst->type == SUNMEMTYPE__UVM) + else if (dst->type == SUNMEMTYPE_DEVICE || dst->type == SUNMEMTYPE_UVM) { hiperr = hipMemcpyAsync(dst->ptr, src->ptr, memory_size, hipMemcpyDeviceToDevice, stream); @@ -376,28 +376,28 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Hip(SUNMemoryHelper helper, size_t* bytes_allocated, size_t* bytes_high_watermark) { - if (mem_type == SUNMEMTYPE__HOST) + if (mem_type == SUNMEMTYPE_HOST) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_host; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_host; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_host; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_host; } - else if (mem_type == SUNMEMTYPE__PINNED) + else if (mem_type == SUNMEMTYPE_PINNED) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_pinned; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_pinned; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_pinned; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned; } - else if (mem_type == SUNMEMTYPE__DEVICE) + else if (mem_type == SUNMEMTYPE_DEVICE) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_device; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_device; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_device; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_device; } - else if (mem_type == SUNMEMTYPE__UVM) + else if (mem_type == SUNMEMTYPE_UVM) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_uvm; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_uvm; diff --git a/src/sunmemory/sycl/sundials_sycl_memory.cpp b/src/sunmemory/sycl/sundials_sycl_memory.cpp index 31375dda7a..50b73e9fe7 100644 --- a/src/sunmemory/sycl/sundials_sycl_memory.cpp +++ b/src/sunmemory/sycl/sundials_sycl_memory.cpp @@ -118,7 +118,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, mem->bytes = mem_size; // Allocate the data pointer - if (mem_type == SUNMEMTYPE__HOST) + if (mem_type == SUNMEMTYPE_HOST) { mem->ptr = malloc(mem_size); if (!(mem->ptr)) @@ -137,7 +137,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_host); } } - else if (mem_type == SUNMEMTYPE__PINNED) + else if (mem_type == SUNMEMTYPE_PINNED) { mem->ptr = ::sycl::malloc_host(mem_size, *sycl_queue); if (!(mem->ptr)) @@ -156,7 +156,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned); } } - else if (mem_type == SUNMEMTYPE__DEVICE) + else if (mem_type == SUNMEMTYPE_DEVICE) { mem->ptr = ::sycl::malloc_device(mem_size, *sycl_queue); if (!(mem->ptr)) @@ -175,7 +175,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sycl(SUNMemoryHelper helper, SUNMemory* memptr, SUNHELPER_CONTENT(helper)->bytes_high_watermark_device); } } - else if (mem_type == SUNMEMTYPE__UVM) + else if (mem_type == SUNMEMTYPE_UVM) { mem->ptr = ::sycl::malloc_shared(mem_size, *sycl_queue); if (!(mem->ptr)) @@ -233,27 +233,27 @@ SUNErrCode SUNMemoryHelper_Dealloc_Sycl(SUNMemoryHelper helper, SUNMemory mem, ::sycl::queue* sycl_queue = GET_SYCL_QUEUE(helper, queue); SUNAssert(sycl_queue, SUN_ERR_ARG_CORRUPT); - if (mem->type == SUNMEMTYPE__HOST) + if (mem->type == SUNMEMTYPE_HOST) { SUNHELPER_CONTENT(helper)->num_deallocations_host++; SUNHELPER_CONTENT(helper)->bytes_allocated_host -= mem->bytes; free(mem->ptr); mem->ptr = nullptr; } - else if (mem->type == SUNMEMTYPE__PINNED || - mem->type == SUNMEMTYPE__DEVICE || mem->type == SUNMEMTYPE__UVM) + else if (mem->type == SUNMEMTYPE_PINNED || + mem->type == SUNMEMTYPE_DEVICE || mem->type == SUNMEMTYPE_UVM) { - if (mem->type == SUNMEMTYPE__PINNED) + if (mem->type == SUNMEMTYPE_PINNED) { SUNHELPER_CONTENT(helper)->num_deallocations_pinned++; SUNHELPER_CONTENT(helper)->bytes_allocated_pinned -= mem->bytes; } - else if (mem->type == SUNMEMTYPE__DEVICE) + else if (mem->type == SUNMEMTYPE_DEVICE) { SUNHELPER_CONTENT(helper)->num_deallocations_device++; SUNHELPER_CONTENT(helper)->bytes_allocated_device -= mem->bytes; } - else if (mem->type == SUNMEMTYPE__UVM) + else if (mem->type == SUNMEMTYPE_UVM) { SUNHELPER_CONTENT(helper)->num_deallocations_uvm++; SUNHELPER_CONTENT(helper)->bytes_allocated_uvm -= mem->bytes; @@ -297,7 +297,7 @@ SUNErrCode SUNMemoryHelper_CopyAsync_Sycl(SUNMemoryHelper helper, SUNMemory dst, ::sycl::queue* sycl_queue = GET_SYCL_QUEUE(helper, queue); SUNAssert(sycl_queue, SUN_ERR_ARG_CORRUPT); - if (src->type == SUNMEMTYPE__HOST && dst->type == SUNMEMTYPE__HOST) + if (src->type == SUNMEMTYPE_HOST && dst->type == SUNMEMTYPE_HOST) { memcpy(dst->ptr, src->ptr, memory_size); } @@ -323,28 +323,28 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Sycl(SUNMemoryHelper helper, size_t* bytes_allocated, size_t* bytes_high_watermark) { - if (mem_type == SUNMEMTYPE__HOST) + if (mem_type == SUNMEMTYPE_HOST) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_host; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_host; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_host; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_host; } - else if (mem_type == SUNMEMTYPE__PINNED) + else if (mem_type == SUNMEMTYPE_PINNED) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_pinned; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_pinned; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_pinned; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_pinned; } - else if (mem_type == SUNMEMTYPE__DEVICE) + else if (mem_type == SUNMEMTYPE_DEVICE) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_device; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_device; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated_device; *bytes_high_watermark = SUNHELPER_CONTENT(helper)->bytes_high_watermark_device; } - else if (mem_type == SUNMEMTYPE__UVM) + else if (mem_type == SUNMEMTYPE_UVM) { *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations_uvm; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations_uvm; diff --git a/src/sunmemory/system/sundials_system_memory.c b/src/sunmemory/system/sundials_system_memory.c index 41ef06d544..2e0bc828cd 100644 --- a/src/sunmemory/system/sundials_system_memory.c +++ b/src/sunmemory/system/sundials_system_memory.c @@ -77,7 +77,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sys(SUNMemoryHelper helper, SUNMemory* memptr, { SUNFunctionBegin(helper->sunctx); - SUNAssert(mem_type == SUNMEMTYPE__HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(mem_type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); SUNMemory mem = SUNMemoryNewEmpty(helper->sunctx); SUNCheckLastErr(); @@ -87,7 +87,7 @@ SUNErrCode SUNMemoryHelper_Alloc_Sys(SUNMemoryHelper helper, SUNMemory* memptr, mem->type = mem_type; mem->bytes = mem_size; - if (mem_type == SUNMEMTYPE__HOST) + if (mem_type == SUNMEMTYPE_HOST) { mem->ptr = malloc(mem_size); SUNAssert(mem->ptr, SUN_ERR_MALLOC_FAIL); @@ -124,11 +124,11 @@ SUNErrCode SUNMemoryHelper_Dealloc_Sys(SUNMemoryHelper helper, SUNMemory mem, if (mem == NULL) { return SUN_SUCCESS; } - SUNAssert(mem->type == SUNMEMTYPE__HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(mem->type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); if (mem->ptr != NULL && mem->own) { - if (mem->type == SUNMEMTYPE__HOST) + if (mem->type == SUNMEMTYPE_HOST) { SUNHELPER_CONTENT(helper)->num_deallocations++; SUNHELPER_CONTENT(helper)->bytes_allocated -= mem->bytes; @@ -146,8 +146,8 @@ SUNErrCode SUNMemoryHelper_Copy_Sys(SUNMemoryHelper helper, SUNMemory dst, SUNDIALS_MAYBE_UNUSED void* queue) { SUNFunctionBegin(helper->sunctx); - SUNAssert(src->type == SUNMEMTYPE__HOST, SUN_ERR_ARG_INCOMPATIBLE); - SUNAssert(dst->type == SUNMEMTYPE__HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(src->type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(dst->type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); memcpy(dst->ptr, src->ptr, memory_size); return SUN_SUCCESS; } @@ -158,7 +158,7 @@ SUNErrCode SUNMemoryHelper_GetAllocStats_Sys( size_t* bytes_allocated, size_t* bytes_high_watermark) { SUNFunctionBegin(helper->sunctx); - SUNAssert(mem_type == SUNMEMTYPE__HOST, SUN_ERR_ARG_INCOMPATIBLE); + SUNAssert(mem_type == SUNMEMTYPE_HOST, SUN_ERR_ARG_INCOMPATIBLE); *num_allocations = SUNHELPER_CONTENT(helper)->num_allocations; *num_deallocations = SUNHELPER_CONTENT(helper)->num_deallocations; *bytes_allocated = SUNHELPER_CONTENT(helper)->bytes_allocated; diff --git a/test/unit_tests/sundials/test_sundials_datanode.cpp b/test/unit_tests/sundials/test_sundials_datanode.cpp index 2e4a6f65e5..efe76aa1f5 100644 --- a/test/unit_tests/sundials/test_sundials_datanode.cpp +++ b/test/unit_tests/sundials/test_sundials_datanode.cpp @@ -71,7 +71,7 @@ TEST_F(SUNDataNodeTest, CreateLeafWorks) err = SUNDataNode_CreateLeaf(SUNDATAIOMODE_INMEM, mem_helper, sunctx, &node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, + err = SUNDataNode_SetData(node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -162,7 +162,7 @@ TEST_F(SUNDataNodeTest, HasChildrenWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -193,7 +193,7 @@ TEST_F(SUNDataNodeTest, RemoveChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -232,7 +232,7 @@ TEST_F(SUNDataNodeTest, RemoveSameChildTwiceWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -267,7 +267,7 @@ TEST_F(SUNDataNodeTest, RemoveChildWorksWhenEmpty) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -295,7 +295,7 @@ TEST_F(SUNDataNodeTest, GetChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -327,7 +327,7 @@ TEST_F(SUNDataNodeTest, GetNamedChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -363,7 +363,7 @@ TEST_F(SUNDataNodeTest, RemoveNamedChildWorks) &child_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(child_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, + err = SUNDataNode_SetData(child_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -398,7 +398,7 @@ TEST_F(SUNDataNodeTest, GetDataWorksWhenLeaf) &root_node); EXPECT_EQ(err, SUN_SUCCESS); - err = SUNDataNode_SetData(root_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, + err = SUNDataNode_SetData(root_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, (void*)(&integer_value), sizeof(integer_value), sizeof(integer_value)); EXPECT_EQ(err, SUN_SUCCESS); @@ -427,7 +427,7 @@ TEST_F(SUNDataNodeTest, SetDataWorksWhenLeaf) EXPECT_EQ(err, SUN_SUCCESS); int new_integer_value = 3; - err = SUNDataNode_SetData(root_node, SUNMEMTYPE__HOST, SUNMEMTYPE__HOST, + err = SUNDataNode_SetData(root_node, SUNMEMTYPE_HOST, SUNMEMTYPE_HOST, (void*)&new_integer_value, sizeof(new_integer_value), sizeof(new_integer_value)); EXPECT_EQ(err, SUN_SUCCESS); diff --git a/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp b/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp index 10c87270d0..6582a1816d 100644 --- a/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp +++ b/test/unit_tests/sunlinsol/magmadense/test_sunlinsol_magmadense.cpp @@ -97,12 +97,12 @@ int main(int argc, char* argv[]) /* Create matrices and vectors */ if (nblocks > 1) { - A = SUNMatrix_MagmaDenseBlock(nblocks, rows, cols, SUNMEMTYPE__DEVICE, + A = SUNMatrix_MagmaDenseBlock(nblocks, rows, cols, SUNMEMTYPE_DEVICE, memhelper, NULL, sunctx); } else { - A = SUNMatrix_MagmaDense(rows, cols, SUNMEMTYPE__DEVICE, memhelper, NULL, + A = SUNMatrix_MagmaDense(rows, cols, SUNMEMTYPE_DEVICE, memhelper, NULL, sunctx); } I = SUNMatClone(A); diff --git a/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp b/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp index 2f8ff692ef..557679d312 100644 --- a/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp +++ b/test/unit_tests/sunlinsol/onemkldense/test_sunlinsol_onemkldense.cpp @@ -152,12 +152,12 @@ int main(int argc, char* argv[]) SUNMatrix A; if (nblocks > 1) { - A = SUNMatrix_OneMklDenseBlock(nblocks, rows, cols, SUNMEMTYPE__DEVICE, + A = SUNMatrix_OneMklDenseBlock(nblocks, rows, cols, SUNMEMTYPE_DEVICE, memhelper, &myQueue, sunctx); } else { - A = SUNMatrix_OneMklDense(rows, cols, SUNMEMTYPE__DEVICE, memhelper, + A = SUNMatrix_OneMklDense(rows, cols, SUNMEMTYPE_DEVICE, memhelper, &myQueue, sunctx); } diff --git a/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp b/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp index 9b66d6d5f2..7dfa3c5ff2 100644 --- a/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp +++ b/test/unit_tests/sunmatrix/magmadense/test_sunmatrix_magmadense.cpp @@ -114,7 +114,7 @@ int main(int argc, char* argv[]) y = HIP_OR_CUDA(N_VNew_Hip(matrows * nblocks, sunctx); , N_VNew_Cuda(matrows * nblocks, sunctx);) A = SUNMatrix_MagmaDenseBlock(nblocks, matrows, matcols, - SUNMEMTYPE__DEVICE, memhelper, NULL, sunctx); + SUNMEMTYPE_DEVICE, memhelper, NULL, sunctx); if (square) { I = SUNMatClone(A); } /* Allocate host data */ diff --git a/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp b/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp index c423df6371..90f5650a6f 100644 --- a/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp +++ b/test/unit_tests/sunmatrix/onemkldense/test_sunmatrix_onemkldense.cpp @@ -147,7 +147,7 @@ int main(int argc, char* argv[]) } SUNMatrix A = SUNMatrix_OneMklDenseBlock(nblocks, matrows, matcols, - SUNMEMTYPE__DEVICE, memhelper, + SUNMEMTYPE_DEVICE, memhelper, &myQueue, sunctx); if (!A) { diff --git a/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu b/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu index d6b0c81fb6..892c99eb0e 100644 --- a/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu +++ b/test/unit_tests/sunmemory/cuda/test_sunmemory_cuda.cu @@ -37,7 +37,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, // Write to the memory sunrealtype host_arr[N]; sunrealtype* some_arr = static_cast(some_memory->ptr); - if (mem_type == SUNMEMTYPE__DEVICE) + if (mem_type == SUNMEMTYPE_DEVICE) { for (int i = 0; i < N; i++) { host_arr[i] = i * sunrealtype{1.0}; } cudaMemcpy(some_memory->ptr, host_arr, bytes_to_alloc, @@ -64,7 +64,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, } return -1; } - if (mem_type == SUNMEMTYPE__DEVICE) + if (mem_type == SUNMEMTYPE_DEVICE) { sunrealtype other_arr[N]; cudaMemcpy(other_arr, other_memory->ptr, bytes_to_alloc, @@ -208,17 +208,17 @@ int main(int argc, char* argv[]) std::cout << " SUNMemoryHelper_Cuda... PASSED\n"; std::cout << "With host memory... \n"; - test_instance(helper, SUNMEMTYPE__HOST, true); + test_instance(helper, SUNMEMTYPE_HOST, true); std::cout << "With pinned memory... \n"; - test_instance(helper, SUNMEMTYPE__PINNED, true); + test_instance(helper, SUNMEMTYPE_PINNED, true); std::cout << "With device memory... \n"; - test_instance(helper, SUNMEMTYPE__DEVICE, true); + test_instance(helper, SUNMEMTYPE_DEVICE, true); std::cout << "With uvm memory... \n"; - test_instance(helper, SUNMEMTYPE__UVM, true); + test_instance(helper, SUNMEMTYPE_UVM, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUNMEMTYPE__HOST, false)) + if (!helper || test_instance(helper2, SUNMEMTYPE_HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; diff --git a/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp b/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp index 9af63b0fdd..614a78c9fe 100644 --- a/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp +++ b/test/unit_tests/sunmemory/hip/test_sunmemory_hip.cpp @@ -37,7 +37,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, // Write to the memory sunrealtype host_arr[N]; sunrealtype* some_arr = static_cast(some_memory->ptr); - if (mem_type == SUNMEMTYPE__DEVICE) + if (mem_type == SUNMEMTYPE_DEVICE) { for (int i = 0; i < N; i++) { host_arr[i] = i * sunrealtype{1.0}; } hipMemcpy(some_memory->ptr, host_arr, bytes_to_alloc, hipMemcpyHostToDevice); @@ -63,7 +63,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, } return -1; } - if (mem_type == SUNMEMTYPE__DEVICE) + if (mem_type == SUNMEMTYPE_DEVICE) { sunrealtype other_arr[N]; hipMemcpy(other_arr, other_memory->ptr, bytes_to_alloc, @@ -207,17 +207,17 @@ int main(int argc, char* argv[]) std::cout << " SUNMemoryHelper_Hip... PASSED\n"; std::cout << "With host memory... \n"; - test_instance(helper, SUNMEMTYPE__HOST, true); + test_instance(helper, SUNMEMTYPE_HOST, true); std::cout << "With pinned memory... \n"; - test_instance(helper, SUNMEMTYPE__PINNED, true); + test_instance(helper, SUNMEMTYPE_PINNED, true); std::cout << "With device memory... \n"; - test_instance(helper, SUNMEMTYPE__DEVICE, true); + test_instance(helper, SUNMEMTYPE_DEVICE, true); std::cout << "With uvm memory... \n"; - test_instance(helper, SUNMEMTYPE__UVM, true); + test_instance(helper, SUNMEMTYPE_UVM, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUNMEMTYPE__HOST, false)) + if (!helper || test_instance(helper2, SUNMEMTYPE_HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; diff --git a/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp b/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp index eb760ca976..0a6cbc35f4 100644 --- a/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp +++ b/test/unit_tests/sunmemory/sycl/test_sunmemory_sycl.cpp @@ -48,7 +48,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, // Write to the memory sunrealtype host_arr[N]; sunrealtype* some_arr = static_cast(some_memory->ptr); - if (mem_type == SUNMEMTYPE__DEVICE) + if (mem_type == SUNMEMTYPE_DEVICE) { for (int i = 0; i < N; i++) { host_arr[i] = i * sunrealtype{1.0}; } myQueue.memcpy(some_memory->ptr, host_arr, bytes_to_alloc); @@ -84,7 +84,7 @@ int test_instance(SUNMemoryHelper helper, SUNMemoryType mem_type, } return -1; } - if (mem_type == SUNMEMTYPE__DEVICE) + if (mem_type == SUNMEMTYPE_DEVICE) { sunrealtype other_arr[N]; myQueue.memcpy(other_arr, other_memory->ptr, bytes_to_alloc); @@ -230,17 +230,17 @@ int main(int argc, char* argv[]) std::cout << " SUNMemoryHelper_Sycl... PASSED\n"; std::cout << "With host memory... \n"; - test_instance(helper, SUNMEMTYPE__HOST, true); + test_instance(helper, SUNMEMTYPE_HOST, true); std::cout << "With pinned memory... \n"; - test_instance(helper, SUNMEMTYPE__PINNED, true); + test_instance(helper, SUNMEMTYPE_PINNED, true); std::cout << "With device memory... \n"; - test_instance(helper, SUNMEMTYPE__DEVICE, true); + test_instance(helper, SUNMEMTYPE_DEVICE, true); std::cout << "With uvm memory... \n"; - test_instance(helper, SUNMEMTYPE__UVM, true); + test_instance(helper, SUNMEMTYPE_UVM, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUNMEMTYPE__HOST, false)) + if (!helper || test_instance(helper2, SUNMEMTYPE_HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; diff --git a/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp b/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp index 5b6ea96120..bd2e31e5a6 100644 --- a/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp +++ b/test/unit_tests/sunmemory/sys/test_sunmemory_sys.cpp @@ -179,11 +179,11 @@ int main(int argc, char* argv[]) } std::cout << " SUNMemoryHelper_Sys... PASSED\n"; - test_instance(helper, SUNMEMTYPE__HOST, true); + test_instance(helper, SUNMEMTYPE_HOST, true); std::cout << " SUNMemoryHelper_Clone... \n"; SUNMemoryHelper helper2 = SUNMemoryHelper_Clone(helper); - if (!helper || test_instance(helper2, SUNMEMTYPE__HOST, false)) + if (!helper || test_instance(helper2, SUNMEMTYPE_HOST, false)) { std::cout << " SUNMemoryHelper_Clone... FAILED\n"; return -1; From f1de1af88153b6ac51b98b7cdfe52e2b50c7edf4 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 13:58:40 -0700 Subject: [PATCH 17/26] regen fortran --- src/arkode/fmod_int32/farkode_arkstep_mod.f90 | 6 +- src/arkode/fmod_int32/farkode_erkstep_mod.f90 | 4 +- .../fmod_int32/farkode_lsrkstep_mod.f90 | 8 +-- src/arkode/fmod_int32/farkode_mod.f90 | 32 +++++----- src/arkode/fmod_int32/farkode_mristep_mod.f90 | 18 +++--- src/arkode/fmod_int32/farkode_sprkstep_mod.c | 28 ++++----- .../fmod_int32/farkode_sprkstep_mod.f90 | 52 ++++++++-------- src/arkode/fmod_int64/farkode_arkstep_mod.f90 | 6 +- src/arkode/fmod_int64/farkode_erkstep_mod.f90 | 4 +- .../fmod_int64/farkode_lsrkstep_mod.f90 | 8 +-- src/arkode/fmod_int64/farkode_mod.f90 | 32 +++++----- src/arkode/fmod_int64/farkode_mristep_mod.f90 | 18 +++--- src/arkode/fmod_int64/farkode_sprkstep_mod.c | 28 ++++----- .../fmod_int64/farkode_sprkstep_mod.f90 | 52 ++++++++-------- .../fsunadaptcontroller_imexgus_mod.f90 | 2 +- .../fsunadaptcontroller_imexgus_mod.f90 | 2 +- .../fsunadaptcontroller_mrihtol_mod.f90 | 2 +- .../fsunadaptcontroller_mrihtol_mod.f90 | 2 +- .../fsunadaptcontroller_soderlind_mod.f90 | 2 +- .../fsunadaptcontroller_soderlind_mod.f90 | 2 +- .../fmod_int32/fsundials_core_mod.f90 | 62 +++++++++---------- .../fmod_int64/fsundials_core_mod.f90 | 62 +++++++++---------- .../band/fmod_int32/fsunlinsol_band_mod.f90 | 4 +- .../band/fmod_int64/fsunlinsol_band_mod.f90 | 4 +- .../dense/fmod_int32/fsunlinsol_dense_mod.f90 | 4 +- .../dense/fmod_int64/fsunlinsol_dense_mod.f90 | 4 +- .../klu/fmod_int32/fsunlinsol_klu_mod.f90 | 4 +- .../klu/fmod_int64/fsunlinsol_klu_mod.f90 | 4 +- .../fmod_int32/fsunlinsol_lapackdense_mod.f90 | 4 +- .../fmod_int64/fsunlinsol_lapackdense_mod.f90 | 4 +- .../pcg/fmod_int32/fsunlinsol_pcg_mod.f90 | 4 +- .../pcg/fmod_int64/fsunlinsol_pcg_mod.f90 | 4 +- .../fmod_int32/fsunlinsol_spbcgs_mod.f90 | 4 +- .../fmod_int64/fsunlinsol_spbcgs_mod.f90 | 4 +- .../fmod_int32/fsunlinsol_spfgmr_mod.f90 | 4 +- .../fmod_int64/fsunlinsol_spfgmr_mod.f90 | 4 +- .../spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 | 4 +- .../spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 | 4 +- .../fmod_int32/fsunlinsol_sptfqmr_mod.f90 | 4 +- .../fmod_int64/fsunlinsol_sptfqmr_mod.f90 | 4 +- .../band/fmod_int32/fsunmatrix_band_mod.f90 | 2 +- .../band/fmod_int64/fsunmatrix_band_mod.f90 | 2 +- .../dense/fmod_int32/fsunmatrix_dense_mod.f90 | 2 +- .../dense/fmod_int64/fsunmatrix_dense_mod.f90 | 2 +- .../fmod_int32/fsunmatrix_sparse_mod.f90 | 2 +- .../fmod_int64/fsunmatrix_sparse_mod.f90 | 2 +- .../fsunnonlinsol_fixedpoint_mod.f90 | 2 +- .../fsunnonlinsol_fixedpoint_mod.f90 | 2 +- .../fmod_int32/fsunnonlinsol_newton_mod.f90 | 2 +- .../fmod_int64/fsunnonlinsol_newton_mod.f90 | 2 +- 50 files changed, 262 insertions(+), 262 deletions(-) diff --git a/src/arkode/fmod_int32/farkode_arkstep_mod.f90 b/src/arkode/fmod_int32/farkode_arkstep_mod.f90 index 65fbb3c66e..278cece912 100644 --- a/src/arkode/fmod_int32/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_arkstep_mod.f90 @@ -1911,8 +1911,8 @@ function FARKStepSetTableNum(arkode_mem, itable, etable) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_DIRKTableID), intent(in) :: itable -integer(ARKODE_ERKTableID), intent(in) :: etable +integer(ARKODE_DIRKTableID_), intent(in) :: itable +integer(ARKODE_ERKTableID_), intent(in) :: etable integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -4490,7 +4490,7 @@ function FARKStepSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver), intent(in) :: solver +integer(ARKRelaxSolver_), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_erkstep_mod.f90 b/src/arkode/fmod_int32/farkode_erkstep_mod.f90 index 964e452c97..cf8ef8bff4 100644 --- a/src/arkode/fmod_int32/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_erkstep_mod.f90 @@ -1069,7 +1069,7 @@ function FERKStepSetTableNum(arkode_mem, etable) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_ERKTableID), intent(in) :: etable +integer(ARKODE_ERKTableID_), intent(in) :: etable integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -2430,7 +2430,7 @@ function FERKStepSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver), intent(in) :: solver +integer(ARKRelaxSolver_), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 b/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 index eb54169668..6a4faea649 100644 --- a/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 @@ -26,7 +26,7 @@ module farkode_lsrkstep_mod private ! DECLARATION CONSTRUCTS - ! typedef enum ARKODE_LSRKMethodType + ! enum ARKODE_LSRKMethodType_ enum, bind(c) enumerator :: ARKODE_LSRK_RKC_2 enumerator :: ARKODE_LSRK_RKL_2 @@ -34,7 +34,7 @@ module farkode_lsrkstep_mod enumerator :: ARKODE_LSRK_SSP_S_3 enumerator :: ARKODE_LSRK_SSP_10_4 end enum - integer, parameter, public :: ARKODE_LSRKMethodType = kind(ARKODE_LSRK_RKC_2) + integer, parameter, public :: ARKODE_LSRKMethodType_ = kind(ARKODE_LSRK_RKC_2) public :: ARKODE_LSRK_RKC_2, ARKODE_LSRK_RKL_2, ARKODE_LSRK_SSP_S_2, ARKODE_LSRK_SSP_S_3, ARKODE_LSRK_SSP_10_4 public :: FLSRKStepCreateSTS public :: FLSRKStepCreateSSP @@ -351,7 +351,7 @@ function FLSRKStepSetSTSMethod(arkode_mem, method) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_LSRKMethodType), intent(in) :: method +integer(ARKODE_LSRKMethodType_), intent(in) :: method integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -367,7 +367,7 @@ function FLSRKStepSetSSPMethod(arkode_mem, method) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_LSRKMethodType), intent(in) :: method +integer(ARKODE_LSRKMethodType_), intent(in) :: method integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 index 5d5982c7e5..0653360479 100644 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -103,14 +103,14 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_SUNADJSTEPPER_ERR = -55_C_INT integer(C_INT), parameter, public :: ARK_DEE_FAIL = -56_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT - ! typedef enum ARKRelaxSolver + ! enum ARKRelaxSolver_ enum, bind(c) enumerator :: ARK_RELAX_BRENT enumerator :: ARK_RELAX_NEWTON end enum - integer, parameter, public :: ARKRelaxSolver = kind(ARK_RELAX_BRENT) + integer, parameter, public :: ARKRelaxSolver_ = kind(ARK_RELAX_BRENT) public :: ARK_RELAX_BRENT, ARK_RELAX_NEWTON - ! typedef enum ARKAccumError + ! enum ARKAccumError enum, bind(c) enumerator :: ARK_ACCUMERROR_NONE enumerator :: ARK_ACCUMERROR_MAX @@ -318,7 +318,7 @@ module farkode_mod public :: FARKodeButcherTable_IsStifflyAccurate public :: FARKodeButcherTable_CheckOrder public :: FARKodeButcherTable_CheckARKOrder - ! typedef enum ARKODE_DIRKTableID + ! enum ARKODE_DIRKTableID_ enum, bind(c) enumerator :: ARKODE_DIRK_NONE = -1 enumerator :: ARKODE_MIN_DIRK_NUM = 100 @@ -351,7 +351,7 @@ module farkode_mod enumerator :: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 enumerator :: ARKODE_MAX_DIRK_NUM = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 end enum - integer, parameter, public :: ARKODE_DIRKTableID = kind(ARKODE_DIRK_NONE) + integer, parameter, public :: ARKODE_DIRKTableID_ = kind(ARKODE_DIRK_NONE) public :: ARKODE_DIRK_NONE, ARKODE_MIN_DIRK_NUM, ARKODE_SDIRK_2_1_2, ARKODE_BILLINGTON_3_3_2, ARKODE_TRBDF2_3_3_2, & ARKODE_KVAERNO_4_2_3, ARKODE_ARK324L2SA_DIRK_4_2_3, ARKODE_CASH_5_2_4, ARKODE_CASH_5_3_4, ARKODE_SDIRK_5_3_4, & ARKODE_KVAERNO_5_3_4, ARKODE_ARK436L2SA_DIRK_6_3_4, ARKODE_KVAERNO_7_4_5, ARKODE_ARK548L2SA_DIRK_8_4_5, & @@ -362,7 +362,7 @@ module farkode_mod public :: FARKodeButcherTable_LoadDIRK public :: FARKodeButcherTable_LoadDIRKByName public :: FARKodeButcherTable_DIRKIDToName - ! typedef enum ARKODE_ERKTableID + ! enum ARKODE_ERKTableID_ enum, bind(c) enumerator :: ARKODE_ERK_NONE = -1 enumerator :: ARKODE_MIN_ERK_NUM = 0 @@ -395,7 +395,7 @@ module farkode_mod enumerator :: ARKODE_TSITOURAS_7_4_5 enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_TSITOURAS_7_4_5 end enum - integer, parameter, public :: ARKODE_ERKTableID = kind(ARKODE_ERK_NONE) + integer, parameter, public :: ARKODE_ERKTableID_ = kind(ARKODE_ERK_NONE) public :: ARKODE_ERK_NONE, ARKODE_MIN_ERK_NUM, ARKODE_HEUN_EULER_2_1_2, ARKODE_BOGACKI_SHAMPINE_4_2_3, & ARKODE_ARK324L2SA_ERK_4_2_3, ARKODE_ZONNEVELD_5_3_4, ARKODE_ARK436L2SA_ERK_6_3_4, ARKODE_SAYFY_ABURUB_6_3_4, & ARKODE_CASH_KARP_6_4_5, ARKODE_FEHLBERG_6_4_5, ARKODE_DORMAND_PRINCE_7_4_5, ARKODE_ARK548L2SA_ERK_8_4_5, & @@ -407,11 +407,11 @@ module farkode_mod public :: FARKodeButcherTable_LoadERK public :: FARKodeButcherTable_LoadERKByName public :: FARKodeButcherTable_ERKIDToName - ! typedef enum ARKODE_SPRKMethodID + ! enum ARKODE_SPRKMethodID_ enum, bind(c) enumerator :: ARKODE_SPRK_NONE = -1 enumerator :: ARKODE_MIN_SPRK_NUM = 0 - enumerator :: ARKODE_SPRK_EULER_1_1 = ARKODE_MIN_SPRK_NUM + enumerator :: ARKODE_SPRK_EULER_1_1 = 0 enumerator :: ARKODE_SPRK_LEAPFROG_2_2 enumerator :: ARKODE_SPRK_PSEUDO_LEAPFROG_2_2 enumerator :: ARKODE_SPRK_RUTH_3_3 @@ -425,7 +425,7 @@ module farkode_mod enumerator :: ARKODE_SPRK_SOFRONIOU_10_36 enumerator :: ARKODE_MAX_SPRK_NUM = ARKODE_SPRK_SOFRONIOU_10_36 end enum - integer, parameter, public :: ARKODE_SPRKMethodID = kind(ARKODE_SPRK_NONE) + integer, parameter, public :: ARKODE_SPRKMethodID_ = kind(ARKODE_SPRK_NONE) public :: ARKODE_SPRK_NONE, ARKODE_MIN_SPRK_NUM, ARKODE_SPRK_EULER_1_1, ARKODE_SPRK_LEAPFROG_2_2, & ARKODE_SPRK_PSEUDO_LEAPFROG_2_2, ARKODE_SPRK_RUTH_3_3, ARKODE_SPRK_MCLACHLAN_2_2, ARKODE_SPRK_MCLACHLAN_3_3, & ARKODE_SPRK_CANDY_ROZMUS_4_4, ARKODE_SPRK_MCLACHLAN_4_4, ARKODE_SPRK_MCLACHLAN_5_6, ARKODE_SPRK_YOSHIDA_6_8, & @@ -4777,7 +4777,7 @@ function FARKodeSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver), intent(in) :: solver +integer(ARKRelaxSolver_), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -5474,7 +5474,7 @@ function FARKodeButcherTable_LoadDIRK(imethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_DIRKTableID), intent(in) :: imethod +integer(ARKODE_DIRKTableID_), intent(in) :: imethod type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -5501,7 +5501,7 @@ function FARKodeButcherTable_DIRKIDToName(imethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING character(kind=C_CHAR, len=:), allocatable :: swig_result -integer(ARKODE_DIRKTableID), intent(in) :: imethod +integer(ARKODE_DIRKTableID_), intent(in) :: imethod type(SwigArrayWrapper) :: fresult integer(C_INT) :: farg1 @@ -5515,7 +5515,7 @@ function FARKodeButcherTable_LoadERK(emethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_ERKTableID), intent(in) :: emethod +integer(ARKODE_ERKTableID_), intent(in) :: emethod type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -5542,7 +5542,7 @@ function FARKodeButcherTable_ERKIDToName(emethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING character(kind=C_CHAR, len=:), allocatable :: swig_result -integer(ARKODE_ERKTableID), intent(in) :: emethod +integer(ARKODE_ERKTableID_), intent(in) :: emethod type(SwigArrayWrapper) :: fresult integer(C_INT) :: farg1 @@ -5728,7 +5728,7 @@ function FARKodeSPRKTable_Load(id) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_SPRKMethodID), intent(in) :: id +integer(ARKODE_SPRKMethodID_), intent(in) :: id type(C_PTR) :: fresult integer(C_INT) :: farg1 diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.f90 b/src/arkode/fmod_int32/farkode_mristep_mod.f90 index 57343e59eb..77d95e81d5 100644 --- a/src/arkode/fmod_int32/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mristep_mod.f90 @@ -26,7 +26,7 @@ module farkode_mristep_mod private ! DECLARATION CONSTRUCTS - ! typedef enum MRISTEP_METHOD_TYPE + ! enum MRISTEP_METHOD_TYPE_ enum, bind(c) enumerator :: MRISTEP_EXPLICIT enumerator :: MRISTEP_IMPLICIT @@ -34,13 +34,13 @@ module farkode_mristep_mod enumerator :: MRISTEP_MERK enumerator :: MRISTEP_SR end enum - integer, parameter, public :: MRISTEP_METHOD_TYPE = kind(MRISTEP_EXPLICIT) + integer, parameter, public :: MRISTEP_METHOD_TYPE_ = kind(MRISTEP_EXPLICIT) public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX, MRISTEP_MERK, MRISTEP_SR - ! typedef enum ARKODE_MRITableID + ! enum ARKODE_MRITableID_ enum, bind(c) enumerator :: ARKODE_MRI_NONE = -1 enumerator :: ARKODE_MIN_MRI_NUM = 200 - enumerator :: ARKODE_MIS_KW3 = ARKODE_MIN_MRI_NUM + enumerator :: ARKODE_MIS_KW3 = 200 enumerator :: ARKODE_MRI_GARK_ERK33a enumerator :: ARKODE_MRI_GARK_ERK45a enumerator :: ARKODE_MRI_GARK_IRK21a @@ -68,7 +68,7 @@ module farkode_mristep_mod enumerator :: ARKODE_IMEX_MRI_SR43 enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_SR43 end enum - integer, parameter, public :: ARKODE_MRITableID = kind(ARKODE_MRI_NONE) + integer, parameter, public :: ARKODE_MRITableID_ = kind(ARKODE_MRI_NONE) public :: ARKODE_MRI_NONE, ARKODE_MIN_MRI_NUM, ARKODE_MIS_KW3, ARKODE_MRI_GARK_ERK33a, ARKODE_MRI_GARK_ERK45a, & ARKODE_MRI_GARK_IRK21a, ARKODE_MRI_GARK_ESDIRK34a, ARKODE_MRI_GARK_ESDIRK46a, ARKODE_IMEX_MRI_GARK3a, & ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, ARKODE_MRI_GARK_FORWARD_EULER, ARKODE_MRI_GARK_RALSTON2, & @@ -1534,7 +1534,7 @@ function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & subroutine swigf_MRIStepCouplingMem_type_set(self, type) use, intrinsic :: ISO_C_BINDING class(MRIStepCouplingMem), intent(in) :: self -integer(MRISTEP_METHOD_TYPE), intent(in) :: type +integer(MRISTEP_METHOD_TYPE_), intent(in) :: type type(SwigClassWrapper) :: farg1 integer(C_INT) :: farg2 @@ -1546,7 +1546,7 @@ subroutine swigf_MRIStepCouplingMem_type_set(self, type) function swigf_MRIStepCouplingMem_type_get(self) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(MRISTEP_METHOD_TYPE) :: swig_result +integer(MRISTEP_METHOD_TYPE_) :: swig_result class(MRIStepCouplingMem), intent(in) :: self integer(C_INT) :: fresult type(SwigClassWrapper) :: farg1 @@ -1822,7 +1822,7 @@ function FMRIStepCoupling_LoadTable(method) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_MRITableID), intent(in) :: method +integer(ARKODE_MRITableID_), intent(in) :: method type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -1869,7 +1869,7 @@ function FMRIStepCoupling_Alloc(nmat, stages, type) & type(C_PTR) :: swig_result integer(C_INT), intent(in) :: nmat integer(C_INT), intent(in) :: stages -integer(MRISTEP_METHOD_TYPE), intent(in) :: type +integer(MRISTEP_METHOD_TYPE_), intent(in) :: type type(C_PTR) :: fresult integer(C_INT) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_sprkstep_mod.c b/src/arkode/fmod_int32/farkode_sprkstep_mod.c index 55eeb61972..07026c7d58 100644 --- a/src/arkode/fmod_int32/farkode_sprkstep_mod.c +++ b/src/arkode/fmod_int32/farkode_sprkstep_mod.c @@ -274,20 +274,6 @@ SWIGEXPORT int _wrap_FSPRKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3 } -SWIGEXPORT int _wrap_FSPRKStepSetUseCompensatedSums(void *farg1, int const *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - int arg2 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - result = (int)SPRKStepSetUseCompensatedSums(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSPRKStepSetMethod(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -765,4 +751,18 @@ SWIGEXPORT int _wrap_FSPRKStepGetNumRhsEvals(void *farg1, long *farg2, long *far } +SWIGEXPORT int _wrap_FSPRKStepSetUseCompensatedSums(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)SPRKStepSetUseCompensatedSums(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 b/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 index 41fb5ee8fd..d42746ddb9 100644 --- a/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 @@ -36,7 +36,6 @@ module farkode_sprkstep_mod integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_10 = ARKODE_SPRK_SOFRONIOU_10_36 public :: FSPRKStepCreate public :: FSPRKStepReInit - public :: FSPRKStepSetUseCompensatedSums public :: FSPRKStepSetMethod type, bind(C) :: SwigArrayWrapper type(C_PTR), public :: data = C_NULL_PTR @@ -74,6 +73,7 @@ module farkode_sprkstep_mod public :: FSPRKStepGetStepStats public :: FSPRKStepFree public :: FSPRKStepGetNumRhsEvals + public :: FSPRKStepSetUseCompensatedSums ! WRAPPER DECLARATIONS interface @@ -101,15 +101,6 @@ function swigc_FSPRKStepReInit(farg1, farg2, farg3, farg4, farg5) & integer(C_INT) :: fresult end function -function swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) & -bind(C, name="_wrap_FSPRKStepSetUseCompensatedSums") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FSPRKStepSetMethod(farg1, farg2) & bind(C, name="_wrap_FSPRKStepSetMethod") & result(fresult) @@ -421,6 +412,15 @@ function swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetUseCompensatedSums") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + end interface @@ -476,22 +476,6 @@ function FSPRKStepReInit(arkode_mem, f1, f2, t0, y0) & swig_result = fresult end function -function FSPRKStepSetUseCompensatedSums(arkode_mem, onoff) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: onoff -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = arkode_mem -farg2 = onoff -fresult = swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) -swig_result = fresult -end function - function FSPRKStepSetMethod(arkode_mem, sprk_storage) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1077,5 +1061,21 @@ function FSPRKStepGetNumRhsEvals(arkode_mem, nf1, nf2) & swig_result = fresult end function +function FSPRKStepSetUseCompensatedSums(arkode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = onoff +fresult = swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) +swig_result = fresult +end function + end module diff --git a/src/arkode/fmod_int64/farkode_arkstep_mod.f90 b/src/arkode/fmod_int64/farkode_arkstep_mod.f90 index 65fbb3c66e..278cece912 100644 --- a/src/arkode/fmod_int64/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_arkstep_mod.f90 @@ -1911,8 +1911,8 @@ function FARKStepSetTableNum(arkode_mem, itable, etable) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_DIRKTableID), intent(in) :: itable -integer(ARKODE_ERKTableID), intent(in) :: etable +integer(ARKODE_DIRKTableID_), intent(in) :: itable +integer(ARKODE_ERKTableID_), intent(in) :: etable integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -4490,7 +4490,7 @@ function FARKStepSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver), intent(in) :: solver +integer(ARKRelaxSolver_), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_erkstep_mod.f90 b/src/arkode/fmod_int64/farkode_erkstep_mod.f90 index 964e452c97..cf8ef8bff4 100644 --- a/src/arkode/fmod_int64/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_erkstep_mod.f90 @@ -1069,7 +1069,7 @@ function FERKStepSetTableNum(arkode_mem, etable) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_ERKTableID), intent(in) :: etable +integer(ARKODE_ERKTableID_), intent(in) :: etable integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -2430,7 +2430,7 @@ function FERKStepSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver), intent(in) :: solver +integer(ARKRelaxSolver_), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 b/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 index eb54169668..6a4faea649 100644 --- a/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 @@ -26,7 +26,7 @@ module farkode_lsrkstep_mod private ! DECLARATION CONSTRUCTS - ! typedef enum ARKODE_LSRKMethodType + ! enum ARKODE_LSRKMethodType_ enum, bind(c) enumerator :: ARKODE_LSRK_RKC_2 enumerator :: ARKODE_LSRK_RKL_2 @@ -34,7 +34,7 @@ module farkode_lsrkstep_mod enumerator :: ARKODE_LSRK_SSP_S_3 enumerator :: ARKODE_LSRK_SSP_10_4 end enum - integer, parameter, public :: ARKODE_LSRKMethodType = kind(ARKODE_LSRK_RKC_2) + integer, parameter, public :: ARKODE_LSRKMethodType_ = kind(ARKODE_LSRK_RKC_2) public :: ARKODE_LSRK_RKC_2, ARKODE_LSRK_RKL_2, ARKODE_LSRK_SSP_S_2, ARKODE_LSRK_SSP_S_3, ARKODE_LSRK_SSP_10_4 public :: FLSRKStepCreateSTS public :: FLSRKStepCreateSSP @@ -351,7 +351,7 @@ function FLSRKStepSetSTSMethod(arkode_mem, method) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_LSRKMethodType), intent(in) :: method +integer(ARKODE_LSRKMethodType_), intent(in) :: method integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -367,7 +367,7 @@ function FLSRKStepSetSSPMethod(arkode_mem, method) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_LSRKMethodType), intent(in) :: method +integer(ARKODE_LSRKMethodType_), intent(in) :: method integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 index cc4927c61c..adffac0b42 100644 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mod.f90 @@ -103,14 +103,14 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_SUNADJSTEPPER_ERR = -55_C_INT integer(C_INT), parameter, public :: ARK_DEE_FAIL = -56_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT - ! typedef enum ARKRelaxSolver + ! enum ARKRelaxSolver_ enum, bind(c) enumerator :: ARK_RELAX_BRENT enumerator :: ARK_RELAX_NEWTON end enum - integer, parameter, public :: ARKRelaxSolver = kind(ARK_RELAX_BRENT) + integer, parameter, public :: ARKRelaxSolver_ = kind(ARK_RELAX_BRENT) public :: ARK_RELAX_BRENT, ARK_RELAX_NEWTON - ! typedef enum ARKAccumError + ! enum ARKAccumError enum, bind(c) enumerator :: ARK_ACCUMERROR_NONE enumerator :: ARK_ACCUMERROR_MAX @@ -318,7 +318,7 @@ module farkode_mod public :: FARKodeButcherTable_IsStifflyAccurate public :: FARKodeButcherTable_CheckOrder public :: FARKodeButcherTable_CheckARKOrder - ! typedef enum ARKODE_DIRKTableID + ! enum ARKODE_DIRKTableID_ enum, bind(c) enumerator :: ARKODE_DIRK_NONE = -1 enumerator :: ARKODE_MIN_DIRK_NUM = 100 @@ -351,7 +351,7 @@ module farkode_mod enumerator :: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 enumerator :: ARKODE_MAX_DIRK_NUM = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 end enum - integer, parameter, public :: ARKODE_DIRKTableID = kind(ARKODE_DIRK_NONE) + integer, parameter, public :: ARKODE_DIRKTableID_ = kind(ARKODE_DIRK_NONE) public :: ARKODE_DIRK_NONE, ARKODE_MIN_DIRK_NUM, ARKODE_SDIRK_2_1_2, ARKODE_BILLINGTON_3_3_2, ARKODE_TRBDF2_3_3_2, & ARKODE_KVAERNO_4_2_3, ARKODE_ARK324L2SA_DIRK_4_2_3, ARKODE_CASH_5_2_4, ARKODE_CASH_5_3_4, ARKODE_SDIRK_5_3_4, & ARKODE_KVAERNO_5_3_4, ARKODE_ARK436L2SA_DIRK_6_3_4, ARKODE_KVAERNO_7_4_5, ARKODE_ARK548L2SA_DIRK_8_4_5, & @@ -362,7 +362,7 @@ module farkode_mod public :: FARKodeButcherTable_LoadDIRK public :: FARKodeButcherTable_LoadDIRKByName public :: FARKodeButcherTable_DIRKIDToName - ! typedef enum ARKODE_ERKTableID + ! enum ARKODE_ERKTableID_ enum, bind(c) enumerator :: ARKODE_ERK_NONE = -1 enumerator :: ARKODE_MIN_ERK_NUM = 0 @@ -395,7 +395,7 @@ module farkode_mod enumerator :: ARKODE_TSITOURAS_7_4_5 enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_TSITOURAS_7_4_5 end enum - integer, parameter, public :: ARKODE_ERKTableID = kind(ARKODE_ERK_NONE) + integer, parameter, public :: ARKODE_ERKTableID_ = kind(ARKODE_ERK_NONE) public :: ARKODE_ERK_NONE, ARKODE_MIN_ERK_NUM, ARKODE_HEUN_EULER_2_1_2, ARKODE_BOGACKI_SHAMPINE_4_2_3, & ARKODE_ARK324L2SA_ERK_4_2_3, ARKODE_ZONNEVELD_5_3_4, ARKODE_ARK436L2SA_ERK_6_3_4, ARKODE_SAYFY_ABURUB_6_3_4, & ARKODE_CASH_KARP_6_4_5, ARKODE_FEHLBERG_6_4_5, ARKODE_DORMAND_PRINCE_7_4_5, ARKODE_ARK548L2SA_ERK_8_4_5, & @@ -407,11 +407,11 @@ module farkode_mod public :: FARKodeButcherTable_LoadERK public :: FARKodeButcherTable_LoadERKByName public :: FARKodeButcherTable_ERKIDToName - ! typedef enum ARKODE_SPRKMethodID + ! enum ARKODE_SPRKMethodID_ enum, bind(c) enumerator :: ARKODE_SPRK_NONE = -1 enumerator :: ARKODE_MIN_SPRK_NUM = 0 - enumerator :: ARKODE_SPRK_EULER_1_1 = ARKODE_MIN_SPRK_NUM + enumerator :: ARKODE_SPRK_EULER_1_1 = 0 enumerator :: ARKODE_SPRK_LEAPFROG_2_2 enumerator :: ARKODE_SPRK_PSEUDO_LEAPFROG_2_2 enumerator :: ARKODE_SPRK_RUTH_3_3 @@ -425,7 +425,7 @@ module farkode_mod enumerator :: ARKODE_SPRK_SOFRONIOU_10_36 enumerator :: ARKODE_MAX_SPRK_NUM = ARKODE_SPRK_SOFRONIOU_10_36 end enum - integer, parameter, public :: ARKODE_SPRKMethodID = kind(ARKODE_SPRK_NONE) + integer, parameter, public :: ARKODE_SPRKMethodID_ = kind(ARKODE_SPRK_NONE) public :: ARKODE_SPRK_NONE, ARKODE_MIN_SPRK_NUM, ARKODE_SPRK_EULER_1_1, ARKODE_SPRK_LEAPFROG_2_2, & ARKODE_SPRK_PSEUDO_LEAPFROG_2_2, ARKODE_SPRK_RUTH_3_3, ARKODE_SPRK_MCLACHLAN_2_2, ARKODE_SPRK_MCLACHLAN_3_3, & ARKODE_SPRK_CANDY_ROZMUS_4_4, ARKODE_SPRK_MCLACHLAN_4_4, ARKODE_SPRK_MCLACHLAN_5_6, ARKODE_SPRK_YOSHIDA_6_8, & @@ -4777,7 +4777,7 @@ function FARKodeSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver), intent(in) :: solver +integer(ARKRelaxSolver_), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -5474,7 +5474,7 @@ function FARKodeButcherTable_LoadDIRK(imethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_DIRKTableID), intent(in) :: imethod +integer(ARKODE_DIRKTableID_), intent(in) :: imethod type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -5501,7 +5501,7 @@ function FARKodeButcherTable_DIRKIDToName(imethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING character(kind=C_CHAR, len=:), allocatable :: swig_result -integer(ARKODE_DIRKTableID), intent(in) :: imethod +integer(ARKODE_DIRKTableID_), intent(in) :: imethod type(SwigArrayWrapper) :: fresult integer(C_INT) :: farg1 @@ -5515,7 +5515,7 @@ function FARKodeButcherTable_LoadERK(emethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_ERKTableID), intent(in) :: emethod +integer(ARKODE_ERKTableID_), intent(in) :: emethod type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -5542,7 +5542,7 @@ function FARKodeButcherTable_ERKIDToName(emethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING character(kind=C_CHAR, len=:), allocatable :: swig_result -integer(ARKODE_ERKTableID), intent(in) :: emethod +integer(ARKODE_ERKTableID_), intent(in) :: emethod type(SwigArrayWrapper) :: fresult integer(C_INT) :: farg1 @@ -5728,7 +5728,7 @@ function FARKodeSPRKTable_Load(id) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_SPRKMethodID), intent(in) :: id +integer(ARKODE_SPRKMethodID_), intent(in) :: id type(C_PTR) :: fresult integer(C_INT) :: farg1 diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.f90 b/src/arkode/fmod_int64/farkode_mristep_mod.f90 index 8edd67d7c6..7bb877d4ac 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mristep_mod.f90 @@ -26,7 +26,7 @@ module farkode_mristep_mod private ! DECLARATION CONSTRUCTS - ! typedef enum MRISTEP_METHOD_TYPE + ! enum MRISTEP_METHOD_TYPE_ enum, bind(c) enumerator :: MRISTEP_EXPLICIT enumerator :: MRISTEP_IMPLICIT @@ -34,13 +34,13 @@ module farkode_mristep_mod enumerator :: MRISTEP_MERK enumerator :: MRISTEP_SR end enum - integer, parameter, public :: MRISTEP_METHOD_TYPE = kind(MRISTEP_EXPLICIT) + integer, parameter, public :: MRISTEP_METHOD_TYPE_ = kind(MRISTEP_EXPLICIT) public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX, MRISTEP_MERK, MRISTEP_SR - ! typedef enum ARKODE_MRITableID + ! enum ARKODE_MRITableID_ enum, bind(c) enumerator :: ARKODE_MRI_NONE = -1 enumerator :: ARKODE_MIN_MRI_NUM = 200 - enumerator :: ARKODE_MIS_KW3 = ARKODE_MIN_MRI_NUM + enumerator :: ARKODE_MIS_KW3 = 200 enumerator :: ARKODE_MRI_GARK_ERK33a enumerator :: ARKODE_MRI_GARK_ERK45a enumerator :: ARKODE_MRI_GARK_IRK21a @@ -68,7 +68,7 @@ module farkode_mristep_mod enumerator :: ARKODE_IMEX_MRI_SR43 enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_SR43 end enum - integer, parameter, public :: ARKODE_MRITableID = kind(ARKODE_MRI_NONE) + integer, parameter, public :: ARKODE_MRITableID_ = kind(ARKODE_MRI_NONE) public :: ARKODE_MRI_NONE, ARKODE_MIN_MRI_NUM, ARKODE_MIS_KW3, ARKODE_MRI_GARK_ERK33a, ARKODE_MRI_GARK_ERK45a, & ARKODE_MRI_GARK_IRK21a, ARKODE_MRI_GARK_ESDIRK34a, ARKODE_MRI_GARK_ESDIRK46a, ARKODE_IMEX_MRI_GARK3a, & ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, ARKODE_MRI_GARK_FORWARD_EULER, ARKODE_MRI_GARK_RALSTON2, & @@ -1534,7 +1534,7 @@ function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & subroutine swigf_MRIStepCouplingMem_type_set(self, type) use, intrinsic :: ISO_C_BINDING class(MRIStepCouplingMem), intent(in) :: self -integer(MRISTEP_METHOD_TYPE), intent(in) :: type +integer(MRISTEP_METHOD_TYPE_), intent(in) :: type type(SwigClassWrapper) :: farg1 integer(C_INT) :: farg2 @@ -1546,7 +1546,7 @@ subroutine swigf_MRIStepCouplingMem_type_set(self, type) function swigf_MRIStepCouplingMem_type_get(self) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(MRISTEP_METHOD_TYPE) :: swig_result +integer(MRISTEP_METHOD_TYPE_) :: swig_result class(MRIStepCouplingMem), intent(in) :: self integer(C_INT) :: fresult type(SwigClassWrapper) :: farg1 @@ -1822,7 +1822,7 @@ function FMRIStepCoupling_LoadTable(method) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_MRITableID), intent(in) :: method +integer(ARKODE_MRITableID_), intent(in) :: method type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -1869,7 +1869,7 @@ function FMRIStepCoupling_Alloc(nmat, stages, type) & type(C_PTR) :: swig_result integer(C_INT), intent(in) :: nmat integer(C_INT), intent(in) :: stages -integer(MRISTEP_METHOD_TYPE), intent(in) :: type +integer(MRISTEP_METHOD_TYPE_), intent(in) :: type type(C_PTR) :: fresult integer(C_INT) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_sprkstep_mod.c b/src/arkode/fmod_int64/farkode_sprkstep_mod.c index 55eeb61972..07026c7d58 100644 --- a/src/arkode/fmod_int64/farkode_sprkstep_mod.c +++ b/src/arkode/fmod_int64/farkode_sprkstep_mod.c @@ -274,20 +274,6 @@ SWIGEXPORT int _wrap_FSPRKStepReInit(void *farg1, ARKRhsFn farg2, ARKRhsFn farg3 } -SWIGEXPORT int _wrap_FSPRKStepSetUseCompensatedSums(void *farg1, int const *farg2) { - int fresult ; - void *arg1 = (void *) 0 ; - int arg2 ; - int result; - - arg1 = (void *)(farg1); - arg2 = (int)(*farg2); - result = (int)SPRKStepSetUseCompensatedSums(arg1,arg2); - fresult = (int)(result); - return fresult; -} - - SWIGEXPORT int _wrap_FSPRKStepSetMethod(void *farg1, void *farg2) { int fresult ; void *arg1 = (void *) 0 ; @@ -765,4 +751,18 @@ SWIGEXPORT int _wrap_FSPRKStepGetNumRhsEvals(void *farg1, long *farg2, long *far } +SWIGEXPORT int _wrap_FSPRKStepSetUseCompensatedSums(void *farg1, int const *farg2) { + int fresult ; + void *arg1 = (void *) 0 ; + int arg2 ; + int result; + + arg1 = (void *)(farg1); + arg2 = (int)(*farg2); + result = (int)SPRKStepSetUseCompensatedSums(arg1,arg2); + fresult = (int)(result); + return fresult; +} + + diff --git a/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 b/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 index 41fb5ee8fd..d42746ddb9 100644 --- a/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 @@ -36,7 +36,6 @@ module farkode_sprkstep_mod integer(C_INT), parameter, public :: SPRKSTEP_DEFAULT_10 = ARKODE_SPRK_SOFRONIOU_10_36 public :: FSPRKStepCreate public :: FSPRKStepReInit - public :: FSPRKStepSetUseCompensatedSums public :: FSPRKStepSetMethod type, bind(C) :: SwigArrayWrapper type(C_PTR), public :: data = C_NULL_PTR @@ -74,6 +73,7 @@ module farkode_sprkstep_mod public :: FSPRKStepGetStepStats public :: FSPRKStepFree public :: FSPRKStepGetNumRhsEvals + public :: FSPRKStepSetUseCompensatedSums ! WRAPPER DECLARATIONS interface @@ -101,15 +101,6 @@ function swigc_FSPRKStepReInit(farg1, farg2, farg3, farg4, farg5) & integer(C_INT) :: fresult end function -function swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) & -bind(C, name="_wrap_FSPRKStepSetUseCompensatedSums") & -result(fresult) -use, intrinsic :: ISO_C_BINDING -type(C_PTR), value :: farg1 -integer(C_INT), intent(in) :: farg2 -integer(C_INT) :: fresult -end function - function swigc_FSPRKStepSetMethod(farg1, farg2) & bind(C, name="_wrap_FSPRKStepSetMethod") & result(fresult) @@ -421,6 +412,15 @@ function swigc_FSPRKStepGetNumRhsEvals(farg1, farg2, farg3) & integer(C_INT) :: fresult end function +function swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) & +bind(C, name="_wrap_FSPRKStepSetUseCompensatedSums") & +result(fresult) +use, intrinsic :: ISO_C_BINDING +type(C_PTR), value :: farg1 +integer(C_INT), intent(in) :: farg2 +integer(C_INT) :: fresult +end function + end interface @@ -476,22 +476,6 @@ function FSPRKStepReInit(arkode_mem, f1, f2, t0, y0) & swig_result = fresult end function -function FSPRKStepSetUseCompensatedSums(arkode_mem, onoff) & -result(swig_result) -use, intrinsic :: ISO_C_BINDING -integer(C_INT) :: swig_result -type(C_PTR) :: arkode_mem -integer(C_INT), intent(in) :: onoff -integer(C_INT) :: fresult -type(C_PTR) :: farg1 -integer(C_INT) :: farg2 - -farg1 = arkode_mem -farg2 = onoff -fresult = swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) -swig_result = fresult -end function - function FSPRKStepSetMethod(arkode_mem, sprk_storage) & result(swig_result) use, intrinsic :: ISO_C_BINDING @@ -1077,5 +1061,21 @@ function FSPRKStepGetNumRhsEvals(arkode_mem, nf1, nf2) & swig_result = fresult end function +function FSPRKStepSetUseCompensatedSums(arkode_mem, onoff) & +result(swig_result) +use, intrinsic :: ISO_C_BINDING +integer(C_INT) :: swig_result +type(C_PTR) :: arkode_mem +integer(C_INT), intent(in) :: onoff +integer(C_INT) :: fresult +type(C_PTR) :: farg1 +integer(C_INT) :: farg2 + +farg1 = arkode_mem +farg2 = onoff +fresult = swigc_FSPRKStepSetUseCompensatedSums(farg1, farg2) +swig_result = fresult +end function + end module diff --git a/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 b/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 index 4dc30dc6a1..68afa07c37 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 +++ b/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 @@ -178,7 +178,7 @@ function FSUNAdaptController_SetParams_ImExGus(c, k1e, k2e, k1i, k2i) & function FSUNAdaptController_GetType_ImExGus(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type) :: swig_result +integer(SUNAdaptController_Type_) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 b/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 index 4dc30dc6a1..68afa07c37 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 +++ b/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 @@ -178,7 +178,7 @@ function FSUNAdaptController_SetParams_ImExGus(c, k1e, k2e, k1i, k2i) & function FSUNAdaptController_GetType_ImExGus(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type) :: swig_result +integer(SUNAdaptController_Type_) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 b/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 index e7afddd833..87dceb7232 100644 --- a/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 +++ b/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 @@ -538,7 +538,7 @@ function FSUNAdaptController_GetFastController_MRIHTol(c, cfast) & function FSUNAdaptController_GetType_MRIHTol(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type) :: swig_result +integer(SUNAdaptController_Type_) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 b/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 index e7afddd833..87dceb7232 100644 --- a/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 +++ b/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 @@ -538,7 +538,7 @@ function FSUNAdaptController_GetFastController_MRIHTol(c, cfast) & function FSUNAdaptController_GetType_MRIHTol(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type) :: swig_result +integer(SUNAdaptController_Type_) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 b/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 index e0f391f7ef..5cc82c454b 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 +++ b/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 @@ -318,7 +318,7 @@ function FSUNAdaptController_SetParams_Soderlind(c, k1, k2, k3, k4, k5) & function FSUNAdaptController_GetType_Soderlind(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type) :: swig_result +integer(SUNAdaptController_Type_) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 b/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 index e0f391f7ef..5cc82c454b 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 +++ b/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 @@ -318,7 +318,7 @@ function FSUNAdaptController_SetParams_Soderlind(c, k1, k2, k3, k4, k5) & function FSUNAdaptController_GetType_Soderlind(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type) :: swig_result +integer(SUNAdaptController_Type_) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sundials/fmod_int32/fsundials_core_mod.f90 b/src/sundials/fmod_int32/fsundials_core_mod.f90 index 72f089875f..fa8db364b7 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int32/fsundials_core_mod.f90 @@ -58,10 +58,10 @@ module fsundials_core_mod public :: SUN_OUTPUTFORMAT_TABLE, SUN_OUTPUTFORMAT_CSV ! enum SUNDataIOMode_ enum, bind(c) - enumerator :: SUN_DATAIOMODE_INMEM + enumerator :: SUNDATAIOMODE_INMEM end enum - integer, parameter, public :: SUNDataIOMode_ = kind(SUN_DATAIOMODE_INMEM) - public :: SUN_DATAIOMODE_INMEM + integer, parameter, public :: SUNDataIOMode_ = kind(SUNDATAIOMODE_INMEM) + public :: SUNDATAIOMODE_INMEM ! enum SUNErrCode_ enum, bind(c) enumerator :: SUN_ERR_MINIMUM = -10000 @@ -132,7 +132,7 @@ module fsundials_core_mod public :: FSUNProfiler_GetElapsedTime public :: FSUNProfiler_Print public :: FSUNProfiler_Reset - ! typedef enum SUNLogLevel + ! enum SUNLogLevel_ enum, bind(c) enumerator :: SUN_LOGLEVEL_ALL = -1 enumerator :: SUN_LOGLEVEL_NONE = 0 @@ -141,7 +141,7 @@ module fsundials_core_mod enumerator :: SUN_LOGLEVEL_INFO = 3 enumerator :: SUN_LOGLEVEL_DEBUG = 4 end enum - integer, parameter, public :: SUNLogLevel = kind(SUN_LOGLEVEL_ALL) + integer, parameter, public :: SUNLogLevel_ = kind(SUN_LOGLEVEL_ALL) public :: SUN_LOGLEVEL_ALL, SUN_LOGLEVEL_NONE, SUN_LOGLEVEL_ERROR, SUN_LOGLEVEL_WARNING, SUN_LOGLEVEL_INFO, & SUN_LOGLEVEL_DEBUG public :: FSUNLogger_Create @@ -313,7 +313,7 @@ module fsundials_core_mod public :: FN_VGetArrayPointer public :: FN_VGetDeviceArrayPointer - ! typedef enum SUNMatrix_ID + ! enum SUNMatrix_ID_ enum, bind(c) enumerator :: SUNMATRIX_DENSE enumerator :: SUNMATRIX_MAGMADENSE @@ -326,7 +326,7 @@ module fsundials_core_mod enumerator :: SUNMATRIX_KOKKOSDENSE enumerator :: SUNMATRIX_CUSTOM end enum - integer, parameter, public :: SUNMatrix_ID = kind(SUNMATRIX_DENSE) + integer, parameter, public :: SUNMatrix_ID_ = kind(SUNMATRIX_DENSE) public :: SUNMATRIX_DENSE, SUNMATRIX_MAGMADENSE, SUNMATRIX_ONEMKLDENSE, SUNMATRIX_BAND, SUNMATRIX_SPARSE, SUNMATRIX_SLUNRLOC, & SUNMATRIX_CUSPARSE, SUNMATRIX_GINKGO, SUNMATRIX_KOKKOSDENSE, SUNMATRIX_CUSTOM ! struct struct _generic_SUNMatrix_Ops @@ -389,17 +389,17 @@ module fsundials_core_mod public :: FSUNQRAdd_CGS2 public :: FSUNQRAdd_DCGS2 public :: FSUNQRAdd_DCGS2_SB - ! typedef enum SUNLinearSolver_Type + ! enum SUNLinearSolver_Type_ enum, bind(c) enumerator :: SUNLINEARSOLVER_DIRECT enumerator :: SUNLINEARSOLVER_ITERATIVE enumerator :: SUNLINEARSOLVER_MATRIX_ITERATIVE enumerator :: SUNLINEARSOLVER_MATRIX_EMBEDDED end enum - integer, parameter, public :: SUNLinearSolver_Type = kind(SUNLINEARSOLVER_DIRECT) + integer, parameter, public :: SUNLinearSolver_Type_ = kind(SUNLINEARSOLVER_DIRECT) public :: SUNLINEARSOLVER_DIRECT, SUNLINEARSOLVER_ITERATIVE, SUNLINEARSOLVER_MATRIX_ITERATIVE, & SUNLINEARSOLVER_MATRIX_EMBEDDED - ! typedef enum SUNLinearSolver_ID + ! enum SUNLinearSolver_ID_ enum, bind(c) enumerator :: SUNLINEARSOLVER_BAND enumerator :: SUNLINEARSOLVER_DENSE @@ -420,7 +420,7 @@ module fsundials_core_mod enumerator :: SUNLINEARSOLVER_KOKKOSDENSE enumerator :: SUNLINEARSOLVER_CUSTOM end enum - integer, parameter, public :: SUNLinearSolver_ID = kind(SUNLINEARSOLVER_BAND) + integer, parameter, public :: SUNLinearSolver_ID_ = kind(SUNLINEARSOLVER_BAND) public :: SUNLINEARSOLVER_BAND, SUNLINEARSOLVER_DENSE, SUNLINEARSOLVER_KLU, SUNLINEARSOLVER_LAPACKBAND, & SUNLINEARSOLVER_LAPACKDENSE, SUNLINEARSOLVER_PCG, SUNLINEARSOLVER_SPBCGS, SUNLINEARSOLVER_SPFGMR, SUNLINEARSOLVER_SPGMR, & SUNLINEARSOLVER_SPTFQMR, SUNLINEARSOLVER_SUPERLUDIST, SUNLINEARSOLVER_SUPERLUMT, SUNLINEARSOLVER_CUSOLVERSP_BATCHQR, & @@ -484,12 +484,12 @@ module fsundials_core_mod integer(C_INT), parameter, public :: SUNLS_PACKAGE_FAIL_REC = 806_C_INT integer(C_INT), parameter, public :: SUNLS_QRFACT_FAIL = 807_C_INT integer(C_INT), parameter, public :: SUNLS_LUFACT_FAIL = 808_C_INT - ! typedef enum SUNNonlinearSolver_Type + ! enum SUNNonlinearSolver_Type_ enum, bind(c) enumerator :: SUNNONLINEARSOLVER_ROOTFIND enumerator :: SUNNONLINEARSOLVER_FIXEDPOINT end enum - integer, parameter, public :: SUNNonlinearSolver_Type = kind(SUNNONLINEARSOLVER_ROOTFIND) + integer, parameter, public :: SUNNonlinearSolver_Type_ = kind(SUNNONLINEARSOLVER_ROOTFIND) public :: SUNNONLINEARSOLVER_ROOTFIND, SUNNONLINEARSOLVER_FIXEDPOINT ! struct struct _generic_SUNNonlinearSolver_Ops type, bind(C), public :: SUNNonlinearSolver_Ops @@ -531,13 +531,13 @@ module fsundials_core_mod public :: FSUNNonlinSolGetNumConvFails integer(C_INT), parameter, public :: SUN_NLS_CONTINUE = +901_C_INT integer(C_INT), parameter, public :: SUN_NLS_CONV_RECVR = +902_C_INT - ! typedef enum SUNAdaptController_Type + ! enum SUNAdaptController_Type_ enum, bind(c) enumerator :: SUN_ADAPTCONTROLLER_NONE enumerator :: SUN_ADAPTCONTROLLER_H enumerator :: SUN_ADAPTCONTROLLER_MRI_H_TOL end enum - integer, parameter, public :: SUNAdaptController_Type = kind(SUN_ADAPTCONTROLLER_NONE) + integer, parameter, public :: SUNAdaptController_Type_ = kind(SUN_ADAPTCONTROLLER_NONE) public :: SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H, SUN_ADAPTCONTROLLER_MRI_H_TOL ! struct struct _generic_SUNAdaptController_Ops type, bind(C), public :: SUNAdaptController_Ops @@ -573,13 +573,13 @@ module fsundials_core_mod public :: FSUNAdaptController_UpdateH public :: FSUNAdaptController_UpdateMRIHTol public :: FSUNAdaptController_Space - ! typedef enum SUNFullRhsMode + ! enum SUNFullRhsMode_ enum, bind(c) enumerator :: SUN_FULLRHS_START enumerator :: SUN_FULLRHS_END enumerator :: SUN_FULLRHS_OTHER end enum - integer, parameter, public :: SUNFullRhsMode = kind(SUN_FULLRHS_START) + integer, parameter, public :: SUNFullRhsMode_ = kind(SUN_FULLRHS_START) public :: SUN_FULLRHS_START, SUN_FULLRHS_END, SUN_FULLRHS_OTHER public :: FSUNStepper_Create public :: FSUNStepper_Destroy @@ -610,13 +610,13 @@ module fsundials_core_mod public :: FSUNStepper_SetDestroyFn ! enum SUNMemoryType_ enum, bind(c) - enumerator :: SUN_MEMTYPE_HOST - enumerator :: SUN_MEMTYPE_PINNED - enumerator :: SUN_MEMTYPE_DEVICE - enumerator :: SUN_MEMTYPE_UVM + enumerator :: SUNMEMTYPE_HOST + enumerator :: SUNMEMTYPE_PINNED + enumerator :: SUNMEMTYPE_DEVICE + enumerator :: SUNMEMTYPE_UVM end enum - integer, parameter, public :: SUNMemoryType_ = kind(SUN_MEMTYPE_HOST) - public :: SUN_MEMTYPE_HOST, SUN_MEMTYPE_PINNED, SUN_MEMTYPE_DEVICE, SUN_MEMTYPE_UVM + integer, parameter, public :: SUNMemoryType_ = kind(SUNMEMTYPE_HOST) + public :: SUNMEMTYPE_HOST, SUNMEMTYPE_PINNED, SUNMEMTYPE_DEVICE, SUNMEMTYPE_UVM public :: FSUNMemoryNewEmpty ! struct struct SUNMemoryHelper_ type, bind(C), public :: SUNMemoryHelper_ @@ -3538,7 +3538,7 @@ function FSUNLogger_QueueMsg(logger, lvl, scope, label, msg_txt) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: logger -integer(SUNLogLevel), intent(in) :: lvl +integer(SUNLogLevel_), intent(in) :: lvl character(kind=C_CHAR, len=*), target :: scope character(kind=C_CHAR), dimension(:), allocatable, target :: farg3_chars character(kind=C_CHAR, len=*), target :: label @@ -3566,7 +3566,7 @@ function FSUNLogger_Flush(logger, lvl) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: logger -integer(SUNLogLevel), intent(in) :: lvl +integer(SUNLogLevel_), intent(in) :: lvl integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -4710,7 +4710,7 @@ function FSUNMatCopyOps(a, b) & function FSUNMatGetID(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID) :: swig_result +integer(SUNMatrix_ID_) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5169,7 +5169,7 @@ subroutine FSUNLinSolFreeEmpty(s) function FSUNLinSolGetType(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5182,7 +5182,7 @@ function FSUNLinSolGetType(s) & function FSUNLinSolGetID(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5431,7 +5431,7 @@ subroutine FSUNNonlinSolFreeEmpty(nls) function FSUNNonlinSolGetType(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type) :: swig_result +integer(SUNNonlinearSolver_Type_) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5673,7 +5673,7 @@ subroutine FSUNAdaptController_DestroyEmpty(c) function FSUNAdaptController_GetType(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type) :: swig_result +integer(SUNAdaptController_Type_) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5957,7 +5957,7 @@ function FSUNStepper_FullRhs(stepper, t, v, f, mode) & real(C_DOUBLE), intent(in) :: t type(N_Vector), target, intent(inout) :: v type(N_Vector), target, intent(inout) :: f -integer(SUNFullRhsMode), intent(in) :: mode +integer(SUNFullRhsMode_), intent(in) :: mode integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 diff --git a/src/sundials/fmod_int64/fsundials_core_mod.f90 b/src/sundials/fmod_int64/fsundials_core_mod.f90 index 46bf39e5a5..658e376f20 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int64/fsundials_core_mod.f90 @@ -58,10 +58,10 @@ module fsundials_core_mod public :: SUN_OUTPUTFORMAT_TABLE, SUN_OUTPUTFORMAT_CSV ! enum SUNDataIOMode_ enum, bind(c) - enumerator :: SUN_DATAIOMODE_INMEM + enumerator :: SUNDATAIOMODE_INMEM end enum - integer, parameter, public :: SUNDataIOMode_ = kind(SUN_DATAIOMODE_INMEM) - public :: SUN_DATAIOMODE_INMEM + integer, parameter, public :: SUNDataIOMode_ = kind(SUNDATAIOMODE_INMEM) + public :: SUNDATAIOMODE_INMEM ! enum SUNErrCode_ enum, bind(c) enumerator :: SUN_ERR_MINIMUM = -10000 @@ -132,7 +132,7 @@ module fsundials_core_mod public :: FSUNProfiler_GetElapsedTime public :: FSUNProfiler_Print public :: FSUNProfiler_Reset - ! typedef enum SUNLogLevel + ! enum SUNLogLevel_ enum, bind(c) enumerator :: SUN_LOGLEVEL_ALL = -1 enumerator :: SUN_LOGLEVEL_NONE = 0 @@ -141,7 +141,7 @@ module fsundials_core_mod enumerator :: SUN_LOGLEVEL_INFO = 3 enumerator :: SUN_LOGLEVEL_DEBUG = 4 end enum - integer, parameter, public :: SUNLogLevel = kind(SUN_LOGLEVEL_ALL) + integer, parameter, public :: SUNLogLevel_ = kind(SUN_LOGLEVEL_ALL) public :: SUN_LOGLEVEL_ALL, SUN_LOGLEVEL_NONE, SUN_LOGLEVEL_ERROR, SUN_LOGLEVEL_WARNING, SUN_LOGLEVEL_INFO, & SUN_LOGLEVEL_DEBUG public :: FSUNLogger_Create @@ -313,7 +313,7 @@ module fsundials_core_mod public :: FN_VGetArrayPointer public :: FN_VGetDeviceArrayPointer - ! typedef enum SUNMatrix_ID + ! enum SUNMatrix_ID_ enum, bind(c) enumerator :: SUNMATRIX_DENSE enumerator :: SUNMATRIX_MAGMADENSE @@ -326,7 +326,7 @@ module fsundials_core_mod enumerator :: SUNMATRIX_KOKKOSDENSE enumerator :: SUNMATRIX_CUSTOM end enum - integer, parameter, public :: SUNMatrix_ID = kind(SUNMATRIX_DENSE) + integer, parameter, public :: SUNMatrix_ID_ = kind(SUNMATRIX_DENSE) public :: SUNMATRIX_DENSE, SUNMATRIX_MAGMADENSE, SUNMATRIX_ONEMKLDENSE, SUNMATRIX_BAND, SUNMATRIX_SPARSE, SUNMATRIX_SLUNRLOC, & SUNMATRIX_CUSPARSE, SUNMATRIX_GINKGO, SUNMATRIX_KOKKOSDENSE, SUNMATRIX_CUSTOM ! struct struct _generic_SUNMatrix_Ops @@ -389,17 +389,17 @@ module fsundials_core_mod public :: FSUNQRAdd_CGS2 public :: FSUNQRAdd_DCGS2 public :: FSUNQRAdd_DCGS2_SB - ! typedef enum SUNLinearSolver_Type + ! enum SUNLinearSolver_Type_ enum, bind(c) enumerator :: SUNLINEARSOLVER_DIRECT enumerator :: SUNLINEARSOLVER_ITERATIVE enumerator :: SUNLINEARSOLVER_MATRIX_ITERATIVE enumerator :: SUNLINEARSOLVER_MATRIX_EMBEDDED end enum - integer, parameter, public :: SUNLinearSolver_Type = kind(SUNLINEARSOLVER_DIRECT) + integer, parameter, public :: SUNLinearSolver_Type_ = kind(SUNLINEARSOLVER_DIRECT) public :: SUNLINEARSOLVER_DIRECT, SUNLINEARSOLVER_ITERATIVE, SUNLINEARSOLVER_MATRIX_ITERATIVE, & SUNLINEARSOLVER_MATRIX_EMBEDDED - ! typedef enum SUNLinearSolver_ID + ! enum SUNLinearSolver_ID_ enum, bind(c) enumerator :: SUNLINEARSOLVER_BAND enumerator :: SUNLINEARSOLVER_DENSE @@ -420,7 +420,7 @@ module fsundials_core_mod enumerator :: SUNLINEARSOLVER_KOKKOSDENSE enumerator :: SUNLINEARSOLVER_CUSTOM end enum - integer, parameter, public :: SUNLinearSolver_ID = kind(SUNLINEARSOLVER_BAND) + integer, parameter, public :: SUNLinearSolver_ID_ = kind(SUNLINEARSOLVER_BAND) public :: SUNLINEARSOLVER_BAND, SUNLINEARSOLVER_DENSE, SUNLINEARSOLVER_KLU, SUNLINEARSOLVER_LAPACKBAND, & SUNLINEARSOLVER_LAPACKDENSE, SUNLINEARSOLVER_PCG, SUNLINEARSOLVER_SPBCGS, SUNLINEARSOLVER_SPFGMR, SUNLINEARSOLVER_SPGMR, & SUNLINEARSOLVER_SPTFQMR, SUNLINEARSOLVER_SUPERLUDIST, SUNLINEARSOLVER_SUPERLUMT, SUNLINEARSOLVER_CUSOLVERSP_BATCHQR, & @@ -484,12 +484,12 @@ module fsundials_core_mod integer(C_INT), parameter, public :: SUNLS_PACKAGE_FAIL_REC = 806_C_INT integer(C_INT), parameter, public :: SUNLS_QRFACT_FAIL = 807_C_INT integer(C_INT), parameter, public :: SUNLS_LUFACT_FAIL = 808_C_INT - ! typedef enum SUNNonlinearSolver_Type + ! enum SUNNonlinearSolver_Type_ enum, bind(c) enumerator :: SUNNONLINEARSOLVER_ROOTFIND enumerator :: SUNNONLINEARSOLVER_FIXEDPOINT end enum - integer, parameter, public :: SUNNonlinearSolver_Type = kind(SUNNONLINEARSOLVER_ROOTFIND) + integer, parameter, public :: SUNNonlinearSolver_Type_ = kind(SUNNONLINEARSOLVER_ROOTFIND) public :: SUNNONLINEARSOLVER_ROOTFIND, SUNNONLINEARSOLVER_FIXEDPOINT ! struct struct _generic_SUNNonlinearSolver_Ops type, bind(C), public :: SUNNonlinearSolver_Ops @@ -531,13 +531,13 @@ module fsundials_core_mod public :: FSUNNonlinSolGetNumConvFails integer(C_INT), parameter, public :: SUN_NLS_CONTINUE = +901_C_INT integer(C_INT), parameter, public :: SUN_NLS_CONV_RECVR = +902_C_INT - ! typedef enum SUNAdaptController_Type + ! enum SUNAdaptController_Type_ enum, bind(c) enumerator :: SUN_ADAPTCONTROLLER_NONE enumerator :: SUN_ADAPTCONTROLLER_H enumerator :: SUN_ADAPTCONTROLLER_MRI_H_TOL end enum - integer, parameter, public :: SUNAdaptController_Type = kind(SUN_ADAPTCONTROLLER_NONE) + integer, parameter, public :: SUNAdaptController_Type_ = kind(SUN_ADAPTCONTROLLER_NONE) public :: SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H, SUN_ADAPTCONTROLLER_MRI_H_TOL ! struct struct _generic_SUNAdaptController_Ops type, bind(C), public :: SUNAdaptController_Ops @@ -573,13 +573,13 @@ module fsundials_core_mod public :: FSUNAdaptController_UpdateH public :: FSUNAdaptController_UpdateMRIHTol public :: FSUNAdaptController_Space - ! typedef enum SUNFullRhsMode + ! enum SUNFullRhsMode_ enum, bind(c) enumerator :: SUN_FULLRHS_START enumerator :: SUN_FULLRHS_END enumerator :: SUN_FULLRHS_OTHER end enum - integer, parameter, public :: SUNFullRhsMode = kind(SUN_FULLRHS_START) + integer, parameter, public :: SUNFullRhsMode_ = kind(SUN_FULLRHS_START) public :: SUN_FULLRHS_START, SUN_FULLRHS_END, SUN_FULLRHS_OTHER public :: FSUNStepper_Create public :: FSUNStepper_Destroy @@ -610,13 +610,13 @@ module fsundials_core_mod public :: FSUNStepper_SetDestroyFn ! enum SUNMemoryType_ enum, bind(c) - enumerator :: SUN_MEMTYPE_HOST - enumerator :: SUN_MEMTYPE_PINNED - enumerator :: SUN_MEMTYPE_DEVICE - enumerator :: SUN_MEMTYPE_UVM + enumerator :: SUNMEMTYPE_HOST + enumerator :: SUNMEMTYPE_PINNED + enumerator :: SUNMEMTYPE_DEVICE + enumerator :: SUNMEMTYPE_UVM end enum - integer, parameter, public :: SUNMemoryType_ = kind(SUN_MEMTYPE_HOST) - public :: SUN_MEMTYPE_HOST, SUN_MEMTYPE_PINNED, SUN_MEMTYPE_DEVICE, SUN_MEMTYPE_UVM + integer, parameter, public :: SUNMemoryType_ = kind(SUNMEMTYPE_HOST) + public :: SUNMEMTYPE_HOST, SUNMEMTYPE_PINNED, SUNMEMTYPE_DEVICE, SUNMEMTYPE_UVM public :: FSUNMemoryNewEmpty ! struct struct SUNMemoryHelper_ type, bind(C), public :: SUNMemoryHelper_ @@ -3538,7 +3538,7 @@ function FSUNLogger_QueueMsg(logger, lvl, scope, label, msg_txt) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: logger -integer(SUNLogLevel), intent(in) :: lvl +integer(SUNLogLevel_), intent(in) :: lvl character(kind=C_CHAR, len=*), target :: scope character(kind=C_CHAR), dimension(:), allocatable, target :: farg3_chars character(kind=C_CHAR, len=*), target :: label @@ -3566,7 +3566,7 @@ function FSUNLogger_Flush(logger, lvl) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: logger -integer(SUNLogLevel), intent(in) :: lvl +integer(SUNLogLevel_), intent(in) :: lvl integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -4710,7 +4710,7 @@ function FSUNMatCopyOps(a, b) & function FSUNMatGetID(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID) :: swig_result +integer(SUNMatrix_ID_) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5169,7 +5169,7 @@ subroutine FSUNLinSolFreeEmpty(s) function FSUNLinSolGetType(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5182,7 +5182,7 @@ function FSUNLinSolGetType(s) & function FSUNLinSolGetID(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5431,7 +5431,7 @@ subroutine FSUNNonlinSolFreeEmpty(nls) function FSUNNonlinSolGetType(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type) :: swig_result +integer(SUNNonlinearSolver_Type_) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5673,7 +5673,7 @@ subroutine FSUNAdaptController_DestroyEmpty(c) function FSUNAdaptController_GetType(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type) :: swig_result +integer(SUNAdaptController_Type_) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5957,7 +5957,7 @@ function FSUNStepper_FullRhs(stepper, t, v, f, mode) & real(C_DOUBLE), intent(in) :: t type(N_Vector), target, intent(inout) :: v type(N_Vector), target, intent(inout) :: f -integer(SUNFullRhsMode), intent(in) :: mode +integer(SUNFullRhsMode_), intent(in) :: mode integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 diff --git a/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 b/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 index d27e9ef3c0..73fc7a1fcf 100644 --- a/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 +++ b/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_Band(y, a, sunctx) & function FSUNLinSolGetType_Band(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_Band(s) & function FSUNLinSolGetID_Band(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 b/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 index 345582d0d0..b7cbb2fbe9 100644 --- a/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 +++ b/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_Band(y, a, sunctx) & function FSUNLinSolGetType_Band(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_Band(s) & function FSUNLinSolGetID_Band(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 b/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 index 42d7986728..678c44ef41 100644 --- a/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 +++ b/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_Dense(y, a, sunctx) & function FSUNLinSolGetType_Dense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_Dense(s) & function FSUNLinSolGetID_Dense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 b/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 index 67087091d9..fe8a5e5778 100644 --- a/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 +++ b/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_Dense(y, a, sunctx) & function FSUNLinSolGetType_Dense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_Dense(s) & function FSUNLinSolGetID_Dense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 b/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 index bbd312f674..8b33d36d43 100644 --- a/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 +++ b/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 @@ -294,7 +294,7 @@ function FSUNLinSol_KLUGetCommon(s) & function FSUNLinSolGetType_KLU(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -307,7 +307,7 @@ function FSUNLinSolGetType_KLU(s) & function FSUNLinSolGetID_KLU(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 b/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 index f836c8b140..2e6576aa9b 100644 --- a/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 +++ b/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 @@ -294,7 +294,7 @@ function FSUNLinSol_KLUGetCommon(s) & function FSUNLinSolGetType_KLU(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -307,7 +307,7 @@ function FSUNLinSolGetType_KLU(s) & function FSUNLinSolGetID_KLU(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 b/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 index f6fd08508f..1bf3494f47 100644 --- a/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 +++ b/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_LapackDense(y, a, sunctx) & function FSUNLinSolGetType_LapackDense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_LapackDense(s) & function FSUNLinSolGetID_LapackDense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 b/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 index 62a245f53b..bc771fd52a 100644 --- a/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 +++ b/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_LapackDense(y, a, sunctx) & function FSUNLinSolGetType_LapackDense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_LapackDense(s) & function FSUNLinSolGetID_LapackDense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 b/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 index 5a38ae2960..63639ba691 100644 --- a/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 +++ b/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_PCGSetMaxl(s, maxl) & function FSUNLinSolGetType_PCG(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_PCG(s) & function FSUNLinSolGetID_PCG(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 b/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 index b6f5851f0e..a25c9ad71f 100644 --- a/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 +++ b/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_PCGSetMaxl(s, maxl) & function FSUNLinSolGetType_PCG(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_PCG(s) & function FSUNLinSolGetID_PCG(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 b/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 index b83fe50880..2fd3a46175 100644 --- a/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 +++ b/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_SPBCGSSetMaxl(s, maxl) & function FSUNLinSolGetType_SPBCGS(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_SPBCGS(s) & function FSUNLinSolGetID_SPBCGS(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 b/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 index 3530bf5bf3..18052b752f 100644 --- a/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 +++ b/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_SPBCGSSetMaxl(s, maxl) & function FSUNLinSolGetType_SPBCGS(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_SPBCGS(s) & function FSUNLinSolGetID_SPBCGS(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 b/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 index 6a8f7896e8..e481625b61 100644 --- a/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 +++ b/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 @@ -300,7 +300,7 @@ function FSUNLinSol_SPFGMRSetMaxRestarts(s, maxrs) & function FSUNLinSolGetType_SPFGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -313,7 +313,7 @@ function FSUNLinSolGetType_SPFGMR(s) & function FSUNLinSolGetID_SPFGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 b/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 index 88ae7451b5..e82e1f5b18 100644 --- a/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 +++ b/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 @@ -300,7 +300,7 @@ function FSUNLinSol_SPFGMRSetMaxRestarts(s, maxrs) & function FSUNLinSolGetType_SPFGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -313,7 +313,7 @@ function FSUNLinSolGetType_SPFGMR(s) & function FSUNLinSolGetID_SPFGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 b/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 index b71379bbb2..bc4d3c3a66 100644 --- a/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 +++ b/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 @@ -300,7 +300,7 @@ function FSUNLinSol_SPGMRSetMaxRestarts(s, maxrs) & function FSUNLinSolGetType_SPGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -313,7 +313,7 @@ function FSUNLinSolGetType_SPGMR(s) & function FSUNLinSolGetID_SPGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 b/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 index 950e7ee8a7..d33933dc0d 100644 --- a/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 +++ b/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 @@ -300,7 +300,7 @@ function FSUNLinSol_SPGMRSetMaxRestarts(s, maxrs) & function FSUNLinSolGetType_SPGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -313,7 +313,7 @@ function FSUNLinSolGetType_SPGMR(s) & function FSUNLinSolGetID_SPGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 b/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 index e34a320d20..29015feadc 100644 --- a/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 +++ b/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_SPTFQMRSetMaxl(s, maxl) & function FSUNLinSolGetType_SPTFQMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_SPTFQMR(s) & function FSUNLinSolGetID_SPTFQMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 b/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 index ffc1fc0626..f229f9d91b 100644 --- a/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 +++ b/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_SPTFQMRSetMaxl(s, maxl) & function FSUNLinSolGetType_SPTFQMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type) :: swig_result +integer(SUNLinearSolver_Type_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_SPTFQMR(s) & function FSUNLinSolGetID_SPTFQMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID) :: swig_result +integer(SUNLinearSolver_ID_) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 index 9a3ee3db0d..30d83eddab 100644 --- a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 +++ b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 @@ -428,7 +428,7 @@ function FSUNBandMatrix_Cols(a) & function FSUNMatGetID_Band(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID) :: swig_result +integer(SUNMatrix_ID_) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 index 06422b3fe3..dfb72cd1f6 100644 --- a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 +++ b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 @@ -428,7 +428,7 @@ function FSUNBandMatrix_Cols(a) & function FSUNMatGetID_Band(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID) :: swig_result +integer(SUNMatrix_ID_) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 index 946d3585d3..1ca347aa21 100644 --- a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 +++ b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 @@ -298,7 +298,7 @@ function FSUNDenseMatrix_Cols(a) & function FSUNMatGetID_Dense(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID) :: swig_result +integer(SUNMatrix_ID_) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 index 6a107049ec..f59ae5b9d0 100644 --- a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 +++ b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 @@ -298,7 +298,7 @@ function FSUNDenseMatrix_Cols(a) & function FSUNMatGetID_Dense(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID) :: swig_result +integer(SUNMatrix_ID_) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 b/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 index cdac2cc9ca..f193290713 100644 --- a/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 +++ b/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 @@ -494,7 +494,7 @@ function FSUNSparseMatrix_SparseType(a) & function FSUNMatGetID_Sparse(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID) :: swig_result +integer(SUNMatrix_ID_) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 b/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 index 5b3ad4f4bf..27b442b453 100644 --- a/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 +++ b/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 @@ -494,7 +494,7 @@ function FSUNSparseMatrix_SparseType(a) & function FSUNMatGetID_Sparse(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID) :: swig_result +integer(SUNMatrix_ID_) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 b/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 index 2e996b26f9..fcfb22c64b 100644 --- a/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 +++ b/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 @@ -223,7 +223,7 @@ function FSUNNonlinSol_FixedPointSens(count, y, m, sunctx) & function FSUNNonlinSolGetType_FixedPoint(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type) :: swig_result +integer(SUNNonlinearSolver_Type_) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 b/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 index 2e996b26f9..fcfb22c64b 100644 --- a/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 +++ b/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 @@ -223,7 +223,7 @@ function FSUNNonlinSol_FixedPointSens(count, y, m, sunctx) & function FSUNNonlinSolGetType_FixedPoint(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type) :: swig_result +integer(SUNNonlinearSolver_Type_) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 b/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 index 79d2a4ae10..cef97d220f 100644 --- a/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 +++ b/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 @@ -225,7 +225,7 @@ function FSUNNonlinSol_NewtonSens(count, y, sunctx) & function FSUNNonlinSolGetType_Newton(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type) :: swig_result +integer(SUNNonlinearSolver_Type_) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 b/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 index 79d2a4ae10..cef97d220f 100644 --- a/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 +++ b/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 @@ -225,7 +225,7 @@ function FSUNNonlinSol_NewtonSens(count, y, sunctx) & function FSUNNonlinSolGetType_Newton(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type) :: swig_result +integer(SUNNonlinearSolver_Type_) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 From 67a1dccb6b5982e97a4e2cdcf4e3a5ae9f8517cf Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 13:59:46 -0700 Subject: [PATCH 18/26] missed Convert to get --- doc/shared/nvectors/NVector_Kokkos.rst | 2 +- doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst | 2 +- doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/shared/nvectors/NVector_Kokkos.rst b/doc/shared/nvectors/NVector_Kokkos.rst index b02acdf6c3..7d086fd7fc 100644 --- a/doc/shared/nvectors/NVector_Kokkos.rst +++ b/doc/shared/nvectors/NVector_Kokkos.rst @@ -64,7 +64,7 @@ To use the NVECTOR_KOKKOS module, we construct an instance of the ``Vector`` cla Instances of the ``Vector`` class are implicitly or explicitly (using the -:cpp:func:`~Vector::Convert` method) convertible to a :c:type:`N_Vector` +:cpp:func:`~Vector::get` method) convertible to a :c:type:`N_Vector` e.g., .. code-block:: cpp diff --git a/doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst b/doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst index 83bd09b9fe..59aac8acd6 100644 --- a/doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst +++ b/doc/shared/sunlinsol/SUNLinSol_KokkosDense.rst @@ -55,7 +55,7 @@ instance of a dense linear solver e.g., sundials::kokkos::DenseLinearSolver<> LS{sunctx}; Instances of the ``DenseLinearSolver`` class are implicitly or explicitly (using -the :cpp:func:`~DenseLinearSolver::Convert` method) convertible to a +the :cpp:func:`~DenseLinearSolver::get` method) convertible to a :c:type:`SUNLinearSolver` e.g., .. code-block:: cpp diff --git a/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst b/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst index 9c663f0232..0c9d618f4d 100644 --- a/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst @@ -69,7 +69,7 @@ the Kokkos dense matrix e.g., sunctx}; Instances of the ``DenseMatrix`` class are implicitly or explicitly (using the -:cpp:func:`~DenseMatrix::Convert` method) convertible to a :c:type:`SUNMatrix` +:cpp:func:`~DenseMatrix::get` method) convertible to a :c:type:`SUNMatrix` e.g., .. code-block:: cpp From eba70ba2f74fb7f49fd72c7a0f68f53d71a6cd19 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 14:01:19 -0700 Subject: [PATCH 19/26] merge error --- src/arkode/arkode.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/arkode/arkode.c b/src/arkode/arkode.c index d080d72ba1..1f7b7b4613 100644 --- a/src/arkode/arkode.c +++ b/src/arkode/arkode.c @@ -2059,19 +2059,6 @@ int arkInitialSetup(ARKodeMem ark_mem, sunrealtype tout) return (retval); } - /* Load initial residual weights */ - if (ark_mem->rwt_is_ewt) - { /* update pointer to ewt */ - ark_mem->rwt = ark_mem->ewt; - } - retval = ark_mem->step_init(ark_mem, tout, ark_mem->init_type); - if (retval != ARK_SUCCESS) - { - arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__, - "Error in initialization of time stepper module"); - return (retval); - } - /* Load initial residual weights */ if (ark_mem->rwt_is_ewt) { /* update pointer to ewt */ From 778359f8d8ec8d5023f4e0521faf5ede4288ca13 Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 14:05:36 -0700 Subject: [PATCH 20/26] typo --- include/arkode/arkode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index 7b1c80c6fa..a6d4bb70fc 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -209,7 +209,7 @@ typedef enum ARKRelaxSolver_ ARKRelaxSolver; * Error Accumulation Options * -------------------------- */ -enum ARKAccumError +enum ARKAccumError_ { ARK_ACCUMERROR_NONE, ARK_ACCUMERROR_MAX, From dc49482ed8a072008297cfb1b71a740e395b76bd Mon Sep 17 00:00:00 2001 From: Cody Balos Date: Mon, 22 Sep 2025 17:05:11 -0700 Subject: [PATCH 21/26] add python pointers for linearsolver and nonlinear --- include/sundials/sundials_linearsolver.h | 1 + include/sundials/sundials_nonlinearsolver.h | 1 + src/sundials/sundials_linearsolver.c | 27 +++++++++++---------- src/sundials/sundials_nonlinearsolver.c | 22 ++++++++--------- 4 files changed, 27 insertions(+), 24 deletions(-) diff --git a/include/sundials/sundials_linearsolver.h b/include/sundials/sundials_linearsolver.h index d31e4b0a1a..690b5a7d5e 100644 --- a/include/sundials/sundials_linearsolver.h +++ b/include/sundials/sundials_linearsolver.h @@ -142,6 +142,7 @@ struct _generic_SUNLinearSolver_Ops struct _generic_SUNLinearSolver { void* content; + void* python; SUNLinearSolver_Ops ops; SUNContext sunctx; }; diff --git a/include/sundials/sundials_nonlinearsolver.h b/include/sundials/sundials_nonlinearsolver.h index f95537b9b3..2108535821 100644 --- a/include/sundials/sundials_nonlinearsolver.h +++ b/include/sundials/sundials_nonlinearsolver.h @@ -125,6 +125,7 @@ struct _generic_SUNNonlinearSolver_Ops struct _generic_SUNNonlinearSolver { void* content; + void* python; SUNNonlinearSolver_Ops ops; SUNContext sunctx; }; diff --git a/src/sundials/sundials_linearsolver.c b/src/sundials/sundials_linearsolver.c index 2f5ce68694..95a7871952 100644 --- a/src/sundials/sundials_linearsolver.c +++ b/src/sundials/sundials_linearsolver.c @@ -81,6 +81,7 @@ SUNLinearSolver SUNLinSolNewEmpty(SUNContext sunctx) /* attach ops and initialize content and context to NULL */ LS->ops = ops; LS->content = NULL; + LS->python = NULL; LS->sunctx = sunctx; return (LS); @@ -94,11 +95,12 @@ void SUNLinSolFreeEmpty(SUNLinearSolver S) { if (S == NULL) { return; } - /* free non-NULL ops structure */ - if (S->ops) { free(S->ops); } + free(S->ops); S->ops = NULL; - /* free overall N_Vector object and return */ + free(S->python); + S->python = NULL; + free(S); return; } @@ -315,16 +317,15 @@ SUNErrCode SUNLinSolFree(SUNLinearSolver S) /* if we reach this point, either ops == NULL or free == NULL, try to cleanup by freeing the content, ops, and solver */ - if (S->content) - { - free(S->content); - S->content = NULL; - } - if (S->ops) - { - free(S->ops); - S->ops = NULL; - } + free(S->content); + S->content = NULL; + + free(S->ops); + S->ops = NULL; + + free(S->python); + S->python = NULL; + free(S); S = NULL; diff --git a/src/sundials/sundials_nonlinearsolver.c b/src/sundials/sundials_nonlinearsolver.c index 2f0484642c..99bd1322f7 100644 --- a/src/sundials/sundials_nonlinearsolver.c +++ b/src/sundials/sundials_nonlinearsolver.c @@ -77,6 +77,7 @@ SUNNonlinearSolver SUNNonlinSolNewEmpty(SUNContext sunctx) NLS->sunctx = sunctx; NLS->ops = ops; NLS->content = NULL; + NLS->python = NULL; return (NLS); } @@ -90,9 +91,12 @@ void SUNNonlinSolFreeEmpty(SUNNonlinearSolver NLS) if (NLS == NULL) { return; } /* free non-NULL ops structure */ - if (NLS->ops) { free(NLS->ops); } + free(NLS->ops); NLS->ops = NULL; + free(NLS->python); + NLS->python = NULL; + /* free overall N_Vector object and return */ free(NLS); return; @@ -149,16 +153,12 @@ SUNErrCode SUNNonlinSolFree(SUNNonlinearSolver NLS) /* if we reach this point, either ops == NULL or free == NULL, try to cleanup by freeing the content, ops, and solver */ - if (NLS->content) - { - free(NLS->content); - NLS->content = NULL; - } - if (NLS->ops) - { - free(NLS->ops); - NLS->ops = NULL; - } + free(NLS->content); + NLS->content = NULL; + free(NLS->ops); + NLS->ops = NULL; + free(NLS->python); + NLS->python = NULL; free(NLS); NLS = NULL; From 5d943660b26f46cf52ec3e76c0675b8e1bad12d1 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 22 Sep 2025 23:34:13 -0700 Subject: [PATCH 22/26] regen swig after typo --- src/arkode/fmod_int32/farkode_mod.f90 | 6 +++--- src/arkode/fmod_int64/farkode_mod.f90 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 index 0653360479..537f8f84b2 100644 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -110,14 +110,14 @@ module farkode_mod end enum integer, parameter, public :: ARKRelaxSolver_ = kind(ARK_RELAX_BRENT) public :: ARK_RELAX_BRENT, ARK_RELAX_NEWTON - ! enum ARKAccumError + ! enum ARKAccumError_ enum, bind(c) enumerator :: ARK_ACCUMERROR_NONE enumerator :: ARK_ACCUMERROR_MAX enumerator :: ARK_ACCUMERROR_SUM enumerator :: ARK_ACCUMERROR_AVG end enum - integer, parameter, public :: ARKAccumError = kind(ARK_ACCUMERROR_NONE) + integer, parameter, public :: ARKAccumError_ = kind(ARK_ACCUMERROR_NONE) public :: ARK_ACCUMERROR_NONE, ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, ARK_ACCUMERROR_AVG public :: FARKodeResize public :: FARKodeReset @@ -3576,7 +3576,7 @@ function FARKodeSetAccumulatedErrorType(arkode_mem, accum_type) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKAccumError), intent(in) :: accum_type +integer(ARKAccumError_), intent(in) :: accum_type integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 index adffac0b42..f73c462f82 100644 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mod.f90 @@ -110,14 +110,14 @@ module farkode_mod end enum integer, parameter, public :: ARKRelaxSolver_ = kind(ARK_RELAX_BRENT) public :: ARK_RELAX_BRENT, ARK_RELAX_NEWTON - ! enum ARKAccumError + ! enum ARKAccumError_ enum, bind(c) enumerator :: ARK_ACCUMERROR_NONE enumerator :: ARK_ACCUMERROR_MAX enumerator :: ARK_ACCUMERROR_SUM enumerator :: ARK_ACCUMERROR_AVG end enum - integer, parameter, public :: ARKAccumError = kind(ARK_ACCUMERROR_NONE) + integer, parameter, public :: ARKAccumError_ = kind(ARK_ACCUMERROR_NONE) public :: ARK_ACCUMERROR_NONE, ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, ARK_ACCUMERROR_AVG public :: FARKodeResize public :: FARKodeReset @@ -3576,7 +3576,7 @@ function FARKodeSetAccumulatedErrorType(arkode_mem, accum_type) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKAccumError), intent(in) :: accum_type +integer(ARKAccumError_), intent(in) :: accum_type integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 From abbecce699b8206b82df860ef8593e98eeafaac5 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 22 Sep 2025 23:46:43 -0700 Subject: [PATCH 23/26] remove enum trailing underscores --- include/arkode/arkode.h | 12 ++-- include/arkode/arkode_butcher_dirk.h | 6 +- include/arkode/arkode_butcher_erk.h | 6 +- include/arkode/arkode_lsrkstep.h | 6 +- include/arkode/arkode_mristep.h | 12 ++-- include/arkode/arkode_splittingstep.h | 2 + include/arkode/arkode_sprk.h | 6 +- include/sundials/sundials_adaptcontroller.h | 6 +- include/sundials/sundials_linearsolver.h | 12 ++-- include/sundials/sundials_logger.h | 6 +- include/sundials/sundials_matrix.h | 6 +- include/sundials/sundials_memory.h | 6 +- include/sundials/sundials_nonlinearsolver.h | 6 +- include/sundials/sundials_nvector.h | 2 + include/sundials/sundials_stepper.h | 6 +- include/sundials/sundials_types.h | 12 ++-- src/arkode/fmod_int32/farkode_arkstep_mod.f90 | 8 +-- src/arkode/fmod_int32/farkode_erkstep_mod.f90 | 6 +- .../fmod_int32/farkode_lsrkstep_mod.f90 | 8 +-- src/arkode/fmod_int32/farkode_mod.f90 | 36 +++++----- src/arkode/fmod_int32/farkode_mristep_mod.f90 | 18 ++--- .../fmod_int32/farkode_sprkstep_mod.f90 | 2 +- src/arkode/fmod_int64/farkode_arkstep_mod.f90 | 8 +-- src/arkode/fmod_int64/farkode_erkstep_mod.f90 | 6 +- .../fmod_int64/farkode_lsrkstep_mod.f90 | 8 +-- src/arkode/fmod_int64/farkode_mod.f90 | 36 +++++----- src/arkode/fmod_int64/farkode_mristep_mod.f90 | 18 ++--- .../fmod_int64/farkode_sprkstep_mod.f90 | 2 +- src/cvode/fmod_int32/fcvode_mod.f90 | 2 +- src/cvode/fmod_int64/fcvode_mod.f90 | 2 +- src/cvodes/fmod_int32/fcvodes_mod.f90 | 2 +- src/cvodes/fmod_int64/fcvodes_mod.f90 | 2 +- src/ida/fmod_int32/fida_mod.f90 | 2 +- src/ida/fmod_int64/fida_mod.f90 | 2 +- src/idas/fmod_int32/fidas_mod.f90 | 2 +- src/idas/fmod_int64/fidas_mod.f90 | 2 +- src/kinsol/fmod_int32/fkinsol_mod.f90 | 2 +- src/kinsol/fmod_int64/fkinsol_mod.f90 | 2 +- .../fsunadaptcontroller_imexgus_mod.f90 | 2 +- .../fsunadaptcontroller_imexgus_mod.f90 | 2 +- .../fsunadaptcontroller_mrihtol_mod.f90 | 2 +- .../fsunadaptcontroller_mrihtol_mod.f90 | 2 +- .../fsunadaptcontroller_soderlind_mod.f90 | 2 +- .../fsunadaptcontroller_soderlind_mod.f90 | 2 +- .../fsunadjointcheckpointscheme_fixed_mod.f90 | 2 +- .../fsunadjointcheckpointscheme_fixed_mod.f90 | 2 +- .../fmod_int32/fsundials_core_mod.f90 | 68 ++++++++++--------- .../fmod_int64/fsundials_core_mod.f90 | 68 ++++++++++--------- src/sundials/sundials_datanode.h | 6 +- .../band/fmod_int32/fsunlinsol_band_mod.f90 | 4 +- .../band/fmod_int64/fsunlinsol_band_mod.f90 | 4 +- .../dense/fmod_int32/fsunlinsol_dense_mod.f90 | 4 +- .../dense/fmod_int64/fsunlinsol_dense_mod.f90 | 4 +- .../klu/fmod_int32/fsunlinsol_klu_mod.f90 | 4 +- .../klu/fmod_int64/fsunlinsol_klu_mod.f90 | 4 +- .../fmod_int32/fsunlinsol_lapackdense_mod.f90 | 4 +- .../fmod_int64/fsunlinsol_lapackdense_mod.f90 | 4 +- .../pcg/fmod_int32/fsunlinsol_pcg_mod.f90 | 4 +- .../pcg/fmod_int64/fsunlinsol_pcg_mod.f90 | 4 +- .../fmod_int32/fsunlinsol_spbcgs_mod.f90 | 4 +- .../fmod_int64/fsunlinsol_spbcgs_mod.f90 | 4 +- .../fmod_int32/fsunlinsol_spfgmr_mod.f90 | 4 +- .../fmod_int64/fsunlinsol_spfgmr_mod.f90 | 4 +- .../spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 | 4 +- .../spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 | 4 +- .../fmod_int32/fsunlinsol_sptfqmr_mod.f90 | 4 +- .../fmod_int64/fsunlinsol_sptfqmr_mod.f90 | 4 +- .../band/fmod_int32/fsunmatrix_band_mod.f90 | 2 +- .../band/fmod_int64/fsunmatrix_band_mod.f90 | 2 +- .../dense/fmod_int32/fsunmatrix_dense_mod.f90 | 2 +- .../dense/fmod_int64/fsunmatrix_dense_mod.f90 | 2 +- .../fmod_int32/fsunmatrix_sparse_mod.f90 | 2 +- .../fmod_int64/fsunmatrix_sparse_mod.f90 | 2 +- .../fsunnonlinsol_fixedpoint_mod.f90 | 2 +- .../fsunnonlinsol_fixedpoint_mod.f90 | 2 +- .../fmod_int32/fsunnonlinsol_newton_mod.f90 | 2 +- .../fmod_int64/fsunnonlinsol_newton_mod.f90 | 2 +- 77 files changed, 292 insertions(+), 246 deletions(-) diff --git a/include/arkode/arkode.h b/include/arkode/arkode.h index a6d4bb70fc..e6a587f36b 100644 --- a/include/arkode/arkode.h +++ b/include/arkode/arkode.h @@ -197,19 +197,21 @@ typedef _SUNDIALS_STRUCT_ _MRIStepInnerStepper* MRIStepInnerStepper; /* -------------------------- * Relaxation Solver Options * -------------------------- */ -enum ARKRelaxSolver_ +enum ARKRelaxSolver { ARK_RELAX_BRENT, ARK_RELAX_NEWTON }; -typedef enum ARKRelaxSolver_ ARKRelaxSolver; +#ifndef SWIG +typedef enum ARKRelaxSolver ARKRelaxSolver; +#endif /* -------------------------- * Error Accumulation Options * -------------------------- */ -enum ARKAccumError_ +enum ARKAccumError { ARK_ACCUMERROR_NONE, ARK_ACCUMERROR_MAX, @@ -217,7 +219,9 @@ enum ARKAccumError_ ARK_ACCUMERROR_AVG }; -typedef enum ARKAccumError_ ARKAccumError; +#ifndef SWIG +typedef enum ARKAccumError ARKAccumError; +#endif /* -------------------------- * Shared API routines diff --git a/include/arkode/arkode_butcher_dirk.h b/include/arkode/arkode_butcher_dirk.h index 7239c516bf..efa556deb2 100644 --- a/include/arkode/arkode_butcher_dirk.h +++ b/include/arkode/arkode_butcher_dirk.h @@ -23,7 +23,7 @@ extern "C" { #endif -enum ARKODE_DIRKTableID_ +enum ARKODE_DIRKTableID { ARKODE_DIRK_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_DIRK_NUM = 100, @@ -57,7 +57,9 @@ enum ARKODE_DIRKTableID_ ARKODE_MAX_DIRK_NUM = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 }; -typedef enum ARKODE_DIRKTableID_ ARKODE_DIRKTableID; +#ifndef SWIG +typedef enum ARKODE_DIRKTableID ARKODE_DIRKTableID; +#endif /* Accessor routine to load built-in DIRK table */ SUNDIALS_EXPORT ARKodeButcherTable diff --git a/include/arkode/arkode_butcher_erk.h b/include/arkode/arkode_butcher_erk.h index 4fcda9b330..3c3198247e 100644 --- a/include/arkode/arkode_butcher_erk.h +++ b/include/arkode/arkode_butcher_erk.h @@ -23,7 +23,7 @@ extern "C" { #endif -enum ARKODE_ERKTableID_ +enum ARKODE_ERKTableID { ARKODE_ERK_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_ERK_NUM = 0, @@ -57,7 +57,9 @@ enum ARKODE_ERKTableID_ ARKODE_MAX_ERK_NUM = ARKODE_TSITOURAS_7_4_5 }; -typedef enum ARKODE_ERKTableID_ ARKODE_ERKTableID; +#ifndef SWIG +typedef enum ARKODE_ERKTableID ARKODE_ERKTableID; +#endif /* Accessor routine to load built-in ERK table */ SUNDIALS_EXPORT ARKodeButcherTable diff --git a/include/arkode/arkode_lsrkstep.h b/include/arkode/arkode_lsrkstep.h index 9994a8760d..a2cbfec539 100644 --- a/include/arkode/arkode_lsrkstep.h +++ b/include/arkode/arkode_lsrkstep.h @@ -32,7 +32,7 @@ typedef int (*ARKDomEigFn)(sunrealtype t, N_Vector y, N_Vector fn, * LSRKStep Constants * ------------------ */ -enum ARKODE_LSRKMethodType_ +enum ARKODE_LSRKMethodType { ARKODE_LSRK_RKC_2, ARKODE_LSRK_RKL_2, @@ -41,7 +41,9 @@ enum ARKODE_LSRKMethodType_ ARKODE_LSRK_SSP_10_4 }; -typedef enum ARKODE_LSRKMethodType_ ARKODE_LSRKMethodType; +#ifndef SWIG +typedef enum ARKODE_LSRKMethodType ARKODE_LSRKMethodType; +#endif /* ------------------- * Exported Functions diff --git a/include/arkode/arkode_mristep.h b/include/arkode/arkode_mristep.h index 2ac5c228df..efce5e9c9f 100644 --- a/include/arkode/arkode_mristep.h +++ b/include/arkode/arkode_mristep.h @@ -35,7 +35,7 @@ extern "C" { * ----------------- */ /* MRIStep method types */ -enum MRISTEP_METHOD_TYPE_ +enum MRISTEP_METHOD_TYPE { MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, @@ -44,10 +44,12 @@ enum MRISTEP_METHOD_TYPE_ MRISTEP_SR }; -typedef enum MRISTEP_METHOD_TYPE_ MRISTEP_METHOD_TYPE; +#ifndef SWIG +typedef enum MRISTEP_METHOD_TYPE MRISTEP_METHOD_TYPE; +#endif /* MRI coupling table IDs */ -enum ARKODE_MRITableID_ +enum ARKODE_MRITableID { ARKODE_MRI_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_MRI_NUM = 200, @@ -80,7 +82,9 @@ enum ARKODE_MRITableID_ ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_SR43 }; -typedef enum ARKODE_MRITableID_ ARKODE_MRITableID; +#ifndef SWIG +typedef enum ARKODE_MRITableID ARKODE_MRITableID; +#endif /* Default MRI coupling tables for each order and type */ static const int MRISTEP_DEFAULT_EXPL_1 = ARKODE_MRI_GARK_FORWARD_EULER; diff --git a/include/arkode/arkode_splittingstep.h b/include/arkode/arkode_splittingstep.h index f133bf0ed7..afeb38d12a 100644 --- a/include/arkode/arkode_splittingstep.h +++ b/include/arkode/arkode_splittingstep.h @@ -57,7 +57,9 @@ enum ARKODE_SplittingCoefficientsID ARKODE_MAX_SPLITTING_NUM = ARKODE_SPLITTING_YOSHIDA_8_6_2 }; +#ifndef SWIG typedef enum ARKODE_SplittingCoefficientsID ARKODE_SplittingCoefficientsID; +#endif /* Coefficient memory management */ SUNDIALS_EXPORT SplittingStepCoefficients SplittingStepCoefficients_Alloc( diff --git a/include/arkode/arkode_sprk.h b/include/arkode/arkode_sprk.h index f5bdb90c30..6d80ba4008 100644 --- a/include/arkode/arkode_sprk.h +++ b/include/arkode/arkode_sprk.h @@ -24,7 +24,7 @@ extern "C" { #endif -enum ARKODE_SPRKMethodID_ +enum ARKODE_SPRKMethodID { ARKODE_SPRK_NONE = -1, /* ensure enum is signed int */ ARKODE_MIN_SPRK_NUM = 0, @@ -43,7 +43,9 @@ enum ARKODE_SPRKMethodID_ ARKODE_MAX_SPRK_NUM = ARKODE_SPRK_SOFRONIOU_10_36 }; -typedef enum ARKODE_SPRKMethodID_ ARKODE_SPRKMethodID; +#ifndef SWIG +typedef enum ARKODE_SPRKMethodID ARKODE_SPRKMethodID; +#endif struct ARKodeSPRKTableMem { diff --git a/include/sundials/sundials_adaptcontroller.h b/include/sundials/sundials_adaptcontroller.h index 8078dfa9d4..3bb6941a7d 100644 --- a/include/sundials/sundials_adaptcontroller.h +++ b/include/sundials/sundials_adaptcontroller.h @@ -37,14 +37,16 @@ extern "C" { * MRI_H_TOL - controls slow step and fast relative tolerances * ----------------------------------------------------------------- */ -enum SUNAdaptController_Type_ +enum SUNAdaptController_Type { SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H, SUN_ADAPTCONTROLLER_MRI_H_TOL }; -typedef enum SUNAdaptController_Type_ SUNAdaptController_Type; +#ifndef SWIG +typedef enum SUNAdaptController_Type SUNAdaptController_Type; +#endif /* ----------------------------------------------------------------- * Generic definition of SUNAdaptController diff --git a/include/sundials/sundials_linearsolver.h b/include/sundials/sundials_linearsolver.h index 690b5a7d5e..8d8c3301c6 100644 --- a/include/sundials/sundials_linearsolver.h +++ b/include/sundials/sundials_linearsolver.h @@ -69,7 +69,7 @@ extern "C" { * Implemented SUNLinearSolver types and IDs: * ----------------------------------------------------------------- */ -enum SUNLinearSolver_Type_ +enum SUNLinearSolver_Type { SUNLINEARSOLVER_DIRECT, SUNLINEARSOLVER_ITERATIVE, @@ -77,9 +77,11 @@ enum SUNLinearSolver_Type_ SUNLINEARSOLVER_MATRIX_EMBEDDED }; -typedef enum SUNLinearSolver_Type_ SUNLinearSolver_Type; +#ifndef SWIG +typedef enum SUNLinearSolver_Type SUNLinearSolver_Type; +#endif -enum SUNLinearSolver_ID_ +enum SUNLinearSolver_ID { SUNLINEARSOLVER_BAND, SUNLINEARSOLVER_DENSE, @@ -101,7 +103,9 @@ enum SUNLinearSolver_ID_ SUNLINEARSOLVER_CUSTOM }; -typedef enum SUNLinearSolver_ID_ SUNLinearSolver_ID; +#ifndef SWIG +typedef enum SUNLinearSolver_ID SUNLinearSolver_ID; +#endif /* ----------------------------------------------------------------- * Generic definition of SUNLinearSolver diff --git a/include/sundials/sundials_logger.h b/include/sundials/sundials_logger.h index 2297204c0d..397be0db8f 100644 --- a/include/sundials/sundials_logger.h +++ b/include/sundials/sundials_logger.h @@ -23,7 +23,7 @@ extern "C" { #endif -enum SUNLogLevel_ +enum SUNLogLevel { SUN_LOGLEVEL_ALL = -1, SUN_LOGLEVEL_NONE = 0, @@ -33,7 +33,9 @@ enum SUNLogLevel_ SUN_LOGLEVEL_DEBUG = 4 }; -typedef enum SUNLogLevel_ SUNLogLevel; +#ifndef SWIG +typedef enum SUNLogLevel SUNLogLevel; +#endif SUNDIALS_EXPORT SUNErrCode SUNLogger_Create(SUNComm comm, int output_rank, SUNLogger* logger); diff --git a/include/sundials/sundials_matrix.h b/include/sundials/sundials_matrix.h index d244d15fb0..d66d2ed6f5 100644 --- a/include/sundials/sundials_matrix.h +++ b/include/sundials/sundials_matrix.h @@ -57,7 +57,7 @@ extern "C" { * Implemented SUNMatrix types * ----------------------------------------------------------------- */ -enum SUNMatrix_ID_ +enum SUNMatrix_ID { SUNMATRIX_DENSE, SUNMATRIX_MAGMADENSE, @@ -71,7 +71,9 @@ enum SUNMatrix_ID_ SUNMATRIX_CUSTOM }; -typedef enum SUNMatrix_ID_ SUNMatrix_ID; +#ifndef SWIG +typedef enum SUNMatrix_ID SUNMatrix_ID; +#endif /* ----------------------------------------------------------------- * Generic definition of SUNMatrix diff --git a/include/sundials/sundials_memory.h b/include/sundials/sundials_memory.h index a629005698..75ccab81de 100644 --- a/include/sundials/sundials_memory.h +++ b/include/sundials/sundials_memory.h @@ -25,7 +25,7 @@ extern "C" { #endif -enum SUNMemoryType_ +enum SUNMemoryType { SUNMEMTYPE_HOST, /* pageable memory accessible on the host */ SUNMEMTYPE_PINNED, /* page-locked memory accessible on the host */ @@ -33,7 +33,9 @@ enum SUNMemoryType_ SUNMEMTYPE_UVM /* memory accessible from the host or device */ }; -typedef enum SUNMemoryType_ SUNMemoryType; +#ifndef SWIG +typedef enum SUNMemoryType SUNMemoryType; +#endif /* * SUNMemory is a simple abstraction of a pointer to some * contiguous memory, so that we can keep track of its type diff --git a/include/sundials/sundials_nonlinearsolver.h b/include/sundials/sundials_nonlinearsolver.h index 2108535821..588faa5011 100644 --- a/include/sundials/sundials_nonlinearsolver.h +++ b/include/sundials/sundials_nonlinearsolver.h @@ -86,13 +86,15 @@ typedef int (*SUNNonlinSolConvTestFn)(SUNNonlinearSolver NLS, N_Vector y, * SUNNonlinearSolver types * ---------------------------------------------------------------------------*/ -enum SUNNonlinearSolver_Type_ +enum SUNNonlinearSolver_Type { SUNNONLINEARSOLVER_ROOTFIND, SUNNONLINEARSOLVER_FIXEDPOINT }; -typedef enum SUNNonlinearSolver_Type_ SUNNonlinearSolver_Type; +#ifndef SWIG +typedef enum SUNNonlinearSolver_Type SUNNonlinearSolver_Type; +#endif /* ----------------------------------------------------------------------------- * Generic definition of SUNNonlinearSolver diff --git a/include/sundials/sundials_nvector.h b/include/sundials/sundials_nvector.h index b988bdc5ef..af82b421b6 100644 --- a/include/sundials/sundials_nvector.h +++ b/include/sundials/sundials_nvector.h @@ -81,7 +81,9 @@ enum N_Vector_ID SUNDIALS_NVEC_CUSTOM }; +#ifndef SWIG typedef enum N_Vector_ID N_Vector_ID; +#endif /* ----------------------------------------------------------------- * Generic definition of N_Vector diff --git a/include/sundials/sundials_stepper.h b/include/sundials/sundials_stepper.h index 56421df7a2..b462e4df22 100644 --- a/include/sundials/sundials_stepper.h +++ b/include/sundials/sundials_stepper.h @@ -21,14 +21,16 @@ extern "C" { #endif -enum SUNFullRhsMode_ +enum SUNFullRhsMode { SUN_FULLRHS_START, SUN_FULLRHS_END, SUN_FULLRHS_OTHER }; -typedef enum SUNFullRhsMode_ SUNFullRhsMode; +#ifndef SWIG +typedef enum SUNFullRhsMode SUNFullRhsMode; +#endif typedef int (*SUNRhsJacFn)(sunrealtype t, N_Vector y, N_Vector fy, SUNMatrix Jac, void* user_data, N_Vector tmp1, diff --git a/include/sundials/sundials_types.h b/include/sundials/sundials_types.h index d43f3343b6..c78867285f 100644 --- a/include/sundials/sundials_types.h +++ b/include/sundials/sundials_types.h @@ -220,13 +220,15 @@ typedef int* int1d; *------------------------------------------------------------------ */ -enum SUNOutputFormat_ +enum SUNOutputFormat { SUN_OUTPUTFORMAT_TABLE, SUN_OUTPUTFORMAT_CSV }; -typedef enum SUNOutputFormat_ SUNOutputFormat; +#ifndef SWIG +typedef enum SUNOutputFormat SUNOutputFormat; +#endif /* *------------------------------------------------------------------ @@ -303,11 +305,13 @@ typedef int SUNComm; *------------------------------------------------------------------ */ -enum SUNDataIOMode_ +enum SUNDataIOMode { SUNDATAIOMODE_INMEM, }; -typedef enum SUNDataIOMode_ SUNDataIOMode; +#ifndef SWIG +typedef enum SUNDataIOMode SUNDataIOMode; +#endif #endif /* _SUNDIALS_TYPES_H */ diff --git a/src/arkode/fmod_int32/farkode_arkstep_mod.f90 b/src/arkode/fmod_int32/farkode_arkstep_mod.f90 index 278cece912..85f5e4ed67 100644 --- a/src/arkode/fmod_int32/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_arkstep_mod.f90 @@ -1911,8 +1911,8 @@ function FARKStepSetTableNum(arkode_mem, itable, etable) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_DIRKTableID_), intent(in) :: itable -integer(ARKODE_ERKTableID_), intent(in) :: etable +integer(ARKODE_DIRKTableID), intent(in) :: itable +integer(ARKODE_ERKTableID), intent(in) :: etable integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -3775,7 +3775,7 @@ function FARKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -4490,7 +4490,7 @@ function FARKStepSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver_), intent(in) :: solver +integer(ARKRelaxSolver), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_erkstep_mod.f90 b/src/arkode/fmod_int32/farkode_erkstep_mod.f90 index cf8ef8bff4..a9ae263da4 100644 --- a/src/arkode/fmod_int32/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_erkstep_mod.f90 @@ -1069,7 +1069,7 @@ function FERKStepSetTableNum(arkode_mem, etable) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_ERKTableID_), intent(in) :: etable +integer(ARKODE_ERKTableID), intent(in) :: etable integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -2220,7 +2220,7 @@ function FERKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -2430,7 +2430,7 @@ function FERKStepSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver_), intent(in) :: solver +integer(ARKRelaxSolver), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 b/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 index 6a4faea649..42477f620d 100644 --- a/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_lsrkstep_mod.f90 @@ -26,7 +26,7 @@ module farkode_lsrkstep_mod private ! DECLARATION CONSTRUCTS - ! enum ARKODE_LSRKMethodType_ + ! enum ARKODE_LSRKMethodType enum, bind(c) enumerator :: ARKODE_LSRK_RKC_2 enumerator :: ARKODE_LSRK_RKL_2 @@ -34,7 +34,7 @@ module farkode_lsrkstep_mod enumerator :: ARKODE_LSRK_SSP_S_3 enumerator :: ARKODE_LSRK_SSP_10_4 end enum - integer, parameter, public :: ARKODE_LSRKMethodType_ = kind(ARKODE_LSRK_RKC_2) + integer, parameter, public :: ARKODE_LSRKMethodType = kind(ARKODE_LSRK_RKC_2) public :: ARKODE_LSRK_RKC_2, ARKODE_LSRK_RKL_2, ARKODE_LSRK_SSP_S_2, ARKODE_LSRK_SSP_S_3, ARKODE_LSRK_SSP_10_4 public :: FLSRKStepCreateSTS public :: FLSRKStepCreateSSP @@ -351,7 +351,7 @@ function FLSRKStepSetSTSMethod(arkode_mem, method) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_LSRKMethodType_), intent(in) :: method +integer(ARKODE_LSRKMethodType), intent(in) :: method integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -367,7 +367,7 @@ function FLSRKStepSetSSPMethod(arkode_mem, method) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_LSRKMethodType_), intent(in) :: method +integer(ARKODE_LSRKMethodType), intent(in) :: method integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_mod.f90 b/src/arkode/fmod_int32/farkode_mod.f90 index 537f8f84b2..e5c63d9ca6 100644 --- a/src/arkode/fmod_int32/farkode_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mod.f90 @@ -103,21 +103,21 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_SUNADJSTEPPER_ERR = -55_C_INT integer(C_INT), parameter, public :: ARK_DEE_FAIL = -56_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT - ! enum ARKRelaxSolver_ + ! enum ARKRelaxSolver enum, bind(c) enumerator :: ARK_RELAX_BRENT enumerator :: ARK_RELAX_NEWTON end enum - integer, parameter, public :: ARKRelaxSolver_ = kind(ARK_RELAX_BRENT) + integer, parameter, public :: ARKRelaxSolver = kind(ARK_RELAX_BRENT) public :: ARK_RELAX_BRENT, ARK_RELAX_NEWTON - ! enum ARKAccumError_ + ! enum ARKAccumError enum, bind(c) enumerator :: ARK_ACCUMERROR_NONE enumerator :: ARK_ACCUMERROR_MAX enumerator :: ARK_ACCUMERROR_SUM enumerator :: ARK_ACCUMERROR_AVG end enum - integer, parameter, public :: ARKAccumError_ = kind(ARK_ACCUMERROR_NONE) + integer, parameter, public :: ARKAccumError = kind(ARK_ACCUMERROR_NONE) public :: ARK_ACCUMERROR_NONE, ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, ARK_ACCUMERROR_AVG public :: FARKodeResize public :: FARKodeReset @@ -318,7 +318,7 @@ module farkode_mod public :: FARKodeButcherTable_IsStifflyAccurate public :: FARKodeButcherTable_CheckOrder public :: FARKodeButcherTable_CheckARKOrder - ! enum ARKODE_DIRKTableID_ + ! enum ARKODE_DIRKTableID enum, bind(c) enumerator :: ARKODE_DIRK_NONE = -1 enumerator :: ARKODE_MIN_DIRK_NUM = 100 @@ -351,7 +351,7 @@ module farkode_mod enumerator :: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 enumerator :: ARKODE_MAX_DIRK_NUM = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 end enum - integer, parameter, public :: ARKODE_DIRKTableID_ = kind(ARKODE_DIRK_NONE) + integer, parameter, public :: ARKODE_DIRKTableID = kind(ARKODE_DIRK_NONE) public :: ARKODE_DIRK_NONE, ARKODE_MIN_DIRK_NUM, ARKODE_SDIRK_2_1_2, ARKODE_BILLINGTON_3_3_2, ARKODE_TRBDF2_3_3_2, & ARKODE_KVAERNO_4_2_3, ARKODE_ARK324L2SA_DIRK_4_2_3, ARKODE_CASH_5_2_4, ARKODE_CASH_5_3_4, ARKODE_SDIRK_5_3_4, & ARKODE_KVAERNO_5_3_4, ARKODE_ARK436L2SA_DIRK_6_3_4, ARKODE_KVAERNO_7_4_5, ARKODE_ARK548L2SA_DIRK_8_4_5, & @@ -362,7 +362,7 @@ module farkode_mod public :: FARKodeButcherTable_LoadDIRK public :: FARKodeButcherTable_LoadDIRKByName public :: FARKodeButcherTable_DIRKIDToName - ! enum ARKODE_ERKTableID_ + ! enum ARKODE_ERKTableID enum, bind(c) enumerator :: ARKODE_ERK_NONE = -1 enumerator :: ARKODE_MIN_ERK_NUM = 0 @@ -395,7 +395,7 @@ module farkode_mod enumerator :: ARKODE_TSITOURAS_7_4_5 enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_TSITOURAS_7_4_5 end enum - integer, parameter, public :: ARKODE_ERKTableID_ = kind(ARKODE_ERK_NONE) + integer, parameter, public :: ARKODE_ERKTableID = kind(ARKODE_ERK_NONE) public :: ARKODE_ERK_NONE, ARKODE_MIN_ERK_NUM, ARKODE_HEUN_EULER_2_1_2, ARKODE_BOGACKI_SHAMPINE_4_2_3, & ARKODE_ARK324L2SA_ERK_4_2_3, ARKODE_ZONNEVELD_5_3_4, ARKODE_ARK436L2SA_ERK_6_3_4, ARKODE_SAYFY_ABURUB_6_3_4, & ARKODE_CASH_KARP_6_4_5, ARKODE_FEHLBERG_6_4_5, ARKODE_DORMAND_PRINCE_7_4_5, ARKODE_ARK548L2SA_ERK_8_4_5, & @@ -407,7 +407,7 @@ module farkode_mod public :: FARKodeButcherTable_LoadERK public :: FARKodeButcherTable_LoadERKByName public :: FARKodeButcherTable_ERKIDToName - ! enum ARKODE_SPRKMethodID_ + ! enum ARKODE_SPRKMethodID enum, bind(c) enumerator :: ARKODE_SPRK_NONE = -1 enumerator :: ARKODE_MIN_SPRK_NUM = 0 @@ -425,7 +425,7 @@ module farkode_mod enumerator :: ARKODE_SPRK_SOFRONIOU_10_36 enumerator :: ARKODE_MAX_SPRK_NUM = ARKODE_SPRK_SOFRONIOU_10_36 end enum - integer, parameter, public :: ARKODE_SPRKMethodID_ = kind(ARKODE_SPRK_NONE) + integer, parameter, public :: ARKODE_SPRKMethodID = kind(ARKODE_SPRK_NONE) public :: ARKODE_SPRK_NONE, ARKODE_MIN_SPRK_NUM, ARKODE_SPRK_EULER_1_1, ARKODE_SPRK_LEAPFROG_2_2, & ARKODE_SPRK_PSEUDO_LEAPFROG_2_2, ARKODE_SPRK_RUTH_3_3, ARKODE_SPRK_MCLACHLAN_2_2, ARKODE_SPRK_MCLACHLAN_3_3, & ARKODE_SPRK_CANDY_ROZMUS_4_4, ARKODE_SPRK_MCLACHLAN_4_4, ARKODE_SPRK_MCLACHLAN_5_6, ARKODE_SPRK_YOSHIDA_6_8, & @@ -3576,7 +3576,7 @@ function FARKodeSetAccumulatedErrorType(arkode_mem, accum_type) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKAccumError_), intent(in) :: accum_type +integer(ARKAccumError), intent(in) :: accum_type integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -3854,7 +3854,7 @@ function FARKodePrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -4777,7 +4777,7 @@ function FARKodeSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver_), intent(in) :: solver +integer(ARKRelaxSolver), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -5474,7 +5474,7 @@ function FARKodeButcherTable_LoadDIRK(imethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_DIRKTableID_), intent(in) :: imethod +integer(ARKODE_DIRKTableID), intent(in) :: imethod type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -5501,7 +5501,7 @@ function FARKodeButcherTable_DIRKIDToName(imethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING character(kind=C_CHAR, len=:), allocatable :: swig_result -integer(ARKODE_DIRKTableID_), intent(in) :: imethod +integer(ARKODE_DIRKTableID), intent(in) :: imethod type(SwigArrayWrapper) :: fresult integer(C_INT) :: farg1 @@ -5515,7 +5515,7 @@ function FARKodeButcherTable_LoadERK(emethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_ERKTableID_), intent(in) :: emethod +integer(ARKODE_ERKTableID), intent(in) :: emethod type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -5542,7 +5542,7 @@ function FARKodeButcherTable_ERKIDToName(emethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING character(kind=C_CHAR, len=:), allocatable :: swig_result -integer(ARKODE_ERKTableID_), intent(in) :: emethod +integer(ARKODE_ERKTableID), intent(in) :: emethod type(SwigArrayWrapper) :: fresult integer(C_INT) :: farg1 @@ -5728,7 +5728,7 @@ function FARKodeSPRKTable_Load(id) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_SPRKMethodID_), intent(in) :: id +integer(ARKODE_SPRKMethodID), intent(in) :: id type(C_PTR) :: fresult integer(C_INT) :: farg1 diff --git a/src/arkode/fmod_int32/farkode_mristep_mod.f90 b/src/arkode/fmod_int32/farkode_mristep_mod.f90 index 77d95e81d5..3647be34f2 100644 --- a/src/arkode/fmod_int32/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_mristep_mod.f90 @@ -26,7 +26,7 @@ module farkode_mristep_mod private ! DECLARATION CONSTRUCTS - ! enum MRISTEP_METHOD_TYPE_ + ! enum MRISTEP_METHOD_TYPE enum, bind(c) enumerator :: MRISTEP_EXPLICIT enumerator :: MRISTEP_IMPLICIT @@ -34,9 +34,9 @@ module farkode_mristep_mod enumerator :: MRISTEP_MERK enumerator :: MRISTEP_SR end enum - integer, parameter, public :: MRISTEP_METHOD_TYPE_ = kind(MRISTEP_EXPLICIT) + integer, parameter, public :: MRISTEP_METHOD_TYPE = kind(MRISTEP_EXPLICIT) public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX, MRISTEP_MERK, MRISTEP_SR - ! enum ARKODE_MRITableID_ + ! enum ARKODE_MRITableID enum, bind(c) enumerator :: ARKODE_MRI_NONE = -1 enumerator :: ARKODE_MIN_MRI_NUM = 200 @@ -68,7 +68,7 @@ module farkode_mristep_mod enumerator :: ARKODE_IMEX_MRI_SR43 enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_SR43 end enum - integer, parameter, public :: ARKODE_MRITableID_ = kind(ARKODE_MRI_NONE) + integer, parameter, public :: ARKODE_MRITableID = kind(ARKODE_MRI_NONE) public :: ARKODE_MRI_NONE, ARKODE_MIN_MRI_NUM, ARKODE_MIS_KW3, ARKODE_MRI_GARK_ERK33a, ARKODE_MRI_GARK_ERK45a, & ARKODE_MRI_GARK_IRK21a, ARKODE_MRI_GARK_ESDIRK34a, ARKODE_MRI_GARK_ESDIRK46a, ARKODE_IMEX_MRI_GARK3a, & ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, ARKODE_MRI_GARK_FORWARD_EULER, ARKODE_MRI_GARK_RALSTON2, & @@ -1534,7 +1534,7 @@ function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & subroutine swigf_MRIStepCouplingMem_type_set(self, type) use, intrinsic :: ISO_C_BINDING class(MRIStepCouplingMem), intent(in) :: self -integer(MRISTEP_METHOD_TYPE_), intent(in) :: type +integer(MRISTEP_METHOD_TYPE), intent(in) :: type type(SwigClassWrapper) :: farg1 integer(C_INT) :: farg2 @@ -1546,7 +1546,7 @@ subroutine swigf_MRIStepCouplingMem_type_set(self, type) function swigf_MRIStepCouplingMem_type_get(self) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(MRISTEP_METHOD_TYPE_) :: swig_result +integer(MRISTEP_METHOD_TYPE) :: swig_result class(MRIStepCouplingMem), intent(in) :: self integer(C_INT) :: fresult type(SwigClassWrapper) :: farg1 @@ -1822,7 +1822,7 @@ function FMRIStepCoupling_LoadTable(method) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_MRITableID_), intent(in) :: method +integer(ARKODE_MRITableID), intent(in) :: method type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -1869,7 +1869,7 @@ function FMRIStepCoupling_Alloc(nmat, stages, type) & type(C_PTR) :: swig_result integer(C_INT), intent(in) :: nmat integer(C_INT), intent(in) :: stages -integer(MRISTEP_METHOD_TYPE_), intent(in) :: type +integer(MRISTEP_METHOD_TYPE), intent(in) :: type type(C_PTR) :: fresult integer(C_INT) :: farg1 integer(C_INT) :: farg2 @@ -3352,7 +3352,7 @@ function FMRIStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 b/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 index d42746ddb9..4c3491c224 100644 --- a/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod_int32/farkode_sprkstep_mod.f90 @@ -976,7 +976,7 @@ function FSPRKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_arkstep_mod.f90 b/src/arkode/fmod_int64/farkode_arkstep_mod.f90 index 278cece912..85f5e4ed67 100644 --- a/src/arkode/fmod_int64/farkode_arkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_arkstep_mod.f90 @@ -1911,8 +1911,8 @@ function FARKStepSetTableNum(arkode_mem, itable, etable) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_DIRKTableID_), intent(in) :: itable -integer(ARKODE_ERKTableID_), intent(in) :: etable +integer(ARKODE_DIRKTableID), intent(in) :: itable +integer(ARKODE_ERKTableID), intent(in) :: etable integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -3775,7 +3775,7 @@ function FARKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -4490,7 +4490,7 @@ function FARKStepSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver_), intent(in) :: solver +integer(ARKRelaxSolver), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_erkstep_mod.f90 b/src/arkode/fmod_int64/farkode_erkstep_mod.f90 index cf8ef8bff4..a9ae263da4 100644 --- a/src/arkode/fmod_int64/farkode_erkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_erkstep_mod.f90 @@ -1069,7 +1069,7 @@ function FERKStepSetTableNum(arkode_mem, etable) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_ERKTableID_), intent(in) :: etable +integer(ARKODE_ERKTableID), intent(in) :: etable integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -2220,7 +2220,7 @@ function FERKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -2430,7 +2430,7 @@ function FERKStepSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver_), intent(in) :: solver +integer(ARKRelaxSolver), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 b/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 index 6a4faea649..42477f620d 100644 --- a/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_lsrkstep_mod.f90 @@ -26,7 +26,7 @@ module farkode_lsrkstep_mod private ! DECLARATION CONSTRUCTS - ! enum ARKODE_LSRKMethodType_ + ! enum ARKODE_LSRKMethodType enum, bind(c) enumerator :: ARKODE_LSRK_RKC_2 enumerator :: ARKODE_LSRK_RKL_2 @@ -34,7 +34,7 @@ module farkode_lsrkstep_mod enumerator :: ARKODE_LSRK_SSP_S_3 enumerator :: ARKODE_LSRK_SSP_10_4 end enum - integer, parameter, public :: ARKODE_LSRKMethodType_ = kind(ARKODE_LSRK_RKC_2) + integer, parameter, public :: ARKODE_LSRKMethodType = kind(ARKODE_LSRK_RKC_2) public :: ARKODE_LSRK_RKC_2, ARKODE_LSRK_RKL_2, ARKODE_LSRK_SSP_S_2, ARKODE_LSRK_SSP_S_3, ARKODE_LSRK_SSP_10_4 public :: FLSRKStepCreateSTS public :: FLSRKStepCreateSSP @@ -351,7 +351,7 @@ function FLSRKStepSetSTSMethod(arkode_mem, method) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_LSRKMethodType_), intent(in) :: method +integer(ARKODE_LSRKMethodType), intent(in) :: method integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -367,7 +367,7 @@ function FLSRKStepSetSSPMethod(arkode_mem, method) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKODE_LSRKMethodType_), intent(in) :: method +integer(ARKODE_LSRKMethodType), intent(in) :: method integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_mod.f90 b/src/arkode/fmod_int64/farkode_mod.f90 index f73c462f82..97f97883ef 100644 --- a/src/arkode/fmod_int64/farkode_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mod.f90 @@ -103,21 +103,21 @@ module farkode_mod integer(C_INT), parameter, public :: ARK_SUNADJSTEPPER_ERR = -55_C_INT integer(C_INT), parameter, public :: ARK_DEE_FAIL = -56_C_INT integer(C_INT), parameter, public :: ARK_UNRECOGNIZED_ERROR = -99_C_INT - ! enum ARKRelaxSolver_ + ! enum ARKRelaxSolver enum, bind(c) enumerator :: ARK_RELAX_BRENT enumerator :: ARK_RELAX_NEWTON end enum - integer, parameter, public :: ARKRelaxSolver_ = kind(ARK_RELAX_BRENT) + integer, parameter, public :: ARKRelaxSolver = kind(ARK_RELAX_BRENT) public :: ARK_RELAX_BRENT, ARK_RELAX_NEWTON - ! enum ARKAccumError_ + ! enum ARKAccumError enum, bind(c) enumerator :: ARK_ACCUMERROR_NONE enumerator :: ARK_ACCUMERROR_MAX enumerator :: ARK_ACCUMERROR_SUM enumerator :: ARK_ACCUMERROR_AVG end enum - integer, parameter, public :: ARKAccumError_ = kind(ARK_ACCUMERROR_NONE) + integer, parameter, public :: ARKAccumError = kind(ARK_ACCUMERROR_NONE) public :: ARK_ACCUMERROR_NONE, ARK_ACCUMERROR_MAX, ARK_ACCUMERROR_SUM, ARK_ACCUMERROR_AVG public :: FARKodeResize public :: FARKodeReset @@ -318,7 +318,7 @@ module farkode_mod public :: FARKodeButcherTable_IsStifflyAccurate public :: FARKodeButcherTable_CheckOrder public :: FARKodeButcherTable_CheckARKOrder - ! enum ARKODE_DIRKTableID_ + ! enum ARKODE_DIRKTableID enum, bind(c) enumerator :: ARKODE_DIRK_NONE = -1 enumerator :: ARKODE_MIN_DIRK_NUM = 100 @@ -351,7 +351,7 @@ module farkode_mod enumerator :: ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 enumerator :: ARKODE_MAX_DIRK_NUM = ARKODE_IMPLICIT_TRAPEZOIDAL_2_2 end enum - integer, parameter, public :: ARKODE_DIRKTableID_ = kind(ARKODE_DIRK_NONE) + integer, parameter, public :: ARKODE_DIRKTableID = kind(ARKODE_DIRK_NONE) public :: ARKODE_DIRK_NONE, ARKODE_MIN_DIRK_NUM, ARKODE_SDIRK_2_1_2, ARKODE_BILLINGTON_3_3_2, ARKODE_TRBDF2_3_3_2, & ARKODE_KVAERNO_4_2_3, ARKODE_ARK324L2SA_DIRK_4_2_3, ARKODE_CASH_5_2_4, ARKODE_CASH_5_3_4, ARKODE_SDIRK_5_3_4, & ARKODE_KVAERNO_5_3_4, ARKODE_ARK436L2SA_DIRK_6_3_4, ARKODE_KVAERNO_7_4_5, ARKODE_ARK548L2SA_DIRK_8_4_5, & @@ -362,7 +362,7 @@ module farkode_mod public :: FARKodeButcherTable_LoadDIRK public :: FARKodeButcherTable_LoadDIRKByName public :: FARKodeButcherTable_DIRKIDToName - ! enum ARKODE_ERKTableID_ + ! enum ARKODE_ERKTableID enum, bind(c) enumerator :: ARKODE_ERK_NONE = -1 enumerator :: ARKODE_MIN_ERK_NUM = 0 @@ -395,7 +395,7 @@ module farkode_mod enumerator :: ARKODE_TSITOURAS_7_4_5 enumerator :: ARKODE_MAX_ERK_NUM = ARKODE_TSITOURAS_7_4_5 end enum - integer, parameter, public :: ARKODE_ERKTableID_ = kind(ARKODE_ERK_NONE) + integer, parameter, public :: ARKODE_ERKTableID = kind(ARKODE_ERK_NONE) public :: ARKODE_ERK_NONE, ARKODE_MIN_ERK_NUM, ARKODE_HEUN_EULER_2_1_2, ARKODE_BOGACKI_SHAMPINE_4_2_3, & ARKODE_ARK324L2SA_ERK_4_2_3, ARKODE_ZONNEVELD_5_3_4, ARKODE_ARK436L2SA_ERK_6_3_4, ARKODE_SAYFY_ABURUB_6_3_4, & ARKODE_CASH_KARP_6_4_5, ARKODE_FEHLBERG_6_4_5, ARKODE_DORMAND_PRINCE_7_4_5, ARKODE_ARK548L2SA_ERK_8_4_5, & @@ -407,7 +407,7 @@ module farkode_mod public :: FARKodeButcherTable_LoadERK public :: FARKodeButcherTable_LoadERKByName public :: FARKodeButcherTable_ERKIDToName - ! enum ARKODE_SPRKMethodID_ + ! enum ARKODE_SPRKMethodID enum, bind(c) enumerator :: ARKODE_SPRK_NONE = -1 enumerator :: ARKODE_MIN_SPRK_NUM = 0 @@ -425,7 +425,7 @@ module farkode_mod enumerator :: ARKODE_SPRK_SOFRONIOU_10_36 enumerator :: ARKODE_MAX_SPRK_NUM = ARKODE_SPRK_SOFRONIOU_10_36 end enum - integer, parameter, public :: ARKODE_SPRKMethodID_ = kind(ARKODE_SPRK_NONE) + integer, parameter, public :: ARKODE_SPRKMethodID = kind(ARKODE_SPRK_NONE) public :: ARKODE_SPRK_NONE, ARKODE_MIN_SPRK_NUM, ARKODE_SPRK_EULER_1_1, ARKODE_SPRK_LEAPFROG_2_2, & ARKODE_SPRK_PSEUDO_LEAPFROG_2_2, ARKODE_SPRK_RUTH_3_3, ARKODE_SPRK_MCLACHLAN_2_2, ARKODE_SPRK_MCLACHLAN_3_3, & ARKODE_SPRK_CANDY_ROZMUS_4_4, ARKODE_SPRK_MCLACHLAN_4_4, ARKODE_SPRK_MCLACHLAN_5_6, ARKODE_SPRK_YOSHIDA_6_8, & @@ -3576,7 +3576,7 @@ function FARKodeSetAccumulatedErrorType(arkode_mem, accum_type) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKAccumError_), intent(in) :: accum_type +integer(ARKAccumError), intent(in) :: accum_type integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -3854,7 +3854,7 @@ function FARKodePrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -4777,7 +4777,7 @@ function FARKodeSetRelaxSolver(arkode_mem, solver) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem -integer(ARKRelaxSolver_), intent(in) :: solver +integer(ARKRelaxSolver), intent(in) :: solver integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -5474,7 +5474,7 @@ function FARKodeButcherTable_LoadDIRK(imethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_DIRKTableID_), intent(in) :: imethod +integer(ARKODE_DIRKTableID), intent(in) :: imethod type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -5501,7 +5501,7 @@ function FARKodeButcherTable_DIRKIDToName(imethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING character(kind=C_CHAR, len=:), allocatable :: swig_result -integer(ARKODE_DIRKTableID_), intent(in) :: imethod +integer(ARKODE_DIRKTableID), intent(in) :: imethod type(SwigArrayWrapper) :: fresult integer(C_INT) :: farg1 @@ -5515,7 +5515,7 @@ function FARKodeButcherTable_LoadERK(emethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_ERKTableID_), intent(in) :: emethod +integer(ARKODE_ERKTableID), intent(in) :: emethod type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -5542,7 +5542,7 @@ function FARKodeButcherTable_ERKIDToName(emethod) & result(swig_result) use, intrinsic :: ISO_C_BINDING character(kind=C_CHAR, len=:), allocatable :: swig_result -integer(ARKODE_ERKTableID_), intent(in) :: emethod +integer(ARKODE_ERKTableID), intent(in) :: emethod type(SwigArrayWrapper) :: fresult integer(C_INT) :: farg1 @@ -5728,7 +5728,7 @@ function FARKodeSPRKTable_Load(id) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_SPRKMethodID_), intent(in) :: id +integer(ARKODE_SPRKMethodID), intent(in) :: id type(C_PTR) :: fresult integer(C_INT) :: farg1 diff --git a/src/arkode/fmod_int64/farkode_mristep_mod.f90 b/src/arkode/fmod_int64/farkode_mristep_mod.f90 index 7bb877d4ac..4593e9c361 100644 --- a/src/arkode/fmod_int64/farkode_mristep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_mristep_mod.f90 @@ -26,7 +26,7 @@ module farkode_mristep_mod private ! DECLARATION CONSTRUCTS - ! enum MRISTEP_METHOD_TYPE_ + ! enum MRISTEP_METHOD_TYPE enum, bind(c) enumerator :: MRISTEP_EXPLICIT enumerator :: MRISTEP_IMPLICIT @@ -34,9 +34,9 @@ module farkode_mristep_mod enumerator :: MRISTEP_MERK enumerator :: MRISTEP_SR end enum - integer, parameter, public :: MRISTEP_METHOD_TYPE_ = kind(MRISTEP_EXPLICIT) + integer, parameter, public :: MRISTEP_METHOD_TYPE = kind(MRISTEP_EXPLICIT) public :: MRISTEP_EXPLICIT, MRISTEP_IMPLICIT, MRISTEP_IMEX, MRISTEP_MERK, MRISTEP_SR - ! enum ARKODE_MRITableID_ + ! enum ARKODE_MRITableID enum, bind(c) enumerator :: ARKODE_MRI_NONE = -1 enumerator :: ARKODE_MIN_MRI_NUM = 200 @@ -68,7 +68,7 @@ module farkode_mristep_mod enumerator :: ARKODE_IMEX_MRI_SR43 enumerator :: ARKODE_MAX_MRI_NUM = ARKODE_IMEX_MRI_SR43 end enum - integer, parameter, public :: ARKODE_MRITableID_ = kind(ARKODE_MRI_NONE) + integer, parameter, public :: ARKODE_MRITableID = kind(ARKODE_MRI_NONE) public :: ARKODE_MRI_NONE, ARKODE_MIN_MRI_NUM, ARKODE_MIS_KW3, ARKODE_MRI_GARK_ERK33a, ARKODE_MRI_GARK_ERK45a, & ARKODE_MRI_GARK_IRK21a, ARKODE_MRI_GARK_ESDIRK34a, ARKODE_MRI_GARK_ESDIRK46a, ARKODE_IMEX_MRI_GARK3a, & ARKODE_IMEX_MRI_GARK3b, ARKODE_IMEX_MRI_GARK4, ARKODE_MRI_GARK_FORWARD_EULER, ARKODE_MRI_GARK_RALSTON2, & @@ -1534,7 +1534,7 @@ function swigc_FMRIStepGetNumRhsEvals(farg1, farg2, farg3) & subroutine swigf_MRIStepCouplingMem_type_set(self, type) use, intrinsic :: ISO_C_BINDING class(MRIStepCouplingMem), intent(in) :: self -integer(MRISTEP_METHOD_TYPE_), intent(in) :: type +integer(MRISTEP_METHOD_TYPE), intent(in) :: type type(SwigClassWrapper) :: farg1 integer(C_INT) :: farg2 @@ -1546,7 +1546,7 @@ subroutine swigf_MRIStepCouplingMem_type_set(self, type) function swigf_MRIStepCouplingMem_type_get(self) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(MRISTEP_METHOD_TYPE_) :: swig_result +integer(MRISTEP_METHOD_TYPE) :: swig_result class(MRIStepCouplingMem), intent(in) :: self integer(C_INT) :: fresult type(SwigClassWrapper) :: farg1 @@ -1822,7 +1822,7 @@ function FMRIStepCoupling_LoadTable(method) & result(swig_result) use, intrinsic :: ISO_C_BINDING type(C_PTR) :: swig_result -integer(ARKODE_MRITableID_), intent(in) :: method +integer(ARKODE_MRITableID), intent(in) :: method type(C_PTR) :: fresult integer(C_INT) :: farg1 @@ -1869,7 +1869,7 @@ function FMRIStepCoupling_Alloc(nmat, stages, type) & type(C_PTR) :: swig_result integer(C_INT), intent(in) :: nmat integer(C_INT), intent(in) :: stages -integer(MRISTEP_METHOD_TYPE_), intent(in) :: type +integer(MRISTEP_METHOD_TYPE), intent(in) :: type type(C_PTR) :: fresult integer(C_INT) :: farg1 integer(C_INT) :: farg2 @@ -3352,7 +3352,7 @@ function FMRIStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 b/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 index d42746ddb9..4c3491c224 100644 --- a/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 +++ b/src/arkode/fmod_int64/farkode_sprkstep_mod.f90 @@ -976,7 +976,7 @@ function FSPRKStepPrintAllStats(arkode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: arkode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/cvode/fmod_int32/fcvode_mod.f90 b/src/cvode/fmod_int32/fcvode_mod.f90 index 971c76af38..4666447bf0 100644 --- a/src/cvode/fmod_int32/fcvode_mod.f90 +++ b/src/cvode/fmod_int32/fcvode_mod.f90 @@ -2620,7 +2620,7 @@ function FCVodePrintAllStats(cvode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: cvode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/cvode/fmod_int64/fcvode_mod.f90 b/src/cvode/fmod_int64/fcvode_mod.f90 index 6e2f051d21..9e9b4d1f63 100644 --- a/src/cvode/fmod_int64/fcvode_mod.f90 +++ b/src/cvode/fmod_int64/fcvode_mod.f90 @@ -2620,7 +2620,7 @@ function FCVodePrintAllStats(cvode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: cvode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/cvodes/fmod_int32/fcvodes_mod.f90 b/src/cvodes/fmod_int32/fcvodes_mod.f90 index 7b561b1ac6..0ff13b5ee1 100644 --- a/src/cvodes/fmod_int32/fcvodes_mod.f90 +++ b/src/cvodes/fmod_int32/fcvodes_mod.f90 @@ -4129,7 +4129,7 @@ function FCVodePrintAllStats(cvode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: cvode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/cvodes/fmod_int64/fcvodes_mod.f90 b/src/cvodes/fmod_int64/fcvodes_mod.f90 index a944a78759..7ba5ef3286 100644 --- a/src/cvodes/fmod_int64/fcvodes_mod.f90 +++ b/src/cvodes/fmod_int64/fcvodes_mod.f90 @@ -4129,7 +4129,7 @@ function FCVodePrintAllStats(cvode_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: cvode_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/ida/fmod_int32/fida_mod.f90 b/src/ida/fmod_int32/fida_mod.f90 index ff51de2b5b..136521893f 100644 --- a/src/ida/fmod_int32/fida_mod.f90 +++ b/src/ida/fmod_int32/fida_mod.f90 @@ -2450,7 +2450,7 @@ function FIDAPrintAllStats(ida_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: ida_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/ida/fmod_int64/fida_mod.f90 b/src/ida/fmod_int64/fida_mod.f90 index 0fe6de64fb..5e3fee8ae6 100644 --- a/src/ida/fmod_int64/fida_mod.f90 +++ b/src/ida/fmod_int64/fida_mod.f90 @@ -2450,7 +2450,7 @@ function FIDAPrintAllStats(ida_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: ida_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/idas/fmod_int32/fidas_mod.f90 b/src/idas/fmod_int32/fidas_mod.f90 index 35264d529a..1184a5a7be 100644 --- a/src/idas/fmod_int32/fidas_mod.f90 +++ b/src/idas/fmod_int32/fidas_mod.f90 @@ -4014,7 +4014,7 @@ function FIDAPrintAllStats(ida_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: ida_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/idas/fmod_int64/fidas_mod.f90 b/src/idas/fmod_int64/fidas_mod.f90 index 86ed943313..7f56044910 100644 --- a/src/idas/fmod_int64/fidas_mod.f90 +++ b/src/idas/fmod_int64/fidas_mod.f90 @@ -4014,7 +4014,7 @@ function FIDAPrintAllStats(ida_mem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: ida_mem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/kinsol/fmod_int32/fkinsol_mod.f90 b/src/kinsol/fmod_int32/fkinsol_mod.f90 index a5b33f5f2a..15a5083d9b 100644 --- a/src/kinsol/fmod_int32/fkinsol_mod.f90 +++ b/src/kinsol/fmod_int32/fkinsol_mod.f90 @@ -1345,7 +1345,7 @@ function FKINPrintAllStats(kinmem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: kinmem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/kinsol/fmod_int64/fkinsol_mod.f90 b/src/kinsol/fmod_int64/fkinsol_mod.f90 index 7ec6c6ef14..e22feeb1f7 100644 --- a/src/kinsol/fmod_int64/fkinsol_mod.f90 +++ b/src/kinsol/fmod_int64/fkinsol_mod.f90 @@ -1345,7 +1345,7 @@ function FKINPrintAllStats(kinmem, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: kinmem type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 b/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 index 68afa07c37..4dc30dc6a1 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 +++ b/src/sunadaptcontroller/imexgus/fmod_int32/fsunadaptcontroller_imexgus_mod.f90 @@ -178,7 +178,7 @@ function FSUNAdaptController_SetParams_ImExGus(c, k1e, k2e, k1i, k2i) & function FSUNAdaptController_GetType_ImExGus(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type_) :: swig_result +integer(SUNAdaptController_Type) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 b/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 index 68afa07c37..4dc30dc6a1 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 +++ b/src/sunadaptcontroller/imexgus/fmod_int64/fsunadaptcontroller_imexgus_mod.f90 @@ -178,7 +178,7 @@ function FSUNAdaptController_SetParams_ImExGus(c, k1e, k2e, k1i, k2i) & function FSUNAdaptController_GetType_ImExGus(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type_) :: swig_result +integer(SUNAdaptController_Type) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 b/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 index 87dceb7232..e7afddd833 100644 --- a/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 +++ b/src/sunadaptcontroller/mrihtol/fmod_int32/fsunadaptcontroller_mrihtol_mod.f90 @@ -538,7 +538,7 @@ function FSUNAdaptController_GetFastController_MRIHTol(c, cfast) & function FSUNAdaptController_GetType_MRIHTol(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type_) :: swig_result +integer(SUNAdaptController_Type) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 b/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 index 87dceb7232..e7afddd833 100644 --- a/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 +++ b/src/sunadaptcontroller/mrihtol/fmod_int64/fsunadaptcontroller_mrihtol_mod.f90 @@ -538,7 +538,7 @@ function FSUNAdaptController_GetFastController_MRIHTol(c, cfast) & function FSUNAdaptController_GetType_MRIHTol(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type_) :: swig_result +integer(SUNAdaptController_Type) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 b/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 index 5cc82c454b..e0f391f7ef 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 +++ b/src/sunadaptcontroller/soderlind/fmod_int32/fsunadaptcontroller_soderlind_mod.f90 @@ -318,7 +318,7 @@ function FSUNAdaptController_SetParams_Soderlind(c, k1, k2, k3, k4, k5) & function FSUNAdaptController_GetType_Soderlind(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type_) :: swig_result +integer(SUNAdaptController_Type) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 b/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 index 5cc82c454b..e0f391f7ef 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 +++ b/src/sunadaptcontroller/soderlind/fmod_int64/fsunadaptcontroller_soderlind_mod.f90 @@ -318,7 +318,7 @@ function FSUNAdaptController_SetParams_Soderlind(c, k1, k2, k3, k4, k5) & function FSUNAdaptController_GetType_Soderlind(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type_) :: swig_result +integer(SUNAdaptController_Type) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunadjointcheckpointscheme/fixed/fmod_int32/fsunadjointcheckpointscheme_fixed_mod.f90 b/src/sunadjointcheckpointscheme/fixed/fmod_int32/fsunadjointcheckpointscheme_fixed_mod.f90 index eeed683776..bf5bc26ff1 100644 --- a/src/sunadjointcheckpointscheme/fixed/fmod_int32/fsunadjointcheckpointscheme_fixed_mod.f90 +++ b/src/sunadjointcheckpointscheme/fixed/fmod_int32/fsunadjointcheckpointscheme_fixed_mod.f90 @@ -111,7 +111,7 @@ function FSUNAdjointCheckpointScheme_Create_Fixed(io_mode, mem_helper, interval, result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result -integer(SUNDataIOMode_), intent(in) :: io_mode +integer(SUNDataIOMode), intent(in) :: io_mode type(SUNMemoryHelper_), target, intent(inout) :: mem_helper integer(C_LONG), intent(in) :: interval integer(C_LONG), intent(in) :: estimate diff --git a/src/sunadjointcheckpointscheme/fixed/fmod_int64/fsunadjointcheckpointscheme_fixed_mod.f90 b/src/sunadjointcheckpointscheme/fixed/fmod_int64/fsunadjointcheckpointscheme_fixed_mod.f90 index eeed683776..bf5bc26ff1 100644 --- a/src/sunadjointcheckpointscheme/fixed/fmod_int64/fsunadjointcheckpointscheme_fixed_mod.f90 +++ b/src/sunadjointcheckpointscheme/fixed/fmod_int64/fsunadjointcheckpointscheme_fixed_mod.f90 @@ -111,7 +111,7 @@ function FSUNAdjointCheckpointScheme_Create_Fixed(io_mode, mem_helper, interval, result(swig_result) use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result -integer(SUNDataIOMode_), intent(in) :: io_mode +integer(SUNDataIOMode), intent(in) :: io_mode type(SUNMemoryHelper_), target, intent(inout) :: mem_helper integer(C_LONG), intent(in) :: interval integer(C_LONG), intent(in) :: estimate diff --git a/src/sundials/fmod_int32/fsundials_core_mod.f90 b/src/sundials/fmod_int32/fsundials_core_mod.f90 index fa8db364b7..0d3e71f894 100644 --- a/src/sundials/fmod_int32/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int32/fsundials_core_mod.f90 @@ -49,18 +49,18 @@ module fsundials_core_mod integer(C_INT), parameter, public :: SUNFALSE = 0_C_INT integer(C_INT), parameter, public :: SUNTRUE = 1_C_INT - ! enum SUNOutputFormat_ + ! enum SUNOutputFormat enum, bind(c) enumerator :: SUN_OUTPUTFORMAT_TABLE enumerator :: SUN_OUTPUTFORMAT_CSV end enum - integer, parameter, public :: SUNOutputFormat_ = kind(SUN_OUTPUTFORMAT_TABLE) + integer, parameter, public :: SUNOutputFormat = kind(SUN_OUTPUTFORMAT_TABLE) public :: SUN_OUTPUTFORMAT_TABLE, SUN_OUTPUTFORMAT_CSV - ! enum SUNDataIOMode_ + ! enum SUNDataIOMode enum, bind(c) enumerator :: SUNDATAIOMODE_INMEM end enum - integer, parameter, public :: SUNDataIOMode_ = kind(SUNDATAIOMODE_INMEM) + integer, parameter, public :: SUNDataIOMode = kind(SUNDATAIOMODE_INMEM) public :: SUNDATAIOMODE_INMEM ! enum SUNErrCode_ enum, bind(c) @@ -132,7 +132,7 @@ module fsundials_core_mod public :: FSUNProfiler_GetElapsedTime public :: FSUNProfiler_Print public :: FSUNProfiler_Reset - ! enum SUNLogLevel_ + ! enum SUNLogLevel enum, bind(c) enumerator :: SUN_LOGLEVEL_ALL = -1 enumerator :: SUN_LOGLEVEL_NONE = 0 @@ -141,7 +141,7 @@ module fsundials_core_mod enumerator :: SUN_LOGLEVEL_INFO = 3 enumerator :: SUN_LOGLEVEL_DEBUG = 4 end enum - integer, parameter, public :: SUNLogLevel_ = kind(SUN_LOGLEVEL_ALL) + integer, parameter, public :: SUNLogLevel = kind(SUN_LOGLEVEL_ALL) public :: SUN_LOGLEVEL_ALL, SUN_LOGLEVEL_NONE, SUN_LOGLEVEL_ERROR, SUN_LOGLEVEL_WARNING, SUN_LOGLEVEL_INFO, & SUN_LOGLEVEL_DEBUG public :: FSUNLogger_Create @@ -313,7 +313,7 @@ module fsundials_core_mod public :: FN_VGetArrayPointer public :: FN_VGetDeviceArrayPointer - ! enum SUNMatrix_ID_ + ! enum SUNMatrix_ID enum, bind(c) enumerator :: SUNMATRIX_DENSE enumerator :: SUNMATRIX_MAGMADENSE @@ -326,7 +326,7 @@ module fsundials_core_mod enumerator :: SUNMATRIX_KOKKOSDENSE enumerator :: SUNMATRIX_CUSTOM end enum - integer, parameter, public :: SUNMatrix_ID_ = kind(SUNMATRIX_DENSE) + integer, parameter, public :: SUNMatrix_ID = kind(SUNMATRIX_DENSE) public :: SUNMATRIX_DENSE, SUNMATRIX_MAGMADENSE, SUNMATRIX_ONEMKLDENSE, SUNMATRIX_BAND, SUNMATRIX_SPARSE, SUNMATRIX_SLUNRLOC, & SUNMATRIX_CUSPARSE, SUNMATRIX_GINKGO, SUNMATRIX_KOKKOSDENSE, SUNMATRIX_CUSTOM ! struct struct _generic_SUNMatrix_Ops @@ -389,17 +389,17 @@ module fsundials_core_mod public :: FSUNQRAdd_CGS2 public :: FSUNQRAdd_DCGS2 public :: FSUNQRAdd_DCGS2_SB - ! enum SUNLinearSolver_Type_ + ! enum SUNLinearSolver_Type enum, bind(c) enumerator :: SUNLINEARSOLVER_DIRECT enumerator :: SUNLINEARSOLVER_ITERATIVE enumerator :: SUNLINEARSOLVER_MATRIX_ITERATIVE enumerator :: SUNLINEARSOLVER_MATRIX_EMBEDDED end enum - integer, parameter, public :: SUNLinearSolver_Type_ = kind(SUNLINEARSOLVER_DIRECT) + integer, parameter, public :: SUNLinearSolver_Type = kind(SUNLINEARSOLVER_DIRECT) public :: SUNLINEARSOLVER_DIRECT, SUNLINEARSOLVER_ITERATIVE, SUNLINEARSOLVER_MATRIX_ITERATIVE, & SUNLINEARSOLVER_MATRIX_EMBEDDED - ! enum SUNLinearSolver_ID_ + ! enum SUNLinearSolver_ID enum, bind(c) enumerator :: SUNLINEARSOLVER_BAND enumerator :: SUNLINEARSOLVER_DENSE @@ -420,7 +420,7 @@ module fsundials_core_mod enumerator :: SUNLINEARSOLVER_KOKKOSDENSE enumerator :: SUNLINEARSOLVER_CUSTOM end enum - integer, parameter, public :: SUNLinearSolver_ID_ = kind(SUNLINEARSOLVER_BAND) + integer, parameter, public :: SUNLinearSolver_ID = kind(SUNLINEARSOLVER_BAND) public :: SUNLINEARSOLVER_BAND, SUNLINEARSOLVER_DENSE, SUNLINEARSOLVER_KLU, SUNLINEARSOLVER_LAPACKBAND, & SUNLINEARSOLVER_LAPACKDENSE, SUNLINEARSOLVER_PCG, SUNLINEARSOLVER_SPBCGS, SUNLINEARSOLVER_SPFGMR, SUNLINEARSOLVER_SPGMR, & SUNLINEARSOLVER_SPTFQMR, SUNLINEARSOLVER_SUPERLUDIST, SUNLINEARSOLVER_SUPERLUMT, SUNLINEARSOLVER_CUSOLVERSP_BATCHQR, & @@ -448,6 +448,7 @@ module fsundials_core_mod ! struct struct _generic_SUNLinearSolver type, bind(C), public :: SUNLinearSolver type(C_PTR), public :: content + type(C_PTR), public :: python type(C_PTR), public :: ops type(C_PTR), public :: sunctx end type SUNLinearSolver @@ -484,12 +485,12 @@ module fsundials_core_mod integer(C_INT), parameter, public :: SUNLS_PACKAGE_FAIL_REC = 806_C_INT integer(C_INT), parameter, public :: SUNLS_QRFACT_FAIL = 807_C_INT integer(C_INT), parameter, public :: SUNLS_LUFACT_FAIL = 808_C_INT - ! enum SUNNonlinearSolver_Type_ + ! enum SUNNonlinearSolver_Type enum, bind(c) enumerator :: SUNNONLINEARSOLVER_ROOTFIND enumerator :: SUNNONLINEARSOLVER_FIXEDPOINT end enum - integer, parameter, public :: SUNNonlinearSolver_Type_ = kind(SUNNONLINEARSOLVER_ROOTFIND) + integer, parameter, public :: SUNNonlinearSolver_Type = kind(SUNNONLINEARSOLVER_ROOTFIND) public :: SUNNONLINEARSOLVER_ROOTFIND, SUNNONLINEARSOLVER_FIXEDPOINT ! struct struct _generic_SUNNonlinearSolver_Ops type, bind(C), public :: SUNNonlinearSolver_Ops @@ -511,6 +512,7 @@ module fsundials_core_mod ! struct struct _generic_SUNNonlinearSolver type, bind(C), public :: SUNNonlinearSolver type(C_PTR), public :: content + type(C_PTR), public :: python type(C_PTR), public :: ops type(C_PTR), public :: sunctx end type SUNNonlinearSolver @@ -531,13 +533,13 @@ module fsundials_core_mod public :: FSUNNonlinSolGetNumConvFails integer(C_INT), parameter, public :: SUN_NLS_CONTINUE = +901_C_INT integer(C_INT), parameter, public :: SUN_NLS_CONV_RECVR = +902_C_INT - ! enum SUNAdaptController_Type_ + ! enum SUNAdaptController_Type enum, bind(c) enumerator :: SUN_ADAPTCONTROLLER_NONE enumerator :: SUN_ADAPTCONTROLLER_H enumerator :: SUN_ADAPTCONTROLLER_MRI_H_TOL end enum - integer, parameter, public :: SUNAdaptController_Type_ = kind(SUN_ADAPTCONTROLLER_NONE) + integer, parameter, public :: SUNAdaptController_Type = kind(SUN_ADAPTCONTROLLER_NONE) public :: SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H, SUN_ADAPTCONTROLLER_MRI_H_TOL ! struct struct _generic_SUNAdaptController_Ops type, bind(C), public :: SUNAdaptController_Ops @@ -573,13 +575,13 @@ module fsundials_core_mod public :: FSUNAdaptController_UpdateH public :: FSUNAdaptController_UpdateMRIHTol public :: FSUNAdaptController_Space - ! enum SUNFullRhsMode_ + ! enum SUNFullRhsMode enum, bind(c) enumerator :: SUN_FULLRHS_START enumerator :: SUN_FULLRHS_END enumerator :: SUN_FULLRHS_OTHER end enum - integer, parameter, public :: SUNFullRhsMode_ = kind(SUN_FULLRHS_START) + integer, parameter, public :: SUNFullRhsMode = kind(SUN_FULLRHS_START) public :: SUN_FULLRHS_START, SUN_FULLRHS_END, SUN_FULLRHS_OTHER public :: FSUNStepper_Create public :: FSUNStepper_Destroy @@ -608,14 +610,14 @@ module fsundials_core_mod public :: FSUNStepper_SetForcingFn public :: FSUNStepper_SetGetNumStepsFn public :: FSUNStepper_SetDestroyFn - ! enum SUNMemoryType_ + ! enum SUNMemoryType enum, bind(c) enumerator :: SUNMEMTYPE_HOST enumerator :: SUNMEMTYPE_PINNED enumerator :: SUNMEMTYPE_DEVICE enumerator :: SUNMEMTYPE_UVM end enum - integer, parameter, public :: SUNMemoryType_ = kind(SUNMEMTYPE_HOST) + integer, parameter, public :: SUNMemoryType = kind(SUNMEMTYPE_HOST) public :: SUNMEMTYPE_HOST, SUNMEMTYPE_PINNED, SUNMEMTYPE_DEVICE, SUNMEMTYPE_UVM public :: FSUNMemoryNewEmpty ! struct struct SUNMemoryHelper_ @@ -3538,7 +3540,7 @@ function FSUNLogger_QueueMsg(logger, lvl, scope, label, msg_txt) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: logger -integer(SUNLogLevel_), intent(in) :: lvl +integer(SUNLogLevel), intent(in) :: lvl character(kind=C_CHAR, len=*), target :: scope character(kind=C_CHAR), dimension(:), allocatable, target :: farg3_chars character(kind=C_CHAR, len=*), target :: label @@ -3566,7 +3568,7 @@ function FSUNLogger_Flush(logger, lvl) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: logger -integer(SUNLogLevel_), intent(in) :: lvl +integer(SUNLogLevel), intent(in) :: lvl integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -4710,7 +4712,7 @@ function FSUNMatCopyOps(a, b) & function FSUNMatGetID(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID_) :: swig_result +integer(SUNMatrix_ID) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5169,7 +5171,7 @@ subroutine FSUNLinSolFreeEmpty(s) function FSUNLinSolGetType(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5182,7 +5184,7 @@ function FSUNLinSolGetType(s) & function FSUNLinSolGetID(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5431,7 +5433,7 @@ subroutine FSUNNonlinSolFreeEmpty(nls) function FSUNNonlinSolGetType(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type_) :: swig_result +integer(SUNNonlinearSolver_Type) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5673,7 +5675,7 @@ subroutine FSUNAdaptController_DestroyEmpty(c) function FSUNAdaptController_GetType(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type_) :: swig_result +integer(SUNAdaptController_Type) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5957,7 +5959,7 @@ function FSUNStepper_FullRhs(stepper, t, v, f, mode) & real(C_DOUBLE), intent(in) :: t type(N_Vector), target, intent(inout) :: v type(N_Vector), target, intent(inout) :: f -integer(SUNFullRhsMode_), intent(in) :: mode +integer(SUNFullRhsMode), intent(in) :: mode integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 @@ -6376,7 +6378,7 @@ function FSUNMemoryHelper_Wrap(arg0, ptr, mem_type) & type(C_PTR) :: swig_result type(SUNMemoryHelper_), target, intent(inout) :: arg0 type(C_PTR) :: ptr -integer(SUNMemoryType_), intent(in) :: mem_type +integer(SUNMemoryType), intent(in) :: mem_type type(C_PTR) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -6396,7 +6398,7 @@ function FSUNMemoryHelper_Alloc(arg0, memptr, mem_size, mem_type, queue) & type(SUNMemoryHelper_), target, intent(inout) :: arg0 type(C_PTR), target, intent(inout) :: memptr integer(C_SIZE_T), intent(in) :: mem_size -integer(SUNMemoryType_), intent(in) :: mem_type +integer(SUNMemoryType), intent(in) :: mem_type type(C_PTR) :: queue integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -6422,7 +6424,7 @@ function FSUNMemoryHelper_AllocStrided(arg0, memptr, mem_size, stride, mem_type, type(C_PTR), target, intent(inout) :: memptr integer(C_SIZE_T), intent(in) :: mem_size integer(C_SIZE_T), intent(in) :: stride -integer(SUNMemoryType_), intent(in) :: mem_type +integer(SUNMemoryType), intent(in) :: mem_type type(C_PTR) :: queue integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -6517,7 +6519,7 @@ function FSUNMemoryHelper_GetAllocStats(arg0, mem_type, num_allocations, num_dea use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(SUNMemoryHelper_), target, intent(inout) :: arg0 -integer(SUNMemoryType_), intent(in) :: mem_type +integer(SUNMemoryType), intent(in) :: mem_type integer(C_LONG), target, intent(inout) :: num_allocations integer(C_LONG), target, intent(inout) :: num_deallocations integer(C_SIZE_T), target, intent(inout) :: bytes_allocated @@ -7048,7 +7050,7 @@ function FSUNAdjointStepper_PrintAllStats(adj_stepper, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: adj_stepper type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/sundials/fmod_int64/fsundials_core_mod.f90 b/src/sundials/fmod_int64/fsundials_core_mod.f90 index 658e376f20..0792a7aeab 100644 --- a/src/sundials/fmod_int64/fsundials_core_mod.f90 +++ b/src/sundials/fmod_int64/fsundials_core_mod.f90 @@ -49,18 +49,18 @@ module fsundials_core_mod integer(C_INT), parameter, public :: SUNFALSE = 0_C_INT integer(C_INT), parameter, public :: SUNTRUE = 1_C_INT - ! enum SUNOutputFormat_ + ! enum SUNOutputFormat enum, bind(c) enumerator :: SUN_OUTPUTFORMAT_TABLE enumerator :: SUN_OUTPUTFORMAT_CSV end enum - integer, parameter, public :: SUNOutputFormat_ = kind(SUN_OUTPUTFORMAT_TABLE) + integer, parameter, public :: SUNOutputFormat = kind(SUN_OUTPUTFORMAT_TABLE) public :: SUN_OUTPUTFORMAT_TABLE, SUN_OUTPUTFORMAT_CSV - ! enum SUNDataIOMode_ + ! enum SUNDataIOMode enum, bind(c) enumerator :: SUNDATAIOMODE_INMEM end enum - integer, parameter, public :: SUNDataIOMode_ = kind(SUNDATAIOMODE_INMEM) + integer, parameter, public :: SUNDataIOMode = kind(SUNDATAIOMODE_INMEM) public :: SUNDATAIOMODE_INMEM ! enum SUNErrCode_ enum, bind(c) @@ -132,7 +132,7 @@ module fsundials_core_mod public :: FSUNProfiler_GetElapsedTime public :: FSUNProfiler_Print public :: FSUNProfiler_Reset - ! enum SUNLogLevel_ + ! enum SUNLogLevel enum, bind(c) enumerator :: SUN_LOGLEVEL_ALL = -1 enumerator :: SUN_LOGLEVEL_NONE = 0 @@ -141,7 +141,7 @@ module fsundials_core_mod enumerator :: SUN_LOGLEVEL_INFO = 3 enumerator :: SUN_LOGLEVEL_DEBUG = 4 end enum - integer, parameter, public :: SUNLogLevel_ = kind(SUN_LOGLEVEL_ALL) + integer, parameter, public :: SUNLogLevel = kind(SUN_LOGLEVEL_ALL) public :: SUN_LOGLEVEL_ALL, SUN_LOGLEVEL_NONE, SUN_LOGLEVEL_ERROR, SUN_LOGLEVEL_WARNING, SUN_LOGLEVEL_INFO, & SUN_LOGLEVEL_DEBUG public :: FSUNLogger_Create @@ -313,7 +313,7 @@ module fsundials_core_mod public :: FN_VGetArrayPointer public :: FN_VGetDeviceArrayPointer - ! enum SUNMatrix_ID_ + ! enum SUNMatrix_ID enum, bind(c) enumerator :: SUNMATRIX_DENSE enumerator :: SUNMATRIX_MAGMADENSE @@ -326,7 +326,7 @@ module fsundials_core_mod enumerator :: SUNMATRIX_KOKKOSDENSE enumerator :: SUNMATRIX_CUSTOM end enum - integer, parameter, public :: SUNMatrix_ID_ = kind(SUNMATRIX_DENSE) + integer, parameter, public :: SUNMatrix_ID = kind(SUNMATRIX_DENSE) public :: SUNMATRIX_DENSE, SUNMATRIX_MAGMADENSE, SUNMATRIX_ONEMKLDENSE, SUNMATRIX_BAND, SUNMATRIX_SPARSE, SUNMATRIX_SLUNRLOC, & SUNMATRIX_CUSPARSE, SUNMATRIX_GINKGO, SUNMATRIX_KOKKOSDENSE, SUNMATRIX_CUSTOM ! struct struct _generic_SUNMatrix_Ops @@ -389,17 +389,17 @@ module fsundials_core_mod public :: FSUNQRAdd_CGS2 public :: FSUNQRAdd_DCGS2 public :: FSUNQRAdd_DCGS2_SB - ! enum SUNLinearSolver_Type_ + ! enum SUNLinearSolver_Type enum, bind(c) enumerator :: SUNLINEARSOLVER_DIRECT enumerator :: SUNLINEARSOLVER_ITERATIVE enumerator :: SUNLINEARSOLVER_MATRIX_ITERATIVE enumerator :: SUNLINEARSOLVER_MATRIX_EMBEDDED end enum - integer, parameter, public :: SUNLinearSolver_Type_ = kind(SUNLINEARSOLVER_DIRECT) + integer, parameter, public :: SUNLinearSolver_Type = kind(SUNLINEARSOLVER_DIRECT) public :: SUNLINEARSOLVER_DIRECT, SUNLINEARSOLVER_ITERATIVE, SUNLINEARSOLVER_MATRIX_ITERATIVE, & SUNLINEARSOLVER_MATRIX_EMBEDDED - ! enum SUNLinearSolver_ID_ + ! enum SUNLinearSolver_ID enum, bind(c) enumerator :: SUNLINEARSOLVER_BAND enumerator :: SUNLINEARSOLVER_DENSE @@ -420,7 +420,7 @@ module fsundials_core_mod enumerator :: SUNLINEARSOLVER_KOKKOSDENSE enumerator :: SUNLINEARSOLVER_CUSTOM end enum - integer, parameter, public :: SUNLinearSolver_ID_ = kind(SUNLINEARSOLVER_BAND) + integer, parameter, public :: SUNLinearSolver_ID = kind(SUNLINEARSOLVER_BAND) public :: SUNLINEARSOLVER_BAND, SUNLINEARSOLVER_DENSE, SUNLINEARSOLVER_KLU, SUNLINEARSOLVER_LAPACKBAND, & SUNLINEARSOLVER_LAPACKDENSE, SUNLINEARSOLVER_PCG, SUNLINEARSOLVER_SPBCGS, SUNLINEARSOLVER_SPFGMR, SUNLINEARSOLVER_SPGMR, & SUNLINEARSOLVER_SPTFQMR, SUNLINEARSOLVER_SUPERLUDIST, SUNLINEARSOLVER_SUPERLUMT, SUNLINEARSOLVER_CUSOLVERSP_BATCHQR, & @@ -448,6 +448,7 @@ module fsundials_core_mod ! struct struct _generic_SUNLinearSolver type, bind(C), public :: SUNLinearSolver type(C_PTR), public :: content + type(C_PTR), public :: python type(C_PTR), public :: ops type(C_PTR), public :: sunctx end type SUNLinearSolver @@ -484,12 +485,12 @@ module fsundials_core_mod integer(C_INT), parameter, public :: SUNLS_PACKAGE_FAIL_REC = 806_C_INT integer(C_INT), parameter, public :: SUNLS_QRFACT_FAIL = 807_C_INT integer(C_INT), parameter, public :: SUNLS_LUFACT_FAIL = 808_C_INT - ! enum SUNNonlinearSolver_Type_ + ! enum SUNNonlinearSolver_Type enum, bind(c) enumerator :: SUNNONLINEARSOLVER_ROOTFIND enumerator :: SUNNONLINEARSOLVER_FIXEDPOINT end enum - integer, parameter, public :: SUNNonlinearSolver_Type_ = kind(SUNNONLINEARSOLVER_ROOTFIND) + integer, parameter, public :: SUNNonlinearSolver_Type = kind(SUNNONLINEARSOLVER_ROOTFIND) public :: SUNNONLINEARSOLVER_ROOTFIND, SUNNONLINEARSOLVER_FIXEDPOINT ! struct struct _generic_SUNNonlinearSolver_Ops type, bind(C), public :: SUNNonlinearSolver_Ops @@ -511,6 +512,7 @@ module fsundials_core_mod ! struct struct _generic_SUNNonlinearSolver type, bind(C), public :: SUNNonlinearSolver type(C_PTR), public :: content + type(C_PTR), public :: python type(C_PTR), public :: ops type(C_PTR), public :: sunctx end type SUNNonlinearSolver @@ -531,13 +533,13 @@ module fsundials_core_mod public :: FSUNNonlinSolGetNumConvFails integer(C_INT), parameter, public :: SUN_NLS_CONTINUE = +901_C_INT integer(C_INT), parameter, public :: SUN_NLS_CONV_RECVR = +902_C_INT - ! enum SUNAdaptController_Type_ + ! enum SUNAdaptController_Type enum, bind(c) enumerator :: SUN_ADAPTCONTROLLER_NONE enumerator :: SUN_ADAPTCONTROLLER_H enumerator :: SUN_ADAPTCONTROLLER_MRI_H_TOL end enum - integer, parameter, public :: SUNAdaptController_Type_ = kind(SUN_ADAPTCONTROLLER_NONE) + integer, parameter, public :: SUNAdaptController_Type = kind(SUN_ADAPTCONTROLLER_NONE) public :: SUN_ADAPTCONTROLLER_NONE, SUN_ADAPTCONTROLLER_H, SUN_ADAPTCONTROLLER_MRI_H_TOL ! struct struct _generic_SUNAdaptController_Ops type, bind(C), public :: SUNAdaptController_Ops @@ -573,13 +575,13 @@ module fsundials_core_mod public :: FSUNAdaptController_UpdateH public :: FSUNAdaptController_UpdateMRIHTol public :: FSUNAdaptController_Space - ! enum SUNFullRhsMode_ + ! enum SUNFullRhsMode enum, bind(c) enumerator :: SUN_FULLRHS_START enumerator :: SUN_FULLRHS_END enumerator :: SUN_FULLRHS_OTHER end enum - integer, parameter, public :: SUNFullRhsMode_ = kind(SUN_FULLRHS_START) + integer, parameter, public :: SUNFullRhsMode = kind(SUN_FULLRHS_START) public :: SUN_FULLRHS_START, SUN_FULLRHS_END, SUN_FULLRHS_OTHER public :: FSUNStepper_Create public :: FSUNStepper_Destroy @@ -608,14 +610,14 @@ module fsundials_core_mod public :: FSUNStepper_SetForcingFn public :: FSUNStepper_SetGetNumStepsFn public :: FSUNStepper_SetDestroyFn - ! enum SUNMemoryType_ + ! enum SUNMemoryType enum, bind(c) enumerator :: SUNMEMTYPE_HOST enumerator :: SUNMEMTYPE_PINNED enumerator :: SUNMEMTYPE_DEVICE enumerator :: SUNMEMTYPE_UVM end enum - integer, parameter, public :: SUNMemoryType_ = kind(SUNMEMTYPE_HOST) + integer, parameter, public :: SUNMemoryType = kind(SUNMEMTYPE_HOST) public :: SUNMEMTYPE_HOST, SUNMEMTYPE_PINNED, SUNMEMTYPE_DEVICE, SUNMEMTYPE_UVM public :: FSUNMemoryNewEmpty ! struct struct SUNMemoryHelper_ @@ -3538,7 +3540,7 @@ function FSUNLogger_QueueMsg(logger, lvl, scope, label, msg_txt) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: logger -integer(SUNLogLevel_), intent(in) :: lvl +integer(SUNLogLevel), intent(in) :: lvl character(kind=C_CHAR, len=*), target :: scope character(kind=C_CHAR), dimension(:), allocatable, target :: farg3_chars character(kind=C_CHAR, len=*), target :: label @@ -3566,7 +3568,7 @@ function FSUNLogger_Flush(logger, lvl) & use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(C_PTR) :: logger -integer(SUNLogLevel_), intent(in) :: lvl +integer(SUNLogLevel), intent(in) :: lvl integer(C_INT) :: fresult type(C_PTR) :: farg1 integer(C_INT) :: farg2 @@ -4710,7 +4712,7 @@ function FSUNMatCopyOps(a, b) & function FSUNMatGetID(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID_) :: swig_result +integer(SUNMatrix_ID) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5169,7 +5171,7 @@ subroutine FSUNLinSolFreeEmpty(s) function FSUNLinSolGetType(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5182,7 +5184,7 @@ function FSUNLinSolGetType(s) & function FSUNLinSolGetID(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5431,7 +5433,7 @@ subroutine FSUNNonlinSolFreeEmpty(nls) function FSUNNonlinSolGetType(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type_) :: swig_result +integer(SUNNonlinearSolver_Type) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5673,7 +5675,7 @@ subroutine FSUNAdaptController_DestroyEmpty(c) function FSUNAdaptController_GetType(c) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNAdaptController_Type_) :: swig_result +integer(SUNAdaptController_Type) :: swig_result type(SUNAdaptController), target, intent(inout) :: c integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -5957,7 +5959,7 @@ function FSUNStepper_FullRhs(stepper, t, v, f, mode) & real(C_DOUBLE), intent(in) :: t type(N_Vector), target, intent(inout) :: v type(N_Vector), target, intent(inout) :: f -integer(SUNFullRhsMode_), intent(in) :: mode +integer(SUNFullRhsMode), intent(in) :: mode integer(C_INT) :: fresult type(C_PTR) :: farg1 real(C_DOUBLE) :: farg2 @@ -6376,7 +6378,7 @@ function FSUNMemoryHelper_Wrap(arg0, ptr, mem_type) & type(C_PTR) :: swig_result type(SUNMemoryHelper_), target, intent(inout) :: arg0 type(C_PTR) :: ptr -integer(SUNMemoryType_), intent(in) :: mem_type +integer(SUNMemoryType), intent(in) :: mem_type type(C_PTR) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 @@ -6396,7 +6398,7 @@ function FSUNMemoryHelper_Alloc(arg0, memptr, mem_size, mem_type, queue) & type(SUNMemoryHelper_), target, intent(inout) :: arg0 type(C_PTR), target, intent(inout) :: memptr integer(C_SIZE_T), intent(in) :: mem_size -integer(SUNMemoryType_), intent(in) :: mem_type +integer(SUNMemoryType), intent(in) :: mem_type type(C_PTR) :: queue integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -6422,7 +6424,7 @@ function FSUNMemoryHelper_AllocStrided(arg0, memptr, mem_size, stride, mem_type, type(C_PTR), target, intent(inout) :: memptr integer(C_SIZE_T), intent(in) :: mem_size integer(C_SIZE_T), intent(in) :: stride -integer(SUNMemoryType_), intent(in) :: mem_type +integer(SUNMemoryType), intent(in) :: mem_type type(C_PTR) :: queue integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -6517,7 +6519,7 @@ function FSUNMemoryHelper_GetAllocStats(arg0, mem_type, num_allocations, num_dea use, intrinsic :: ISO_C_BINDING integer(C_INT) :: swig_result type(SUNMemoryHelper_), target, intent(inout) :: arg0 -integer(SUNMemoryType_), intent(in) :: mem_type +integer(SUNMemoryType), intent(in) :: mem_type integer(C_LONG), target, intent(inout) :: num_allocations integer(C_LONG), target, intent(inout) :: num_deallocations integer(C_SIZE_T), target, intent(inout) :: bytes_allocated @@ -7048,7 +7050,7 @@ function FSUNAdjointStepper_PrintAllStats(adj_stepper, outfile, fmt) & integer(C_INT) :: swig_result type(C_PTR) :: adj_stepper type(C_PTR) :: outfile -integer(SUNOutputFormat_), intent(in) :: fmt +integer(SUNOutputFormat), intent(in) :: fmt integer(C_INT) :: fresult type(C_PTR) :: farg1 type(C_PTR) :: farg2 diff --git a/src/sundials/sundials_datanode.h b/src/sundials/sundials_datanode.h index e7a1672b11..37cc879e0b 100644 --- a/src/sundials/sundials_datanode.h +++ b/src/sundials/sundials_datanode.h @@ -30,14 +30,16 @@ extern "C" { typedef int64_t sundataindex; -enum SUNDataNodeType_ +enum SUNDataNodeType { SUNDATANODE_LEAF, SUNDATANODE_LIST, SUNDATANODE_OBJECT }; -typedef enum SUNDataNodeType_ SUNDataNodeType; +#ifndef SWIG +typedef enum SUNDataNodeType SUNDataNodeType; +#endif typedef struct SUNDataNode_Ops_* SUNDataNode_Ops; typedef struct SUNDataNode_* SUNDataNode; diff --git a/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 b/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 index 73fc7a1fcf..d27e9ef3c0 100644 --- a/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 +++ b/src/sunlinsol/band/fmod_int32/fsunlinsol_band_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_Band(y, a, sunctx) & function FSUNLinSolGetType_Band(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_Band(s) & function FSUNLinSolGetID_Band(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 b/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 index b7cbb2fbe9..345582d0d0 100644 --- a/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 +++ b/src/sunlinsol/band/fmod_int64/fsunlinsol_band_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_Band(y, a, sunctx) & function FSUNLinSolGetType_Band(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_Band(s) & function FSUNLinSolGetID_Band(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 b/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 index 678c44ef41..42d7986728 100644 --- a/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 +++ b/src/sunlinsol/dense/fmod_int32/fsunlinsol_dense_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_Dense(y, a, sunctx) & function FSUNLinSolGetType_Dense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_Dense(s) & function FSUNLinSolGetID_Dense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 b/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 index fe8a5e5778..67087091d9 100644 --- a/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 +++ b/src/sunlinsol/dense/fmod_int64/fsunlinsol_dense_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_Dense(y, a, sunctx) & function FSUNLinSolGetType_Dense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_Dense(s) & function FSUNLinSolGetID_Dense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 b/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 index 8b33d36d43..bbd312f674 100644 --- a/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 +++ b/src/sunlinsol/klu/fmod_int32/fsunlinsol_klu_mod.f90 @@ -294,7 +294,7 @@ function FSUNLinSol_KLUGetCommon(s) & function FSUNLinSolGetType_KLU(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -307,7 +307,7 @@ function FSUNLinSolGetType_KLU(s) & function FSUNLinSolGetID_KLU(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 b/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 index 2e6576aa9b..f836c8b140 100644 --- a/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 +++ b/src/sunlinsol/klu/fmod_int64/fsunlinsol_klu_mod.f90 @@ -294,7 +294,7 @@ function FSUNLinSol_KLUGetCommon(s) & function FSUNLinSolGetType_KLU(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -307,7 +307,7 @@ function FSUNLinSolGetType_KLU(s) & function FSUNLinSolGetID_KLU(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 b/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 index 1bf3494f47..f6fd08508f 100644 --- a/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 +++ b/src/sunlinsol/lapackdense/fmod_int32/fsunlinsol_lapackdense_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_LapackDense(y, a, sunctx) & function FSUNLinSolGetType_LapackDense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_LapackDense(s) & function FSUNLinSolGetID_LapackDense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 b/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 index bc771fd52a..62a245f53b 100644 --- a/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 +++ b/src/sunlinsol/lapackdense/fmod_int64/fsunlinsol_lapackdense_mod.f90 @@ -145,7 +145,7 @@ function FSUNLinSol_LapackDense(y, a, sunctx) & function FSUNLinSolGetType_LapackDense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -158,7 +158,7 @@ function FSUNLinSolGetType_LapackDense(s) & function FSUNLinSolGetID_LapackDense(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 b/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 index 63639ba691..5a38ae2960 100644 --- a/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 +++ b/src/sunlinsol/pcg/fmod_int32/fsunlinsol_pcg_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_PCGSetMaxl(s, maxl) & function FSUNLinSolGetType_PCG(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_PCG(s) & function FSUNLinSolGetID_PCG(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 b/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 index a25c9ad71f..b6f5851f0e 100644 --- a/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 +++ b/src/sunlinsol/pcg/fmod_int64/fsunlinsol_pcg_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_PCGSetMaxl(s, maxl) & function FSUNLinSolGetType_PCG(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_PCG(s) & function FSUNLinSolGetID_PCG(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 b/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 index 2fd3a46175..b83fe50880 100644 --- a/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 +++ b/src/sunlinsol/spbcgs/fmod_int32/fsunlinsol_spbcgs_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_SPBCGSSetMaxl(s, maxl) & function FSUNLinSolGetType_SPBCGS(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_SPBCGS(s) & function FSUNLinSolGetID_SPBCGS(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 b/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 index 18052b752f..3530bf5bf3 100644 --- a/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 +++ b/src/sunlinsol/spbcgs/fmod_int64/fsunlinsol_spbcgs_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_SPBCGSSetMaxl(s, maxl) & function FSUNLinSolGetType_SPBCGS(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_SPBCGS(s) & function FSUNLinSolGetID_SPBCGS(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 b/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 index e481625b61..6a8f7896e8 100644 --- a/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 +++ b/src/sunlinsol/spfgmr/fmod_int32/fsunlinsol_spfgmr_mod.f90 @@ -300,7 +300,7 @@ function FSUNLinSol_SPFGMRSetMaxRestarts(s, maxrs) & function FSUNLinSolGetType_SPFGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -313,7 +313,7 @@ function FSUNLinSolGetType_SPFGMR(s) & function FSUNLinSolGetID_SPFGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 b/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 index e82e1f5b18..88ae7451b5 100644 --- a/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 +++ b/src/sunlinsol/spfgmr/fmod_int64/fsunlinsol_spfgmr_mod.f90 @@ -300,7 +300,7 @@ function FSUNLinSol_SPFGMRSetMaxRestarts(s, maxrs) & function FSUNLinSolGetType_SPFGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -313,7 +313,7 @@ function FSUNLinSolGetType_SPFGMR(s) & function FSUNLinSolGetID_SPFGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 b/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 index bc4d3c3a66..b71379bbb2 100644 --- a/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 +++ b/src/sunlinsol/spgmr/fmod_int32/fsunlinsol_spgmr_mod.f90 @@ -300,7 +300,7 @@ function FSUNLinSol_SPGMRSetMaxRestarts(s, maxrs) & function FSUNLinSolGetType_SPGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -313,7 +313,7 @@ function FSUNLinSolGetType_SPGMR(s) & function FSUNLinSolGetID_SPGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 b/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 index d33933dc0d..950e7ee8a7 100644 --- a/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 +++ b/src/sunlinsol/spgmr/fmod_int64/fsunlinsol_spgmr_mod.f90 @@ -300,7 +300,7 @@ function FSUNLinSol_SPGMRSetMaxRestarts(s, maxrs) & function FSUNLinSolGetType_SPGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -313,7 +313,7 @@ function FSUNLinSolGetType_SPGMR(s) & function FSUNLinSolGetID_SPGMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 b/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 index 29015feadc..e34a320d20 100644 --- a/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 +++ b/src/sunlinsol/sptfqmr/fmod_int32/fsunlinsol_sptfqmr_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_SPTFQMRSetMaxl(s, maxl) & function FSUNLinSolGetType_SPTFQMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_SPTFQMR(s) & function FSUNLinSolGetID_SPTFQMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 b/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 index f229f9d91b..ffc1fc0626 100644 --- a/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 +++ b/src/sunlinsol/sptfqmr/fmod_int64/fsunlinsol_sptfqmr_mod.f90 @@ -273,7 +273,7 @@ function FSUNLinSol_SPTFQMRSetMaxl(s, maxl) & function FSUNLinSolGetType_SPTFQMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_Type_) :: swig_result +integer(SUNLinearSolver_Type) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 @@ -286,7 +286,7 @@ function FSUNLinSolGetType_SPTFQMR(s) & function FSUNLinSolGetID_SPTFQMR(s) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNLinearSolver_ID_) :: swig_result +integer(SUNLinearSolver_ID) :: swig_result type(SUNLinearSolver), target, intent(inout) :: s integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 index 30d83eddab..9a3ee3db0d 100644 --- a/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 +++ b/src/sunmatrix/band/fmod_int32/fsunmatrix_band_mod.f90 @@ -428,7 +428,7 @@ function FSUNBandMatrix_Cols(a) & function FSUNMatGetID_Band(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID_) :: swig_result +integer(SUNMatrix_ID) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 index dfb72cd1f6..06422b3fe3 100644 --- a/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 +++ b/src/sunmatrix/band/fmod_int64/fsunmatrix_band_mod.f90 @@ -428,7 +428,7 @@ function FSUNBandMatrix_Cols(a) & function FSUNMatGetID_Band(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID_) :: swig_result +integer(SUNMatrix_ID) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 index 1ca347aa21..946d3585d3 100644 --- a/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 +++ b/src/sunmatrix/dense/fmod_int32/fsunmatrix_dense_mod.f90 @@ -298,7 +298,7 @@ function FSUNDenseMatrix_Cols(a) & function FSUNMatGetID_Dense(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID_) :: swig_result +integer(SUNMatrix_ID) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 index f59ae5b9d0..6a107049ec 100644 --- a/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 +++ b/src/sunmatrix/dense/fmod_int64/fsunmatrix_dense_mod.f90 @@ -298,7 +298,7 @@ function FSUNDenseMatrix_Cols(a) & function FSUNMatGetID_Dense(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID_) :: swig_result +integer(SUNMatrix_ID) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 b/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 index f193290713..cdac2cc9ca 100644 --- a/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 +++ b/src/sunmatrix/sparse/fmod_int32/fsunmatrix_sparse_mod.f90 @@ -494,7 +494,7 @@ function FSUNSparseMatrix_SparseType(a) & function FSUNMatGetID_Sparse(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID_) :: swig_result +integer(SUNMatrix_ID) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 b/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 index 27b442b453..5b3ad4f4bf 100644 --- a/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 +++ b/src/sunmatrix/sparse/fmod_int64/fsunmatrix_sparse_mod.f90 @@ -494,7 +494,7 @@ function FSUNSparseMatrix_SparseType(a) & function FSUNMatGetID_Sparse(a) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNMatrix_ID_) :: swig_result +integer(SUNMatrix_ID) :: swig_result type(SUNMatrix), target, intent(inout) :: a integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 b/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 index fcfb22c64b..2e996b26f9 100644 --- a/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 +++ b/src/sunnonlinsol/fixedpoint/fmod_int32/fsunnonlinsol_fixedpoint_mod.f90 @@ -223,7 +223,7 @@ function FSUNNonlinSol_FixedPointSens(count, y, m, sunctx) & function FSUNNonlinSolGetType_FixedPoint(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type_) :: swig_result +integer(SUNNonlinearSolver_Type) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 b/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 index fcfb22c64b..2e996b26f9 100644 --- a/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 +++ b/src/sunnonlinsol/fixedpoint/fmod_int64/fsunnonlinsol_fixedpoint_mod.f90 @@ -223,7 +223,7 @@ function FSUNNonlinSol_FixedPointSens(count, y, m, sunctx) & function FSUNNonlinSolGetType_FixedPoint(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type_) :: swig_result +integer(SUNNonlinearSolver_Type) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 b/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 index cef97d220f..79d2a4ae10 100644 --- a/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 +++ b/src/sunnonlinsol/newton/fmod_int32/fsunnonlinsol_newton_mod.f90 @@ -225,7 +225,7 @@ function FSUNNonlinSol_NewtonSens(count, y, sunctx) & function FSUNNonlinSolGetType_Newton(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type_) :: swig_result +integer(SUNNonlinearSolver_Type) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 diff --git a/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 b/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 index cef97d220f..79d2a4ae10 100644 --- a/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 +++ b/src/sunnonlinsol/newton/fmod_int64/fsunnonlinsol_newton_mod.f90 @@ -225,7 +225,7 @@ function FSUNNonlinSol_NewtonSens(count, y, sunctx) & function FSUNNonlinSolGetType_Newton(nls) & result(swig_result) use, intrinsic :: ISO_C_BINDING -integer(SUNNonlinearSolver_Type_) :: swig_result +integer(SUNNonlinearSolver_Type) :: swig_result type(SUNNonlinearSolver), target, intent(inout) :: nls integer(C_INT) :: fresult type(C_PTR) :: farg1 From c6b2b8b4a07f3778406ddde5cb8867d44420549b Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 23 Sep 2025 00:10:53 -0700 Subject: [PATCH 24/26] add _deprecated headers to cmake --- src/arkode/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/arkode/CMakeLists.txt b/src/arkode/CMakeLists.txt index 9b92e7a0e7..a0178d6b7e 100644 --- a/src/arkode/CMakeLists.txt +++ b/src/arkode/CMakeLists.txt @@ -56,19 +56,23 @@ set(arkode_SOURCES set(arkode_HEADERS arkode.h arkode_arkstep.h + arkode_arkstep_deprecated.h arkode_bandpre.h arkode_bbdpre.h arkode_butcher.h arkode_butcher_dirk.h arkode_butcher_erk.h arkode_erkstep.h + arkode_erkstep_deprecated.h arkode_forcingstep.h arkode_ls.h arkode_lsrkstep.h arkode_mristep.h + arkode_mristep_deprecated.h arkode_splittingstep.h arkode_sprk.h - arkode_sprkstep.h) + arkode_sprkstep.h + arkode_sprkstep_deprecated.h) # Add prefix with complete path to the ARKODE header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/arkode/ arkode_HEADERS) From 12a66eee0c4be97cf0bf5d1f9be74a52fcfeaaf0 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 23 Sep 2025 00:11:39 -0700 Subject: [PATCH 25/26] format --- include/arkode/arkode_sprk.hpp | 1 - include/sundials/sundials_adaptcontroller.h | 2 +- include/sundials/sundials_matrix.h | 2 +- src/nvector/cuda/nvector_cuda.cu | 4 +-- src/nvector/hip/nvector_hip.hip.cpp | 29 ++++++++----------- src/nvector/raja/nvector_raja.cpp | 3 +- src/nvector/sycl/nvector_sycl.cpp | 4 +-- src/sundials/sundials_datanode.h | 2 +- src/sundials/sundials_linearsolver.c | 2 +- .../magmadense/sunlinsol_magmadense.cpp | 3 +- src/sunmatrix/cusparse/sunmatrix_cusparse.cu | 4 +-- src/sunmemory/sycl/sundials_sycl_memory.cpp | 4 +-- 12 files changed, 26 insertions(+), 34 deletions(-) diff --git a/include/arkode/arkode_sprk.hpp b/include/arkode/arkode_sprk.hpp index d15041c34c..ed176b3b2f 100644 --- a/include/arkode/arkode_sprk.hpp +++ b/include/arkode/arkode_sprk.hpp @@ -45,7 +45,6 @@ ARKodeSPRKTableView ARKodeSPRKTableView::Create(Args&&... args) return ARKodeSPRKTableView(table); } - } // namespace experimental } // namespace sundials diff --git a/include/sundials/sundials_adaptcontroller.h b/include/sundials/sundials_adaptcontroller.h index 3bb6941a7d..03194877de 100644 --- a/include/sundials/sundials_adaptcontroller.h +++ b/include/sundials/sundials_adaptcontroller.h @@ -36,7 +36,7 @@ extern "C" { * H - controls a single-rate step size * MRI_H_TOL - controls slow step and fast relative tolerances * ----------------------------------------------------------------- */ - + enum SUNAdaptController_Type { SUN_ADAPTCONTROLLER_NONE, diff --git a/include/sundials/sundials_matrix.h b/include/sundials/sundials_matrix.h index d66d2ed6f5..0940a90628 100644 --- a/include/sundials/sundials_matrix.h +++ b/include/sundials/sundials_matrix.h @@ -56,7 +56,7 @@ extern "C" { /* ----------------------------------------------------------------- * Implemented SUNMatrix types * ----------------------------------------------------------------- */ - + enum SUNMatrix_ID { SUNMATRIX_DENSE, diff --git a/src/nvector/cuda/nvector_cuda.cu b/src/nvector/cuda/nvector_cuda.cu index b312a33973..14a25d66de 100644 --- a/src/nvector/cuda/nvector_cuda.cu +++ b/src/nvector/cuda/nvector_cuda.cu @@ -394,8 +394,8 @@ N_Vector N_VMakeManaged_Cuda(sunindextype length, sunrealtype* vdata, NVEC_CUDA_CONTENT(v)->length = length; NVEC_CUDA_CONTENT(v)->mem_helper = SUNMemoryHelper_Cuda(sunctx); - NVEC_CUDA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), vdata, SUNMEMTYPE_UVM); + NVEC_CUDA_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_CUDA_MEMHELP(v), + vdata, SUNMEMTYPE_UVM); NVEC_CUDA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_CUDA_MEMHELP(v), NVEC_CUDA_CONTENT(v)->host_data); NVEC_CUDA_CONTENT(v)->stream_exec_policy = DEFAULT_STREAMING_EXECPOLICY.clone(); diff --git a/src/nvector/hip/nvector_hip.hip.cpp b/src/nvector/hip/nvector_hip.hip.cpp index 5fbe7f16f3..f0cc472903 100644 --- a/src/nvector/hip/nvector_hip.hip.cpp +++ b/src/nvector/hip/nvector_hip.hip.cpp @@ -409,9 +409,8 @@ void N_VSetHostArrayPointer_Hip(sunrealtype* h_vdata, N_Vector v) } else { - NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), - (void*)h_vdata, - SUNMEMTYPE_UVM); + NVEC_HIP_CONTENT(v)->host_data = + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)h_vdata, SUNMEMTYPE_UVM); NVEC_HIP_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->host_data); @@ -448,8 +447,7 @@ void N_VSetDeviceArrayPointer_Hip(sunrealtype* d_vdata, N_Vector v) else { NVEC_HIP_CONTENT(v)->device_data = - SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, - SUNMEMTYPE_UVM); + SUNMemoryHelper_Wrap(NVEC_HIP_MEMHELP(v), (void*)d_vdata, SUNMEMTYPE_UVM); NVEC_HIP_CONTENT(v)->host_data = SUNMemoryHelper_Alias(NVEC_HIP_MEMHELP(v), NVEC_HIP_CONTENT(v)->device_data); @@ -2329,10 +2327,9 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) if (alloc_mem) { // Allocate pinned memory on the host - alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), - &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE_PINNED, - (void*)NVEC_HIP_STREAM(v)); + alloc_fail = + SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_host), + bytes, SUNMEMTYPE_PINNED, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( @@ -2340,10 +2337,9 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) "alloc SUNMEMTYPE_PINNED, using SUNMEMTYPE_HOST instead\n"); // If pinned alloc failed, allocate plain host memory - alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), - &(vcp->reduce_buffer_host), bytes, - SUNMEMTYPE_HOST, - (void*)NVEC_HIP_STREAM(v)); + alloc_fail = + SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_host), + bytes, SUNMEMTYPE_HOST, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( @@ -2353,10 +2349,9 @@ static int InitializeReductionBuffer(N_Vector v, sunrealtype value, size_t n) } // Allocate device memory - alloc_fail = SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), - &(vcp->reduce_buffer_dev), bytes, - SUNMEMTYPE_DEVICE, - (void*)NVEC_HIP_STREAM(v)); + alloc_fail = + SUNMemoryHelper_Alloc(NVEC_HIP_MEMHELP(v), &(vcp->reduce_buffer_dev), + bytes, SUNMEMTYPE_DEVICE, (void*)NVEC_HIP_STREAM(v)); if (alloc_fail) { SUNDIALS_DEBUG_PRINT( diff --git a/src/nvector/raja/nvector_raja.cpp b/src/nvector/raja/nvector_raja.cpp index 4e0f131a75..621d9baf2e 100644 --- a/src/nvector/raja/nvector_raja.cpp +++ b/src/nvector/raja/nvector_raja.cpp @@ -398,8 +398,7 @@ N_Vector N_VMakeManaged_Raja(sunindextype length, sunrealtype* vdata, NVEC_RAJA_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); #endif NVEC_RAJA_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_RAJA_CONTENT(v)->mem_helper, vdata, - SUNMEMTYPE_UVM); + SUNMemoryHelper_Wrap(NVEC_RAJA_CONTENT(v)->mem_helper, vdata, SUNMEMTYPE_UVM); NVEC_RAJA_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_RAJA_CONTENT(v)->mem_helper, NVEC_RAJA_CONTENT(v)->host_data); diff --git a/src/nvector/sycl/nvector_sycl.cpp b/src/nvector/sycl/nvector_sycl.cpp index 27d709c765..7adf6bced6 100644 --- a/src/nvector/sycl/nvector_sycl.cpp +++ b/src/nvector/sycl/nvector_sycl.cpp @@ -501,8 +501,8 @@ N_Vector N_VMakeManaged_Sycl(sunindextype length, sunrealtype* vdata, NVEC_SYCL_CONTENT(v)->length = length; NVEC_SYCL_CONTENT(v)->mem_helper = SUNMemoryHelper_Sycl(sunctx); NVEC_SYCL_CONTENT(v)->own_helper = SUNTRUE; - NVEC_SYCL_CONTENT(v)->host_data = - SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), vdata, SUNMEMTYPE_UVM); + NVEC_SYCL_CONTENT(v)->host_data = SUNMemoryHelper_Wrap(NVEC_SYCL_MEMHELP(v), + vdata, SUNMEMTYPE_UVM); NVEC_SYCL_CONTENT(v)->device_data = SUNMemoryHelper_Alias(NVEC_SYCL_MEMHELP(v), NVEC_SYCL_CONTENT(v)->host_data); NVEC_SYCL_CONTENT(v)->stream_exec_policy = diff --git a/src/sundials/sundials_datanode.h b/src/sundials/sundials_datanode.h index 37cc879e0b..ff88c21435 100644 --- a/src/sundials/sundials_datanode.h +++ b/src/sundials/sundials_datanode.h @@ -31,7 +31,7 @@ extern "C" { typedef int64_t sundataindex; enum SUNDataNodeType -{ +{ SUNDATANODE_LEAF, SUNDATANODE_LIST, SUNDATANODE_OBJECT diff --git a/src/sundials/sundials_linearsolver.c b/src/sundials/sundials_linearsolver.c index 95a7871952..71fef2dbfc 100644 --- a/src/sundials/sundials_linearsolver.c +++ b/src/sundials/sundials_linearsolver.c @@ -319,7 +319,7 @@ SUNErrCode SUNLinSolFree(SUNLinearSolver S) try to cleanup by freeing the content, ops, and solver */ free(S->content); S->content = NULL; - + free(S->ops); S->ops = NULL; diff --git a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp index fa88d98829..7490693281 100644 --- a/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp +++ b/src/sunlinsol/magmadense/sunlinsol_magmadense.cpp @@ -164,8 +164,7 @@ SUNLinearSolver SUNLinSol_MagmaDense(N_Vector y, SUNMatrix Amat, SUNContext sunc but in device memory for the batched methods. */ retval = SUNMemoryHelper_Alloc(content->memhelp, &content->pivots, M * nblocks * sizeof(sunindextype), - nblocks > 1 ? SUNMEMTYPE_DEVICE - : SUNMEMTYPE_HOST, + nblocks > 1 ? SUNMEMTYPE_DEVICE : SUNMEMTYPE_HOST, nullptr); if (retval) { diff --git a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu index 5119c2aac7..709b032b58 100644 --- a/src/sunmatrix/cusparse/sunmatrix_cusparse.cu +++ b/src/sunmatrix/cusparse/sunmatrix_cusparse.cu @@ -412,8 +412,8 @@ SUNMatrix SUNMatrix_cuSparse_NewBlockCSR(int nblocks, int blockrows, /* Allocate device memory for the matrix */ alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_colind, - sizeof(int) * blocknnz, - SUNMEMTYPE_DEVICE, nullptr); + sizeof(int) * blocknnz, SUNMEMTYPE_DEVICE, + nullptr); alloc_fail += SUNMemoryHelper_Alloc(SMCU_MEMHELP(A), &d_rowptr, sizeof(int) * (blockrows + 1), SUNMEMTYPE_DEVICE, nullptr); diff --git a/src/sunmemory/sycl/sundials_sycl_memory.cpp b/src/sunmemory/sycl/sundials_sycl_memory.cpp index 50b73e9fe7..23fc21c335 100644 --- a/src/sunmemory/sycl/sundials_sycl_memory.cpp +++ b/src/sunmemory/sycl/sundials_sycl_memory.cpp @@ -240,8 +240,8 @@ SUNErrCode SUNMemoryHelper_Dealloc_Sycl(SUNMemoryHelper helper, SUNMemory mem, free(mem->ptr); mem->ptr = nullptr; } - else if (mem->type == SUNMEMTYPE_PINNED || - mem->type == SUNMEMTYPE_DEVICE || mem->type == SUNMEMTYPE_UVM) + else if (mem->type == SUNMEMTYPE_PINNED || mem->type == SUNMEMTYPE_DEVICE || + mem->type == SUNMEMTYPE_UVM) { if (mem->type == SUNMEMTYPE_PINNED) { From 8d373a707978e04f7f1257be3549ebba84cc33a0 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Tue, 23 Sep 2025 00:15:02 -0700 Subject: [PATCH 26/26] merge fixes --- tools/log_example_mri.py | 70 ++++++++++++++---- tools/suntools/logs.py | 154 +++++++++++++++++++++++---------------- 2 files changed, 150 insertions(+), 74 deletions(-) diff --git a/tools/log_example_mri.py b/tools/log_example_mri.py index 1578c02453..bf6e0d08e4 100755 --- a/tools/log_example_mri.py +++ b/tools/log_example_mri.py @@ -31,6 +31,8 @@ def main(): parser.add_argument("logfiles", type=str, nargs="+", help="Log file to plot") + parser.add_argument("--scatter", action="store_true", help="Use scatter plot for step sizes") + parser.add_argument("--stats", action="store_true", help="Print step statistics") parser.add_argument("--labels", type=str, nargs="+", help="Labels for plot legend") @@ -43,6 +45,14 @@ def main(): parser.add_argument("--step-number", action="store_true", help="Plot value vs step number") + parser.add_argument("--timescale", type=float, help="Time scaling factor") + + parser.add_argument("--stepscale", type=float, help="Step size scaling factor") + + parser.add_argument("--xlabel", type=str, help="X-axis label") + + parser.add_argument("--ylabel", type=str, help="Y-axis label") + parser.add_argument( "--step-range", type=int, @@ -123,6 +133,16 @@ def main(): x_a = times_a x_f = times_f + if args.timescale: + for level_idx in range(len(x_a)): + x_a[level_idx] = args.timescale * np.array(x_a[level_idx]) + x_f[level_idx] = args.timescale * np.array(x_f[level_idx]) + + if args.stepscale: + for level_idx in range(len(vals_a)): + vals_a[level_idx] = args.stepscale * np.array(vals_a[level_idx]) + vals_f[level_idx] = args.stepscale * np.array(vals_f[level_idx]) + # now that we've read the first log, make as many subplots as time levels if log_idx == 0: _, axes = plt.subplots(len(x_a), sharex=True) @@ -134,14 +154,24 @@ def main(): for level_idx in range(len(x_a)): # plot step attempts - axes[level_idx].plot( - x_a[level_idx], - vals_a[level_idx], - color=colors(log_idx), - marker=".", - zorder=0.1, - label="attempts", - ) + if args.scatter: + axes[level_idx].scatter( + x_a[level_idx], + vals_a[level_idx], + color=colors(log_idx), + marker=".", + zorder=0.1, + label="attempts", + ) + else: + axes[level_idx].plot( + x_a[level_idx], + vals_a[level_idx], + color=colors(log_idx), + marker=".", + zorder=0.1, + label="attempts", + ) # plot failed steps axes[level_idx].scatter( @@ -156,8 +186,19 @@ def main(): ) axes[level_idx].grid(alpha=0.3, linestyle="--") - axes[level_idx].set_ylabel("step size") - axes[level_idx].set_title(f"level {level_idx}") + + if args.ylabel: + axes[level_idx].set_ylabel(args.ylabel) + else: + axes[level_idx].set_ylabel("step size") + + if len(x_a) == 2: + if level_idx == 0: + axes[level_idx].set_title(f"Slow Time Scale") + else: + axes[level_idx].set_title(f"Fast Time Scale") + else: + axes[level_idx].set_title(f"Level {level_idx}") if args.logx: axes[level_idx].set_xscale("log") @@ -181,10 +222,13 @@ def main(): f"Avg level {level_idx} attempts per level {level_idx - 1} attempts: {len(vals_a[level_idx])/len(vals_a[level_idx - 1]):.2f}" ) - if args.step_number: - axes[len(x_a) - 1].set_xlabel("step") + if args.xlabel: + axes[len(x_a) - 1].set_xlabel(args.xlabel) else: - axes[len(x_a) - 1].set_xlabel("time") + if args.step_number: + axes[len(x_a) - 1].set_xlabel("step") + else: + axes[len(x_a) - 1].set_xlabel("time") # number of logfiles nlogs = len(args.logfiles) diff --git a/tools/suntools/logs.py b/tools/suntools/logs.py index 7f170880f2..411d87dccc 100644 --- a/tools/suntools/logs.py +++ b/tools/suntools/logs.py @@ -17,25 +17,33 @@ # ----------------------------------------------------------------------------- import re -import numpy as np from collections import ChainMap -def convert_to_num(s): - """Try to convert a string to an int or float""" +def _convert_to_num(s): + """Try to convert a string to an int or float + + :param str s: The string to convert. + :returns: If the string is a numerical value, an integer (long long) or floating + point (double) value, otherwise the input string. + """ try: - return np.longlong(s) + return int(s) except ValueError: try: - return np.double(s) + return float(s) except ValueError: return s -def parse_logfile_payload(payload, line_number, all_lines, array_indicator="(:)"): - """ - Parse the payload of a SUNDIALS log file line into a dictionary. The payload - of a SUNDIALS log file line is the part after all the [ ] brackets. +def _parse_logfile_payload(payload, line_number, all_lines, array_indicator="(:)"): + """Parse the payload of a log file line into a dictionary. + + :param str payload: The payload of a log file line. + :param int line_number: The line number of payload in the log file. + :param str all_lines: All the lines in the log file. + :param str array_indicator: The string that denotes an array output in the log file. + :returns: A dictionary of key-value pairs from the payload. """ kvpstrs = payload.split(",") kvp_dict = {} @@ -53,42 +61,56 @@ def parse_logfile_payload(payload, line_number, all_lines, array_indicator="(:)" for line in all_lines[line_number + 1 :]: if line.startswith("[") or not line.strip(): break - values.append(np.double(line)) + values.append(float(line)) kvp_dict[key.strip()] = values else: kvp_dict[key.strip()] = value.strip() return kvp_dict -def parse_logfile_line(line, line_number, all_lines): - """ - Parse a line from a SUNDIALS log file into a dictionary. - - A log file line has the form: - [loglvl][rank][scope][label] key1 = value, key2 = value - The log line payload (everything after the brackets) can be multiline with - one value per line for keys corresponding to an array/vector: - [loglvl][rank][scope][label] y(:) = - y_1 - y_2 - ... +def _parse_logfile_line(line, line_number, all_lines): + """Parse a line from a log file into a dictionary. + + :param str line: The log file line to parse. + :param int line_number: The line number of the line in the log file. + :param str all_lines: All the lines in the log file. + :returns: A dictionary of key-value pairs from the line payload. + + A log file line begins a preamble containing the logging level (ERROR, WARNING, + INFO, or DEBUG), the MPI rank that issued the message, the function that issued the + message (scope), and a label with additional context for the message. For + informational or debugging logs the preamble is followed by the payload which is + either a comma-separated list of key-value pairs + + .. code-block:: none + + [loglvl][rank][scope][label] key1 = value1, key2 = value2 + + or multiline output with one value per line for keys corresponding to a vector or + array + + .. code-block:: none + + [loglvl][rank][scope][label] y(:) = + y_1 + y_2 + ... """ pattern = re.compile(r"\[(\w+)\]\[(rank \d+)\]\[(.*)\]\[(.*)\](.*)") matches = pattern.findall(line) line_dict = {} if matches: line_dict["loglvl"] = matches[0][0] - line_dict["rank"] = convert_to_num(matches[0][1].split()[1]) + line_dict["rank"] = _convert_to_num(matches[0][1].split()[1]) line_dict["scope"] = matches[0][2] line_dict["label"] = matches[0][3] - line_dict["payload"] = parse_logfile_payload(matches[0][4], line_number, all_lines) + line_dict["payload"] = _parse_logfile_payload(matches[0][4], line_number, all_lines) return line_dict class StepData: - """ - Helper class for parsing a step attempt from a SUNDIALS log file into a - hierarchical dictionary where entries may be lists of dictionaries. + """Helper class for parsing a step attempt from a log file into a hierarchical + dictionary where entries may be lists of dictionaries. """ def __init__(self): @@ -142,19 +164,17 @@ def get_step(self): def log_file_to_list(filename): - """ - This function takes a SUNDIALS log file and creates a list where each list - element represents an integrator step attempt. - - E.g., - [ - { - step : 1, - tn : 0.0, - stages : [ {stage : 1, tcur : 0.0, ...}, {stage : 2, tcur : 0.5, ...}, ...] - ... - }, ... - ] + """Parses a log file and returns a list of dictionaries. + + :param str filename: The name of the log file to parse. + :returns: A list of dictionaries. + + The list returned for a time integrator log file will contain a dictionary for each + step attempt e.g., + + .. code-block:: none + + [ {step : 1, tn : 0.0, h : 0.01, ...}, {step : 2, tn : 0.01, h : 0.10, ...}, ...] """ with open(filename, "r") as logfile: @@ -175,7 +195,7 @@ def log_file_to_list(filename): for line_number, line in enumerate(all_lines): - line_dict = parse_logfile_line(line.rstrip(), line_number, all_lines) + line_dict = _parse_logfile_line(line.rstrip(), line_number, all_lines) if not line_dict: continue @@ -311,43 +331,45 @@ def log_file_to_list(filename): return step_attempts -def print_log_list(a_list, indent=0): - """Print list value in step attempt dictionary""" +def _print_log_list(a_list, indent=0): + """Print list value from a log entry dictionary""" spaces = (indent + 2) * " " for entry in a_list: if type(entry) is list: print(f"{spaces}[") - print_log_list(entry, indent + 2) + _print_log_list(entry, indent + 2) print(f"{spaces}]") elif type(entry) is dict: print(f"{spaces}{{") - print_log_dict(entry, indent + 2) + _print_log_dict(entry, indent + 2) print(f"{spaces}}}") else: print(f"{spaces}{entry}") -def print_log_dict(a_dict, indent=0): - """Print dictionary value in step attempt dictionary""" +def _print_log_dict(a_dict, indent=0): + """Print dictionary value from a log entry dictionary""" spaces = (indent + 2) * " " for key in a_dict: if type(a_dict[key]) is list: print(f"{spaces}{key} :") print(f"{spaces}[") - print_log_list(a_dict[key], indent=indent + 2) + _print_log_list(a_dict[key], indent=indent + 2) print(f"{spaces}]") elif type(a_dict[key]) is dict: print(f"{spaces}{key} :") print(f"{spaces}{{") - print_log_dict(a_dict[key], indent=indent + 2) + _print_log_dict(a_dict[key], indent=indent + 2) print(f"{spaces}}}") else: print(f"{spaces}{key} : {a_dict[key]}") def print_log(log, indent=0): - """ - Print the entries from a log file list of step attempts. + """Print a log file list created by :py:func:`log_file_to_list`. + + :param list log: The log file list to print. + :param int indent: The number of spaces to indent the output. """ spaces = indent * " " subspaces = (indent + 2) * " " @@ -357,12 +379,12 @@ def print_log(log, indent=0): if type(entry[key]) is list: print(f"{subspaces}{key} :") print(f"{subspaces}[") - print_log_list(entry[key], indent=indent + 2) + _print_log_list(entry[key], indent=indent + 2) print(f"{subspaces}]") elif type(entry[key]) is dict: print(f"{subspaces}{key} :") print(f"{subspaces}{{") - print_log_dict(entry[key], indent=indent + 2) + _print_log_dict(entry[key], indent=indent + 2) print(f"{subspaces}}}") else: print(f"{subspaces}{key} : {entry[key]}") @@ -372,11 +394,23 @@ def print_log(log, indent=0): def get_history( log, key, step_status=None, time_range=None, step_range=None, group_by_level=False ): - """ - Extract the step/time series of the requested value. + """Extract the history of a key from a log file list created by + :py:func:`log_file_to_list`. + + :param list log: The log file list to extract values from. + :param str key: The key to extract. + :param str step_status: Only extract values for steps which match the given status + e.g., "success" or "failed". + :param time_range: Only extract values in the time interval, [low, high]. + :type time_range: [float, float] + :param step_range: Only extract values in the step number interval, [low, high]. + :type step_range: [int, int] + :param bool group_by_level: Group outputs by time level. + :returns: A list of steps, times, and values """ steps, times, values, levels = _get_history(log, key, step_status, time_range, step_range) + if group_by_level: from collections import defaultdict @@ -393,9 +427,7 @@ def get_history( def _get_history(log, key, step_status, time_range, step_range): - """ - Extract the step/time series of the requested value. - """ + """Extract the step/time series of the requested value.""" steps = [] times = [] @@ -404,8 +436,8 @@ def _get_history(log, key, step_status, time_range, step_range): for entry in log: - step = np.longlong(entry["step"]) - time = np.double(entry["tn"]) + step = int(entry["step"]) + time = float(entry["tn"]) level = entry["level"] if time_range is not None: @@ -424,7 +456,7 @@ def _get_history(log, key, step_status, time_range, step_range): if key in entry and save_data: steps.append(step) times.append(time) - values.append(convert_to_num(entry[key])) + values.append(_convert_to_num(entry[key])) levels.append(level) if "stages" in entry: