| 1834 | } |
| 1835 | |
| 1836 | bool 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 | |
| 1847 | bool AllocatorFacade::IsStreamSafeCUDAAllocatorUsed() { |
| 1848 | return GetPrivate()->IsStreamSafeCUDAAllocatorUsed(); |
no test coverage detected