#if !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION) #pragma once #include #include namespace at::xpu { // Keep BC only using c10::CaptureId_t; using c10::MempoolId_t; struct TORCH_XPU_API MemPool { MemPool( std::shared_ptr allocator = nullptr, bool is_user_created = true, bool use_on_oom = false, bool no_split = false); C10_DISABLE_COPY_AND_ASSIGN(MemPool); MemPool(MemPool&&) = default; MemPool& operator=(MemPool&&) = default; ~MemPool(); MempoolId_t id(); int use_count(); c10::DeviceIndex device(); static MempoolId_t graph_pool_handle(bool is_user_created = true); private: static std::atomic uid_; static std::atomic uuid_; bool is_user_created_; MempoolId_t id_; c10::DeviceIndex device_; }; } // namespace at::xpu #else #error "This file should not be included when either TORCH_STABLE_ONLY or TORCH_TARGET_VERSION is defined." #endif // !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)