mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-20 02:55:47 +00:00
0ab3edd87d
`vtkm::VecFlat` is a wrapper around a `Vec`-like class that may be a nested series of vectors. For example, if you run a gradient operation on a vector field, you are probably going to get a `Vec` of `Vec`s that looks something like `vtkm::Vec<vtkm::Vec<vtkm::Float32, 3>, 3>`. That is fine, but what if you want to treat the result simply as a `Vec` of size 9? The `VecFlat` wrapper class allows you to do this. Simply place the nested `Vec` as an argument to `VecFlat` and it will behave as a flat `Vec` class. (In fact, `VecFlat` is a subclass of `Vec`.) The `VecFlat` class can be copied to and from the nested `Vec` it is wrapping. There is a `vtkm::make_VecFlat` convenience function that takes an object and returns a `vtkm::VecFlat` wrapped around it.
66 lines
1.8 KiB
CMake
66 lines
1.8 KiB
CMake
##============================================================================
|
|
## Copyright (c) Kitware, Inc.
|
|
## All rights reserved.
|
|
## See LICENSE.txt for details.
|
|
##
|
|
## This software is distributed WITHOUT ANY WARRANTY; without even
|
|
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
## PURPOSE. See the above copyright notice for more information.
|
|
##============================================================================
|
|
|
|
set(headers
|
|
Testing.h
|
|
VecTraitsTests.h
|
|
)
|
|
|
|
VTKM_declare_headers(${headers})
|
|
|
|
set(unit_tests
|
|
UnitTestBinaryPredicates.cxx
|
|
UnitTestBinaryOperators.cxx
|
|
UnitTestBounds.cxx
|
|
UnitTestCellShape.cxx
|
|
UnitTestDeprecated.cxx
|
|
UnitTestExceptions.cxx
|
|
UnitTestHash.cxx
|
|
UnitTestList.cxx
|
|
UnitTestListTag.cxx
|
|
UnitTestMatrix.cxx
|
|
UnitTestNewtonsMethod.cxx
|
|
UnitTestNoAssert.cxx
|
|
UnitTestPair.cxx
|
|
UnitTestRange.cxx
|
|
UnitTestTesting.cxx
|
|
UnitTestTransform3D.cxx
|
|
UnitTestTuple.cxx
|
|
UnitTestTypeList.cxx
|
|
UnitTestTypeListTag.cxx
|
|
UnitTestTypes.cxx
|
|
UnitTestTypeTraits.cxx
|
|
UnitTestUnaryPredicates.cxx
|
|
UnitTestVecAxisAlignedPointCoordinates.cxx
|
|
UnitTestVecFromPortal.cxx
|
|
UnitTestVecFromPortalPermute.cxx
|
|
UnitTestVectorAnalysis.cxx
|
|
UnitTestVecFlat.cxx
|
|
UnitTestVecTraits.cxx
|
|
UnitTestVecVariable.cxx
|
|
)
|
|
|
|
# Unit tests that have device-specific code to be tested
|
|
set(unit_tests_device
|
|
UnitTestAlgorithms.cxx
|
|
UnitTestAtomic.cxx
|
|
UnitTestGeometry.cxx
|
|
UnitTestMath.cxx
|
|
)
|
|
|
|
|
|
#variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
|
|
set_source_files_properties(UnitTestBounds.cxx PROPERTIES
|
|
COMPILE_OPTIONS "$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:GNU>>:-fno-var-tracking-assignments>")
|
|
|
|
vtkm_unit_tests(SOURCES ${unit_tests})
|
|
|
|
vtkm_unit_tests(NAME UnitTests_vtkm_testing_device SOURCES ${unit_tests_device} ALL_BACKENDS)
|