News for hackers. Stuff that matters.
Re:Show HN: Vector - A High-Level Programming Language for G... by kylelutz on Saturday December 21, 2013 @01:56PM (#6947531)
Would you be interested in trying to adapt some of your approaches into a C++ GPGPU library (https://github.com/kylelutz/compute)?
Re:Show HN: Vector - A High-Level Programming Language for G... by zhemao on Saturday December 21, 2013 @10:39PM (#6949233)
Hey that's pretty cool, and would probably make OpenCL usable by mere mortals. One improvement that I see you could borrow from vector is getting rid of this explicit copying business. Take a look at the array implementation in our runtime library.

https://github.com/vectorlang/vector/blob/master/rtlib/vecto...

Basically, the VectorArray class contains both the host array pointer and the device array pointer. There are also two boolean flags, h_dirty and d_dirty. When you modify array elements on the host, h_dirty is set to one. Then, when you run a kernel, the data is copied to the device if h_dirty is set, h_dirty is cleared, and d_dirty is set. When you try to read an array element again on the CPU, the data is copied from device to host if d_dirty is set, and d_dirty is then cleared.