1: #ifndef PETSCDEVICETESTCOMMON_H
2: #define PETSCDEVICETESTCOMMON_H
4: /* this file needs to be the one to include petsc/private/deviceimpl.h since it needs to define
5: * a special macro to ensure that the error checking macros stay defined even in optimized
6: * builds
7: */
8: #if defined(PETSCDEVICEIMPL_H)
9: #error "must #include this file before petsc/private/deviceimpl.h"
10: #endif
12: #if !defined(PETSC_DEVICE_KEEP_ERROR_CHECKING_MACROS)
13: #define PETSC_DEVICE_KEEP_ERROR_CHECKING_MACROS 1
14: #endif
15: #include <petsc/private/deviceimpl.h>
17: static inline PetscErrorCode AssertDeviceExists(PetscDevice device)
18: {
20: return 0;
21: }
23: static inline PetscErrorCode AssertDeviceDoesNotExist(PetscDevice device)
24: {
26: return 0;
27: }
29: static inline PetscErrorCode AssertDeviceContextExists(PetscDeviceContext dctx)
30: {
32: return 0;
33: }
35: static inline PetscErrorCode AssertDeviceContextDoesNotExist(PetscDeviceContext dctx)
36: {
38: return 0;
39: }
41: static inline PetscErrorCode AssertPetscStreamTypesValidAndEqual(PetscStreamType left, PetscStreamType right, const char *errStr)
42: {
46: return 0;
47: }
49: static inline PetscErrorCode AssertPetscDeviceTypesValidAndEqual(PetscDeviceType left, PetscDeviceType right, const char *errStr)
50: {
54: return 0;
55: }
57: static inline PetscErrorCode AssertPetscDevicesValidAndEqual(PetscDevice left, PetscDevice right, const char *errStr)
58: {
61: return 0;
62: }
64: static inline PetscErrorCode AssertPetscDeviceContextsValidAndEqual(PetscDeviceContext left, PetscDeviceContext right, const char *errStr)
65: {
68: return 0;
69: }
70: #endif /* PETSCDEVICETESTCOMMON_H */