xref: /honee/problems/sgs_model_torch_weak.c (revision 0006be33bc3a095c7a40443db044019362bd3e1c)
1 // Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3 //
4 // SPDX-License-Identifier: BSD-2-Clause
5 //
6 // This file is part of CEED:  http://github.com/ceed
7 //
8 // @file This creates weak functions for libtorch dependent functions.
9 
10 #include <sgs_model_torch.h>
11 
12 PetscErrorCode LoadModel_Torch(const char *model_path, TorchDeviceType device_enum) __attribute__((weak));
13 PetscErrorCode LoadModel_Torch(const char *model_path, TorchDeviceType device_enum) {
14   PetscFunctionBeginUser;
15   SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "Must build with USE_TORCH set to run %s", __func__);
16 }
17 
18 PetscErrorCode ModelInference_Torch(Vec DD_Inputs_loc, Vec DD_Outputs_loc) __attribute__((weak));
19 PetscErrorCode ModelInference_Torch(Vec DD_Inputs_loc, Vec DD_Outputs_loc) {
20   PetscFunctionBeginUser;
21   SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "Must build with USE_TORCH set to run %s", __func__);
22 }
23