xref: /honee/src/smartsim_weak.c (revision 0c608af58d6c66f4fcbe6fff5e0f907584234584)
1 // SPDX-FileCopyrightText: Copyright (c) 2017-2024, HONEE contributors.
2 // SPDX-License-Identifier: Apache-2.0 OR BSD-2-Clause
3 //
4 // @file This creates weak functions for smartsim dependent functions. If the smartsim-dependent functions are actually built, these functions are not
5 // linked to the final executable.
6 
7 #include <navierstokes.h>
8 
9 #define SMARTSIM_WEAK(...)                                                                                       \
10   __VA_ARGS__ __attribute__((weak));                                                                             \
11   __VA_ARGS__ {                                                                                                  \
12     PetscFunctionBeginUser;                                                                                      \
13     SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "HONEE must be built with SMARTREDIS_DIR set to run %s", __func__); \
14   };
15 
16 SMARTSIM_WEAK(PetscErrorCode SGS_DD_TrainingSetup(Ceed ceed, Honee honee, ProblemData problem))
17 SMARTSIM_WEAK(PetscErrorCode TSMonitor_SGS_DD_Training(TS ts, PetscInt step_num, PetscReal solution_time, Vec Q, void *ctx))
18 SMARTSIM_WEAK(PetscErrorCode TSPostStep_SGS_DD_Training(TS ts))
19 
20 SMARTSIM_WEAK(PetscErrorCode TSMonitor_SmartSimSolutionSetup(TS ts, PetscInt step_num, PetscReal solution_time, Vec Q, void *ctx))
21 SMARTSIM_WEAK(PetscErrorCode TSMonitor_SmartSimSolution(TS ts, PetscInt step_num, PetscReal solution_time, Vec Q, void *ctx))
22