xref: /honee/problems/sgs_model_torch_weak.c (revision cbdfeaf49eecfe108b28f98e5e7c308a9796a444)
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 libtorch dependent functions.
5 
6 #include <sgs_model_torch.h>
7 
8 PetscErrorCode LoadModel_Torch(const char *model_path, TorchDeviceType device_enum) __attribute__((weak));
9 PetscErrorCode LoadModel_Torch(const char *model_path, TorchDeviceType device_enum) {
10   PetscFunctionBeginUser;
11   SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "Must build with USE_TORCH set to run %s", __func__);
12 }
13 
14 PetscErrorCode ModelInference_Torch(Vec DD_Inputs_loc, Vec DD_Outputs_loc) __attribute__((weak));
15 PetscErrorCode ModelInference_Torch(Vec DD_Inputs_loc, Vec DD_Outputs_loc) {
16   PetscFunctionBeginUser;
17   SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "Must build with USE_TORCH set to run %s", __func__);
18 }
19