PetscMemoryAccessMode#
Describes the intended usage of a memory region
Synopsis#
#include <petscdevicetypes.h>
typedef enum {
PETSC_MEMORY_ACCESS_READ = 1, /* 01 */
PETSC_MEMORY_ACCESS_WRITE = 2, /* 10 */
PETSC_MEMORY_ACCESS_READ_WRITE = 3 /* 11 */
} PetscMemoryAccessMode;
Values#
PETSC_MEMORY_ACCESS_READ- Read onlyPETSC_MEMORY_ACCESS_WRITE- Write onlyPETSC_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)-trueifmodeis any kind of read,falseotherwisePetscMemoryAccessWrite(mode)-trueifmodeis 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