File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -604,6 +604,30 @@ void pocl_vortex_run (void *data, _cl_command_node *cmd) {
604604 POCL_ABORT ("POCL_VORTEX_RUN\n" );
605605 }
606606
607+ uint64_t cur_num_threads , cur_num_warps , cur_num_cores ;
608+ int caps_return1 =
609+ vx_dev_caps (dd -> vx_device , VX_CAPS_NUM_THREADS , & cur_num_threads );
610+ int caps_return2 = vx_dev_caps (dd -> vx_device , VX_CAPS_NUM_WARPS , & cur_num_warps );
611+ int caps_return3 = vx_dev_caps (dd -> vx_device , VX_CAPS_NUM_CORES , & cur_num_cores );
612+
613+ int gVortexBranchDivergenceOptLevel = 8 ;
614+ const char * env_val = getenv ("VORTEX_DIVERGENCE_OPT_LEVEL" );
615+ if (env_val != NULL ) {
616+ gVortexBranchDivergenceOptLevel = atoi (env_val );
617+ }
618+
619+ char filename [256 ];
620+ snprintf (filename , sizeof (filename ), "perf_counter_%dC_%dW_%dT_O%d.txt" ,
621+ + cur_num_cores , cur_num_warps , cur_num_threads , gVortexBranchDivergenceOptLevel );
622+ FILE * outputFile = fopen (filename , "a" );
623+ if (!outputFile ) {
624+ perror ("Failed to open file" );
625+ return 1 ;
626+ }
627+
628+ vx_dump_perf (dd -> vx_device , outputFile );
629+ fclose (outputFile );
630+
607631 // release arguments device buffer
608632 vx_mem_free (vx_kargs_buffer );
609633}
You can’t perform that action at this time.
0 commit comments