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
157 lines
5.4 KiB
C++
157 lines
5.4 KiB
C++
// Copyright Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include <rocRoller/Serialization/Base_fwd.hpp>
|
|
|
|
namespace rocRoller
|
|
{
|
|
/**
|
|
* These represent the individual wait queues that exist on a GPU.
|
|
*/
|
|
enum class GPUWaitQueueType : int
|
|
{
|
|
LoadQueue = 0,
|
|
StoreQueue,
|
|
SendMsgQueue,
|
|
SMemQueue,
|
|
DSQueue,
|
|
EXPQueue,
|
|
VSQueue,
|
|
TensorQueue,
|
|
FinalInstruction,
|
|
None,
|
|
Count,
|
|
};
|
|
|
|
std::string toString(GPUWaitQueueType);
|
|
|
|
/**
|
|
* These represent an individual register that a s_waitcnt instruction can target.
|
|
*/
|
|
enum class GPUWaitQueue : int
|
|
{
|
|
LoadQueue = 0,
|
|
StoreQueue,
|
|
KMQueue,
|
|
DSQueue,
|
|
EXPQueue,
|
|
VSQueue,
|
|
TensorQueue,
|
|
None,
|
|
Count,
|
|
};
|
|
|
|
constexpr GPUWaitQueue fromWaitQueueType(GPUWaitQueueType input);
|
|
|
|
std::string toString(GPUWaitQueue input);
|
|
|
|
enum class CoexecCategory : int
|
|
{
|
|
NotAnInstruction = 0,
|
|
Scalar,
|
|
VMEM,
|
|
VALU,
|
|
VALU_Trans,
|
|
XDL,
|
|
XDL_Scale,
|
|
LDS,
|
|
Count
|
|
};
|
|
|
|
std::string toString(CoexecCategory cat);
|
|
|
|
class GPUInstructionInfo
|
|
{
|
|
public:
|
|
GPUInstructionInfo() = default;
|
|
GPUInstructionInfo(std::string const& instruction,
|
|
int waitcnt,
|
|
std::vector<GPUWaitQueueType> const& waitQueues,
|
|
int latency = 0,
|
|
bool implicitAccess = false,
|
|
bool branch = false,
|
|
unsigned int maxOffsetValue = 0);
|
|
|
|
std::string getInstruction() const;
|
|
int getWaitCount() const;
|
|
std::vector<GPUWaitQueueType> getWaitQueues() const;
|
|
int getLatency() const;
|
|
bool hasImplicitAccess() const;
|
|
bool isBranch() const;
|
|
unsigned int maxOffsetValue() const;
|
|
|
|
friend std::ostream& operator<<(std::ostream& os, const GPUInstructionInfo& d);
|
|
|
|
template <typename T1, typename T2, typename T3>
|
|
friend struct rocRoller::Serialization::MappingTraits;
|
|
|
|
/**
|
|
* Static functions below are for checking instruction type.
|
|
* The input to these functions is the op name.
|
|
* @{
|
|
*/
|
|
static bool isDLOP(std::string const& inst);
|
|
static bool isMFMA(std::string const& inst);
|
|
static bool isWMMA(std::string const& inst);
|
|
static bool isSWMMAC(std::string const& inst);
|
|
static bool isVCMPX(std::string const& inst);
|
|
static bool isVCMP(std::string const& inst);
|
|
|
|
static bool isScalar(std::string const& inst);
|
|
static bool isSMEM(std::string const& inst);
|
|
static bool isSBarrier(std::string const& opCode);
|
|
static bool isSControl(std::string const& inst);
|
|
static bool isSALU(std::string const& inst);
|
|
static bool isIntInst(std::string const& inst);
|
|
static bool isUIntInst(std::string const& inst);
|
|
|
|
static bool isVector(std::string const& inst);
|
|
static bool isVALU(std::string const& inst);
|
|
static bool isVALUTrans(std::string const& inst);
|
|
static bool isDGEMM(std::string const& inst);
|
|
static bool isSGEMM(std::string const& inst);
|
|
static bool isVMEM(std::string const& inst);
|
|
static bool isVMEMRead(std::string const& inst);
|
|
static bool isVMEMWrite(std::string const& inst);
|
|
static bool isFlat(std::string const& inst);
|
|
static bool isLDS(std::string const& inst);
|
|
static bool isLDSRead(std::string const& inst);
|
|
static bool isLDSWrite(std::string const& inst);
|
|
static bool isTensor(std::string const& inst);
|
|
|
|
static bool isACCVGPRRead(std::string const& inst);
|
|
static bool isACCVGPRWrite(std::string const& inst);
|
|
static bool isVAddInst(std::string const& inst);
|
|
static bool isVAddCarryInst(std::string const& inst);
|
|
static bool isVSubInst(std::string const& inst);
|
|
static bool isVSubCarryInst(std::string const& inst);
|
|
static bool isVReadlane(std::string const& inst);
|
|
static bool isVWritelane(std::string const& inst);
|
|
static bool isVPermlane(std::string const& inst);
|
|
static bool isVDivScale(std::string const& inst);
|
|
static bool isVDivFmas(std::string const& inst);
|
|
|
|
static CoexecCategory getCoexecCategory(std::string const& opCode);
|
|
/** @} */
|
|
|
|
private:
|
|
std::string m_instruction = "";
|
|
int m_waitCount = -1;
|
|
std::vector<GPUWaitQueueType> m_waitQueues;
|
|
int m_latency = -1;
|
|
bool m_implicitAccess = false;
|
|
bool m_isBranch = false;
|
|
unsigned int m_maxOffsetValue = 0;
|
|
};
|
|
|
|
std::string toString(GPUWaitQueue);
|
|
std::string toString(GPUWaitQueueType);
|
|
}
|
|
|
|
#include <rocRoller/GPUArchitecture/GPUInstructionInfo_impl.hpp>
|