Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
15339 Discussions

Real time Counter in Kernel

Altera_Forum
Honored Contributor II
780 Views

Hi,  

I want to define a real time counter and print his result .  

Can I define Real time clock "i" in kernel and print the result of counter?. 

In Other hand, I thought that I define a counter "i" in my Kernel and I store My counter "i" in global memory and then I read buffer from Host. 

My question : Does this counter "i" defined in kernel works under real time FPGA clock ? 

If yes , How I can print the result of counter ? This code (below) doesn't work for me. 

Kernel ( 

__global uint *restrict Y, 

int Gid = get_global_id(0); 

i=i+1; 

Y[Gid]=i; 

Thank you.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
67 Views

There is no clock in OpenCL and there is no guarantee that your accumulation will happen once every clock. You will not be able to get clock-accurate timing results in OpenCL. However, you can get very accurate timing results (but not clock-accurate) by using OpenCL's built-in profiler: 

 

https://stackoverflow.com/questions/23550912/measuring-execution-time-of-opencl-kernels
Reply