/home/runner/work/HiCR/HiCR/include/hicr/backends/ascend/memoryManager.hpp Source File
HiCR
|
memoryManager.hpp
Go to the documentation of this file.
62 __INLINE__ std::shared_ptr<HiCR::LocalMemorySlot> allocateLocalMemorySlotImpl(std::shared_ptr<HiCR::MemorySpace> memorySpace, const size_t size) override
76 HICR_THROW_LOGIC("The passed memory space is not supported by this memory manager. Supported ascend and hwloc\n");
79 __INLINE__ std::shared_ptr<HiCR::LocalMemorySlot> allocateLocalDeviceMemorySlot(const std::shared_ptr<HiCR::MemorySpace> memorySpace, const size_t size)
94 __INLINE__ std::shared_ptr<HiCR::LocalMemorySlot> allocateLocalHostMemorySlot(const std::shared_ptr<HiCR::MemorySpace> memorySpace, const size_t size)
111 __INLINE__ void *deviceAlloc(std::shared_ptr<ascend::MemorySpace> memorySpace, const size_t size)
124 if (err != ACL_SUCCESS) HICR_THROW_RUNTIME("Can not allocate memory on Ascend device %d. Error %d", device->getId(), err);
143 if (err != ACL_SUCCESS) HICR_THROW_RUNTIME("Can not allocate memory on host through ascend-dedicated function. Error %d", err);
149 __INLINE__ std::shared_ptr<HiCR::LocalMemorySlot> registerLocalMemorySlotImpl(std::shared_ptr<HiCR::MemorySpace> memorySpace, void *const ptr, const size_t size) override
154 __INLINE__ void memsetImpl(const std::shared_ptr<HiCR::LocalMemorySlot> memorySlot, int value, size_t size) override
157 // Ascend aclrtMemset() automatically understands if the memory resides on the device or the host, so we can use it directly
162 __INLINE__ void freeLocalMemorySlotImpl(std::shared_ptr<HiCR::LocalMemorySlot> memorySlot) override
176 const auto memorySlotMemorySpace = dynamic_pointer_cast<HiCR::backend::ascend::MemorySpace>(memorySlot->getMemorySpace());
181 if (err != ACL_SUCCESS) HICR_THROW_RUNTIME("Error while freeing device %d memory. Error %d", memorySlotDeviceId, err);
This file implements the Device class for the Ascend backend.
Provides a definition for the local memory slot class for the Ascend backend.
This file implements the memory space class for the Ascend backend.
This file implements the memory space class for the HWLoc-based backend.
Definition memoryManager.hpp:51
Definition memoryManager.hpp:49
~MemoryManager()=default
Provides a definition for the base backend's memory manager class.
Generated by