|
MLIR-AIE
|
Include dependency graph for memory_allocator.cpp:Go to the source code of this file.
Functions | |
| void | ess_WriteGM (uint64_t addr, const void *data, uint64_t size) |
| void | ess_ReadGM (uint64_t addr, void *data, uint64_t size) |
| int * | mlir_aie_mem_alloc (aie_libxaie_ctx_t *ctx, ext_mem_model_t &handle, int size) |
| Allocate a buffer in device memory. | |
| void | mlir_aie_sync_mem_cpu (ext_mem_model_t &handle) |
| Synchronize the buffer from the device to the host CPU. | |
| void | mlir_aie_sync_mem_dev (ext_mem_model_t &handle) |
| Synchronize the buffer from the host CPU to the device. | |
| u64 | mlir_aie_get_device_address (aie_libxaie_ctx_t *ctx, void *VA) |
| Return a device address corresponding to the given host address. | |
| void ess_ReadGM | ( | uint64_t | addr, |
| void * | data, | ||
| uint64_t | size | ||
| ) |
Referenced by mlir_aie_sync_mem_cpu().
| void ess_WriteGM | ( | uint64_t | addr, |
| const void * | data, | ||
| uint64_t | size | ||
| ) |
Referenced by mlir_aie_sync_mem_dev().
| u64 mlir_aie_get_device_address | ( | aie_libxaie_ctx_t * | ctx, |
| void * | host_address | ||
| ) |
Return a device address corresponding to the given host address.
| ctx | The AIE context |
| host_address | A host-side pointer returned from mlir_aie_mem_alloc |
Definition at line 56 of file memory_allocator.cpp.
References aie_libxaie_ctx_t::allocations.
| int * mlir_aie_mem_alloc | ( | aie_libxaie_ctx_t * | ctx, |
| ext_mem_model_t & | handle, | ||
| int | size | ||
| ) |
Allocate a buffer in device memory.
| ctx | The AIE context |
| handle | External memory model handle for tracking the allocation |
| size | The number of 32-bit words to allocate |
Definition at line 22 of file memory_allocator.cpp.
References aie_libxaie_ctx_t::allocations, ext_mem_model_t::physicalAddr, ext_mem_model_t::size, and ext_mem_model_t::virtualAddr.
| void mlir_aie_sync_mem_cpu | ( | ext_mem_model_t & | handle | ) |
Synchronize the buffer from the device to the host CPU.
This is expected to be called after the device writes data into device memory, so that the data can be read by the CPU. In a non-cache coherent system, this implies invalidating the processor cache associated with the buffer.
| handle | External memory model handle identifying the buffer to synchronize |
Definition at line 48 of file memory_allocator.cpp.
References ess_ReadGM(), ext_mem_model_t::physicalAddr, ext_mem_model_t::size, and ext_mem_model_t::virtualAddr.
| void mlir_aie_sync_mem_dev | ( | ext_mem_model_t & | handle | ) |
Synchronize the buffer from the host CPU to the device.
This is expected to be called after the host writes data into device memory, so that the data can be read by the device. In a non-cache coherent system, this implies flushing the processor cache associated with the buffer.
| handle | External memory model handle identifying the buffer to synchronize |
Definition at line 52 of file memory_allocator.cpp.
References ess_WriteGM(), ext_mem_model_t::physicalAddr, ext_mem_model_t::size, and ext_mem_model_t::virtualAddr.