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