Commit Graph

11150 Commits

Author SHA1 Message Date
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
Robert Maynard
262f07c9b0 Properly name the VTKm CMakeFiles. 2014-02-11 14:56:03 -05:00
Robert Maynard
c2101b8ffc Add in a serial device adapter and required supporting classes.
We now can verify that the array handle is usable by a device adapter.
2014-02-11 12:34:56 -05:00
Robert Maynard
6466da1a11 Merge branch 'add_arrayHandle' 2014-02-10 15:02:08 -05:00
Robert Maynard
a94abd7a71 Add in the minimum part of the control env to have a testable array handle. 2014-02-10 15:00:17 -05:00
Robert Maynard
24f561f0fe Add testing support to vtkm, and add tests for primitive types. 2014-02-10 15:00:17 -05:00
Robert Maynard
c07301a993 Add in primitive types to vtkm (Id, Scalar, Tuple).
This includes the configure scripts to setup if you want a 32bit or
64bit build.
2014-02-10 15:00:17 -05:00
Robert Maynard
ad0bc83320 Add in the basic CMake Infrastructure required for vtkm. 2014-02-10 15:00:17 -05:00
Robert Maynard
f1de2ebae2 Add a license to vtkm. 2014-02-10 15:00:17 -05:00
Robert Maynard
c00d01be6f Move documents into a directory, instead being in the repos root. 2014-02-10 14:01:22 -05:00
Robert Maynard
3ddb07318b Add in the coding conventions that we will use. 2014-02-07 11:02:55 -05:00
Robert Maynard
078323cf69 some rough notes on design choices we are making. 2014-02-07 11:02:50 -05:00
Robert Maynard
c138d6cd82 Initial commit. 2014-02-04 15:08:03 -05:00