vtk-m/vtkm/cont/testing/CMakeLists.txt
Kenneth Moreland c44f686496 Add hints to device adapter scheduler
The `DeviceAdapter` provides an abstract interface to the accelerator
devices worklets and other algorithms run on. As such, the programmer has
less control about how the device launches each worklet. Each device
adapter has its own configuration parameters and other ways to attempt to
optimize how things are run, but these are always a universal set of
options that are applied to everything run on the device. There is no way
to specify launch parameters for a particular worklet.

To provide this information, VTK-m now supports `Hint`s to the device
adapter. The `DeviceAdapterAlgorithm::Schedule` method takes a templated
argument that is of the type `HintList`. This object contains a template
list of `Hint` types that provide suggestions on how to launch the parallel
execution. The device adapter will pick out hints that pertain to it and
adjust its launching accordingly.

These are called hints rather than, say, directives, because they don't
force the device adapter to do anything. The device adapter is free to
ignore any (and all) hints. The point is that the device adapter can take
into account the information to try to optimize for itself.

A provided hint can be tied to specific device adapters. In this way, an
worklet can further optimize itself. If multiple hints match a device
adapter, the last one in the list will be selected.

The `Worklet` base now has an internal type named `Hints` that points to a
`HintList` that is applied when the worklet is scheduled. Derived worklet
classes can provide hints by simply defining their own `Hints` type.
2024-02-09 10:42:23 -05:00

148 lines
4.4 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
TestingDeviceAdapter.h
TestingRuntimeDeviceConfiguration.h
TestingSerialization.h
)
set(unit_tests
UnitTestArrayExtractComponent.cxx
UnitTestArrayGetValues.cxx
UnitTestArrayHandleCartesianProduct.cxx
UnitTestArrayHandleCompositeVector.cxx
UnitTestArrayHandleCounting.cxx
UnitTestArrayHandleDiscard.cxx
UnitTestArrayHandleIndex.cxx
UnitTestArrayHandleOffsetsToNumComponents.cxx
UnitTestArrayHandleRandomUniformBits.cxx
UnitTestArrayHandleReverse.cxx
UnitTestArrayHandleThreadSafety.cxx
UnitTestArrayHandleUniformPointCoordinates.cxx
UnitTestArrayPortalFromIterators.cxx
UnitTestArrayPortalToIterators.cxx
UnitTestBuffer.cxx
UnitTestComputeRange.cxx
UnitTestControlSignatureTag.cxx
UnitTestContTesting.cxx
UnitTestDataSetBuilderCurvilinear.cxx
UnitTestDataSetBuilderExplicit.cxx
UnitTestDataSetBuilderRectilinear.cxx
UnitTestDataSetBuilderUniform.cxx
UnitTestDataSetConvertToExpected.cxx
UnitTestDataSetExplicit.cxx
UnitTestDataSetRectilinear.cxx
UnitTestDataSetUniform.cxx
UnitTestDeviceAdapterAlgorithmGeneral.cxx
UnitTestDeviceSelectOnThreads.cxx
UnitTestError.cxx
UnitTestFieldRangeCompute.cxx
UnitTestInitialize.cxx
UnitTestIteratorFromArrayPortal.cxx
UnitTestLateDeallocate.cxx
UnitTestLogging.cxx
UnitTestMergePartitionedDataSet.cxx
UnitTestMoveConstructors.cxx
UnitTestPartitionedDataSet.cxx
UnitTestRuntimeConfigurationOptions.cxx
UnitTestRuntimeDeviceInformation.cxx
UnitTestRuntimeDeviceNames.cxx
UnitTestScopedRuntimeDeviceTracker.cxx
UnitTestStorageList.cxx
UnitTestTimer.cxx
UnitTestToken.cxx
UnitTestTryExecute.cxx
UnitTestTypeCheckArray.cxx
UnitTestTypeCheckCellSet.cxx
UnitTestTypeCheckExecObject.cxx
UnitTestTypeCheckKeys.cxx
UnitTestUnknownArrayHandle.cxx
UnitTestUnknownCellSet.cxx
)
set(unit_tests_device
UnitTestAlgorithm.cxx
UnitTestArrayCopy.cxx
UnitTestArrayHandle.cxx
UnitTestArrayHandleConcatenate.cxx
UnitTestArrayHandleConstant.cxx
UnitTestArrayHandleCast.cxx
UnitTestArrayHandleDecorator.cxx
UnitTestArrayHandleExtractComponent.cxx
UnitTestArrayHandleGroupVec.cxx
UnitTestArrayHandleGroupVecVariable.cxx
UnitTestArrayHandleImplicit.cxx
UnitTestArrayHandleMultiplexer.cxx
UnitTestArrayHandlePermutation.cxx
UnitTestArrayHandleRandomStandardNormal.cxx
UnitTestArrayHandleRandomUniformReal.cxx
UnitTestArrayHandleRecombineVec.cxx
UnitTestArrayHandleRuntimeVec.cxx
UnitTestArrayHandleSOA.cxx
UnitTestArrayHandleSwizzle.cxx
UnitTestArrayHandleTransform.cxx
UnitTestArrayHandleView.cxx
UnitTestArrayHandleXGCCoordinates.cxx
UnitTestArrayHandleZip.cxx
UnitTestArrayRangeCompute.cxx
UnitTestBitField.cxx
UnitTestCellLocatorChooser.cxx
UnitTestCellLocatorGeneral.cxx
UnitTestCellLocatorPartitioned.cxx
UnitTestCellLocatorRectilinearGrid.cxx
UnitTestCellLocatorUniformGrid.cxx
UnitTestCellLocatorUnstructured.cxx
UnitTestCellSet.cxx
UnitTestCellSetExplicit.cxx
UnitTestCellSetPermutation.cxx
UnitTestColorTable.cxx
UnitTestDataSetPermutation.cxx
UnitTestDataSetSingleType.cxx
UnitTestDeviceAdapterAlgorithmDependency.cxx
UnitTestHints.cxx
UnitTestImplicitFunction.cxx
UnitTestParticleArrayCopy.cxx
UnitTestPointLocatorSparseGrid.cxx
UnitTestTransportArrayIn.cxx
UnitTestTransportArrayInOut.cxx
UnitTestTransportArrayOut.cxx
UnitTestTransportCellSetIn.cxx
UnitTestTransportExecObject.cxx
UnitTestTransportWholeArray.cxx
)
if(TARGET vtkm_filter_field_conversion)
list(APPEND unit_tests_device
UnitTestCellSetExtrude.cxx
)
endif()
if(TARGET vtkm_filter_contour)
list(APPEND unit_tests
UnitTestAbort.cxx
)
endif()
vtkm_unit_tests(SOURCES ${unit_tests} DEVICE_SOURCES ${unit_tests_device})
target_sources(UnitTests_vtkm_cont_testing
PRIVATE
UnitTestHints.cxx
)
#add distributed tests i.e.test to run with MPI
#if MPI is enabled.
set(mpi_unit_tests
UnitTestFieldRangeGlobalCompute.cxx
UnitTestSerializationArrayHandle.cxx
UnitTestSerializationDataSet.cxx
)
vtkm_unit_tests(MPI SOURCES ${mpi_unit_tests})