some other links for performance measurement

2 views
Skip to first unread message

Zubair Nawaz

unread,
Oct 22, 2012, 4:10:34 AM10/22/12
to pucit-...@googlegroups.com

Bilal Shahzad

unread,
Oct 22, 2012, 10:01:33 AM10/22/12
to pucit-...@googlegroups.com
Sir,

Can we use following code, it is for C++?

clock_t t1, t2;
t1
= clock();

run
function 1,000,000 times

t2
= clock()

float
diff = ((float)t2 - (float)t1) / 1000000.0F;


I am unable to calculate time/performance using following code in opencl. Is anyone able to run this successfully?  It is returning same start and end time.

clGetEventProfilingInfo(prof_event, CL_PROFILING_COMMAND_START,
           sizeof(time_start), &time_start, NULL);
             clGetEventProfilingInfo(prof_event, CL_PROFILING_COMMAND_END,
                   sizeof(time_end), &time_end, NULL);
             total_time += time_end - time_start;

Thanks,



From: Zubair Nawaz <zubair...@gmail.com>
To: pucit-...@googlegroups.com
Sent: Monday, 22 October 2012 1:10 PM
Subject: [M.Phil CS F11] some other links for performance measurement



Sarwan dar

unread,
Oct 22, 2012, 10:34:48 AM10/22/12
to pucit-...@googlegroups.com
God rays sample has a good method of calculating time elapsed since the beginning of the programme.I used that In my program.
Regards,
Sarwan Dar

Bilal Shahzad

unread,
Oct 22, 2012, 10:44:31 AM10/22/12
to pucit-...@googlegroups.com

Sarwan,

I could not find any such method there. Was sir fine with that method? Can you elaborate here if possible? Thanks


From: Sarwan dar <sarw...@gmail.com>
To: pucit-...@googlegroups.com
Sent: Monday, 22 October 2012 7:34 PM
Subject: Re: [M.Phil CS F11] some other links for performance measurement

Sarwan dar

unread,
Oct 22, 2012, 11:53:20 AM10/22/12
to pucit-...@googlegroups.com
I think sir only wants us to measure the time of the application on a cpu as well as a gpu and wouldnt mind if we use any other method for that purpose.Many of the sample open cl applications use this method for performance measurement.
 
I have attached a sample project and you could use that code if you like.
This is how I did it. 
//for perf. counters
#include <Windows.h>
#include <conio.h>
#include <iostream>

LARGE_INTEGER g_PerfFrequency;
LARGE_INTEGER g_PerformanceCountNDRangeStart;
LARGE_INTEGER g_PerformanceCountNDRangeStop;
 
/*to be placed on top of the call
clenqueueNDrangekernel(which sets the work items and work groups per kernel)*/
 
 QueryPerformanceCounter(&g_PerformanceCountNDRangeStart);
 
/*to be placed before clenqueuereadbuffer(which reads the result of the output)*/

QueryPerformanceCounter(&g_PerformanceCountNDRangeStop);
 
/*After execution of the kernel this call can be placed anywhere in main to print*/
 
 QueryPerformanceFrequency(&g_PerfFrequency);
    printf("NDRange perf. counter time %f ms.\n", 1000.0f*(float)(g_PerformanceCountNDRangeStop.QuadPart - g_PerformanceCountNDRangeStart.QuadPart)/(float)g_PerfFrequency.QuadPart);
sample timer.rar

Bilal Shahzad

unread,
Oct 22, 2012, 12:43:28 PM10/22/12
to pucit-...@googlegroups.com
Thanks Sarwan. This is working :)


Sent: Monday, 22 October 2012 8:53 PM
Reply all
Reply to author
Forward
0 new messages