Ceed

void CeedDebugImpl(const Ceed ceed, const char *format, ...)

Print Ceed debugging information.

Backend Developer Functions

Return

None

Parameters
  • ceed: Ceed context

  • format: Printing format

void CeedDebugImpl256(const Ceed ceed, const unsigned char color, const char *format, ...)

Print Ceed debugging information in color.

Backend Developer Functions

Return

None

Parameters
  • ceed: Ceed context

  • color: Color to print

  • format: Printing format

int CeedMallocArray(size_t n, size_t unit, void *p)

Allocate an array on the host; use CeedMalloc()

Memory usage can be tracked by the library. This ensures sufficient alignment for vectorization and should be used for large allocations.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

See

CeedFree()

Parameters
  • n: Number of units to allocate

  • unit: Size of each unit

  • p: Address of pointer to hold the result.

int CeedCallocArray(size_t n, size_t unit, void *p)

Allocate a cleared (zeroed) array on the host; use CeedCalloc()

Memory usage can be tracked by the library.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

See

CeedFree()

Parameters
  • n: Number of units to allocate

  • unit: Size of each unit

  • p: Address of pointer to hold the result.

int CeedReallocArray(size_t n, size_t unit, void *p)

Reallocate an array on the host; use CeedRealloc()

Memory usage can be tracked by the library.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

See

CeedFree()

Parameters
  • n: Number of units to allocate

  • unit: Size of each unit

  • p: Address of pointer to hold the result.

int CeedFree(void *p)

Free memory allocated using CeedMalloc() or CeedCalloc()

Parameters
  • p: address of pointer to memory. This argument is of type void* to avoid needing a cast, but is the address of the pointer (which is zeroed) rather than the pointer.

int CeedRegister(const char *prefix, int (*init)(const char*, Ceed), unsigned int priority, )

Register a Ceed backend.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • prefix: Prefix of resources for this backend to respond to. For example, the reference backend responds to “/cpu/self”.

  • init: Initialization function called by CeedInit() when the backend is selected to drive the requested resource.

  • priority: Integer priority. Lower values are preferred in case the resource requested by CeedInit() has non-unique best prefix match.

int CeedIsDebug(Ceed ceed, bool *isDebug)

Return debugging status flag.

Bcakend

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context to get debugging flag

  • isDebug: Variable to store debugging flag

int CeedGetParent(Ceed ceed, Ceed *parent)

Retrieve a parent Ceed context.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context to retrieve parent of

  • [out] parent: Address to save the parent to

int CeedGetDelegate(Ceed ceed, Ceed *delegate)

Retrieve a delegate Ceed context.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context to retrieve delegate of

  • [out] delegate: Address to save the delegate to

int CeedSetDelegate(Ceed ceed, Ceed delegate)

Set a delegate Ceed context.

This function allows a Ceed context to set a delegate Ceed context. All backend implementations default to the delegate Ceed context, unless overridden.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context to set delegate of

  • [out] delegate: Address to set the delegate to

int CeedGetObjectDelegate(Ceed ceed, Ceed *delegate, const char *objname)

Retrieve a delegate Ceed context for a specific object type.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context to retrieve delegate of

  • [out] delegate: Address to save the delegate to

  • [in] objname: Name of the object type to retrieve delegate for

int CeedSetObjectDelegate(Ceed ceed, Ceed delegate, const char *objname)

Set a delegate Ceed context for a specific object type.

This function allows a Ceed context to set a delegate Ceed context for a given type of Ceed object. All backend implementations default to the delegate Ceed context for this object. For example, CeedSetObjectDelegate(ceed, refceed, “Basis”) uses refceed implementations for all CeedBasis backend functions.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context to set delegate of

  • [out] delegate: Address to set the delegate to

  • [in] objname: Name of the object type to set delegate for

int CeedGetOperatorFallbackResource(Ceed ceed, const char **resource)

Get the fallback resource for CeedOperators.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context

  • [out] resource: Variable to store fallback resource

int CeedSetOperatorFallbackResource(Ceed ceed, const char *resource)

Set the fallback resource for CeedOperators.

The current resource, if any, is freed by calling this function. This string is freed upon the destruction of the Ceed context.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • [out] ceed: Ceed context

  • resource: Fallback resource to set

int CeedGetOperatorFallbackParentCeed(Ceed ceed, Ceed *parent)

Get the parent Ceed context associated with a fallback Ceed context for a CeedOperator.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context

  • [out] parent: Variable to store parent Ceed context

int CeedSetDeterministic(Ceed ceed, bool isDeterministic)

Flag Ceed context as deterministic.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed to flag as deterministic

int CeedSetBackendFunction(Ceed ceed, const char *type, void *object, const char *fname, int (*f)())

Set a backend function.

This function is used for a backend to set the function associated with the Ceed objects. For example, CeedSetBackendFunction(ceed, “Ceed”, ceed, “VectorCreate”, BackendVectorCreate) sets the backend implementation of ‘CeedVectorCreate’ and CeedSetBackendFunction(ceed, “Basis”, basis, “Apply”, BackendBasisApply) sets the backend implementation of ‘CeedBasisApply’. Note, the prefix ‘Ceed’ is not required for the object type (“Basis” vs “CeedBasis”).

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context for error handling

  • type: Type of Ceed object to set function for

  • [out] object: Ceed object to set function for

  • fname: Name of function to set

  • f: Function to set

int CeedGetData(Ceed ceed, void *data)

Retrieve backend data for a Ceed context.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context to retrieve data of

  • [out] data: Address to save data to

int CeedSetData(Ceed ceed, void *data)

Set backend data for a Ceed context.

Backend Developer Functions

Return

An error code: 0 - success, otherwise - failure

Parameters
  • ceed: Ceed context to set data of

  • data: Address of data to set