PetscMemoryAccessMode#

Describes the intended usage of a memory region

Synopsis#

#include <petscdevicetypes.h> 
typedef enum {
  PETSC_MEMORY_ACCESS_READ       = 0x1, // 01
  PETSC_MEMORY_ACCESS_WRITE      = 0x2, // 10
  PETSC_MEMORY_ACCESS_READ_WRITE = 0x3, // 11
} PetscMemoryAccessMode;

Values#

Notes#

This enum is a bitmask with the following encoding (assuming 2 bit):

The following convenience macros are also provided:

  • PetscMemoryAccessRead(mode) - true if mode is any kind of read, false otherwise

  • PetscMemoryAccessWrite(mode) - true if mode is any kind of write, false otherwise

Developer Note#

This enum uses a function (PetscMemoryAccessModeToString()) to convert values to string representation, so cannot be used in PetscOptionsEnum().

See Also#

PetscMemoryAccessModeToString(), PetscDevice, PetscDeviceContext

Level#

beginner

Location#

include/petscdevicetypes.h


Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages