CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
134 lines
3.0 KiB
C++
134 lines
3.0 KiB
C++
// Copyright Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#pragma once
|
|
|
|
#include <rocRoller/Context.hpp>
|
|
|
|
#include <rocRoller/CodeGen/Instruction.hpp>
|
|
#include <rocRoller/GPUArchitecture/GPUArchitecture.hpp>
|
|
#include <rocRoller/GPUArchitecture/GPUArchitectureLibrary.hpp>
|
|
#include <rocRoller/ScheduledInstructions.hpp>
|
|
#include <rocRoller/Scheduling/Scheduling.hpp>
|
|
|
|
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 <std::ranges::input_range T>
|
|
inline void Context::schedule(T const& insts)
|
|
{
|
|
for(Instruction const& inst : insts)
|
|
{
|
|
scheduleCopy(inst);
|
|
}
|
|
}
|
|
|
|
template <std::ranges::input_range T>
|
|
inline void Context::schedule(T&& insts)
|
|
{
|
|
for(Instruction const& inst : insts)
|
|
{
|
|
scheduleCopy(inst);
|
|
}
|
|
}
|
|
|
|
inline std::shared_ptr<Register::Allocator> Context::allocator(Register::Type registerType)
|
|
{
|
|
return m_allocators.at(static_cast<int>(registerType));
|
|
}
|
|
|
|
inline LabelAllocatorPtr Context::labelAllocator() const
|
|
{
|
|
return m_labelAllocator;
|
|
}
|
|
|
|
inline std::shared_ptr<LDSAllocator> 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<Scheduling::IObserver> Context::observer() const
|
|
{
|
|
return m_observer;
|
|
}
|
|
|
|
inline AssemblyKernelPtr Context::kernel() const
|
|
{
|
|
return m_kernel;
|
|
}
|
|
|
|
inline std::shared_ptr<ArgumentLoader> Context::argLoader() const
|
|
{
|
|
return m_argLoader;
|
|
}
|
|
|
|
inline std::shared_ptr<ScheduledInstructions> Context::instructions() const
|
|
{
|
|
return m_instructions;
|
|
}
|
|
|
|
inline std::shared_ptr<MemoryInstructions> Context::mem() const
|
|
{
|
|
return m_mem;
|
|
}
|
|
|
|
inline std::shared_ptr<CopyGenerator> Context::copier() const
|
|
{
|
|
return m_copier;
|
|
}
|
|
|
|
inline std::shared_ptr<BranchGenerator> Context::brancher() const
|
|
{
|
|
return m_brancher;
|
|
}
|
|
|
|
inline std::shared_ptr<CrashKernelGenerator> Context::crasher() const
|
|
{
|
|
return m_crasher;
|
|
}
|
|
|
|
inline std::shared_ptr<RandomGenerator> 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;
|
|
}
|
|
}
|