Open GoogleCodeExporter opened 9 years ago
The code (added by Eric Caspole) supporting arrays of objects actually solves
some of this (albeit with specific constraints). We can access arrays of
objects from Aparapi and the OpenCL code generated actually creates a
contiguous block of memory (essentially a contiguous array of structs) which is
accessed from OpenCL code.
The issue is that an Array or collection of ImageInfo instances will not be
placed in contiguous memory (same argument I have against 2d arrays :( ). The
code that Eric put together is forced to scan an incoming array of Java objects
and copy the accessed fields into a single memory sequence. This is expensive
as it happens each time we call Kernel.execute().
So I am not sure we need this as an enhancement, I think that the current array
of objects feature will probably work for the application you have in mind.
Regarding the @Position annotation. We can determine the position of fields
using the unsafe wrapper class. So thankfully we don't have to force the use of
Annotations here.
So Ryan can you take a look at the array of objects support and see if it works
for you here?
Original comment by frost.g...@gmail.com
on 14 Feb 2012 at 5:39
Original comment by frost.g...@gmail.com
on 23 Feb 2012 at 8:13
Gary,
Based on the new functionality in the Trunk for multi-dimensional arrays and
the new AparapiBuffer class, is there any new features we can envision
supporting additional 'struct' or 'arrays of objects' support?
Original comment by ryan.lam...@gmail.com
on 22 Apr 2013 at 5:14
Original issue reported on code.google.com by
ryan.lam...@gmail.com
on 29 Dec 2011 at 4:21