Add concept of atomic load, implement atomic_inits
This PR enables atomic loads of variables on the RHS of atomic operations.
The major points of this are:
- Create a new base class of OrderedAtomic which handles stringification and holds ordering/scope
- Add a new derived class AtomicLoad for atomicity. The AtomicLoad atomicities are populated during the preprocess step (as it's much easier to pull out the depenency names and atomicity candidates once the kernel has begun to be processed rather than out of the parse step of the instruction creation).
- If we ever decide to implement CL2 flavored atomics, we'll need to get AtomicLoads to emit an
atomic_load
operation, however as it stands it's fine as a simple volatile load. The synchronization / correctness aspect is handled by the synchronization barrier checks as with other variables. - Add test of atomic_load in test/test_loopy.py::test_atomic_load
- Add atomic_init implementation for opencl / add test in test/test_loopy.py::test_atomic_init -- using CL1 flavor, this can be accomplished by a simple x-change as we do for updates now. If CL2 flavor ever gets implemented, we'd have to use the
atomic_init
func
Edited by Nick Curtis