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#
- PETSC_MEMORY_ACCESS_READ- Read only
- PETSC_MEMORY_ACCESS_WRITE- Write only
- PETSC_MEMORY_ACCESS_READ_WRITE- Read and write
Notes#
This enum is a bitmask with the following encoding (assuming 2 bit):
  PETSC_MEMORY_ACCESS_READ       = 0b01
  PETSC_MEMORY_ACCESS_WRITE      = 0b10
  PETSC_MEMORY_ACCESS_READ_WRITE = 0b11
  // consequently
  PETSC_MEMORY_ACCESS_READ | PETSC_MEMORY_ACCESS_WRITE = PETSC_MEMORY_ACCESS_READ_WRITE
The following convenience macros are also provided:
- PetscMemoryAccessRead(mode)-- trueif- modeis any kind of read,- falseotherwise
- PetscMemoryAccessWrite(mode)-- trueif- modeis any kind of write,- falseotherwise
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#
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages