/home/runner/work/HiCR/HiCR/include/hicr/frontends/objectStore/objectStore.hpp Source File
HiCR
|
objectStore.hpp
Go to the documentation of this file.
40};
161 [[nodiscard]] __INLINE__ std::shared_ptr<DataObject> createObject(void *ptr, size_t size, blockId id)
178 [[nodiscard]] __INLINE__ std::shared_ptr<DataObject> createObject(std::shared_ptr<LocalMemorySlot> slot, blockId id)
197 HICR_THROW_LOGIC("Trying to publish a block that has already been published."); // FIXME: What do we do with republishing?
203 _globalObjects.insert({dataObject->_instanceId << OBJECT_STORE_KEY_INSTANCE_ID_BITS | objectId, dataObject});
252 // Deduce globally unique block ID for the GlobalMemorySlot key, by combining the given instance and block IDs
253 compoundId_t compoundId = dataObject._instanceId << OBJECT_STORE_KEY_INSTANCE_ID_BITS | dataObject._id;
260 // Allocate a local memory slot for the block, associate it with the global slot and add it to the blocks of the given instance
265 if (dataObject._globalSlot == nullptr) HICR_THROW_LOGIC("Trying to get a block that has not been properly transferred.");
268 _communicationManager.memcpy(dataObject._localSlot, 0, dataObject._globalSlot, 0, dataObject._size);
287 // Only free the local memory slot if it is a fetched object, which means the local slot allocation
294 if (dataObject._globalSlot) _communicationManager.destroyPromotedGlobalMemorySlot(dataObject._globalSlot);
296 compoundId_t compoundId = dataObject._instanceId << OBJECT_STORE_KEY_INSTANCE_ID_BITS | dataObject._id;
315 uint8_t *serializedGlobalSlot = _communicationManager.serializeGlobalMemorySlot(dataObject._globalSlot); // implicitly produces allocation
335 _communicationManager.deserializeGlobalMemorySlot(reinterpret_cast<uint8_t *>(const_cast<uint8_t(*)[28 + sizeof(size_t)]>(&handle.serializedGlobalSlot)), _tag);
Definition communicationManager.hpp:54
virtual std::shared_ptr< GlobalMemorySlot > promoteLocalMemorySlot(const std::shared_ptr< LocalMemorySlot > &localMemorySlot, GlobalMemorySlot::tag_t tag)
Definition communicationManager.hpp:177
virtual uint8_t * serializeGlobalMemorySlot(const std::shared_ptr< HiCR::GlobalMemorySlot > &globalSlot) const
Definition communicationManager.hpp:148
__INLINE__ void memcpy(const std::shared_ptr< LocalMemorySlot > &destination, size_t dst_offset, const std::shared_ptr< LocalMemorySlot > &source, size_t src_offset, size_t size)
Definition communicationManager.hpp:267
__INLINE__ void fence(GlobalMemorySlot::tag_t tag)
Definition communicationManager.hpp:377
virtual std::shared_ptr< GlobalMemorySlot > deserializeGlobalMemorySlot(uint8_t *buffer, GlobalMemorySlot::tag_t tag)
Definition communicationManager.hpp:161
virtual void destroyPromotedGlobalMemorySlot(const std::shared_ptr< GlobalMemorySlot > &memorySlot)
Definition communicationManager.hpp:236
Definition memoryManager.hpp:51
__INLINE__ void freeLocalMemorySlot(const std::shared_ptr< HiCR::LocalMemorySlot > &memorySlot)
Definition memoryManager.hpp:138
virtual std::shared_ptr< LocalMemorySlot > registerLocalMemorySlot(const std::shared_ptr< HiCR::MemorySpace > &memorySpace, void *const ptr, const size_t size)
Definition memoryManager.hpp:86
__INLINE__ std::shared_ptr< LocalMemorySlot > allocateLocalMemorySlot(const std::shared_ptr< MemorySpace > &memorySpace, const size_t size)
Definition memoryManager.hpp:66
Definition dataObject.hpp:79
Definition objectStore.hpp:115
__INLINE__ std::shared_ptr< DataObject > deserialize(const handle &handle)
Definition objectStore.hpp:330
__INLINE__ handle serialize(DataObject &dataObject)
Definition objectStore.hpp:309
__INLINE__ std::shared_ptr< DataObject > createObject(std::shared_ptr< LocalMemorySlot > slot, blockId id)
Definition objectStore.hpp:178
__INLINE__ void destroy(DataObject &dataObject)
Definition objectStore.hpp:285
~ObjectStore()=default
__INLINE__ void publish(std::shared_ptr< DataObject > dataObject)
Definition objectStore.hpp:190
__INLINE__ std::shared_ptr< LocalMemorySlot > get(DataObject &dataObject)
Definition objectStore.hpp:250
ObjectStore(CommunicationManager &communicationManager, GlobalMemorySlot::tag_t tag, MemoryManager &memoryManager, std::shared_ptr< MemorySpace > memorySpace, Instance::instanceId_t instanceId)
Definition objectStore.hpp:127
__INLINE__ bool fence(const std::shared_ptr< DataObject > &dataObject)
Definition objectStore.hpp:370
std::shared_ptr< MemorySpace > getMemorySpace() const
Definition objectStore.hpp:149
__INLINE__ std::shared_ptr< DataObject > createObject(void *ptr, size_t size, blockId id)
Definition objectStore.hpp:161
Provides a definition for the base backend's communication manager class.
Provides a definition for a HiCR Global Memory Slot class.
Provides a definition for the HiCR Instance class.
Provides a definition for the base backend's memory manager class.
Provides functionality for a data object over HiCR.
Definition dataObject.hpp:45
uint8_t serializedGlobalSlot[28+sizeof(size_t)]
Definition dataObject.hpp:64
Instance::instanceId_t instanceId
Definition dataObject.hpp:49
Generated by