GTPin
Public Member Functions
gtpin::IGtHliLibrary Class Reference

Collection of the High-Level Instrumentation (HLI) modules. More...

#include <igt_hli_library.h>

Public Member Functions

virtual IGtHliModuleHandle AddModule (ConstByteSpan spirv, const char *name=nullptr, bool isScalar=true)=0
 Add an HLI module to this library.
virtual IGtHliModuleHandle LoadModule (const char *fileName, const char *name=nullptr, bool isScalar=true)=0
 Load an HLI module from the specified file and add it to this library.
virtual IGtHliModuleHandle CompileModule (const char *source, GtHliLanguage language=GtHliLanguage::OPENCL_C, GtHliCompilationOptions options={}, const char *name=nullptr, bool isScalar=true)=0
 Compile the specifed source to the SPIR-V representation, and add the compiled module to this library.
virtual IGtHliModuleHandle CompileModuleFromFile (const char *filePath, GtHliLanguage language=GtHliLanguage::OPENCL_C, GtHliCompilationOptions options={}, const char *name=nullptr, bool isScalar=true)=0
 Compile the specifed source file to the SPIR-V representation, and add the compiled module to this library.
virtual uint32_t NumModules () const =0
virtual IGtHliModuleHandle GetModule (uint32_t ordNum) const =0
 Get handle to the HLI module specified by its ordinal number.
virtual bool HasModule (IGtHliModuleHandle moduleHandle) const =0
 Check to see if this library contains HLI module with the specified handle.
virtual IGtHliModuleHandle FindModule (const char *name) const =0
 Find HLI module with the specified name.

Detailed Description

Collection of the High-Level Instrumentation (HLI) modules.

The HLI library contains HLI modules, compiled to the SPIR-V representation.

Availability:
  • Anytime and anywhere

Member Function Documentation

virtual IGtHliModuleHandle gtpin::IGtHliLibrary::AddModule ( ConstByteSpan  spirv,
const char *  name = nullptr,
bool  isScalar = true 
) [pure virtual]

Add an HLI module to this library.

Parameters:
[in]spirvContent of the HLI module in the SPIRV format
[in]nameOptional name of the module
[in]isScalartrue - always build this HLI module in SIMD1 false - build this HLI module in SIMD of the module being instrumented
Returns:
Handle to the new module, or nullptr if the module could not be added to the library. In case of error, the IGtCore::LastError() function provides the specific failure reason
virtual IGtHliModuleHandle gtpin::IGtHliLibrary::CompileModule ( const char *  source,
GtHliLanguage  language = GtHliLanguage::OPENCL_C 
) [pure virtual]

Compile the specifed source to the SPIR-V representation, and add the compiled module to this library.

Parameters:
[in]sourceSource code of the HLI module
[in]languageThe source language
[in]optionsThe module's compilation options
[in]nameOptional name of the module
[in]isScalartrue - always build this HLI module in SIMD1 false - build this HLI module in SIMD of the module being instrumented
Returns:
Handle to the new module, or nullptr if the module could not be added to the library. In case of error, the IGtCore::LastError() function provides the specific failure reason
virtual IGtHliModuleHandle gtpin::IGtHliLibrary::CompileModuleFromFile ( const char *  filePath,
GtHliLanguage  language = GtHliLanguage::OPENCL_C 
) [pure virtual]

Compile the specifed source file to the SPIR-V representation, and add the compiled module to this library.

Parameters:
[in]filePathPath of the file that contains source code of the HLI module
[in]languageThe source language
[in]optionsThe module's compilation options
[in]nameOptional name of the module
[in]isScalartrue - always build this HLI module in SIMD1 false - build this HLI module in SIMD of the module being instrumented
Returns:
Handle to the new module, or nullptr if the module could not be added to the library. In case of error, the IGtCore::LastError() function provides the specific failure reason
virtual IGtHliModuleHandle gtpin::IGtHliLibrary::FindModule ( const char *  name) const [pure virtual]

Find HLI module with the specified name.

Parameters:
[in]nameThe name assigned to the module
Returns:
Handle to the function, or nullptr if the module is not found in this library
virtual IGtHliModuleHandle gtpin::IGtHliLibrary::GetModule ( uint32_t  ordNum) const [pure virtual]

Get handle to the HLI module specified by its ordinal number.

Precondition:
ordNum is an integer in the [0, NumModules()] range
Returns:
Handle to the requested module
virtual bool gtpin::IGtHliLibrary::HasModule ( IGtHliModuleHandle  moduleHandle) const [pure virtual]

Check to see if this library contains HLI module with the specified handle.

Parameters:
[in]moduleHandleThe handle to be checked
Returns:
True, if this library contains a module with the specified handle, false - otherwise
virtual IGtHliModuleHandle gtpin::IGtHliLibrary::LoadModule ( const char *  fileName,
const char *  name = nullptr,
bool  isScalar = true 
) [pure virtual]

Load an HLI module from the specified file and add it to this library.

Parameters:
[in]fileNameFull name of the file that contains HLI module in the SPIRV format
[in]nameOptional name of the module
[in]isScalartrue - always build this HLI module in SIMD1 false - build this HLI module in SIMD of the module being instrumented
Returns:
Handle to the loaded module, or nullptr if the module loading failed. In case of error, the IGtCore::LastError() function provides the specific failure reason
virtual uint32_t gtpin::IGtHliLibrary::NumModules ( ) const [pure virtual]
Returns:
Number of HLI modules in this library
 All Data Structures Functions Variables Typedefs Enumerations Enumerator


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