Forum Discussion
Altera_Forum
Honored Contributor
7 years agoOur program is in a way that we can not partition the program data on global memory among different kernels. Any kernel may write in any memory address (assume a graph processing algorithm that updates data of random nodes). actually our special algorithm does not have race condition problem. because we only write data, and even if multiple kernels write into same global memory address (update same graph node), they write exactly same value.... so, in any write order, finally result will be correct.
The real problem is with cache inconsistency, when each writer (kernel) has its own copy of cache, without being aware of changes of other writer. Considering the above situation, will putting "volatile" on global memory variable solve the cache coherency issue? anyway, cache is not expected to increase performance, due to very random access pattern. I really thanks for your helps,