Commit Graph

12 Commits

Author SHA1 Message Date
T.J. Corona
af32a21b2e Add support for bidirectional array transforms.
Array transforms can now be created with an inverse functor, allowing for
casts back into the native array type. As a result, array transforms with
both a functor and inverse functor defined can perform read and write
operations. As an example, ArrayHandleCast now supports this operation. The
original implementation of ArrayHandleCast (i.e. read only) has been renamed
'ArrayHandleCastForInput'.
2015-11-10 15:13:02 -05:00
Kenneth Moreland
65c2261892 Add default constructors/destructors/assignment to ArrayHandle classes
The ArrayHandle classes all exclusively work in the control environment.
However, CUDA likes to add __device__ to constructors, destructors, and
assignment operators it automatically adds. This in turn causes warnings
about the __device__ function using host-only classes (like
boost::shared_ptr). Solve this problem by adding explicit methods for
all of these.

Implemented this by wrapping up all these default objects in a macro.
This also solved the problem of other constructors that are necessary
for array handles such as a constructor that takes the base array
handle.
2015-10-21 13:36:27 -06:00
Kenneth Moreland
7ff62d8d6b Explicitly add destructors and copy constructors to ArrayHandle classes
Under CUDA, the default constructors and destructors created are exported
as __host__ and __device__, which causes problems because they used a boost
pointer that only works on the host. The explicit copy constructors and
destructors do the same thing as the default ones except declared to only
work on the host.
2015-10-21 07:50:52 -06:00
Robert Maynard
66f6db5a97 IsWriteableArrayHandle now can tell if an array handle can be written too 2015-10-01 09:23:10 -04:00
Sujin Philip
f35601162e Fix ArrayHandleTransform to use supplied functor object instead of a default 2015-09-29 15:44:10 -04:00
Kenneth Moreland
882c20a2cb Support DynamicArrayHandle::CastToArrayHandle for fancy ArrayHandles
Basically, this entails adding a constructor to each fancy ArrayHandle
that accepts the base ArrayHandle with the appropriate type and storage.
2015-09-20 00:28:11 -06:00
Robert Maynard
6b8e7822be The Copyright statement now has all the periods in the correct location. 2015-05-21 10:30:11 -04:00
Robert Maynard
19ee2be2b6 Allow ArrayHandleTransform Control Portal to be accessed when using cuda.
Because of the device/control markups previously we couldn't access the
control portal when compiling with cuda enabled.
2015-05-04 10:58:07 -04:00
Kenneth Moreland
1c733d4e32 Update the ArrayTransfer classes to new interface merged in
For what it's worth, the implementation of these classes simplified
quite a bit.
2015-04-30 22:01:02 -06:00
Kenneth Moreland
fe444e1267 Add ArrayHandlePermutation
Also found a problem with ArrayHandle that manifests itself with derived
types when you first do a PrepareForInput and then a PrepareForInPlace.
The ArrayHandle assumes the data is already moved to the device and
skips the in place call to the array transfer. However, this means the
transfer of the derived array handle does not have a chance to set up
for in place.

I think the appropriate solution may be to move the appropriate logic
from ArrayHandle to ArrayTransfer. I will look into that next.
2015-04-23 20:45:24 -04:00
Kenneth Moreland
04a3be81c1 Fix GetNumberOfValues in transformed array handle portal
The number of values in the array handle portal was screwy and the
GetNumberOfValues method was flat out wrong (thanks to Rob Maynard for
pointing that out). This is fixed.

Also fixed a subtle but nasty typing problem in the Storage's
GetPortalConst method.
2015-04-23 11:07:26 -04:00
Kenneth Moreland
f7daaf36a8 Add ArrayHandleTransform. 2015-04-13 14:43:18 -06:00