Lines Matching defs:HstPtr

465     void *HstPtr;
487 EntryTy(void *HstPtr, void *DevAccessiblePtr, size_t Size,
489 : HstPtr(HstPtr), DevAccessiblePtr(DevAccessiblePtr), Size(Size),
493 EntryTy(void *HstPtr)
494 : HstPtr(HstPtr), DevAccessiblePtr(nullptr), Size(0),
502 return Left.HstPtr < Right.HstPtr;
523 /// Find an allocation that intersects with \p HstPtr pointer. Assume the
525 const EntryTy *findIntersecting(const void *HstPtr) const {
531 auto It = Allocs.lower_bound({const_cast<void *>(HstPtr)});
534 if (It != Allocs.end() && It->HstPtr == HstPtr)
547 if (utils::advancePtr(It->HstPtr, It->Size) > HstPtr)
556 Error insertEntry(void *HstPtr, void *DevAccessiblePtr, size_t Size,
563 /// also that the registered buffer with \p HstPtr address and \p Size is
565 Error registerEntryUse(const EntryTy &Entry, void *HstPtr, size_t Size);
619 /// this new one. The registration requires the host pointer in \p HstPtr,
623 Error registerHostBuffer(void *HstPtr, void *DevAccessiblePtr, size_t Size);
629 Error unregisterHostBuffer(void *HstPtr);
631 /// Lock the host buffer at \p HstPtr or register a new user if it intersects
635 Expected<void *> lockHostBuffer(void *HstPtr, size_t Size);
637 /// Unlock the host buffer at \p HstPtr or unregister a user if other users
640 Error unlockHostBuffer(void *HstPtr);
646 Error lockMappedHostBuffer(void *HstPtr, size_t Size);
649 Error unlockUnmappedHostBuffer(void *HstPtr);
652 /// allocation which the \p HstPtr belongs, if any. Return null in case the
653 /// \p HstPtr does not belong to any host pinned allocation. The device
656 void *getDeviceAccessiblePtrFromPinnedBuffer(const void *HstPtr) const {
660 const EntryTy *Entry = findIntersecting(HstPtr);
665 utils::getPtrDiff(HstPtr, Entry->HstPtr));
669 bool isHostPinnedBuffer(const void *HstPtr) const {
673 return (findIntersecting(const_cast<void *>(HstPtr)) != nullptr);
773 Expected<void *> dataLock(void *HstPtr, int64_t Size) {
774 return PinnedAllocs.lockHostBuffer(HstPtr, Size);
778 Error dataUnlock(void *HstPtr) {
779 return PinnedAllocs.unlockHostBuffer(HstPtr);
782 /// Lock the host buffer \p HstPtr with \p Size bytes with the vendor-specific
784 virtual Expected<void *> dataLockImpl(void *HstPtr, int64_t Size) = 0;
786 /// Unlock a previously locked host buffer starting at \p HstPtr.
787 virtual Error dataUnlockImpl(void *HstPtr) = 0;
789 /// Mark the host buffer with address \p HstPtr and \p Size bytes as a mapped
794 Error notifyDataMapped(void *HstPtr, int64_t Size) {
795 return PinnedAllocs.lockMappedHostBuffer(HstPtr, Size);
798 /// Mark the host buffer with address \p HstPtr as unmapped. This means that
801 Error notifyDataUnmapped(void *HstPtr) {
802 return PinnedAllocs.unlockUnmappedHostBuffer(HstPtr);
805 /// Check whether the host buffer with address \p HstPtr is pinned by the
808 virtual Expected<bool> isPinnedPtrImpl(void *HstPtr, void *&BaseHstPtr,
813 Error dataSubmit(void *TgtPtr, const void *HstPtr, int64_t Size,
815 virtual Error dataSubmitImpl(void *TgtPtr, const void *HstPtr, int64_t Size,
819 Error dataRetrieve(void *HstPtr, const void *TgtPtr, int64_t Size,
821 virtual Error dataRetrieveImpl(void *HstPtr, const void *TgtPtr, int64_t Size,
1256 int32_t data_notify_mapped(int32_t DeviceId, void *HstPtr, int64_t Size);
1259 int32_t data_notify_unmapped(int32_t DeviceId, void *HstPtr);
1262 int32_t data_submit(int32_t DeviceId, void *TgtPtr, void *HstPtr,
1266 int32_t data_submit_async(int32_t DeviceId, void *TgtPtr, void *HstPtr,
1270 int32_t data_retrieve(int32_t DeviceId, void *HstPtr, void *TgtPtr,
1274 int32_t data_retrieve_async(int32_t DeviceId, void *HstPtr, void *TgtPtr,