|
MLIR 24.0.0git
|
Tracks aligned byte consumption against a configurable shared memory cap. More...
#include "mlir/Dialect/OpenACC/OpenACCUtilsCG.h"
Public Member Functions | |
| SharedMemoryBudget (int64_t maxTotalBytes, int64_t initialBytesUsed=0) | |
| bool | tryAllocate (int64_t bytes, int64_t alignment=kDefaultAlignmentBytes) |
Reserve bytes, rounding the current offset up to alignment first. | |
| int64_t | bytesUsed () const |
| int64_t | maxTotalBytes () const |
| void | setMaxTotalBytes (int64_t maxTotalBytes) |
Static Public Member Functions | |
| static int64_t | alignOffset (int64_t offset, int64_t alignment=kDefaultAlignmentBytes) |
Round offset up to the next multiple of alignment, which must be a power of two. | |
Static Public Attributes | |
| static constexpr int64_t | kDefaultAlignmentBytes = 16 |
| Default allocation alignment (bytes). | |
Tracks aligned byte consumption against a configurable shared memory cap.
Definition at line 122 of file OpenACCUtilsCG.h.
|
inline |
Definition at line 127 of file OpenACCUtilsCG.h.
References maxTotalBytes().
|
static |
Round offset up to the next multiple of alignment, which must be a power of two.
Definition at line 226 of file OpenACCUtilsCG.cpp.
Referenced by mlir::acc::sumExistingSharedMemoryBytes(), and tryAllocate().
|
inline |
Definition at line 134 of file OpenACCUtilsCG.h.
|
inline |
Definition at line 135 of file OpenACCUtilsCG.h.
Referenced by setMaxTotalBytes(), and SharedMemoryBudget().
Definition at line 136 of file OpenACCUtilsCG.h.
References maxTotalBytes().
| bool mlir::acc::SharedMemoryBudget::tryAllocate | ( | int64_t | bytes, |
| int64_t | alignment = kDefaultAlignmentBytes ) |
Reserve bytes, rounding the current offset up to alignment first.
Returns false without mutating state if the reservation would exceed the cap. alignment must be a power of two.
Definition at line 232 of file OpenACCUtilsCG.cpp.
References alignOffset().
|
staticconstexpr |
Default allocation alignment (bytes).
Definition at line 125 of file OpenACCUtilsCG.h.