Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

access constant memory

Altera_Forum
Honored Contributor II
1,154 Views

Hi, 

 

I asked the constant memory problem early. 

And I understand that access constant memory is faster than access global memory. 

 

But the kernel code I programmed is the same speed when I placed the array in constant or global memory , and two cases as shown : 

 

*******constant memory******* 

kernel test(constant int * a){ 

... 

int n = rand (); // rand() function is used to generate a integer number and n is not the same for each workitem 

int tmp = a[n];  

... 

 

************************** 

*******global memory******* 

kernel test(global int * a){ 

... 

int n = rand (); // rand() function is used to generate a integer number and n is not the same for each workitem 

int tmp = a[n];  

... 

 

************************** 

Therefore , each workitem might not access the same address of array a. 

These cases result in same speed (kernel time)  

In nvidia guide , if access constant memory address is not the same address , it will be access sequentially. 

Is it the same as Altera OpenCL ? 

 

Thanks
0 Kudos
0 Replies
Reply