GTPin
Public Member Functions
gtpin::IGtVregFactory Class Reference

Factory and container of virtual registers. More...

#include <igt_vreg_factory.h>

Public Member Functions

virtual const IGtVregMake (GtVregType type=VREG_TYPE_DWORD, uint32_t flags=VREG_FLAG_NONE, GtSubRegNum subRegNum=GtSubRegNum::Invalid())=0
 Create a new virtual register with the specified properties and store it in the factory's container.
virtual const IGtVregGet (GtVregNum vn) const =0
 Get virtual register with the specified ordinal number.
virtual const IGtVregGetProfileBufferAddrVreg () const =0
 Get a special virtual register intended to hold address of the profile buffer in GPU.
virtual bool Contains (GtVregNum vn) const =0
 Check to see if a virtual register with the specified ordinal number exists.
virtual uint32_t Size () const =0
 Return number of virtual registers in this container.
virtual void Clear ()=0
 Remove all virtual registers created by this factory.
virtual const IGtVregMakeCounter (GtVregType type=VREG_TYPE_DWORD)=0
 Return Virtual register of the specified type, zero-initialized on entry to the kernel.
virtual const IGtVregMakeScratch (GtVregType type=VREG_TYPE_DWORD)=0
 Return Scratch virtual register of the specified type.
virtual const IGtVregMakeMsgAddrScratch (GtVregType type=VREG_TYPE_PTR)=0
 Return Scratch virtual register of the specified type, intended to hold a SEND message address payload.
virtual const IGtVregMakeMsgDataScratch (GtVregType type=VREG_TYPE_DWORD)=0
 Return Scratch virtual register of the specified type, intended to hold a SEND message data payload.
virtual uint32_t GetVregSize (GtVregType type) const =0
 Given vreg type, return the register size in bytes.

Detailed Description

Factory and container of virtual registers.

Availability:

Member Function Documentation

virtual bool gtpin::IGtVregFactory::Contains ( GtVregNum  vn) const [pure virtual]

Check to see if a virtual register with the specified ordinal number exists.

Parameters:
[in]vnOrdinal number of the virtual register
Returns:
true, if this container holds a virtual register with the specified ordinal number
virtual const IGtVreg& gtpin::IGtVregFactory::Get ( GtVregNum  vn) const [pure virtual]

Get virtual register with the specified ordinal number.

Parameters:
[in]vnOrdinal number of the virtual register
Precondition:
Contains(vn)
Returns:
The requested virtual register
virtual const IGtVreg& gtpin::IGtVregFactory::GetProfileBufferAddrVreg ( ) const [pure virtual]

Get a special virtual register intended to hold address of the profile buffer in GPU.

The returned register could be invalid, if GPU platform of this factory does not use a register to hold pointer to the profile buffer. For example, some GPU platforms pass the buffer address in a binding table entry rather than in a GRF register.
GTPin initializes this register at entry to the kernel. It is assumed that instrumentation procedures do not modify the value of this register, and use it as a read-only virtual register.

virtual const IGtVreg& gtpin::IGtVregFactory::Make ( GtVregType  type = VREG_TYPE_DWORD,
uint32_t  flags = VREG_FLAG_NONE,
GtSubRegNum  subRegNum = GtSubRegNum::Invalid() 
) [pure virtual]

Create a new virtual register with the specified properties and store it in the factory's container.

Parameters:
[in]typeType of the register.
[in]flagsCombination of VREG_FLAG values
[in]subRegNumIf valid, specifies required subregister number for this vreg. Invalid value means that this vreg has no restriction on physical subregister number assignment
Returns:
Reference to the new virtual register
Precondition:
Size of the virtual register, as implied by its type, should not exceed maximum size of physical registers in the GEN model, associated with the factory (see IGtGenModel::GrfRegSize()).
 All Data Structures Functions Variables Typedefs Enumerations Enumerator


  Copyright (C) 2013-2025 Intel Corporation
SPDX-License-Identifier: MIT