Commit Graph

11412 Commits

Author SHA1 Message Date
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
e6a16c938f Merge branch 'any-scalar-width' 2014-10-10 11:30:35 -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
94e9ee8c81 Merge branch 'any-scalar-width' 2014-10-09 15:05:22 -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
750dd66687 Merge branch 'function-interface-wrong-package' 2014-10-08 10:07:51 -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
d91f66acab Keep pyexpander generated files out of build directory
The previous behavior of the pyexpander check (in
VTKmCheckPyexpander.cmake) was to generate the file in the binary
directory and then remove it from there iff the check failed. This
caused two problems. The first is that if the check failed then the file
was deleted and there was no file to copy to the source as the
instructions suggested. The second is that if the check succeeded the
build would then use the files in the build directory rather than the
source directory, and if the programmer accidently modified the binary
files (because, for example, if a build error occured there), the
configure system would not catch that.

This change in behavior was that if the check failed, the file is
renamed to have a .save extension so that the file remains and can be
easily copied back to the source directory if that is appropriate. If
the check succeeds, the generated file is removed and a file with the
extension .check is touched. That .check file is used as a make target
to signal that the test has been performed.
2014-10-08 10:03:10 -06:00
Kenneth Moreland
1f587a32a9 Merge branch 'function-interface-slow' 2014-09-15 14:27:00 -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
d8dcaeed4e Merge branch 'array-portal-from-wide-iterators' 2014-09-12 10:00:39 -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
35a757d9fe Merge branch 'array-portal-from-wide-iterators' 2014-09-12 09:55:16 -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
e73bc4df5b Merge branch 'system-information-test' 2014-09-10 13:36:39 -06:00
Kenneth Moreland
5aca77a530 Add SystemInformation test
The SystemInformation test always passes. It prints out the contents of
various configuration parameters. The intention is to capture this
information in dashboard reports. That way if a change causes a
dashboard failure and a developer does not have access to the dashboard,
she can look at the output of this test to see the configuration of the
build and that machine.
2014-09-10 13:36:16 -06:00
Kenneth Moreland
2adb4a83a8 Merge branch 'no-portal-get-iterator' 2014-09-09 11:19:39 -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
fdf3543c36 Merge branch 'msvc-unsafe-warnings' 2014-08-12 16:09:26 -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
fe4d26210c Turn off unsafe function warning for CMake-generated test code.
The CMake template for the source file that contains the main function for
tests uses functions that MSVC considers unsafe. We want to check for these
conditions but have no control over the CMake-generated test code (which
looks right anyway). This disables the warning specifically for those
source files but nothing else.
2014-08-12 14:00:24 -06:00
Kenneth Moreland
85664c8ed9 Merge remote-tracking branch 'msvc-warnings' 2014-07-17 17:05: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
6052ce2620 Merge branch 'update-readme' 2014-07-16 10:16:08 -06:00
Kenneth Moreland
029c278286 Update readme to include PISTON. 2014-07-16 10:15:44 -06:00
Kenneth Moreland
b66a5c706a Merge branch 'icc-fix' 2014-07-10 10:58:04 -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
4c65092322 Merge branch 'expand-function-interface' 2014-07-07 08:31:47 -06:00
Robert Maynard
d8e615b0cb Merge branch 'cdash_support' 2014-06-30 11:21:27 -04:00
Robert Maynard
1156078552 Add the correct copyright statement to CTestConfig. 2014-06-30 11:21:07 -04:00
Robert Maynard
15d43d8803 Merge branch 'cdash_support' 2014-06-27 17:06:32 -04:00
Robert Maynard
978d9b4272 Add a CDash support to vtkm. 2014-06-27 16:50:36 -04: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
2f1d910eeb Merge branch 'container-to-storage' 2014-06-25 11:29:26 -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
b2584f92a6 Merge branch 'windows_function_interface' 2014-06-20 16:55:12 -04: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
19f16951a3 Merge branch 'count-vectors' 2014-06-19 11:13:06 -06: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