Forum Discussion

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

Questions about resource usage

Hi,

I have a pretty simple kernel that stores the image pixels to output as follows:


int index = get_global_id(0);
for (int i=index; i<WIDTH*HEIGHT;i++)
{
output = input;
}

The FPGA is SoCKit board. If I set global item N=1(ndrange is 111), so single work-item kernel is created. (I know it doesn't make sense, just to test)

If I set global item to N=8, so 8 work-items are created for the kernel.

If I set N=32, 128, 480, just N work-items are created.

However, the resource usage report always shows the same resource usage. I checked the FPGA resource usage report after synthesis, also the same.

I tested the kernel speed. kernel time is becoming smaller if N is bigger generally.

It seems the aoc compiler doesn't really know N value while compiling. Only kernel file is the input and N is not mentioned there.

I just confused how the hardware generated. If I understanding correctly, if N is bigger and bigger, more work-items are created and the FPGA would become fully used. So why the resource usage is always the same?

Did I misunderstand something? I checked the documents on AOC webpage, nothing is really explained. Only mentioned more work-item hardware are generated to accelerate blablabla.

Thanks

Shaodong

2 Replies

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

    PS: Is there a way to check how many work-items are really created?

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

    You are misunderstanding the hardware generated for FPGA. Essentially, your kernel becomes a "pipeline" where each work-item moves from one stage to the next stage every cycle, i.e. your kernel is fixed hardware and work-items run on it. Hence, the generated hardware is not affected by how many work-items there are. "Best Practices Guide" has a high-level description of the pipeline architecture generated.