MLIR-AIE
|
#include "hsa/hsa.h"
#include "hsa/hsa_ext_amd.h"
#include "memory_allocator.h"
#include "test_library.h"
#include <iostream>
Go to the source code of this file.
Functions | |
int * | mlir_aie_mem_alloc (aie_libxaie_ctx_t *_xaie, 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 (struct aie_libxaie_ctx_t *_xaie, void *VA) |
Return a device address corresponding to the given host address. | |
u64 mlir_aie_get_device_address | ( | aie_libxaie_ctx_t * | _xaie, |
void * | host_address | ||
) |
Return a device address corresponding to the given host address.
host_address | A host-side pointer returned from mlir_aie_mem_alloc |
Definition at line 53 of file memory_allocator_hsa.cpp.
int * mlir_aie_mem_alloc | ( | aie_libxaie_ctx_t * | _xaie, |
ext_mem_model_t & | handle, | ||
int | size | ||
) |
Allocate a buffer in device memory.
bufIdx | The index of the buffer to allocate. |
size | The number of 32-bit words to allocate |
Definition at line 20 of file memory_allocator_hsa.cpp.
References 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.
bufIdx | The buffer index. |
Definition at line 44 of file memory_allocator_hsa.cpp.
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.
bufIdx | The buffer index. |
Definition at line 46 of file memory_allocator_hsa.cpp.