View Full Version : How can i create or use a critical section in OpenCL?
03-02-2011, 09:30 AM
Already exist a critical section sentence in OpenCL?
If there is not, how can i create a critical section in OpenCL?
03-02-2011, 04:06 PM
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.
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.