/home/runner/work/HiCR/HiCR/include/hicr/backends/opencl/communicationManager.hpp Source File
HiCR
|
communicationManager.hpp
Go to the documentation of this file.
49 CommunicationManager(const std::unordered_map<opencl::Device::deviceIdentifier_t, std::shared_ptr<cl::CommandQueue>> &deviceQueueMap)
80 __INLINE__ void exchangeGlobalMemorySlotsImpl(const HiCR::GlobalMemorySlot::tag_t tag, const std::vector<globalKeyMemorySlotPair_t> &memorySlots) override
85 __INLINE__ void queryMemorySlotUpdatesImpl(std::shared_ptr<HiCR::LocalMemorySlot> memorySlot) override { HICR_THROW_RUNTIME("Not yet implemented for this backend"); }
87 __INLINE__ std::shared_ptr<HiCR::GlobalMemorySlot> getGlobalMemorySlotImpl(const HiCR::GlobalMemorySlot::tag_t tag, const HiCR::GlobalMemorySlot::globalKey_t globalKey) override
98 __INLINE__ void destroyGlobalMemorySlotImpl(const std::shared_ptr<HiCR::GlobalMemorySlot> memorySlot) override { HICR_THROW_RUNTIME("Not yet implemented for this backend"); }
132 if (src == nullptr) [[unlikely]] { HICR_THROW_LOGIC("The passed source memory slot is not supported by this backend\n"); }
133 if (dst == nullptr) [[unlikely]] { HICR_THROW_LOGIC("The passed destination memory slot is not supported by this backend\n"); }
144 err = queue->enqueueCopyBuffer(*(src->getBuffer()), *(dst->getBuffer()), src_offset, dst_offset, size, nullptr, nullptr);
145 if (err != CL_SUCCESS) [[unlikely]] { HICR_THROW_RUNTIME("Can not perform memcpy. Err: %d", err); }
160 err = queue->enqueueCopyBuffer(*(src->getBuffer()), *(dst->getBuffer()), src_offset, dst_offset, size, nullptr, &completionEvent);
161 if (err != CL_SUCCESS) [[unlikely]] { HICR_THROW_RUNTIME("Can not perform memcpy. Err: %d", err); }
178 __INLINE__ bool acquireGlobalLockImpl(std::shared_ptr<HiCR::GlobalMemorySlot> memorySlot) override { HICR_THROW_RUNTIME("Not yet implemented for this backend"); }
180 __INLINE__ void releaseGlobalLockImpl(std::shared_ptr<HiCR::GlobalMemorySlot> memorySlot) override { HICR_THROW_RUNTIME("Not yet implemented for this backend"); }
187 const std::unordered_map<opencl::Device::deviceIdentifier_t, std::shared_ptr<cl::CommandQueue>> _deviceQueueMap;
207 HICR_THROW_LOGIC("The passed memory space is not supported by this memory manager. Supported opencl and hwloc\n");
216 __INLINE__ void map(const cl::CommandQueue *queue, std::shared_ptr<HiCR::backend::opencl::LocalMemorySlot> &memSlot)
219 memSlot->getPointer() = queue->enqueueMapBuffer(*(memSlot->getBuffer()), CL_TRUE, CL_MAP_READ | CL_MAP_WRITE, 0, memSlot->getSize(), nullptr, nullptr, &err);
220 if (err != CL_SUCCESS) [[unlikely]] { HICR_THROW_RUNTIME("Can not map the buffer. Error: %d", err); }
229 __INLINE__ void unmap(const cl::CommandQueue *queue, std::shared_ptr<HiCR::backend::opencl::LocalMemorySlot> &memSlot)
231 auto err = queue->enqueueUnmapMemObject(*(memSlot->getBuffer()), memSlot->getPointer(), nullptr, nullptr);
232 if (err != CL_SUCCESS) [[unlikely]] { HICR_THROW_RUNTIME("Can not unmap the buffer. Error: %d", err); }
This file implements the Device class for the OpenCL backend.
Provides a definition for the local memory slot class for the OpenCL backend.
This file implements the memory manager class for the OpenCL backend.
This file implements the memory space class for the OpenCL backend.
Definition communicationManager.hpp:54
__INLINE__ void increaseMessageRecvCounter(HiCR::LocalMemorySlot &memorySlot) noexcept
Definition communicationManager.hpp:652
__INLINE__ void increaseMessageSentCounter(HiCR::LocalMemorySlot &memorySlot) noexcept
Definition communicationManager.hpp:659
Definition communicationManager.hpp:41
~CommunicationManager()=default
__INLINE__ void memcpyAsync(const std::shared_ptr< HiCR::LocalMemorySlot > &destination, const size_t dst_offset, const std::shared_ptr< HiCR::LocalMemorySlot > &source, const size_t src_offset, const size_t size, const cl::CommandQueue *queue)
Definition communicationManager.hpp:68
CommunicationManager(const std::unordered_map< opencl::Device::deviceIdentifier_t, std::shared_ptr< cl::CommandQueue > > &deviceQueueMap)
Definition communicationManager.hpp:49
uint64_t deviceIdentifier_t
Definition device.hpp:43
Provides a definition for the base backend's communication manager class.
Provides a definition for a HiCR Global Memory Slot class.
Generated by