Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
8 years ago

How to partition buffers in global memory manually?

Manual Partitioning of Global Memory section of the Intel[SUP]®[/SUP] FPGA SDK for OpenCL™ Programming Guide tells :

"however, you have the option to control the memory bandwidth across a group of buffers by partitioning your data manually."

But the Specifying Buffer Location in Global Memory only shows how to allocate buffer to specific global memory type.

to instruct the host to allocate a buffer to a specific global memory type, insert the buffer_location("<memory_type>") attribute, where <memory_type> is the name of the global memory type provided by your board vendor. for example:

__kernel void foo(__global __attribute__((buffer_location("ddr"))) int *x, __global __attribute__((buffer_location("qdr"))) int *y)

[h=1] Is there any way to specify buffer location in the same global memory type just like DDR?

[/h] I am not sure how to distribute different buffer to different bank, is there any sample?

Many thanks!

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    By default, all device buffers are automatically interleaved across all available DDR banks. If you want to manually put your buffers into a specific bank, you have to disable interleaving when compiling the kernel code and also modify your host code. Check section "1.7.2.1" and "1.7.2.2" of the Programing Guide for instructions and examples.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for ur help! I found that this function implemented only in Quartus 17.0.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    No, this feature has been available in Quartus since a long time ago. The only difference is that the flag has been renamed from "CL_MEM_BANK_1_ALTERA" to "CL_MEM_BANK_1_INTEL" in v17.0.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for ur help, I find it!

    But now I could only find programming document with Quartus 17.0, its really inconvenient while using Quartus 16.1