GTPin
Public Types | Public Member Functions

Type of an HLI function argument. More...

#include <igt_iarg.h>

Public Types

enum  ENUM {
  INVALID,
  PRIME,
  HOST_PTR,
  DEVICE_PTR,
  BUFFER_OFFSET,
  TID,
  FFTID,
  GRF_RANGE,
  CONST_GRF_RANGE,
  SIMD_MASK,
  INS_OP_MASK,
  SLM_PTR
}

Public Member Functions

constexpr GtIargType (ENUM e=INVALID)
 Conversion constructor.
constexpr operator ENUM () const
 Conversion operator.
constexpr bool IsValid () const
 Return true for a valid argument type.
constexpr bool IsPrime () const
 Return true for a primary argument type.
constexpr bool IsHostPtr () const
 Return true for a host pointer.
constexpr bool IsDevicePtr () const
 Return true for a device pointer.
constexpr bool IsBufferOffset () const
 Return true for an offset in profile buffer.
constexpr bool IsTid () const
 Return true if argument is the current TID.
constexpr bool IsFfTid () const
 Return true if argument is the current FFTID.
constexpr bool IsSlmPtr () const
 Return true if argument is the current SLM_PTR.
const char * ToString () const
 Return string representation.
constexpr bool IsCompatible (GtHliParamType paramType) const
 Check to see if this argument type is compatible with the specified parameter type.

Detailed Description

Type of an HLI function argument.

This type specifies how the HLI function argument should be treated before passing it to the function (assigning to the function parameter). For example, if function paramter is a pointer in the device (GPU) space, and the corresponding argument is a pointer in the host (CPU) space, GTPin must perform host-to-device pointer conversion before passing the argument value to the function.

Note:
The function parameter refer to the variable listed inside the parentheses in the function definition.
The function argument is the value that is passed to the function when it is called
The parameter type and the argument type are not always identical, but argument value must be convertible to the corresponding parameter type. The conversion is provided by either compiler or GTPin

Folowing list provides allowed argument-to-parameter assignments and corresponding conversions and computations automatically performed by GTPin

Types of HLI function arguments

GtIargType::PRIME An argument of prime type passed by value
Function parameter: any prime type
Argument value: any prime type
Specified by: immediate, register, or IargPrime structure
Argument conversion: none
Factory method: IGtIargFactory::MakePrime

GtIargType::HOST_PTR Pointer in the host memory, converted into device address. See IGtMemoryMapper for details of the host-to-device memory mapping Function parameter: pointer in the device memory
Argument value: pointer in the host memory
Specified by: immediate or IargHostPtr structure
Argument conversion: host-to-device address mapping
Factory method: IGtIargFactory::MakeHostPtr

GtIargType::DEVICE_PTR Address in the device memory space, passed by register value Function parameter: pointer in the device memory
Argument value: pointer in the device memory
Specified by: register or IargDevicePtr structure
Argument conversion: none
Factory method: IGtIargFactory::MakeDevicePtr

GtIargType::BUFFER_OFFSET Offset in the GTPin profile buffer, converted into device address
Function parameter: pointer in the device memory
Argument value: offset in the GTPin profile buffer
Specified by: immediate, register, or IargBufferOffset structure
Argument conversion: buffer offset-to-address mapping
Factory method: IGtIargFactory::MakeBufferOffset

GtIargType::TID HW thread ID extracted from the State Register
Function parameter: 32-bit integer
Argument value: void
Specified by: IargTid structure
Argument conversion: Thread ID extracted from the State Register
Factory method: IGtIargFactory::MakeTid

GtIargType::FFTID Fixed Function Thread ID extracted from the State Register Function parameter: 32-bit integer
Argument value: void
Specified by: IargFfTid structure
Argument conversion: Fixed Function Thread ID extracted from the State Register
Factory method: IGtIargFactory::MakeFfTid

GtIargType::GRF_RANGE Mutable GRF range
Function parameter: pointer to a mutable array of GRF registers
Argument value: GRF range
Specified by: IargGrfRange structure
Argument conversion: Map GRF range into an array in device memory. Set array's address in the parameter
Factory method: IGtIargFactory::MakeGrfRange

GtIargType::CONST_GRF_RANGE Immutable GRF range
Function parameter: pointer to a constant array of GRF registers
Argument value: GRF range
Specified by: IargConstGrfRange structure
Argument conversion: Copy GRF range into an array in device memory. Set array's address in the parameter
Factory method: IGtIargFactory::MakeConstGrfRange

GtIargType::SIMD_MASK Mask of effective SIMD channels
Function parameter: 32-bit integer
Specified by: IargSimdMask structure
Factory method: IGtIargFactory::MakeSimdMask

GtIargType::INS_OP_MASK Mask of scalar operations performed by the instruction on the vector of data elements
Function parameter: 32-bit integer
Specified by: IargInsOpMask structure
Factory method: IGtIargFactory::MakeInsOpMask

* GtIargType::SLM_PTR Pointer to the base of SLM (should be 0)
Function parameter: 32-bit integer
Specified by: IargSlmPtr structure
Factory method: IGtIargFactory::MakeIargSlmPtr


Member Enumeration Documentation

Enumerator:
INVALID 

Invalid HLI argument type.

PRIME 

Primary HLI argument type: integer, floating-point, enumeration.

HOST_PTR 

Pointer to a variable in the host (CPU) address space.

DEVICE_PTR 

Pointer to a variable in the device (GPU) address space.

BUFFER_OFFSET 

Offset within the profile buffer.

TID 

Current Thread ID (TID)

FFTID 

Current Fixed Function Thread ID (FFTID)

GRF_RANGE 

Mutable GRF range.

CONST_GRF_RANGE 

Immutable GRF range.

SIMD_MASK 

Mask of effective SIMD channels.

INS_OP_MASK 

Mask of scalar operations performed by the instruction on the vector of data elements.

SLM_PTR 

Pointer to the base of SLM.


Member Function Documentation

constexpr bool gtpin::GtIargType::IsCompatible ( GtHliParamType  paramType) const [inline]

Check to see if this argument type is compatible with the specified parameter type.

The HLI function argument is called compatible with the corresponding HLI parameter if the argument value can be assigned to the function parameter. The assignment may involve the argument conversion provided by GTPin or compiler.

Parameters:
[in]paramTypeType of the HLI parameter
Returns:
true if this argument is compatible with the specified parameter type
 All Data Structures Functions Variables Typedefs Enumerations Enumerator


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