Commit Graph

8 Commits

Author SHA1 Message Date
Robert Maynard
f38673f618 Replace ErrorControlOutOfMemory with ErrorControlBadAllocation. 2015-10-01 14:25:28 -04:00
Will Usher
046cd2d2b9 Change StorageBasic to use an aligned allocator.
The storage used will now be aligned to `VTKM_CACHE_LINE_SIZE bytes,
resulting in slightly better cache usage and load/store performance.
This define is set in `StorageBasic.h We also now detect if Posix is
available in Configure.h and will define VTKM_POSIX with _POSIX_VERSION
if it's available.

The AlignedAllocator used by StorageBasic is also STL compatible
and can be used in STL containers so user's can use it in their
std::vector and pass aligned user memory to the storage.
2015-08-11 13:42:55 -06:00
Robert Maynard
b43fb01ff0 Redesign StorageBasic to allow modification of user provided memory.
The driving desire for this change was to make vtk-m ArrayHandle behave more
like the standard vector. The canonical example of what we want to support is:

```
std::vector<vtkm::Id> values;
values.resize(100);
vtkm::cont::ArrayHandle<vtkm::Id> array = vtkm::cont::make_ArrayHandle(values);
vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapter>::Sort(array);
```

And with-out the ability to modify user provided memory, this was impossible.
2015-06-05 10:32:48 -04:00
Robert Maynard
07970cf476 Correct all signed / unsigned and narrowing warnings ( 64bit to 32bit ). 2015-05-28 09:05:17 -04:00
Robert Maynard
6b8e7822be The Copyright statement now has all the periods in the correct location. 2015-05-21 10:30:11 -04:00
Kenneth Moreland
a2c280993c Remove UserPortal from ArrayHandle.
The UserPortal in ArrayHandle was used to copy a pointer the user
created into an ArrayHandle to use in VTK-m algorithms. However, this is
only really valid for a basic storage, so the functionality has been
moved there, and you have to construct an ArrayHandle with a storage
instead of an array portal.
2015-04-28 10:49:46 -04:00
Kenneth Moreland
bc3e1ebd21 delete operator and std::allocator are not necessarily the same
The unit test for StorageBasic tested the StealArray feature and then
used the delete[] operator on the stolen array to deallocate it. For
many standard libraries the default implementation for delete[] is
the same as (or at least compatible with) std::allocator, but for
the PGI compiler they were not compatible and this resulted in a
run-time error. This change fixes the problem with the test by using
the same allocator as the StorageBasic test.
2014-10-23 15:39:05 -06:00
Kenneth Moreland
21823500c3 Change ArrayContainerControl to Storage.
After a talk with Robert Maynard, we decided to change the name
ArrayContainerControl to Storage. There are several reasons for this
change.

1. The name ArrayContainerControl is unwieldy. It is long, hard for
humans to parse, and makes for long lines and wraparound. It is also
hard to distinguish from other names like ArrayHandleFoo and
ArrayExecutionManager.

2. The word container is getting overloaded. For example, there is a
SimplePolymorphicContainer. Container is being used for an object that
literally acts like a container for data. This class really manages
data.

3. The data does not necessarily have to be on the control side.
Implicit containers store the data nowhere. Derivative containers might
have all the real data on the execution side. It is possible in the
future to have storage on the execution environment instead of the
control (think interfacing with a simulator on the GPU).

Storage is not a perfect word (what does implicit storage really mean?),
but its the best English word we came up with.
2014-06-24 09:58:32 -06:00