avoid copying data to/from global memory that is only used internally
commitc27d9a376644fc3e900ab274d0ea704f40e70bb1
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 22 Feb 2013 15:53:08 +0000 (22 16:53 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 16 Oct 2013 13:25:22 +0000 (16 15:25 +0200)
tree7c61d2a323b980f96b50660cd214c58adb23160a
parent075630745a383521f80d09e77eb79884e0a3aebe
avoid copying data to/from global memory that is only used internally

If some element of an array that is mapped to private or shared memory
is written by a kernel, then in general, we need to copy this element
back to global memory.  However, if all the reads of that array element
occur inside the same kernel, then there is no need to copy the data
back to global memory.
Similarly, any array element read by a kernel is first copied in from
global memory, but there is no need to perform this copying if the
array element was written inside the same kernel.

Only perform the copy-in or copy-out on data elements that may
come in from the outside or that may still be needed later.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
gpu.c
ppcg.c
ppcg.h
schedule.h