// Copyright Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT #pragma once #include #include #include #include #include #include namespace rocRoller { inline Scheduling::InstructionStatus Context::peek(Instruction const& inst) { return m_observer->peek(inst); } inline void Context::schedule(Instruction& inst) { auto status = m_observer->peek(inst); inst.setPeekedStatus(std::move(status)); m_observer->modify(inst); m_observer->observe(inst); m_instructions->schedule(inst); } template inline void Context::schedule(T const& insts) { for(Instruction const& inst : insts) { scheduleCopy(inst); } } template inline void Context::schedule(T&& insts) { for(Instruction const& inst : insts) { scheduleCopy(inst); } } inline std::shared_ptr Context::allocator(Register::Type registerType) { return m_allocators.at(static_cast(registerType)); } inline LabelAllocatorPtr Context::labelAllocator() const { return m_labelAllocator; } inline std::shared_ptr Context::ldsAllocator() const { return m_ldsAllocator; } inline GPUArchitecture const& Context::targetArchitecture() const { return m_targetArch; } inline int Context::hipDeviceIndex() const { return m_hipDeviceIdx; } inline std::shared_ptr Context::observer() const { return m_observer; } inline AssemblyKernelPtr Context::kernel() const { return m_kernel; } inline std::shared_ptr Context::argLoader() const { return m_argLoader; } inline std::shared_ptr Context::instructions() const { return m_instructions; } inline std::shared_ptr Context::mem() const { return m_mem; } inline std::shared_ptr Context::copier() const { return m_copier; } inline std::shared_ptr Context::brancher() const { return m_brancher; } inline std::shared_ptr Context::crasher() const { return m_crasher; } inline std::shared_ptr Context::random() const { return m_random; } inline KernelOptions const& Context::kernelOptions() { return m_kernelOptions; } inline std::string Context::assemblyFileName() const { return m_assemblyFileName; } inline RegTagManPtr Context::registerTagManager() const { return m_registerTagMan; } }