GTPin

- Main Page
- Related Pages
- Modules
- Data Structures

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Public Member Functions
gtpin::GtMapped< MM, VARS > Class Template Reference
GTPin: Host-to-Device Memory Mapper

Template container of host-to-device mapped variables. More...

`#include <igt_memory_mapper.h>`

## Public Member Functions
| GtMapped (const VARS &...vars)
| Constructor.
void | Map (IGtMemoryMapper &mapper) const
| Map all variables in this container using the specified memory mapper.

## Detailed Description

### template<GT_MMAP_METHOD MM, typename... VARS>
class gtpin::GtMapped< MM, VARS >

Template container of host-to-device mapped variables.

Parameters:

  MM | The method of the memory mapping and sharing
  VARS | Types of variables to be mapped

       Usage:
          auto mySharedVars      = GtMakeShared(myVar1, myVar2);        // Declare myVar... variables as host<->device synchronized
          auto mySharedConstVars = GtMakeSharedConst(myCvar1, myCvar2); // Declare myCvar... variables as host->device synchronized
          auto mySharedRetVars   = GtMakeSharedRet(myRvar1, myRvar2);   // Declare myRvar... variables as host<-device synchronized

          MyTool::OnKernelBuild(IGtKernelInstrument& instrumentor)
          {
              auto& mapper = instrumentor.MemoryMapper();
              mySharedVars.Map(mapper);        // Share myVar... variables using GT_MMAP_SHARE method
              mySharedConstVars.Map(mapper);   // Share myCvar... variables using GT_MMAP_SHARE_CONST method
              mySharedRetVars.Map(mapper);     // Share myRvar... variables using GT_MMAP_SHARE_RET method
          }

## Constructor & Destructor Documentation

template<GT_MMAP_METHOD MM, typename... VARS>

gtpin::GtMapped< MM, VARS >::GtMapped | ( | const VARS &... | vars | ) | `[inline]`

Constructor.

Parameters:

  [in] | vars | List of variables to be mapped

## Member Function Documentation

template<GT_MMAP_METHOD MM, typename... VARS>

void gtpin::GtMapped< MM, VARS >::Map | ( | IGtMemoryMapper & | mapper | ) | const`[inline]`

Map all variables in this container using the specified memory mapper.

Parameters:

  [in] | mapper | Object that provides the host-to-device memory mapping service

Availability:
  - IGtTool::OnKernelBuild

All Data Structures Functions Variables Typedefs Enumerations Enumerator

      Copyright (C) 2013-2025 Intel Corporation

      SPDX-License-Identifier: MIT