1*ae2b091fSJames Wright // SPDX-FileCopyrightText: Copyright (c) 2017-2024, HONEE contributors. 2*ae2b091fSJames Wright // SPDX-License-Identifier: Apache-2.0 OR BSD-2-Clause 34c07ec22SJames Wright // 44c07ec22SJames Wright // @file This creates weak functions for libtorch dependent functions. 54c07ec22SJames Wright 64c07ec22SJames Wright #include <sgs_model_torch.h> 74c07ec22SJames Wright 84c07ec22SJames Wright PetscErrorCode LoadModel_Torch(const char *model_path, TorchDeviceType device_enum) __attribute__((weak)); 94c07ec22SJames Wright PetscErrorCode LoadModel_Torch(const char *model_path, TorchDeviceType device_enum) { 104c07ec22SJames Wright PetscFunctionBeginUser; 114c07ec22SJames Wright SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "Must build with USE_TORCH set to run %s", __func__); 124c07ec22SJames Wright } 134c07ec22SJames Wright 144c07ec22SJames Wright PetscErrorCode ModelInference_Torch(Vec DD_Inputs_loc, Vec DD_Outputs_loc) __attribute__((weak)); 154c07ec22SJames Wright PetscErrorCode ModelInference_Torch(Vec DD_Inputs_loc, Vec DD_Outputs_loc) { 164c07ec22SJames Wright PetscFunctionBeginUser; 174c07ec22SJames Wright SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "Must build with USE_TORCH set to run %s", __func__); 184c07ec22SJames Wright } 19