You are not logged in.

#1 2011-05-21 05:55:49

toffyrn
Member
Registered: 2008-10-07
Posts: 221

[SOLVED] OpenCL barrier() not working as I expect

I am working on a parallell tridiagonal solver in OpenCL.

The algorithm is called "cyclic reduction", and the main philosophy goes like this:
Having "N" elements, we reduce it to a system of "N/2" elements by forward elimination.
This goes on until only 2 elements are left.

My plan was to have some work items, and divide all elements on different workitems.
Arrays to work with are sent to the kernel as global, and to ensure that all workitems are done with "N"-step before proceeding to "N/2"-step "barrier(CLK_GLOBAL_MEM_FENCE);" is issued.
Despite this, workitems continue to next step without waiting.

I am fairly new to OpenCL programming, and need to learn this for my master thesis.

The code I'm working on is here:
https://orion.toffyrn.net/trac/study/br … ex3.py#L61

It is solving the problem "Ax = d" where " A = tridiag(a,b,c)".
Both thomas algorithm and cyclic reduction are implemented in the kernels "thomas" and "cr", both are working with only one workitem.

Any help is appreciated.

Last edited by toffyrn (2011-05-22 09:54:01)

Offline

#2 2011-05-22 09:53:42

toffyrn
Member
Registered: 2008-10-07
Posts: 221

Re: [SOLVED] OpenCL barrier() not working as I expect

My problem was that barriers don't work across workgroups, and my call to kernel started more work groups.
The solver is still not working as it should when system size increase, but the barrier problem is solved by having only one work group!

Last edited by toffyrn (2011-05-22 09:55:23)

Offline

Board footer

Powered by FluxBB