ceed-impl.h (e36deacd66b8a396a30ce35a93f58a1debb05da0) ceed-impl.h (c7c22b028b61a8d4de0ed536be76aa98e93bbcea)
1// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3// reserved. See files LICENSE and NOTICE for details.
4//
5// This file is part of CEED, a collection of benchmarks, miniapps, software
6// libraries and APIs for efficient high-order finite element and spectral
7// element discretizations for exascale applications. For more information and
8// source code availability see http://github.com/ceed.

--- 25 unchanged lines hidden (view full) ---

34 const CeedScalar *, const CeedScalar *, const CeedScalar *, CeedBasis);
35 int (*QFunctionCreate)(CeedQFunction);
36 int (*OperatorCreate)(CeedOperator);
37 void *data;
38};
39
40/* In the next 3 functions, p has to be the address of a pointer type, i.e. p
41 has to be a pointer to a pointer. */
1// Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2// the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3// reserved. See files LICENSE and NOTICE for details.
4//
5// This file is part of CEED, a collection of benchmarks, miniapps, software
6// libraries and APIs for efficient high-order finite element and spectral
7// element discretizations for exascale applications. For more information and
8// source code availability see http://github.com/ceed.

--- 25 unchanged lines hidden (view full) ---

34 const CeedScalar *, const CeedScalar *, const CeedScalar *, CeedBasis);
35 int (*QFunctionCreate)(CeedQFunction);
36 int (*OperatorCreate)(CeedOperator);
37 void *data;
38};
39
40/* In the next 3 functions, p has to be the address of a pointer type, i.e. p
41 has to be a pointer to a pointer. */
42CEED_INTERN int CeedMallocArray(size_t n, size_t unit, void *p, char*, int);
43CEED_INTERN int CeedCallocArray(size_t n, size_t unit, void *p, char*, int);
44CEED_INTERN int CeedReallocArray(size_t n, size_t unit, void *p, char*, int);
45CEED_INTERN int CeedFreeImpl(void *p, char*, int);
42CEED_INTERN int CeedMallocArray(size_t n, size_t unit, void *p);
43CEED_INTERN int CeedCallocArray(size_t n, size_t unit, void *p);
44CEED_INTERN int CeedReallocArray(size_t n, size_t unit, void *p);
45CEED_INTERN int CeedFree(void *p);
46
47#define CeedChk(ierr) do { if (ierr) return ierr; } while (0)
48/* Note that CeedMalloc and CeedCalloc will, generally, return pointers with
49 different memory alignments: CeedMalloc returns pointers aligned at
50 CEED_ALIGN bytes, while CeedCalloc uses the alignment of calloc. */
46
47#define CeedChk(ierr) do { if (ierr) return ierr; } while (0)
48/* Note that CeedMalloc and CeedCalloc will, generally, return pointers with
49 different memory alignments: CeedMalloc returns pointers aligned at
50 CEED_ALIGN bytes, while CeedCalloc uses the alignment of calloc. */
51#define CeedMalloc(n, p) CeedMallocArray((n), sizeof(**(p)), p,__FILE__,__LINE__)
52#define CeedCalloc(n, p) CeedCallocArray((n), sizeof(**(p)), p,__FILE__,__LINE__)
53#define CeedRealloc(n, p) CeedReallocArray((n), sizeof(**(p)), p,__FILE__,__LINE__)
54#define CeedFree(p) CeedFreeImpl(p,__FILE__,__LINE__)
51#define CeedMalloc(n, p) CeedMallocArray((n), sizeof(**(p)), p)
52#define CeedCalloc(n, p) CeedCallocArray((n), sizeof(**(p)), p)
53#define CeedRealloc(n, p) CeedReallocArray((n), sizeof(**(p)), p)
55
56void CeedDebug(const char *,...);
57
58struct CeedVector_private {
59 Ceed ceed;
60 int (*SetArray)(CeedVector, CeedMemType, CeedCopyMode, CeedScalar *);
61 int (*GetArray)(CeedVector, CeedMemType, CeedScalar **);
62 int (*GetArrayRead)(CeedVector, CeedMemType, const CeedScalar **);

--- 70 unchanged lines hidden ---
54
55void CeedDebug(const char *,...);
56
57struct CeedVector_private {
58 Ceed ceed;
59 int (*SetArray)(CeedVector, CeedMemType, CeedCopyMode, CeedScalar *);
60 int (*GetArray)(CeedVector, CeedMemType, CeedScalar **);
61 int (*GetArrayRead)(CeedVector, CeedMemType, const CeedScalar **);

--- 70 unchanged lines hidden ---