// Copyright Advanced Micro Devices, Inc., or its affiliates. // SPDX-License-Identifier: MIT #include #include namespace rocRoller { namespace Scheduling { int WMMAWrite::getMaxNops(const Instruction& inst) const { return m_maxNops; } bool WMMAWrite::trigger(const Instruction& inst) const { return GPUInstructionInfo::isWMMA(inst.getOpCode()); }; int WMMAWrite::getNops(const Instruction& inst) const { if(GPUInstructionInfo::isWMMA(inst.getOpCode())) { const auto& srcs = inst.getSrcs(); std::optional value; // SrcA RAW AssertFatal(nullptr != srcs.at(0), "Empty SrcA"); if((value = checkRegister(srcs.at(0)))) { return *value; } // SrcB RAW AssertFatal(nullptr != srcs.at(1), "Empty SrcB"); if((value = checkRegister(srcs.at(1)))) { return *value; } } return 0; } } }