Commit Graph

11412 Commits

Author SHA1 Message Date
Kenneth Moreland
01f6b0a42b Merge branch 'remove-copy-into' 2014-06-11 16:16:21 -06:00
Kenneth Moreland
a789d54e99 Remove CopyInto method from array-support classes
It was originally put there to support CopyInto in ArrayHandle, but that
has already been removed. It really only makes sense for trivial
examples and testing code, and it sometimes causes complications with
coding.
2014-06-11 16:15:46 -06:00
Kenneth Moreland
e9ba448e3f Merge branch 'correct-header-wrappers' 2014-06-11 10:46:09 -06:00
Kenneth Moreland
2bd9632a36 Fix testing versions.
There is a special version of the testing methods for use in the control
environment that handles execeptions that can be thrown there. There are
tests to make sure you are using the correct version of the testing
framework, but it was broken until the last commit. Now that it's fixed,
here are two places where the wrong testing method was used.
2014-06-11 10:45:36 -06:00
Kenneth Moreland
ed9cf46a17 Make sure all header wrapper macros start with vtk_m_ rather than vtkm_
We made this change a while ago to help with completion in IDEs.
(Completion was matching a bunch of wrapper macros that were almost
never used anywhere.) Most of the changes are in comments, but there are
a few bad macro definitions.
2014-06-11 10:43:36 -06:00
Kenneth Moreland
9f7fcaf579 Merge branch 'windows-fixes' 2014-06-10 16:16:54 -06:00
Kenneth Moreland
fb4f550918 Fix MSVC compiler warnings.
Most of the warnings were about losing precision in conversions.
2014-06-10 16:09:28 -06:00
Kenneth Moreland
155a7eba54 Add special types for Tuples of size 0 and 1.
Mostly this is was motivated by the windows compiler complaining about a
zero-length array in Tuple<T,0>.
2014-06-10 15:33:39 -06:00
Kenneth Moreland
95edbdf0ab Include correct files for timing on windows. 2014-06-10 13:12:42 -06:00
Kenneth Moreland
7ad3bb0683 Remove alignment attribute from Extent struct.
See commit 763949351f8aec10896f7edf62839f261a25e2fd for an explanation on
why we are no longer using alignment attributes.
2014-06-10 13:00:26 -06:00
Kenneth Moreland
6d52c878c2 Merge branch 'timer' 2014-06-10 12:55:43 -06:00
Kenneth Moreland
50a5210a7d Add Timer class.
Helpful for safely timing parallel code across different devices.
2014-06-10 12:54:18 -06:00
Kenneth Moreland
5109cd40a3 Merge branch 'exec-cmake' 2014-06-10 11:36:40 -06:00
Kenneth Moreland
b012668345 Add a FunctorBase class for scheduling non-worklets
Whenever creating a functor to be launched in the execution environment
using the device adapter Schedule algorithm, you had to also create a
couple of methods to handle error message buffers. For convenience, lots
of code started to just inherit from WorkletBase. Although this worked,
it was a misnomer (and might cause problems in the future if worklets
later require different things from its base). To get around this
problem, add a FunctorBase class that is intended to be used as the
superclass to functors called with Schedule.
2014-06-10 11:35:13 -06:00
Kenneth Moreland
3ed7093945 Add test for ErrorMessageBuffer 2014-06-10 11:21:55 -06:00
Kenneth Moreland
b692cb3d89 Add CMake configuration for execution environment code 2014-06-10 11:14:11 -06:00
Kenneth Moreland
8f8ee4500e Merge branch 'undefined-flags' 2014-06-09 16:32:45 -06:00
Kenneth Moreland
744d97229f Changed undefined macros to something other than zero.
Previously, VTKM_DEVICE_ADAPTER_UNDEFINED and
VTKM_ARRAY_CONTAINER_CONTROL_UNDEFINED were set to 0. The problem is
that if someone set VTKM_DEVICE_ADAPTER or VTKM_ARRAY_CONTAINER_CONTROL
to something invalid, that would test positive when compared to 0. Thus,
you get an error about not defining the default when in fact the problem
is setting an invalid flag.

This change makes the undefined constants -1 so that the comparison will
fail unless the macro is actually properly set.
2014-06-09 16:32:02 -06:00
Kenneth Moreland
da68debbf3 Merge branch 'dynamic-point-coordinates' 2014-06-09 11:13:17 -06:00
Kenneth Moreland
7b3ea2345d Add a helper class to determine composite array types
Getting the type right for ArrayHandleCompositeVector can be a bit
tricky. It is expressed in a somewhat strange function signature format
and you have to extract the right component type for the return. This
adds an ArrayHandleCompositeVectorType that makes it easier (although no
less verbose).
2014-06-06 16:05:55 -06:00
Kenneth Moreland
e706a52cc8 Add documentation for FunctionInterface and make_FunctionInterface. 2014-06-06 15:20:50 -06:00
Kenneth Moreland
29973facf1 Merge branch 'config-file' 2014-05-27 19:58:02 -06:00
Kenneth Moreland
f157453e0e Create and install CMake configure files for external projects. 2014-05-22 15:20:41 -06:00
Robert Maynard
085524f7ea Merge branch 'WindowsSupport' 2014-05-19 14:40:19 -04:00
Robert Maynard
763949351f Stop trying to align vtkm types. Read the full comments on why.
Using alignment on basic types when vtkm only targetted Linux/BSD/OSX was
'okay' because of how the alignment operators worked, but potential was going
to cause issues in the long run if we failed to detect the correct size and the
compiler was than forced to not use intrinsics.

Now with adding windows support we have run into another problem. Basically
using an alignment operator on a typedef means that the type must never
be passed by value, but must always be passed by reference. The reason for
this is that passing by value doesn't respect alignment requirements, and
can cause very subtle errors or crashes.

A really good read for people more interested in these problems:

http://eigen.tuxfamily.org/dox/group__TopicPassingByValue.html
http://eigen.tuxfamily.org/dox-devel/group__DenseMatrixManipulation__Alignement.html
2014-05-19 14:27:37 -04:00
Robert Maynard
552a8ab160 Work around windows.h clobbering GetMessage.
windows.h uses a macro to forward GetMessage to GetMessageA or
GetMessageW, so to work around that we do the same on windows.
2014-05-19 14:23:30 -04:00
Robert Maynard
1ef967a426 Correct the option parser on windows.
You can't include headers inside namespaces.
2014-05-19 14:20:59 -04:00
Robert Maynard
ec2032e1d3 Correc the rest of the alignmnet issues. 2014-05-19 14:20:52 -04:00
Robert Maynard
40c579f119 Correcting alignment issues so we compile on windows. 2014-05-19 13:17:04 -04:00
Kenneth Moreland
7d769a8f4a Add classes to manage point coordinates.
Each type of point coordinates has its own class with the name
PointCoordinates*. Currently there is a PointCoordiantesArray that contains
an ArrayHandle holding the point coordinates and a PointCoordinatesUniform
that takes the standard extent, origin, and spacing for a uniform rectilinear
grid and defines point coordiantes for that. Creating new PointCoordinates
arrays is pretty easy, and we will almost definitely add more. For example,
we should have an elevation version that takes uniform coordinates for
a 2D grid and then an elevation in the third dimension. We can probably
also use a basic composite point coordinates that can build them from
other coordinates.

There is also a DynamicPointCoordinates class that polymorphically stores
an instance of a PointCoordinates class. It has a CastAndCall method that
behaves like DynamicArrayHandle; it can call a functor with an array handle
(possible implicit) that holds the point coordinates.
2014-05-15 13:41:45 -06:00
Kenneth Moreland
ff31afca3e Merge branch 'composite-vector-array' into dynamic-point-coordinates 2014-05-14 14:26:23 -06:00
Kenneth Moreland
261157ed22 Created ArrayHandleCompositeVector.
This derived array handle creates an array of vectors whose components come
from other arrays of vectors. In either case ArrayHandleCompositeVector
handles scalars as vectors of size 1.
2014-05-13 15:31:07 -06:00
Kenneth Moreland
3f2099fe76 Merge branch 'function-interface' into composite-vector-array 2014-05-13 14:11:35 -06:00
Kenneth Moreland
d3134b7050 Add ForEach methods to FunctionInterface.
Provides a convienient mechanism to do an in-place type-preserving
transform or a check of each parameter.
2014-05-13 14:08:14 -06:00
Kenneth Moreland
438fe0ff8d Implement FunctionInterface::StaticTransform
This will allow a faster conversion than the dynamic transform and will
allow you to define compile-time types for transformation unlike dynamic
transform or invoke with transform.
2014-05-06 13:32:10 -06:00
Kenneth Moreland
406e655910 Add implicit array for uniform grid point coordinates. 2014-05-01 19:19:54 -04:00
Kenneth Moreland
5cb4934279 Add Extent classes. 2014-04-30 17:07:57 -06:00
Kenneth Moreland
dac47ee550 Add DynamicTransform class.
This is used with the FunctionInterface::DynamicTransformCont method to
convert a call of arguments using dynamic array handles to a function
templated on concrete types.
2014-04-30 10:31:10 -06:00
Kenneth Moreland
90d78ca9b6 Merge branch 'function-interface' into dynamic-invoke 2014-04-30 09:49:26 -06:00
Kenneth Moreland
defb4f00cf Fix CLANG errors and warnings for FunctionInterface. 2014-04-30 09:47:22 -06:00
Kenneth Moreland
ebc20b432d Add FunctionInterface class.
The FunctionInterface class is a convienient way to wrap up a variable
number of arguments and pass them around templated interfaces without
requiring variadic template arguments. It also correctly hands return
arguments.
2014-04-24 20:02:29 -05:00
Kenneth Moreland
c4ecdbada8 Add a mechanism to check whether an array handle is valid
Use this mechanism in the dynamic array handle to skip over trying
invalid array handle types (and thereby incurring a compiler error even
though we never intended to use these classes).
2014-04-03 14:08:53 -06:00
Kenneth Moreland
d309fa7ae5 Add a dynamic array handle.
The dynamic array handle holds a reference to an array handle of an
unknown type. It contains the ability to try to cast it to an instance
of array handle or to try lists of types and containers.

There is currently an issue that is causing the test code not to
compile. It is the case that some combinations of types and containers
are not compatible. For example, an implict container is bound to a
certain type, and the container is undefined if they do not agree. There
needs to be a mechanism to detect these invalid combinations and skip
over them in the MTP for each.
2014-04-03 14:04:48 -06:00
Kenneth Moreland
3d3965b87f Use enum trick to get around problem of undefined static variable. 2014-04-02 10:53:03 -06:00
Kenneth Moreland
c2d926fa49 Add tag-based type list templates
Provies a list of types in a template like boost::mpl::vector and a
method to call a functor on each type. However, rather than explicitly
list each type, uses tags to identify the list. This provides the
following main advantages:

1. Can use these type lists without creating horrendously long class
names based on them, making compiler errors easier to read. For example,
you would have a typename like MyClass<TypeListTagVectors> instead of
MyClass<TypeList<Id3,Vector2,Vector3,Vector4> > (or worse if variadic
templates are not supported). This is the main motivation for this
implementation.

2. Do not require variadic templates and usually few constructions. That
should speed compile times.

There is one main disadvantage to this approach: It is difficult to get
a printed list of items in a list during an error. If necessary, it
probably would not be too hard to make a template to convert a tag to a
boost mpl vector.
2014-03-31 17:45:52 -06:00
Robert Maynard
c008213561 Merge branch 'astyle_applied' 2014-03-07 10:22:51 -05:00
Robert Maynard
2b7a0e0490 revise the header guard naming convention to not conflict with macro names. 2014-03-07 10:22:36 -05:00
Robert Maynard
f2552645e0 Merge branch 'astyle_applied' 2014-02-11 16:21:08 -05:00
Robert Maynard
5b8bec5ecd Merge branch 'add_serial_deviceAdapter' 2014-02-11 16:21:02 -05:00
Robert Maynard
c80fb9259f Update the initial repository to use the correct indentation style. 2014-02-11 16:20:30 -05:00