Forum Discussion

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

Pipes OpenCL

Hello everyone,

What is the main advantage of using pipes on Altera OpenCL SDK? I'm still trying to figure out why separating the codes in different kernels. If possible, I would like an example.

Thank you :)

4 Replies

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

    The main advantage of channels (and pipes) is "ease of programming" which comes at the cost of higher area overhead and some restrictions on what you can do in your kernel (e.g. no SIMD or parallel work groups are supported in NDRange kernels that use channels). You can always do what you do with channels, without channels, but it will likely require [much] more programming effort.

    For NDRange kernels it regularly makes sense to have multiple kernels with different local and global work size. For single work-item kernels, it rarely makes sense to have multiple kernels because it would just result in area waste caused by extra kernel interfaces. Though in all cases one might want to have multiple kernels and connect them with channels to reduce programming effort. Sometimes it might also make sense to mix NDRange and single work-item kernels and connect them with channels so that each kernel type is used for the part of the computation that better matches it; e.g. DDR memory performance is generally higher in NDRange kernels while loops with iteration dependencies work better in single work-item.

    You can find multiple examples of applications with multiple kernels and channels among Altera's examples here (https://www.altera.com/products/design-software/embedded-software-developers/opencl/developer-zone.html). Search for the word "channel" in the "Design Examples" page.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Is there any pipes example

    thanks

    --- Quote End ---

    Check Altera's design example page which I linked in my previous reply.