threadgroup_barrier(mem_flags::
mem_threadgroup_imageblock);
// process pixels in imageblock -
update the elements in slice
process_pixels_in_imageblock(img_blk, gid, lid);
// a barrier to make sure all threads
have finished writing to the
elements in the imageblock
threadgroup_barrier(mem_flags::
mem_threadgroup_imageblock);
// write a specific element in
imageblock to output image
// only 1 thread in the threadgroup performs
the imageblock write
if (lid.x == 0 && lid.y == 0)
dst.write(img_blk.slice(f->a), gid);
}
2017-9-12 | Copyright © 2017 Apple Inc. All Rights Reserved.
Page
of
157
174