// Copyright Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT #pragma once #include #include #include #include #include #include namespace rocRoller { namespace Scheduling { /** * A subclass for cooperative scheduling * * This scheduler works by repeatedly choosing the next stream with * the minimum cost, and yielding from that stream until an * instruction with a non-zero cost is encountered. */ class CooperativeScheduler : public Scheduler { public: CooperativeScheduler(ContextPtr, CostFunction); using Base = Scheduler; static const std::string Basename; inline static const std::string Name = "CooperativeScheduler"; static bool Match(Argument arg); static std::shared_ptr Build(Argument arg); std::string name() const override; bool supportsAddingStreams() const override; Generator operator()(std::vector>& seqs) override; }; } }