Process the kernel circuit from inputs to outputs, looking for latch sharing opportunities.
Process the kernel circuit from inputs to outputs, looking for latch sharing opportunities.
The device being scheduled for (so the latches can allocate their OpenCL buffers eventually
A function telling this routine which latches can share latches
A map from each virtual register of the circuit to its shared latch
An allocator of shared latches that are guaranteed to produce correct results even with an out-of-order command queue.
Produces a set of shared latches guaranteed to work on any kernel launch order that preserves the semantics of the calculation. For an OpenCL out-of-order queue, the kernels are allowed to run in an order unrelated to the order in which the kernels were enqueued, although ordering established by event linking is preserved.