Lines Matching refs:stream
201 inline PetscErrorCode MemoryChunk<E>::release(const device::StreamBase<U> *stream) noexcept in release() argument
205 stream_id_ = stream->get_id(); in release()
206 PetscCall(stream->record_event(event_)); in release()
223 inline PetscErrorCode MemoryChunk<E>::claim(const device::StreamBase<U> *stream, size_type req_size… in claim() argument
226 if ((*success = can_claim(stream, req_size, serialize))) { in claim()
227 if (serialize && !stream_compat_(stream)) PetscCall(stream->wait_for_event(event_)); in claim()
247 inline bool MemoryChunk<E>::can_claim(const device::StreamBase<U> *stream, size_type req_size, bool… in can_claim() argument
251 if (stream_compat_(stream)) return true; in can_claim()
347 PetscErrorCode MemoryBlock<T, A, S>::clear_(const stream_type *stream) noexcept in clear_() argument
351 PetscCall(allocator_->deallocate(mem_, stream)); in clear_()
366 …ryBlock(allocator_type *alloc, size_type s, const device::StreamBase<U> *stream) noexcept : alloca… in MemoryBlock() argument
369 PetscCallAbort(PETSC_COMM_SELF, alloc->allocate(&mem_, s, stream)); in MemoryBlock()
377 stream_type stream; in ~MemoryBlock() local
380 PetscCallAbort(PETSC_COMM_SELF, clear_(&stream)); in ~MemoryBlock()
394 stream_type stream; in operator =() local
396 PetscCallAbort(PETSC_COMM_SELF, clear_(&stream)); in operator =()
430 …, S>::try_allocate_chunk(size_type req_size, T **ptr, const stream_type *stream, bool *success) no… in try_allocate_chunk() argument
442 PetscCall(chunks_.back().claim(stream, req_size, success)); in try_allocate_chunk()
451 PetscCall(chunk.claim(stream, req_size, success, serialize)); in try_allocate_chunk()
475 while (chunks_.back().can_claim(stream, 0, false)) { in try_allocate_chunk()
514 inline PetscErrorCode MemoryBlock<T, A, S>::try_deallocate_chunk(T **ptr, const stream_type *stream… in try_deallocate_chunk() argument
521 PetscCall(chunk->release(stream)); in try_deallocate_chunk()
724 …Type, AllocType, DefaultChunkSize>::make_block_(size_type size, const stream_type *stream) noexcept in make_block_() argument
729 PetscCallCXX(pool_.emplace_back(&allocator_, block_size, stream)); in make_block_()
735 …e, StreamType, AllocType, DefaultChunkSize>::register_finalize_(const stream_type *stream) noexcept in register_finalize_() argument
738 PetscCall(make_block_(chunk_size_, stream)); in register_finalize_()
752 … DefaultChunkSize>::allocate_(size_type size, value_type **ptr, const stream_type *stream) noexcept in allocate_() argument
757 PetscCall(this->register_finalize(stream)); in allocate_()
759 PetscCall(block.try_allocate_chunk(size, ptr, stream, &found)); in allocate_()
765 PetscCall(make_block_(size, stream)); in allocate_()
767 PetscCall(pool_.back().try_allocate_chunk(size, ptr, stream, &found)); in allocate_()
796 …unkSize>::allocate(size_t req_size, value_type **ptr, const stream_type *stream, size_type alignme… in allocate() argument
802 PetscAssertPointer(stream, 3); in allocate()
808 PetscCall(allocate_(aligned_size, &ret_ptr, stream)); in allocate()
813 if (PetscDefined(USE_DEBUG)) PetscCall(allocator_.set_canary(ret_ptr, size, stream)); in allocate()
830 …ype, AllocType, DefaultChunkSize>::deallocate(value_type **ptr, const stream_type *stream) noexcept in deallocate() argument
834 PetscAssertPointer(stream, 2); in deallocate()
840 PetscCall(block.try_deallocate_chunk(ptr, stream, &found)); in deallocate()
863 …ltChunkSize>::reallocate(size_t new_req_size, value_type **ptr, const stream_type *stream) noexcept in reallocate() argument
873 PetscAssertPointer(stream, 3); in reallocate()
877 PetscCall(deallocate(ptr, stream)); in reallocate()
891 PetscCall(chunk->release(stream)); in reallocate()
892 PetscCall(allocate(new_size, ptr, stream)); in reallocate()
893 PetscCall(allocator_.uninitialized_copy(*ptr, old_ptr, new_size, stream)); in reallocate()