xref: /libCEED/examples/solids/include/utils.h (revision 019b76820d7ff306c177822c4e76ffe5939c204b)
1 // Copyright (c) 2017-2022, 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 #ifndef libceed_solids_examples_utils_h
9 #define libceed_solids_examples_utils_h
10 
11 #include <ceed.h>
12 #include <petsc.h>
13 
14 // Translate PetscMemType to CeedMemType
15 static inline CeedMemType MemTypeP2C(PetscMemType mem_type) {
16   return PetscMemTypeDevice(mem_type) ? CEED_MEM_DEVICE : CEED_MEM_HOST;
17 }
18 
19 #endif // libceed_solids_examples_utils_h
20