Commit Graph

8177 Commits

Author SHA1 Message Date
Jeremy Meredith
5a0a658d7d adding worklet map cell framework (so far, identical to field version). 2015-02-04 11:00:15 -05:00
Dave Pugmire
e3970b09f1 Add a simple worklet that creates a cell-type variable. 2015-02-03 12:02:48 -05:00
Dave Pugmire
d6ccc97304 Add initial data set for unstructured mesh. 2015-02-02 16:44:24 -05:00
Robert Maynard
3c8ce36666 Properly deallocate cuda memory when we are done with it. 2015-01-28 15:54:45 -05:00
Dave Pugmire
1b24b1015f add dataset test file. 2015-01-28 11:50:06 -05:00
Dave Pugmire
09ec291feb fill in the dataset with some values. 2015-01-28 11:46:07 -05:00
Dave Pugmire
01dce61672 data model tweaks.
fix a bad commit.
2015-01-28 11:27:15 -05:00
Dave Pugmire
cf006085b4 Merge branch 'datamodel-design' of public.kitware.com:vtkm into datamodel-design
Conflicts:
	CMakeLists.txt
2015-01-27 17:02:03 -05:00
Dave Pugmire
8dc09f271d Add initial dataset files. 2015-01-27 16:22:21 -05:00
Dave Pugmire
f0c9879296 Testing file for data set 2015-01-27 16:09:32 -05:00
dpugmire
7ff3c82858 Add some initial DataSet 2015-01-27 16:01:11 -05:00
Robert Maynard
46df484ca7 Redesign the way we implement when to choose texture portals.
The logic to select texture portals is easier to understand now.
2015-01-20 13:58:28 -05:00
Robert Maynard
89f8f07806 Properly specify the iterator type for ArrayHandleCounting. 2015-01-20 13:58:28 -05:00
Robert Maynard
e26040282b Properly map TexturePortals to Iterators.
Also at the same time disable the Texture support by default.
2015-01-20 13:58:28 -05:00
Robert Maynard
04bc41cad3 Fix multiple issue in the cuda array handle unit tests.
The namespaces need to be different for each test, or else only the first
implementation of the function will be used for all tests that call that
function.

Also updated the test to verify that we can count starting from a non zero
number.
2015-01-20 09:03:24 -05:00
Robert Maynard
f8bb4214ad Implicit Storage containers don't return anything from GetPortal/Const()
This means you can't assign the results of the function call to a variable.
This was causing nvcc to crash.
2015-01-20 09:03:24 -05:00
Robert Maynard
9f60876a0a Move the MapField testing worklets to a worklet namespace.
NVCC is unable to handle finding the worklets when they are in an anonymous
namespace. It only looks at the the anonymous namespaces included by the
files that device code uses, and misses our anon namespace. Moving to a named
namespace solves these issues.
2015-01-19 14:25:54 -05:00
Kenneth Moreland
ef093d5c07 The DoWorkletInvokeFunctor methods were missing VTKM_EXEC_EXPORT. 2015-01-15 22:47:28 -07:00
Kenneth Moreland
76ac77b2e5 Move another FunctionInterface manipulation to be exclusively control 2015-01-15 22:42:36 -07:00
Kenneth Moreland
51b5cc63c4 Merge branch 'no-function-interface-zip' into cuda_DeviceAdapterAlgorithm 2015-01-15 22:35:38 -07:00
Kenneth Moreland
dcf1679020 FunctionInterface Append and Replace methods control environment only
They were declared as in both control and execution, but this would
cause problems when the FunctionInterface contained objects that could
only be copied in the control environment. Using these methods probably
only makes sense in the control environment anyway. (They are a bit
heavyweight to use in an inner loop of the execution environment.)
2015-01-15 22:34:04 -07:00
Kenneth Moreland
694010b8d7 Fix annoying warning about converting signed to unsigned. 2015-01-15 22:32:04 -07:00
Kenneth Moreland
37dac92052 Add index tags to FunctionInterface features.
The functors in the ForEach, StaticTransform, and DynamicTransform
methods sometimes can use the index of the parameter that they are
operating on. This can be a helpful diagnostic in compile and run-time
errors. It is also helpful when linking parameters from one
FunctionInterface with those of another.

This new features are now replacing implementations using the Zip
functionality that was removed earlier. The implementation is actually
simplified a bit.
2015-01-15 22:13:47 -07:00
Kenneth Moreland
0fdc311682 Remove test of Zip functionality from UnitTestFunctionInterface
Since that feature has been removed.
2015-01-12 19:24:53 -08:00
Kenneth Moreland
93e42bc3e1 Remove Zip functionality in FunctionInterface.
The Zip function does not work when compiling with CUDA because it
forces the parameters to be in both the control and execution (host and
device) environments.
2015-01-12 18:08:32 -08:00
Robert Maynard
3e8ac22fe6 Allow worklet tests to be built for the cuda device adapter. 2014-12-19 13:47:28 -05:00
Robert Maynard
1b5c5a6ce5 Add in initial support for texture binding of input arrays. 2014-12-19 13:47:28 -05:00
Robert Maynard
a509dae909 Use pinned memory for error reporting on the cuda backend.
This reduces the amount of explicit cuda Device to Host memory copies.
2014-12-19 13:47:28 -05:00
Robert Maynard
d9270e408d Adding a cuda device adapter to vtkm.
Porting the dax device adapter over to vtkm. Unlike the dax version, doesn't
use the thrust::device_vector, but instead uses thrust::system calls so that
we can support multiple thrust based backends.

Also this has Texture Memory support for input array handles. Some more work
will need to be done to ArrayHandle so that everything works when using an
ArrayHandle inplace with texture memory bindings.
2014-12-19 13:47:28 -05:00
Robert Maynard
e2eb901be3 move DeviceAdapterAlgorithm to correct folder as it's namespace 2014-12-18 11:09:15 -05:00
Kenneth Moreland
25613a26ad Re-disable timing test in FunctionInterface unit test
When fixing a problem where the disabled test had left some unused
classes, which some compilers picked up on (SHA
eae8921dc714c9bdb12058db365f890425291ea2), I used a preprocessor wrapper
to enable/disable the code (mostly to preserve history). However, I
forgot to leave the code disabled. Disable that here.
2014-12-10 09:44:54 -07:00
Robert Maynard
735a2ff25a Update the documentation to use vtkm::FloatDefault instead of vtkm::Scalar. 2014-12-10 10:38:03 -05:00
Robert Maynard
519509bba1 Update the documentation to note have references to dax. 2014-12-10 10:37:25 -05:00
Kenneth Moreland
a6622aeea9 Documentation fixes.
Fix documentation comments in FunctionInterface.h and some declarations
that are only for documentation in DeviceAdapterAlgorithm.h.
2014-12-09 16:07:27 -07:00
Kenneth Moreland
4ab4dc9cf2 Use test_equal instead of == for comparing numbers in exec worklets.
A couple of tests were failing with the Intel compiler due to
imprecision in comparing floating point values.

Also snuck in some minor documentation fixes in a comment for
FunctionInterface.
2014-11-12 08:53:03 -07:00
Kenneth Moreland
eae8921dc7 Remove unused functor from function interface test.
It was the functor that was used to test the time overhead of invoking
a functor through a FunctionInterface, but that test has been disabled.
2014-11-12 08:39:45 -07:00
Kenneth Moreland
72c62a3556 Merge branch 'dispatch'
Conflicts:
	vtkm/internal/testing/UnitTestFunctionInterface.cxx
2014-11-10 12:27:31 -07:00
Kenneth Moreland
d093a05af5 Minor documentation fixes. 2014-11-10 11:04:05 -07:00
Kenneth Moreland
30893f0b0d Add utility include to Pair.h
Pair.h references std::Pair, which is defined in the utility header.
Thus, that should really be included.
2014-10-23 16:34:52 -06:00
Kenneth Moreland
e2e8a3adb9 Disable the timing test for FunctionInterface.
There is a test that tries to determine that the Invoke methods in
FunctionInterface do not add an unreasonable overhead. However, this
test is unreliable. Also, the most critical performance hit would be in
invoking a worklet operation, but that is now done elsewhere anyway.
2014-10-23 16:03:58 -06: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
343c12b500 Fix ICC warnings.
ICC can be pretty thorough about finding unused elements. In this case
it was picking up an unused method in instances of a templated class
in an anonymous namespace. It was a method that should be there due to
the nature of the class, but it happened to not be used (which was OK,
too). To get around the problem, I just added some use of that method
in another method.
2014-10-23 10:59:18 -06:00
Kenneth Moreland
51e3b2bb1d Add checks for signature tags
It's easy to put accidently put something that is not a valid tag in a
ControlSignature or ExecutionSignature. Previously, when you did that
you got a weird error at the end of a very long template instantiation
chain that made it difficult to find the offending worklet.

This adds some type checks when the dispatcher is instantated to check
the signatures. It doesn't point directly to the signature or its
parameter, but it is much closer.
2014-10-23 08:28:50 -06:00
Kenneth Moreland
40efb51342 Fix MSVC warnings
MSVC is picky about type conversions. To get it to shut up, explicitly
cast the worklet return value to the fetch value in the
WorkletInvokeFunctor. The good is that it will help with needing
explicit conversions on these return values. But that is also bad in
that it might make some unexpected conversions possible.
2014-10-23 07:12:01 -06:00
Kenneth Moreland
6b1db2cf04 Check value type in Invoke input arrays.
Instead of just checking that a dispatcher's Invoke input is an
ArrayHandle, also check that the ValueType of the ArrayHandle is
compatible with the types of the worklet operator. This is done by
adding a template argument to the ControlSignature tags that is a type
list tag that gets passed to the type check.
2014-10-22 16:51:42 -06:00
Kenneth Moreland
f4fb9f0ace Merge branch 'new-list-features' into distpach 2014-10-22 15:21:48 -06:00
Kenneth Moreland
421746d041 Add basic support for type checking of Invoke arguments 2014-10-22 15:21:18 -06:00
Kenneth Moreland
9ac538b6b9 MSVC fixes
One fix is a simple (pointless) compiler warning about precision. The
other fix is an error in one of the test codes that did not clear out
the message string in an error message buffer like it was supposed to.
2014-10-22 10:52:35 -06:00
Kenneth Moreland
b0b0bee4f6 Add VTKM_IS_LIST_TAG checks to dynamic classes 2014-10-22 10:46:54 -06:00
Kenneth Moreland
184118d9a2 Add a template that tests whether a type is in a list.
Also reduced the maximum list size to 15 (which is the current longest
single list we have). Trying to reduce the size of the generated code a
bit, which is getting a little long.
2014-10-22 10:35:56 -06:00
Kenneth Moreland
b368830fc0 Add VTKM_IS_LIST_TAG macro
As part of this is a ListTagCheck class that can be used for other
template magic.
2014-10-22 07:24:04 -06:00
Kenneth Moreland
d4ad846e65 Merge branch 'any-scalar-width' 2014-10-21 16:53:50 -06:00
Kenneth Moreland
7cf25331e2 Fix MSVC compiler warnings
Generally, the MSVC compiler tends to be more picky about implicit type
conversions. It warns if there is any possibility of precision loss.
2014-10-21 16:52:24 -06:00
Kenneth Moreland
80809a8f0f Add DispatcherMapField.
This is a simple version of a dispatcher, but an important one.

Note that there is an issue brought up with UnitTestWorkletMapField in
that there needs to be better ways to specify worklet argument types.
2014-10-21 13:10:00 -06:00
Kenneth Moreland
53a454fe77 Add basic dispatcher functionality.
These changes support the implementation of DispatcherBase. This class
provides the basic functionality for calling an Invoke method in the
control environment, transferring data to the execution environment,
scheduling threads in the execution environment, pulling data for each
calling of the worklet method, and actually calling the worklet.
2014-10-21 11:49:23 -06:00
Kenneth Moreland
b78688f4f4 Add ability to zip function interface objects.
The zip capability allows you to parameter-wise combine two
FunctionInterface objects. The result is another FunctionInterface with
each parameter a Pair containing the respective values of the two
inputs.

Being able to zip allows you to do transforms and invokes on data that
is divided among multiple function interface objects.
2014-10-16 16:31:55 -06:00
Kenneth Moreland
01d6619774 Add basic worklet superclasses and signature tags 2014-10-15 15:47:39 -06:00
Kenneth Moreland
79399c210e Add Fetch class
The Fetch class is responsible for moving data in and out of some
collection in the execution environment. The Fetch class is templated
with a pair of tags (the type of fetch and the aspect) that control the
mechanism used for the fetch.
2014-10-15 13:52:27 -06:00
Kenneth Moreland
30558cf7ed Add Transport class
The Transport class is responsible for moving data from the control
environment to the execution environment. (Actually, it might be more
accurate to say it gets the execution environment associated with a
given control object.) The Transport class is templated with a tag that
controls the mechanism used for the transport.
2014-10-14 10:44:48 -06:00
Kenneth Moreland
10ba2efbf7 Unify test values.
Lots of tests have to move values in and out of arrays and check them
against expected values. It is also often the case that these tests are
run on lots of different types. There is some repeated code for
generating known values for particular indices. This change unifies some
of that. This can probably also encourage making more generic tests.
2014-10-14 10:00:34 -06:00
Kenneth Moreland
a7e6666037 Rename some type lists to be a bit more consistent. 2014-10-10 11:30:10 -06:00
Kenneth Moreland
e931d0d28b TypeListTagAll should really have all basic types.
The previous commits had TypeListTagAll containing a subset of Vec
types. This commit adds all possible vectors with 2 to 4 components
containing one of the basic C types.
2014-10-09 15:04:52 -06:00
Kenneth Moreland
7f94eafc9c Remove vtkm::Scalar and vtkm::Vector# types
Providing these types tends to "lock in" the precision of the algorithms
used in VTK-m. Since we are using templating anyway, our templates
should be generic enough to handle difference precision in the data.
Usually the appropriate type can be determined by the data provided. In
the case where there is no hint on the precision of data to use (for
example, in the code that provides coordinates for uniform data), there
is a vtkm::FloatDefault.
2014-10-09 08:54:56 -06:00
Kenneth Moreland
4881ed4ddb Change tests that try all base types to use different precision
Before we assumed that we would only use the basic types specified by
the widths of vtkm::Scalar and vtkm::Id. We want to expand this to make
sure the code works on whatever data precision we need.
2014-10-08 16:56:33 -06:00
Kenneth Moreland
0cc9d27e26 Expand the list of types to include multiple widths.
Since we want our code to generally handle data of different precision
(for example either float or double) expand the types in our list types
to include multiple precision.
2014-10-08 15:40:20 -06:00
Kenneth Moreland
b2298172ee Allow longer base lists
Previously we just hand coded base lists up to 4 entries, which was fine
for what we were using it for. However, now that we want to support base
types of different sizes, we are going to need much longer lists.
2014-10-08 12:53:01 -06:00
Kenneth Moreland
c3fbe073e8 Change VectorTraits to VecTraits.
Matches the previous move from Tuple to Vec. We can unify on this name.
2014-10-08 10:09:43 -06:00
Kenneth Moreland
2139d93206 Change vtkm::Tuple to vtkm::Vec
There are multiple reasons for this name change:

* The name Tuple conflicts with the boost::Tuple class, which as a
different interface and feature set. This gets confusing, especially
since VTK-m uses boost quite a bit.

* The use of this class is usually (although not always) as a
mathematical vector.

* The vtkm::Scalar and vtkm::Vector* classes are going to go away soon
to better support multiple base data type widths. Having this
abbriviated name will hopefully make the code a bit nicer when these
types have to be explicitly specified.

Also modified the implementation a bit to consolidate some of the code.
2014-10-08 10:09:43 -06:00
Kenneth Moreland
cbe6284b83 Add IdComponent and other base types with explicit widths
In preparation for supporting base types with more widths, add typedefs
for the base types with explicit widths (number of bits).

Also added a IdComponent type that should be used for indices for
components into tuples and vectors. There now should be no reason to use
"int" inside of VTK-m code (especially for indexing). This change cleans
up many of the int types that were used throughout.
2014-10-08 10:09:42 -06:00
Kenneth Moreland
ddf630da1c Fix wrapper macros around FunctionInterface header files
The header wrapper macros in all the FunctionInterface header files
declared the function interface to be in the cont package, which is
wrong.
2014-10-08 10:07:08 -06:00
Kenneth Moreland
1c710349e4 Add exception for timing test with MSVC in non-release mode.
We have a test for FunctionInterface to make sure that calling a function
indirectly through that is about as fast as directly. On MSVC we sometimes
observe that this timing fails in debug mode. This is probably the compiler
adding some code to each function invocation. That won't happen in production
compiles, so we don't care about it too much. Make an exception in this case.
2014-09-15 14:23:38 -06:00
Kenneth Moreland
08893fff1b Correct error message.
Why do I not see the typos until I've merged and pushed my
changes to the main repository?
2014-09-12 09:59:38 -06:00
Kenneth Moreland
e612e423e5 Check for wide iterators in ArrayPortalFromIterators.
When compiling with 32-bit Ids for a 64 bit machine (which is not
uncommon), it is possible that the distance between two iterators
is larger than the maximum value that can be stored in vtkm::Id.
If two such iterators were passed to ArrayPortalFromIterators, that
would cause problems.

This change checks for that condition and throws an out of memory
exception if it occurs. That would be a pretty darn big array and
is more likely to be the cause of an error somewhere else in the
code, but either way the check and error is good. This change also
fixes a warning we have been getting with MSVC.
2014-09-12 09:51:07 -06:00
Kenneth Moreland
904f582103 Properly check "raw" iterators in MSVC.
For MSVC we use the non-portable wrapper stdext::checked_array_iterators
because the compiler insists on it for safety. When we check to make sure
our templates are giving us raw pointers, we have to check for this wrapper
instead of the raw pointer itself.
2014-09-09 10:36:38 -06:00
Kenneth Moreland
8839e615e6 Remove GetIteratorBegin/End from all ArrayPortal classes.
Replace them (and their use) with the new ArrayPortalToIterators
functionality.
2014-09-08 14:59:11 -06:00
Kenneth Moreland
9bbbaecab6 Add ArrayPortalToIterators functionality.
This moves the ability to get an iterator from an array portal out of
the portal itself. The next step is to move the GetIteratorBegin/End out
of ArrayPortal. This should make the implemenation a bit cleaner.
2014-09-08 13:39:58 -06:00
Kenneth Moreland
6fb33f88af Use MSVC checked_array_iterator to suppress warnings and add checks.
MSVC likes to warn about using raw pointers as iterators in generic
algorithms because they have been known to lead to problems. When
compiling with that compiler, wrap raw pointers in
stdext::checked_array_pointer to suppress the error and also add a bit
more checking.
2014-08-12 15:25:45 -06:00
Kenneth Moreland
b917cf49f4 Replace CountByTwo with String Int in ArrayHandleCounting test.
I wanted to test ArrayHandleCounting with some non-standard data type.
I was using a class that looked like a number that counts by two, but
the operator behavior was not a proper group and that was causing issues.
Replaced that with a class that inefficiently represents an unsigned
integer as a string with that many characters. The inefficiency does not
matter because it is just a test.
2014-07-17 14:35:39 -06:00
Kenneth Moreland
9466151326 Make floating point comparison more tolerant in UnitTestDynamicArrayHandle
It appears that when the Intel compiler is optimizing, constant floating
point values can be slightly different than the same value stored in memory
and never changed. This change uses the test_equal method to compare
these floating point values that might have a slight numeric error.
2014-07-10 10:53:02 -06:00
Kenneth Moreland
adad702652 If pyexpander is available, run it and check the source file.
Although we cannot expect every developer to have pyexpander, for those
that do the build will automatically run it and check the expanded file
in the source code. If they match, a descriptive error is given.

We don't automatically update the file because subtle problems might
occur. It is better to alert a developer to fix the problem properly.
2014-06-26 18:26:45 -06:00
Kenneth Moreland
5fb7f63829 Replace Boost preprocessor iteration with macro expansion tool
This commit removes the usage of the boost preprocessor library to
iteratively generate templates with a variable number of parameters. It
is replaced with a template that is expanded by running it through the
pyexpander macro processing tool (http://pyexpander.sourceforge.net).

One reason for this change is to make the code easier to read. In
particular, it is difficult to understand compiler errors when they
occur deep within an iterating macro. Another reason for this change is
that the Intel compiler currently has a bug that breaks with the boost
preprocessor library.

One issue with this approach is that the macro expansion is not part of
the build process. Although open, pyexpander is not a tool most
developers will have readily installed on their system. Thus, if you
want to make changes to any of the macro code, you have to make sure
pyexpander is installed, then make changes to the input files, then
manually run pyexpander from the command line.
2014-06-25 16:03:44 -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
Robert Maynard
9f3d68c2c0 MSVC 2010 has troubles with < operators in the middle of enable_if.
Moved the code over to using mpl::less to solve the problem.
2014-06-20 16:53:27 -04:00
Kenneth Moreland
9573aa2764 Fix a test object to handle changes in the counting array handle 2014-06-19 11:12:54 -06:00
Kenneth Moreland
8ce0a268ea Minor change that allows vector types to be used in ArrayHandleCounting.
Probably not a lot of use for this, but a simple implementation that
should not affect anything else.
2014-06-18 23:14:39 -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
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
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
50a5210a7d Add Timer class.
Helpful for safely timing parallel code across different devices.
2014-06-10 12:54:18 -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
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
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
2b7a0e0490 revise the header guard naming convention to not conflict with macro names. 2014-03-07 10:22:36 -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
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
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