Results 1 to 2 of 2

Thread: FIFO queue implementation in OpenCL?

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    1

    FIFO queue implementation in OpenCL?

    Hi,

    How am I supposed to implement an ever growing FIFO queue in OpenCL?

    I have a queue that originally has a predefined size, but my kernel is supposed to:

    - dequeue the first item,
    - see if this item needs "subdivision".
    -> if it does not, stop processing the item, and move on to the next one in a FIFO fashion
    -> if it does, then subdivide, eg. generate 2 new items and enqueue them.

    Would somebody have a reference for me for the implementation of a FIFO queue in OpenCL?

    Thanks.

  2. #2
    Senior Member
    Join Date
    Dec 2011
    Posts
    124

    Re: FIFO queue implementation in OpenCL?

    Sounds like a job for dynamic parallelism in CUDA.

    In OpenCL you could have an atomic queue head pointer and an atomic queue tail pointer and use traditional techniques to dequeue and enqueue items. It's not going to be efficient though.

    If possible, let the CPU figure out what to enqueue first, run a kernel that does those items, and then take the results, which define new items to run, and run the kernel again on them. In other words, do a bunch of work on known queue items for each kernel invocation rather than have one kernel that somehow keeps eating items from a queue (that's not how OpenCL was designed to work).

    If you overlap memory transfers and compute you could keep the GPU pretty busy doing it this way.

Similar Threads

  1. Implementation of OpenCL in clang
    By mariusC in forum OpenCL
    Replies: 3
    Last Post: 02-04-2011, 09:27 AM
  2. Fifo header not initialised properly
    By jarno in forum OpenML Coding & Technical Issues
    Replies: 0
    Last Post: 04-11-2005, 03:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •