MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / InSameStream

Method InSameStream

paddle/phi/core/memory/allocation/allocator_facade.cc:1836–1845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1834}
1835
1836bool AllocatorFacade::InSameStream(
1837 const std::shared_ptr<phi::Allocation>& allocation,
1838 const phi::Stream& stream) {
1839#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
1840 gpuStream_t s = reinterpret_cast<gpuStream_t>(stream.id()); // NOLINT
1841 return s == GetStream(allocation);
1842#else
1843 PADDLE_THROW(common::errors::PreconditionNotMet("Not compiled with GPU."));
1844#endif
1845}
1846
1847bool AllocatorFacade::IsStreamSafeCUDAAllocatorUsed() {
1848 return GetPrivate()->IsStreamSafeCUDAAllocatorUsed();

Callers 1

InSameStreamFunction · 0.45

Calls 2

GetStreamFunction · 0.85
idMethod · 0.45

Tested by

no test coverage detected