#pragma once #include "engine/framework/core/execution_context.h" #include "engine/framework/runtime/session.h" #include "engine/models/roformer/assets.h" #include #include #include namespace engine::models::roformer { class RoformerRuntime { public: RoformerRuntime( std::shared_ptr assets, core::ExecutionContext & execution_context, assets::TensorStorageType weight_storage_type); ~RoformerRuntime(); const RoformerArchitectureConfig & config() const noexcept; const std::vector & separate_chunk(const std::vector & chunk_planar); // Source may run on a CPU worker while sink runs on the caller thread. // Their captured mutable state must be independent. Sink is called in order. void process_chunks(size_t count, const std::function &)> & source, const std::function &)> & sink); private: class Impl; std::shared_ptr assets_; std::unique_ptr impl_; size_t fft_threads_ = 1; }; } // namespace engine::models::roformer