mfxTraceU32 MFXTraceITT_BeginTask(mfxTraceStaticHandle *static_handle ,const char * //file_name ,mfxTraceU32 //line_num ,const char * //function_name ,mfxTraceChar* //category ,mfxTraceLevel level ,const char * task_name ,mfxTraceTaskHandle *handle ,const void * /*task_params*/) { if (!static_handle || !handle) return 1; if (MFX_TRACE_LEVEL_API == level || MFX_TRACE_LEVEL_INTERNAL_VTUNE == level) { // cache string handle across task instances if (NULL == static_handle->itt1.ptr) { static_handle->itt1.ptr = __itt_string_handle_create(task_name); } // task is traced handle->itt1.uint32 = 1; __itt_task_begin(GetDomain(), __itt_null, __itt_null, (__itt_string_handle*)static_handle->itt1.ptr); } return 0; }
// Constructor // automatically creates an ITT begin marker at the start of this task //----------------------------------------------------------------------------- CPUTITTTaskMarker::CPUTITTTaskMarker(__itt_domain *pITTDomain, __itt_string_handle *pITTStringHandle) { mpITTDomain = pITTDomain; mpITTStringHandle = pITTStringHandle; __itt_task_begin(pITTDomain, __itt_null, __itt_null, pITTStringHandle); }
void TextureUploadProcessor::runLoop_() { _needRedraw = false; if( GLContext::getCurrent() != getGLContext().get( )) getGLContext()->makeCurrent(); processorInputPtr_->applyAll( CONNECTION_ID ); _checkThreadOperation(); #ifdef _ITT_DEBUG_ __itt_task_begin ( ittTextureLoadDomain, __itt_null, __itt_null, ittTextureComputationTask ); #endif //_ITT_DEBUG_ const DashRenderStatus& renderStatus = _dashTree->getRenderStatus(); if( renderStatus.getFrameID() != _currentFrameID ) { _protectUnloading.clear(); CollectVisiblesVisitor collectVisibles( _dashTree, _protectUnloading ); DFSTraversal traverser; const RootNode& rootNode = _dashTree->getDataSource()->getVolumeInformation().rootNode; traverser.traverse( rootNode, collectVisibles, renderStatus.getFrameID( )); _textureCache.setProtectList( _protectUnloading ); _currentFrameID = renderStatus.getFrameID(); } _loadData(); processorOutputPtr_->commit( CONNECTION_ID ); #ifdef _ITT_DEBUG_ __itt_task_end( ittTextureLoadDomain ); #endif //_ITT_DEBUG_ }
void RunExample() { __itt_task_begin(pD, __itt_null, __itt_null, __itt_string_handle_create(L"End of run")); for(int i = 0; i < 50; ++i) { Example(i); } __itt_task_end(pD); }
void Example(int index) { __itt_task_begin(pD, __itt_null, __itt_null, pSH1); __itt_metadata_add(pD, __itt_null, pSH2, __itt_metadata_s32, 1, (void*)&index); __itt_metadata_str_add(pD, __itt_null, pSH1, L"Example is running", 0); if(index == 10) { Sleep(30); } else { Sleep(5); /* do nothing */ } __itt_task_end(pD); }
void TextureLoaderVisitor::visit( DashRenderNode& renderNode, VisitState& state ) { const LODNode& lodNode = renderNode.getLODNode(); if( !lodNode.isValid( )) return; if( !renderNode.isInFrustum( )) { state.setVisitChild( false ); return; } if( !renderNode.isLODVisible( )) return; state.setVisitChild( false ); const ConstCacheObjectPtr texPtr = renderNode.getTextureObject(); if( texPtr->isLoaded( )) return; TextureObject& texture = _cache.getNodeTexture( lodNode.getNodeId().getId( )); if( texture.isLoaded() ) { renderNode.setTextureObject( &texture ); _output->commit( CONNECTION_ID ); return; } else { const ConstCacheObjectPtr textureData = renderNode.getTextureDataObject(); if( textureData->isLoaded( )) { #ifdef _ITT_DEBUG_ __itt_task_begin ( ittTextureLoadDomain, __itt_null, __itt_null, ittTextureLoadTask ); #endif //_ITT_DEBUG_ TextureObject& lodTexture = _cache.getNodeTexture( lodNode.getNodeId().getId( )); lodTexture.setTextureDataObject( static_cast< const TextureDataObject * >( textureData.get() ) ); lodTexture.cacheLoad(); #ifdef _ITT_DEBUG_ __itt_task_end( ittTextureLoadDomain ); #endif //_ITT_DEBUG_ renderNode.setTextureObject( &lodTexture ); renderNode.setTextureDataObject( TextureDataObject::getEmptyPtr() ); _output->commit( CONNECTION_ID ); _needRedraw = true; } else { _allLoaded = false; LBVERB << "Texture data not loaded:" << lodNode.getNodeId() << std::endl; } } if( !isSynchronous( )) // only in asynchronous mode state.setBreakTraversal( _input->dataWaitingOnInput( CONNECTION_ID )); }
void start(Module *M, Task *T) { __itt_task_begin(M, __itt_null, __itt_null, T); }