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
}