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