Results 1 to 3 of 3

Thread: How can i create or use a critical section in OpenCL?

  1. #1

    How can i create or use a critical section in OpenCL?

    Hi,

    Already exist a critical section sentence in OpenCL?
    If there is not, how can i create a critical section in OpenCL?



    Very Thanks,

    Luiz Drumond.

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: How can i create or use a critical section in OpenCL?

    There is no builtin function to create a critical section. Notice that by definition a critical section runs sequentially and will hurt performance a lot.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3

    Re: How can i create or use a critical section in OpenCL?

    You can use the atomic functions (if your platform/device supports the extension) to implement a critical section (look at wikipedias critical section page, you can use atomic instructions to create a mutex).

    But, as David mentioned, it will really hurt performance. Some algorithms have no alternative, but make sure it's your last resort.

Similar Threads

  1. Can I only Create a Pbuffer without create a window surface
    By sunim in forum Cross API and window system integration
    Replies: 3
    Last Post: 02-04-2012, 12:14 PM
  2. Section 8.2 Addressing mode and filtering
    By giridhart in forum OpenCL
    Replies: 1
    Last Post: 09-24-2010, 03:29 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
  •