这篇教程C++ vt_enter函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vt_enter函数的典型用法代码示例。如果您正苦于以下问题:C++ vt_enter函数的具体用法?C++ vt_enter怎么用?C++ vt_enter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vt_enter函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: phat_entervoid phat_enter(char *str, int *id) { uint64_t time; /* -- if not yet initialized, initialize VampirTrace -- */ if ( phat_init ) { uint32_t main_id; VT_MEMHOOKS_OFF(); phat_init = 0; vt_open(); main_id = register_region("main"); time = vt_pform_wtime(); vt_enter(&time, main_id); VT_MEMHOOKS_ON(); } /* -- if VampirTrace already finalized, return -- */ if ( !vt_is_alive ) return; /* -- ignore SUN OMP runtime functions -- */ if ( strchr(str, '$') != NULL ) return; VT_MEMHOOKS_OFF(); time = vt_pform_wtime(); /* -- get region identifier -- */ if ( *id == -1 ) { /* -- region entered the first time, register region -- */# if defined (VT_OMPI) || defined (VT_OMP) if (omp_in_parallel()) {# pragma omp critical (vt_comp_phat_1) { if ( (*id = hash_get((long) str)) == VT_NO_ID ) { *id = register_region(str); } } } else { *id = register_region(str); }# else *id = register_region(str);# endif } /* -- write enter record -- */ vt_enter(&time, *id); VT_MEMHOOKS_ON();}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:50,
示例2: vt_cuptievt_getOrCreateCtx/* * Retrieve the VampirTrace CUPTI context from the CUDA context. * * @param cuCtx the CUDA context * @param ptid the active VampirTrace thread id * * @return VampirTrace CUPTI context */static vt_cupti_ctx_t* vt_cuptievt_getOrCreateCtx(CUcontext cuCtx, uint32_t ptid){ vt_cupti_ctx_t *vtcuptiCtx = NULL; uint64_t time; /* check, if the current VampirTrace thread is enabled for GPU counters */ if((vt_gpu_prop[ptid] & VTGPU_NO_PC) == VTGPU_NO_PC) return NULL; time = vt_pform_wtime(); vt_enter(ptid, &time, vt_cuptievt_rid_init); /* retrieve a global VampirTrace CUPTI context */ vtcuptiCtx = vt_cupti_getCreateCtx(cuCtx); /* if the event context is not available yet, then create it */ if(NULL == vtcuptiCtx->events){ vt_cupti_events_initContext(vtcuptiCtx); } time = vt_pform_wtime(); vt_exit(ptid, &time); return vtcuptiCtx;}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:34,
示例3: VT_User_start__void VT_User_start__(const char* name, const char *file, int lno) { uint32_t rid; uint64_t time; /* -- if not yet initialized, initialize VampirTrace -- */ if ( vt_init ) { VT_MEMHOOKS_OFF(); vt_init = 0; vt_open(); VT_MEMHOOKS_ON(); } VT_MEMHOOKS_OFF(); time = vt_pform_wtime(); /* -- get region identifier -- */ if ( (rid = hash_get((unsigned long) name)) == VT_NO_ID ) { /* -- region entered the first time, register region -- */#if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); if ( (rid = hash_get((unsigned long) name)) == VT_NO_ID ) rid = register_region(name, 0, file, lno); VTTHRD_UNLOCK_IDS();#else /* VT_MT || VT_HYB */ rid = register_region(name, 0, file, lno);#endif /* VT_MT || VT_HYB */ } /* -- write enter record -- */ vt_enter(&time, rid); VT_MEMHOOKS_ON();}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:34,
示例4: VT_DECLDEFVT_DECLDEF(void __profile_loop(struct profile_gen_struct* d)){ uint64_t time; /* -- if VampirTrace already finalized, return -- */ if ( !vt_is_alive ) return; VT_MEMHOOKS_OFF(); time = vt_pform_wtime(); /* -- get region identifier -- */ if ( d->data == NULL ) { /* -- loop entered the first time, register region -- */#if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); if ( d->data == NULL ) register_region(d, VT_LOOP); VTTHRD_UNLOCK_IDS();#else /* VT_MT || VT_HYB */ register_region(d, VT_LOOP);#endif /* VT_MT || VT_HYB */ } /* -- write enter record -- */ vt_enter(&time, *((uint32_t*)(d->data))); VT_MEMHOOKS_ON();}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:30,
示例5: waitpid_t wait(WAIT_STATUS_TYPE status){ pid_t rc; uint64_t time; VT_MEMHOOKS_OFF(); if ( DO_TRACE(wait) ) { /* mark enter function */ time = vt_pform_wtime(); vt_enter(&time, libc_funcs[FUNCIDX(wait)].rid); } /* call (real) function */ CALL_FUNC(wait, rc, (status)); if ( DO_TRACE(wait) ) { /* mark leave function */ time = vt_pform_wtime(); vt_exit(&time); } VT_MEMHOOKS_ON(); return rc;}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:28,
示例6: waitpidpid_t waitpid(pid_t pid, int* status, int options){ pid_t rc; uint64_t time; VT_MEMHOOKS_OFF(); if ( DO_TRACE(waitpid) ) { /* mark enter function */ time = vt_pform_wtime(); vt_enter(&time, libc_funcs[FUNCIDX(waitpid)].rid); } /* call (real) function */ CALL_FUNC(waitpid, rc, (pid, status, options)); if ( DO_TRACE(waitpid) ) { /* mark leave function */ time = vt_pform_wtime(); vt_exit(&time); } VT_MEMHOOKS_ON(); return rc;}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:28,
示例7: systemint system(const char* string){ int rc; uint64_t time; VT_MEMHOOKS_OFF(); if ( DO_TRACE(system) ) { /* mark enter function */ time = vt_pform_wtime(); vt_enter(&time, libc_funcs[FUNCIDX(system)].rid); } /* call (real) function */ CALL_FUNC(system, rc, (string)); if ( DO_TRACE(system) ) { /* mark leave function */ time = vt_pform_wtime(); vt_exit(&time); } VT_MEMHOOKS_ON(); return rc;}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:28,
示例8: forkpid_t fork(void){ pid_t rc; uint64_t time; VT_MEMHOOKS_OFF(); if ( DO_TRACE(fork) ) { /* mark enter function */ time = vt_pform_wtime(); vt_enter(&time, libc_funcs[FUNCIDX(fork)].rid); } /* call (real) function */ CALL_FUNC(fork, rc, ()); if ( DO_TRACE(fork) ) { /* handle fork, if succeeded */ if ( rc != -1 ) vt_fork(rc); if ( rc != 0 ) { /* mark leave function */ time = vt_pform_wtime(); vt_exit(&time); } } VT_MEMHOOKS_ON(); return rc;}
开发者ID:gzt200361,项目名称:ThirdParty-2.0.0,代码行数:35,
示例9: VT_User_start__void VT_User_start__(const char* name, const char* file, int lno){ uint32_t rid; uint64_t time; VT_INIT; VT_SUSPEND_MALLOC_TRACING(VT_CURRENT_THREAD); time = vt_pform_wtime(); /* -- get region identifier by address -- */ if ( (rid = hash_get_addr((unsigned long)name)) == VT_NO_ID ) { /* -- region entered the first time, register region -- */#if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); if ( (rid = hash_get_addr((unsigned long)name)) == VT_NO_ID ) rid = register_region((unsigned long)name, name, file, lno); VTTHRD_UNLOCK_IDS();#else /* VT_MT || VT_HYB */ rid = register_region((unsigned long)name, name, file, lno);#endif /* VT_MT || VT_HYB */ } /* -- write enter record -- */ vt_enter(VT_CURRENT_THREAD, &time, rid); VT_RESUME_MALLOC_TRACING(VT_CURRENT_THREAD);}
开发者ID:Niharikareddy,项目名称:cce-mpi-openmpi-1.6.4,代码行数:30,
示例10: VT_DECLDEFVT_DECLDEF(int VT_pthread_create__(pthread_t* thread, const pthread_attr_t* attr, void *(*start_routine)(void*), void* arg)){ int rc; uint64_t time; struct vt_pthread_pack_struct* pack; if (vt_init) { vt_init = 0; vt_open(); } time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_pthread_regid[VT__PTHREAD_CREATE]); pack = (struct vt_pthread_pack_struct*)malloc( sizeof(struct vt_pthread_pack_struct)); if (pack == NULL) vt_error(); pack->start_routine = start_routine; pack->arg = arg; pack->ptid = VTThrd_getThreadId(); rc = pthread_create(thread, attr, vt_pthread_function, (void*)pack); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); return rc;}
开发者ID:315234,项目名称:OpenFOAM-2.2.x-OSX,代码行数:33,
示例11: POMP_Parallel_beginvoid POMP_Parallel_begin(struct ompregdescr* r) { if ( IS_POMP_TRACE_ON ) { struct VTRegDescr* data = (struct VTRegDescr*)(r->data); uint64_t time = vt_pform_wtime(); vt_omp_parallel_begin(); vt_enter(&time, data->rid); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:8,
示例12: POMP_Critical_beginvoid POMP_Critical_begin(struct ompregdescr* r) { if ( IS_POMP_TRACE_ON ) { struct VTRegDescr* data = (struct VTRegDescr*)(r->data); uint64_t time = vt_pform_wtime(); vt_omp_alock(&time, data->brid); vt_enter(&time, data->sbrid); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:8,
示例13: ___rouent2void ___rouent2(struct s1 *p) { uint32_t tid; uint64_t time; /* -- if not yet initialized, initialize VampirTrace -- */ if (rou_init) { rou_init = 0; vt_open(); } /* -- if VampirTrace already finalized, return -- */ if ( !vt_is_alive ) return; /* -- get calling thread id -- */ GET_THREAD_ID(tid); VT_SUSPEND_MALLOC_TRACING(tid); time = vt_pform_wtime(); if (!p->isseen) { char* rname = p->rout; char* modpos; /* fix opari output file names */ if ( (modpos = strstr(p->file, ".mod.")) != NULL ) { strcpy(modpos, modpos+4); }#if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); if (!p->isseen) { p->fid = vt_def_scl_file(tid, p->file); p->rid = vt_def_region(tid, rname, p->fid, p->lineno, VT_NO_LNO, NULL, VT_FUNCTION); p->isseen = 1; } VTTHRD_UNLOCK_IDS();#else /* VT_MT || VT_HYB */ p->fid = vt_def_scl_file(tid, p->file); p->rid = vt_def_region(tid, rname, p->fid, p->lineno, VT_NO_LNO, NULL, VT_FUNCTION); p->isseen = 1;#endif /* VT_MT || VT_HYB */ } /* write enter trace record */ vt_enter(tid, &time, p->rid); VT_RESUME_MALLOC_TRACING(tid);}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:55,
示例14: POMP_Beginvoid POMP_Begin(struct ompregdescr* r) { struct VTRegDescr* data = (struct VTRegDescr*)(r->data); if ( main_rid == VT_NO_ID ) main_rid = data->rid; if ( IS_POMP_TRACE_ON ) { uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, data->rid); }}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:11,
示例15: POMP_Parallel_fork2void POMP_Parallel_fork2(struct ompregdescr* r, int* p) { if ( !pomp_initialized ) POMP_Init(); vt_omp_fork2(VT_CURRENT_THREAD, (uint32_t*)p); if ( IS_POMP_TRACE_ON ) { uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_trc_regid[VT__TRC_OMPPREG]); }}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:11,
示例16: VT_DECLDEFVT_DECLDEF(void POMP_Unset_nest_lock_f(omp_nest_lock_t *s)) { if ( IS_POMP_TRACE_ON ) { uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_omp_regid[VT__OMP_UNSET_NEST_LOCK]); omp_unset_nest_lock(s); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); } else { omp_unset_nest_lock(s); }} VT_GENERATE_F77_BINDINGS(pomp_unset_nest_lock, POMP_UNSET_NEST_LOCK,
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:12,
示例17: VT_Dyn_startvoid VT_Dyn_start(uint32_t index, const char* name, const char* fname, uint32_t lno, uint32_t loop){ uint64_t time; uint32_t* rid; vt_libassert(index < VT_MAX_DYNINST_REGIONS); /* Ignore events if VT is initializing */ if( !dyn_init && !vt_is_alive ) return; /* If not yet initialized, initialize VampirTrace */ if ( dyn_init ) { VT_MEMHOOKS_OFF(); dyn_init = 0; rtab = (uint32_t*)calloc(VT_MAX_DYNINST_REGIONS, sizeof(uint32_t)); if ( rtab == NULL ) vt_error(); vt_open(); vt_comp_finalize = VT_Dyn_finalize; VT_MEMHOOKS_ON(); } /* If VampirTrace already finalized, return */ if ( !vt_is_alive ) return; VT_MEMHOOKS_OFF(); time = vt_pform_wtime(); /* Get region identifier */ rid = &(rtab[index]); if ( *rid == 0 ) { /* If region entered the first time, register region */#if (defined(VT_MT) || defined(VT_HYB)) VTTHRD_LOCK_IDS(); if ( *rid == 0 ) *rid = register_region(name, fname, lno, loop); VTTHRD_UNLOCK_IDS();#else /* VT_MT || VT_HYB */ *rid = register_region(name, fname, lno, loop);#endif /* VT_MT || VT_HYB */ } /* Write enter record */ vt_enter(VT_CURRENT_THREAD, &time, *rid); VT_MEMHOOKS_ON();}
开发者ID:315234,项目名称:OpenFOAM-2.2.x-OSX,代码行数:53,
示例18: POMP_Unset_nest_lockvoid POMP_Unset_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { uint64_t time = vt_pform_wtime(); vt_enter(&time, vt_omp_regid[VT__OMP_UNSET_NEST_LOCK]); omp_unset_nest_lock(s); time = vt_pform_wtime(); vt_omp_rlock(&time, vt_lock_id(s)); vt_exit(&time); } else { omp_unset_nest_lock(s); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:12,
示例19: POMP_Destroy_lockvoid POMP_Destroy_lock(omp_lock_t *s) { if ( IS_POMP_TRACE_ON ) { uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_omp_regid[VT__OMP_DESTROY_LOCK]); omp_destroy_lock(s); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); } else { omp_destroy_lock(s); }}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:12,
示例20: VT_DECLDEFVT_DECLDEF(void VT_User_start2___f(unsigned int* rid)){ uint64_t time; VT_SUSPEND_MALLOC_TRACING(VT_CURRENT_THREAD); /* -- write enter record -- */ time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, *rid); VT_RESUME_MALLOC_TRACING(VT_CURRENT_THREAD);} VT_GENERATE_F77_BINDINGS(vt_user_start2__, VT_USER_START2__,
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:12,
示例21: VT_User_start2__void VT_User_start2__(unsigned int rid){ uint64_t time; VT_SUSPEND_MALLOC_TRACING(VT_CURRENT_THREAD); /* -- write enter record -- */ time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, rid); VT_RESUME_MALLOC_TRACING(VT_CURRENT_THREAD);}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:12,
示例22: DEF_FPOMP_FUNCDEF_FPOMP_FUNC(void POMP_Unset_nest_lock_f(omp_nest_lock_t *s)) { if ( IS_POMP_TRACE_ON ) { uint64_t time = vt_pform_wtime(); vt_enter(&time, vt_omp_regid[VT__OMP_UNSET_NEST_LOCK]); omp_unset_nest_lock(s); time = vt_pform_wtime(); vt_omp_rlock(&time, vt_lock_id(s)); vt_exit(&time); } else { omp_unset_nest_lock(s); }} VT_GENERATE_F77_BINDINGS(pomp_unset_nest_lock, POMP_UNSET_NEST_LOCK,
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:12,
示例23: POMP_Set_nest_lockvoid POMP_Set_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_omp_regid[VT__OMP_SET_NEST_LOCK]); omp_set_nest_lock(s); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); } else { omp_set_nest_lock(s); }}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:12,
示例24: POMP_Destroy_nest_lockvoid POMP_Destroy_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { uint64_t time = vt_pform_wtime(); vt_enter(&time, vt_omp_regid[VT__OMP_DESTROY_NEST_LOCK]); omp_destroy_nest_lock(s); vt_lock_destroy(s); time = vt_pform_wtime(); vt_exit(&time); } else { omp_destroy_nest_lock(s); vt_lock_destroy(s); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:13,
示例25: POMP_Init_nest_lockvoid POMP_Init_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { uint64_t time = vt_pform_wtime(); vt_enter(&time, vt_omp_regid[VT__OMP_INIT_NEST_LOCK]); omp_init_nest_lock(s); vt_lock_init(s); time = vt_pform_wtime(); vt_exit(&time); } else { omp_init_nest_lock(s); vt_lock_init(s); }}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:13,
示例26: vt_cuptiact_createStream/* * Create a VampirTrace CUPTI Activity stream. * * @param devID ID of the CUDA device * @param strmID ID of the CUDA stream * * @return pointer to created VampirTrace CUPTI Activity stream */static vt_cuptiact_strm_t* vt_cuptiact_createStream(vt_cupti_ctx_t *vtCtx, uint32_t strmID){ vt_cuptiact_strm_t *vtStrm = NULL; vtStrm = (vt_cuptiact_strm_t *)malloc(sizeof(vt_cuptiact_strm_t)); if(vtStrm == NULL) vt_error_msg("[CUPTI Activity] Could not allocate memory for stream!"); vtStrm->strmID = strmID; vtStrm->vtLastTime = vt_gpu_init_time; vtStrm->destroyed = 0; vtStrm->next = NULL; /* create VT-User-Thread with name and parent id and get its id */ { char thread_name[16] = "CUDA"; if(vt_gpu_stream_reuse){ if(vtCtx->devID != VT_NO_ID){ if(-1 == snprintf(thread_name+4, 12, "[%d]", vtCtx->devID)) vt_cntl_msg(1, "Could not create thread name for CUDA thread!"); } }else{ if(vtCtx->devID == VT_NO_ID){ if(-1 == snprintf(thread_name+4, 12, "[?:%d]", strmID)) vt_cntl_msg(1, "Could not create thread name for CUDA thread!"); }else{ if(-1 == snprintf(thread_name+4, 12, "[%d:%d]", vtCtx->devID, strmID)) vt_cntl_msg(1, "Could not create thread name for CUDA thread!"); } } VT_CHECK_THREAD; vt_gpu_registerThread(thread_name, VT_MY_THREAD, &(vtStrm->vtThrdID)); } /* if first stream created for this device, make it the default stream */ if(vtCtx->activity->strmList == NULL){ /* write enter event for GPU_IDLE on first stream */ if(vt_gpu_trace_idle == 1){ if(vt_gpu_init_time < vt_start_time) vt_gpu_init_time = vt_start_time; vt_enter(vtStrm->vtThrdID, &vt_gpu_init_time, vt_gpu_rid_idle); /*vt_warning("IDLEente: %llu (%d)", vt_gpu_init_time, vtStrm->vtThrdID);*/ vtCtx->activity->gpuIdleOn = 1; } } return vtStrm;}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.7.1,代码行数:59,
示例27: POMP_Test_nest_lockint POMP_Test_nest_lock(omp_nest_lock_t *s) { if ( IS_POMP_TRACE_ON ) { int result; uint64_t time; time = vt_pform_wtime(); vt_enter(VT_CURRENT_THREAD, &time, vt_omp_regid[VT__OMP_TEST_NEST_LOCK]); result = omp_test_nest_lock(s); time = vt_pform_wtime(); vt_exit(VT_CURRENT_THREAD, &time); return result; } else { return omp_test_nest_lock(s); }}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:14,
注:本文中的vt_enter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ vt_error_msg函数代码示例 C++ vt_cntl_msg函数代码示例 |