Fix a couple of places where having a Vec of a Vec (for example
vtkm::Vec<vtkm::Vec<vtkm::Float32, 3>, 3>) did not work as it should.
One major place was in the test_equal function used in the testing
framework. If given a Vec of Vec, it would try to convert the Vec to
Float64 and fail. Now the comparison decends as many levels as need be.
The second place was in TypeTraits::ZeroInitialization() for all Vec
types. Originally it initialized the Vec using the default constructor
of the component type. This works fine when the component type is a
standard type, but if the component type is itself a Vec, then the
default constructor does not actually set any of the sub components.
Solved the issue by using the result of ZeroInitialization for the
component type, which will work for basic types and Vecs and anything
else supported by TypeTraits.
These structs behave much like Vec except that they work on a short C
array given to them rather than having the statically sized short array
defined within.
I expect to use this in the short term to help implement cell face
classes, but there are probably many other uses.
ec5fd175 Modify test_equal for values close to zero
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !629
b97b4cc7 Allow thrust::reduce to work when iterator and initial value types differ.
64bcc343 Refactor MinAndMax to use vtkm::Vec<T,2> instead of Pair.
8d60ed57 Refactor MinAndMax to be a shared binary operator.
18375b54 Update Bound computations to always use a single Reduce call
2cfc9743 Reduce can support reduce to a T type that isn't the arrayhandles T type.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !614
I noticed the UnitTestTransform3D test failed using the random seed
1480544620. On closer inspection, I found that the issue was with the
comparison of two numbers close to 0. The numbers were just above the
threshold, but their difference was not quite enough to make the ratio
below the threshold.
After reviewing some other floating point comparisons, they seem to be
more forgiving of numbers close to 0. Thus, I changed this comparison to
pass if the difference between the numbers was below the threshold.
Because this makes the comparison a lot more forgiving for small
numbers, I lowered the default threshold by an order of magnitude. So
far it looks like the tests are passing, but we should look out for
occasional failures.
6b1094c7 Consistently include windows.h by making a wrapper header.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !620
We previously included windows.h in numerous locations using different
techniques to guard against bringing in parts of the file that are bad
(min/max macros, etc). This solves the problem by consistently using
vtkm/internal/Windows.h to setup everything.
natively thrust::reduce is unable to handle the use case where the
iterator type and the initial value/return value are two different
types. We use array handle cast to work around this problem when
we detect this usecase.
767fc9c6 Do not declare OpenGLHeaders.h when there is no OpenGL
10d9dd44 Remove GLEW_LIBRARIES from Rendering module libraries
0772a157 Revert "Don't build vtkm_rendering if we can't find opengl"
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !617
Previously, all declared policies had to implement every tag required by
the policy, even if it was the same as the default. In addition to being
annoying, this makes us less forward compatible because if we add a new
item to the policy any unchanged policy would become incorrect.
This change moves the default policy declarations from the default
policy to PolicyBase. The default policy inherits all of them without
any change. Other policies need only override those that are different
than the default.
For some reason on my Visual Studio 2013 the definition of
VTKM_STATIC_ASSERT (without the message) did not report where the actual
error message happened. This change seems to get Visual Studio to report
the location of the failed assert with a reasonable message.
There are many rendering classes that do not rely on OpenGL. We really
want to be able to use this functionality on systems that do not have
OpenGL. That is a big part of the point.
This reverts commit c75feb74bb6add43e1be9a42a9bf4bf205b97c39.
CUDA has some strange rules about using private classes and anonymous
namespaces. For whatever reason, recent changes have introduced such an
issue. When compiling on CUDA, expose the problematic class. It is
testing code, so it does not matter much.
The shape array in CellSetExplicit was changed a while ago to be of type
vtkm::UInt8. However, the shape types remained at vtkm::IdComponent. I
can think of no reason why they should not be the same type.
RemoveUnusedPoints contains a couple of worklets and some helper methods
to compact the points in a CellSetExplicit. This is helpful when you
have an operation that creates new cells but might not use all the
original points of the inputs.
This is a fancy array handle that can group entries in another array by
arbitrary amounts. This allows us to implement input and output arrays
with a different sized Vec for each instance. This is necessary for
generating new topologies with cells of different types.
There was a case of bad casting where a Float32 that should be in the
range between 0 and 1 was cast to an Id and then multiplied by the size
of an array. The intention is to get a proportional index into the
array, but because the float was cast to an int first, you get either
the first or last index.
Instead, first cast the size of the array to a Float32, multiply it by
the fraction, and then cast back to an Id. That should give the desired
effect.
4de37559 fix a pragma location bug
9048e0ba detect cuda versions and decide if to put a diagnostic inside or outside of a class.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !611
Changing the macros of the methods of ArrayPortalStreaming to be only
for CONT (the control environment) rather than both CONT and EXEC (both
the control and export environments). ArrayPortalStreaming is really
only used in the control environment and passed to the default transport
where the data is copied to the execution environment.
My hope is that this change will eliminate some rather odd and non-
descriptive warnings on the dashboard.
Change the VTKM_CONT_EXPORT to VTKM_CONT. (Likewise for EXEC and
EXEC_CONT.) Remove the inline from these macros so that they can be
applied to everything, including implementations in a library.
Because inline is not declared in these modifies, you have to add the
keyword to functions and methods where the implementation is not inlined
in the class.
8dadf560 Add in support for vector fields to Gradient worklet.
d53f43fb CellDerivaties now support computing the derivatives of vtkm::Vec fields.
b4378c85 Allow vtkm::Matrix to support T values which are vtkm::Vec.
9caabf97 vtkm::Vec now supports +=, -=, *=, and /=.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !608
This usage of raw_referenc_cast returns a const PortalValue which is than
assigned too. So to work around the problem we need to mark operator= on
the class as const.
It is common to write template code that needs to operate across both
scalar and vector values. To facilitate code like this we are required
to provide these common operators.
c4183cfa Refactor WholeCellSetIn to handle Point->Cell and Cell->Point
f65f5ea6 WorkletBase can now transport CellSets as a whole execution object.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !601
When the intel compiler has vectorization enabled ( -O2/-O3 ) it converts the
`adjacent/hypotenuse` divide operation into reciprocal (rcpps) and
multiply (mulps) operations. This causes a change in the expected result that
is larger than the default tolerance of test_equal. So to resolve the problem
we increase the tolerance for acos when using icc.
35a81df0 change variable names to avoid confusion
b2719157 simplify functions to get the approximation and detail coefficients length
d7e94e3a update 2D idwt to not assign zero to the last element of cDTemp
568bd63f fix a few warnings
514dcf4b see if unused warning shows up
30660bf4 fix comments by Rob
97118931 improved error message when test failing
9b45dba3 fix 2 warnings
...
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !577
fix compiler warnings.
Fix a bunch of compiler warnings that were in the rendering code and dataset builder classes.
@kmorel
@robertmaynard
See merge request !597
In VTK-m libraries, we are typically exporting (with declspec) classes rather
than the independent methods within the class. When you are exporting to a
dll in MSVC and the class contains a field that is not similarly exported,
then you get a warning. This is generally not an issue for our use since we
are really only using classes from the standard library and distributed with
VTK-m itself. The only sane way to fix the issue is to just disable the
warning.
When the intel compiler has vectorization enabled ( -O2/-O3 ) it converts the
`adjacent/hypotenuse` divide operation into reciprocal (rcpps) and
multiply (mulps) operations. This causes a change in the expected result that
is larger than the tolerance of test_equal.
Frankly, I am surprised that the CellAverage worklet compiled on CUDA
when the parenthesis operator relied on methods that were not delcared
as __device__.
There was a mismatch in the ApplyPolicy function for CoordinateSystem
objects. The return type declared for the function was not the same as
the type of object actually returned.
Also added a test that actually uses a filter with a CoordinateSystem as
a field to actually test this functionality.
Previously, the CellAverage worklet only operated on scalar fields.
However, there is no reason why you cannot average vectors. This change
allows passing input fields with arbitrary value types in the field
array.
We will use this functionality in the commit to test running filters on
coordinate systems (which, of course, are Vec 3 objects).
797d30d7 Remove unnecessary link from vtkm_rendering to glfw
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !593
There is no code in the rendering library that uses GLFW. (GLFW is
currently only used directly by tests and examples.) This adds
unnecessary link dependencies that can only hurt us later.
4f482474 Fixing error in data set reader that zeroed out cell asscociated fields in unstructured data sets
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !587
a8e06d8e Expand how we check that we have a c++11 compiler.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !589
37efba15 CellSetSingleType now can be constructed with proper number of points
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !586
7d295de8 Refactor vtk-m symbol visibility macros to be on the classes.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !585
Instead of labeling each method that needs to have visibility
we can label entire classes, this reduces the amount of noise and
potential for mistakes when writing classes.
Rendering using VBOs.
2D and 3D rendering is now done using VBOs.
@kmorel @robertmaynard
I think this is redy. You guys ok with this merge req?
See merge request !566
The function UnitTestTransferGLUT's second argument was declared as type
char **. However, the automatic code generated by CMake's testing
framework calls the function with the type char *[]. Some compilers
distinguish between these two types and were causing linking errors.
Fixed the type so the signatures match.
Change the OpenGL configuration to require GLEW as most of the OpenGL
code actually requires GLEW (or will as soon as the VBO branch gets
merged in).
Also removed some stray find_package commands and rearranged the
configuration to use the vtkm_configure_component_* commands instead.
452af3a0 Restore the AppendType and ReplaceType templates of FunctionInterface
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !570
ba8c8586 Get IntegerSequence to work correctly with MSVC.
377532c7 Update brigand to get a chunk of msvc2013 fixes.
a7f7cfe4 Update brigand.hpp to get corrections for MSVC2013.
a931b8e2 FunctionInterface and DispatcherBase don't require boost now.
ac0929a1 Add fast tracks for ListTag operations on size <= 4.
7ad88b6e Use c++11 variadic templates as storage of ListTags.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !559
One of the dashboard was complaining that the bottomLeft variable might
have been used uninitialized because it got set in a condition above it.
In fact, that condition is always true the first during the first
iteration, but it is not worth fighting the compiler over it. Instead,
just initialize the value of bottomLeft when it is constructed.
One of the dashboard compilers found a code path in PNGDecode where if
given a buffer too short for a header the info.width and info.height
were not initialized but their values still returned to the calling
function. This case does not really matter since an error is also
returned, but still technically incorrect. Fixed the problem by
initializing the width and height to 0 (which could help anyway if the
error is not properly checked).
This makes the name more consistent with the names of the other VTK-m
CMake options.
Also changed the default to be ON. I do not see a big downside to
compiling the rendering library most of the time.
123bc8b6 Add a configuration error if OSMesa was not found
0a61085d Do not load OpenGL libraries if OSMesa already loaded
640e92c7 Add VTKm_ENABLE_OSMESA option
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !548
If VTKm_ENABLE_OSMesa was on but OSMesa was not found, CMake would just
give a status update but happily configure. This change checks for the
condition where VTKm_ENABLE_OSMesa is on but OSMesa was not configured
correctly and raises an error in this case.
UnitTestMapperEGL.cxx: MapperGL is no longer a templated class.
UnitTestMapperGLFW.cxx: strmp needs cstring
rendering/CMakeLists.txt: need to append egl_sources to sources.
UnitTestMapperEGL.cxx: MapperGL is no longer a templated class.
UnitTestMapperGLFW.cxx: strmp needs cstring
rendering/CMakeLists.txt: need to append egl_sources to sources.
Add glut rendering unittest.
Make the GLFW package variables advanced, and add it to the configure components.
Modify the other examples that use GLUT to use the configure components command.
See merge request !546
The remove boost::shared_ptr and the rendering library branches where
developed simultaneously, and thus some of the rendering library
implementation was using boost::shared_ptr like the old code. Bring up
to date with the rest of VTK-m by using std::shared_ptr instead.
Make the GLFW package variables advanced, and add it to the configure components.
Modify the other examples that use GLUT to use the configure components command.
The clang compiler was running into linker errors constructors of
classes with virtual methods that were inline and destructors that were
not declared at all. In this case, the compiler was not creating
everything needed by a virtual table and the link died.
One of the dashboards is complaining about the destructor implementation
not being used in a particular test build. I suspect it is because the
export macro has an inline, so I am trying removing it.
I noticed that Visual Studio was taking an insane amount of time to
compile BitmapFontFactory.cxx (~20 minutes). Following some suggestions
on stackoverflow (http://stackoverflow.com/questions/7893850/long-
compile-times-in-visual-c-2010-with-large-static-arrays) I changed the
arrays to be static const (something that is more viable when compiling
a library instead of header-only). The compile after this changes seems
basically immediate now.
Also made the TextAnnotation classes conform better to VTK-m coding
style. Specifically, changed the order of words in subclass names (e.g.
TextAnnotationBillboard instead of BillboardTextAnnotation) and broke
out each subclass into its own header/source files.
When things in the rendering library need to execute things in parallel
(outside of another rendering library like OpenGL) it should run it on
available parallel devices. This means using TryExecute to attempt on
whatever devices may be available. It also means that some of the
sources must be compiled with CUDA's nvcc. To enable this, made a code
wrapping mechanism to compile within a .cu file.
This is using the C++11 override keyword to make the compiler check to
ensure that we are correctly overriding virtual methods when we mean to.
Currently this will not compile without C++11. However, we are planning
on moving to C++11 very soon, and we can fix the macro if we don't.
I have noticed at least on my windows machine that source code that uses
the rendering package is taking a long time to compile. The rendering
library does not rely much on templates and more on virtual methods.
Thus, it is a good candidate for moving to a library so that it need be
compiled only once.
This sets up the configure scripts to create the library. There is also
a simple port of one class to the library. More will follow.
Fix precision warnings when FloatDefault is 64 bit
When VTKm_USE_DOUBLE_PRECISION is on (not the default), then
vtkm::FloatDefault is set to 64 bit values. There was some code that was
coded for 32 bit and never checked for 64 bit (on all compilers).
See merge request !526
1881d375 Explicitly error out if vtk-m is used with a non c++11 compiler.
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kenneth Moreland <kmorel@sandia.gov>
Merge-request: !532