Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16556 Discussions

Real time Counter in Kernel

Altera_Forum
Honored Contributor II
969 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
256 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
0 Kudos
Reply