vtk-m2/vtkm/cont/CMakeLists.txt
Kenneth Moreland c16236ce69 Use ArrayRangeCompute without specifying a device
Most uses of ArrayRangeCompute just want to get the range of the data
and probably don't have a particular device in mind. Thus, it is better
to use a TryExecute internally use whatever devices are available.

Note that when using TryExecute, the calling code is expected to be able
to support all devices. That might not always be the case. Thus, I am
experimenting a bit with how we incorporate this in a library. The
advantage of having the code compiled in a library is that you only have
to compile it once and the calling code does not need to worry about
CUDA, etc.

However, because ArrayRangeCompute is templated, we can only pre-compile
some subset of array handle types. The most common are compiled into the
code (matching all the predefined ArrayHandles as well as some special
cases). If the code wants to use some other type, it has to include
ArrayRangeCompute.hxx. The only place where this is necessary is a test
that intentially trys to find the range on an uncommon type.

If array portals were to support virtual methods, then we should be able
to modify this code so that we could precompile for all array handle
types.
2017-03-09 13:18:36 -05:00

119 lines
3.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.
##
## Copyright 2014 Sandia Corporation.
## Copyright 2014 UT-Battelle, LLC.
## Copyright 2014 Los Alamos National Security.
##
## Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
## the U.S. Government retains certain rights in this software.
##
## Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
## Laboratory (LANL), the U.S. Government retains certain rights in
## this software.
##============================================================================
set(headers
ArrayHandle.h
ArrayHandleCast.h
ArrayHandleCartesianProduct.h
ArrayHandleCompositeVector.h
ArrayHandleConstant.h
ArrayHandleCounting.h
ArrayHandleDiscard.h
ArrayHandleGroupVec.h
ArrayHandleGroupVecVariable.h
ArrayHandleImplicit.h
ArrayHandleIndex.h
ArrayHandlePermutation.h
ArrayHandleStreaming.h
ArrayHandleTransform.h
ArrayHandleUniformPointCoordinates.h
ArrayHandleZip.h
ArrayPortal.h
ArrayPortalToIterators.h
ArrayHandleConcatenate.h
ArrayRangeCompute.h
ArrayRangeCompute.hxx
CellSet.h
CellSetExplicit.h
CellSetListTag.h
CellSetSingleType.h
CellSetStructured.h
CellSetPermutation.h
CoordinateSystem.h
DataSet.h
DataSetBuilderExplicit.h
DataSetBuilderRectilinear.h
DataSetBuilderUniform.h
DataSetFieldAdd.h
DeviceAdapter.h
DeviceAdapterAlgorithm.h
DeviceAdapterListTag.h
DynamicArrayHandle.h
DynamicCellSet.h
Error.h
ErrorBadAllocation.h
ErrorBadType.h
ErrorBadValue.h
ErrorExecution.h
ErrorInternal.h
Field.h
RuntimeDeviceInformation.h
RuntimeDeviceTracker.h
Storage.h
StorageBasic.h
StorageImplicit.h
StorageListTag.h
Timer.h
TryExecute.h
)
set(header_impls
ArrayHandle.hxx
CellSetStructured.hxx
StorageBasic.hxx
)
set(sources
ArrayHandle.cxx
CellSet.cxx
CellSetStructured.cxx
CoordinateSystem.cxx
DynamicArrayHandle.cxx
Field.cxx
internal/SimplePolymorphicContainer.cxx
StorageBasic.cxx
)
# This list of sources has code that uses devices and so might need to be
# compiled with a device-specific compiler (like CUDA).
set(device_sources
ArrayRangeCompute.cxx
RuntimeDeviceTracker.cxx
)
vtkm_library(
SOURCES ${sources}
WRAP_FOR_CUDA ${device_sources}
HEADERS ${header_impls})
target_include_directories(vtkm_cont PRIVATE ${VTKm_BACKEND_INCLUDE_DIRS})
#-----------------------------------------------------------------------------
add_subdirectory(internal)
add_subdirectory(arg)
vtkm_declare_headers(${headers})
add_subdirectory(serial)
add_subdirectory(cuda)
add_subdirectory(tbb)
#-----------------------------------------------------------------------------
add_subdirectory(testing)