163d591795
The `vtkm_unit_tests` function in the CMake build now allows you to specify which files need to be compiled with a device compiler using the `DEVICE_SOURCES` argument. Previously, the only way to specify that unit tests needed to be compiled with a device compiler was to use the `ALL_BACKENDS` argument, which would automatically compile everything with the device compiler as well as test the code on all backends. `ALL_BACKENDS` is still supported, but it no longer changes the sources to be compiled with the device compiler.
74 lines
2.0 KiB
CMake
74 lines
2.0 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})
|
|
|
|
if(VTKm_ENABLE_TESTING)
|
|
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
|
|
UnitTestLowerBound.cxx
|
|
UnitTestMath.cxx
|
|
UnitTestUpperBound.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
|
|
DEVICE_SOURCES ${unit_tests_device}
|
|
ALL_BACKENDS
|
|
)
|
|
endif()
|