This commit is contained in:
Dave Pugmire 2022-04-11 12:16:08 -04:00
commit 93dca43cd9
277 changed files with 3896 additions and 5231 deletions

@ -81,12 +81,12 @@
- .docker_image
.ubuntu1804_cuda: &ubuntu1804_cuda
image: "kitware/vtkm:ci-ubuntu1804_cuda11.1-20201016"
image: "kitware/vtkm:ci-ubuntu1804_cuda11.6-20220407"
extends:
- .docker_image
.ubuntu1804_cuda_kokkos: &ubuntu1804_cuda_kokkos
image: "kitware/vtkm:ci-ubuntu1804_cuda11_kokkos-20210916"
image: "kitware/vtkm:ci-ubuntu1804_cuda11_kokkos-20220407"
extends:
- .docker_image

@ -36,3 +36,21 @@ test:centos8_sanitizer:
- build:centos8_sanitizer
needs:
- build:centos8_sanitizer
# Build on centos8 without tests
# Uses gcc 8.2.1
build:centos8:
tags:
- build
- vtkm
- docker
- linux
extends:
- .centos8
- .cmake_build_linux
- .run_automatically
variables:
CMAKE_BUILD_TYPE: RelWithDebInfo
CMAKE_GENERATOR: "Unix Makefiles"
VTKM_SETTINGS: "serial+no_testing"

@ -58,6 +58,7 @@ foreach(option IN LISTS options)
elseif(no_testing STREQUAL option)
set(VTKm_ENABLE_TESTING "OFF" CACHE STRING "")
set(VTKm_ENABLE_TESTING_LIBRARY "OFF" CACHE STRING "")
elseif(examples STREQUAL option)
set(VTKm_ENABLE_EXAMPLES "ON" CACHE STRING "")
@ -97,8 +98,10 @@ foreach(option IN LISTS options)
elseif(volta STREQUAL option)
set(VTKm_CUDA_Architecture "volta" CACHE STRING "")
# From turing we set the architecture using the cannonical
# CMAKE_CUDA_ARCHITECTURES
elseif(turing STREQUAL option)
set(VTKm_CUDA_Architecture "turing" CACHE STRING "")
set(CMAKE_CUDA_ARCHITECTURES "75" CACHE STRING "")
elseif(hip STREQUAL option)
if(CMAKE_VERSION VERSION_LESS_EQUAL 3.20)
@ -164,7 +167,7 @@ if(SCCACHE_COMMAND)
# Use VTKm_CUDA_Architecture to determine if we need CUDA sccache setup
# since this will also capture when kokkos is being used with CUDA backing
if(DEFINED VTKm_CUDA_Architecture)
if(DEFINED VTKm_CUDA_Architecture OR DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_COMPILER_LAUNCHER "${SCCACHE_COMMAND}" CACHE STRING "")
endif()
endif()

@ -1,4 +1,4 @@
FROM nvidia/cuda:11.1-devel-ubuntu18.04
FROM nvidia/cuda:11.6.1-devel-ubuntu18.04
LABEL maintainer "Robert Maynard<robert.maynard@kitware.com>"
# Base dependencies for building VTK-m projects

@ -1,4 +1,4 @@
FROM nvidia/cuda:11.0-devel-ubuntu18.04
FROM nvidia/cuda:11.6.1-devel-ubuntu18.04
LABEL maintainer "Vicente Adolfo Bolea Sanchez<vicente.bolea@kitware.com>"
# Base dependencies for building VTK-m projects

@ -0,0 +1,12 @@
#ifndef @INSTANTIATION_INC_GUARD@
#define @INSTANTIATION_INC_GUARD@
#endif
#include <@INSTANTIATION_TEMPLATE_SOURCE@>
/* Needed for linking errors when no instantiations */
int @INSTANTIATION_INC_GUARD@@counter@__;
@INSTANTIATION_DECLARATION@
#undef @INSTANTIATION_INC_GUARD@

@ -115,8 +115,15 @@ endif()
# replace this with setting `cuda_architecture_flags` as part of the
# EXPORT_PROPERTIES of the vtkm_cuda target
if(VTKm_ENABLE_CUDA AND VTKM_FROM_INSTALL_DIR)
set_target_properties(vtkm::cuda PROPERTIES cuda_architecture_flags "@VTKm_CUDA_Architecture_Flags@")
set_target_properties(vtkm::cuda PROPERTIES requires_static_builds TRUE)
set_target_properties(vtkm::cuda PROPERTIES
# Canonical way of setting CUDA arch
CUDA_ARCHITECTURES "@CMAKE_CUDA_ARCHITECTURES@"
# Legacy way of setting CUDA arch
cuda_architecture_flags "@VTKm_CUDA_Architecture_Flags@"
requires_static_builds TRUE)
# If VTK-m is built with 3.18+ and the consumer is < 3.18 we need to drop
# these properties as they break the VTK-m cuda flag logic

@ -80,7 +80,7 @@ if(VTKm_ENABLE_CUDA)
message(FATAL_ERROR "VTK-m CUDA support requires version 9.2+")
endif()
if (NOT TARGET vtkm::cuda)
if(NOT TARGET vtkm::cuda)
add_library(vtkm_cuda INTERFACE)
add_library(vtkm::cuda ALIAS vtkm_cuda)
set_target_properties(vtkm_cuda PROPERTIES EXPORT_NAME vtkm::cuda)
@ -108,146 +108,162 @@ if(VTKm_ENABLE_CUDA)
target_compile_features(vtkm_cuda INTERFACE cxx_std_14)
endif()
# add the -gencode flags so that all cuda code
# way compiled properly
# If we have specified CMAKE_CUDA_ARCHITECTURES and CMake >= 3.18 we are
# done setting up vtkm_cuda.
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES OR CMAKE_VERSION VERSION_LESS 3.18)
#---------------------------------------------------------------------------
# Populates CMAKE_CUDA_FLAGS with the best set of flags to compile for a
# given GPU architecture. The majority of developers should leave the
# option at the default of 'native' which uses system introspection to
# determine the smallest numerous of virtual and real architectures it
# should target.
#
# The option of 'all' is provided for people generating libraries that
# will deployed to any number of machines, it will compile all CUDA code
# for all major virtual architectures, guaranteeing that the code will run
# anywhere.
#
# The option 'none' is provided so that when being built as part of another
# project, its own custom flags can be used.
#
# 1 - native
# - Uses system introspection to determine compile flags
# 2 - fermi
# - Uses: --generate-code=arch=compute_20,code=sm_20
# 3 - kepler
# - Uses: --generate-code=arch=compute_30,code=sm_30
# - Uses: --generate-code=arch=compute_35,code=sm_35
# 4 - maxwell
# - Uses: --generate-code=arch=compute_50,code=sm_50
# 5 - pascal
# - Uses: --generate-code=arch=compute_60,code=sm_60
# 6 - volta
# - Uses: --generate-code=arch=compute_70,code=sm_70
# 7 - turing
# - Uses: --generate-code=arch=compute_75,code=sm_75
# 8 - ampere
# - Uses: --generate-code=arch=compute_80,code=sm_80
# - Uses: --generate-code=arch=compute_86,code=sm_86
# 8 - all
# - Uses: --generate-code=arch=compute_30,code=sm_30
# - Uses: --generate-code=arch=compute_35,code=sm_35
# - Uses: --generate-code=arch=compute_50,code=sm_50
# - Uses: --generate-code=arch=compute_60,code=sm_60
# - Uses: --generate-code=arch=compute_70,code=sm_70
# - Uses: --generate-code=arch=compute_75,code=sm_75
# - Uses: --generate-code=arch=compute_80,code=sm_80
# - Uses: --generate-code=arch=compute_86,code=sm_86
# 8 - none
#
# Recommend user to use CMAKE_CUDA_ARCHITECTURES instead
if(DEFINED VTKm_CUDA_Architecture AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.18)
message(DEPRECATION "VTKm_CUDA_Architecture used, use CMAKE_CUDA_ARCHITECTURES instead in CMake >= 3.18")
endif()
#specify the property
set(VTKm_CUDA_Architecture "native" CACHE STRING "Which GPU Architecture(s) to compile for")
set_property(CACHE VTKm_CUDA_Architecture PROPERTY STRINGS native fermi kepler maxwell pascal volta turing ampere all none)
# We disable CMAKE_CUDA_ARCHITECTURES since we add the arch manually
set(CMAKE_CUDA_ARCHITECTURES OFF)
#detect what the property is set too
if(VTKm_CUDA_Architecture STREQUAL "native")
# add the -gencode flags so that all cuda code
# way compiled properly
if(VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT)
#Use the cached value
set(arch_flags ${VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT})
else()
#---------------------------------------------------------------------------
# When using CMAKE >= 3.18 use instead CMAKE_CUDA_ARCHITECTURES since it
# is the canonical way to specify archs in modern CMAKE.
#
# Populates CMAKE_CUDA_FLAGS with the best set of flags to compile for a
# given GPU architecture. The majority of developers should leave the
# option at the default of 'native' which uses system introspection to
# determine the smallest numerous of virtual and real architectures it
# should target.
#
# The option of 'all' is provided for people generating libraries that
# will deployed to any number of machines, it will compile all CUDA code
# for all major virtual architectures, guaranteeing that the code will run
# anywhere.
#
# The option 'none' is provided so that when being built as part of another
# project, its own custom flags can be used.
#
# 1 - native
# - Uses system introspection to determine compile flags
# 2 - fermi
# - Uses: --generate-code=arch=compute_20,code=sm_20
# 3 - kepler
# - Uses: --generate-code=arch=compute_30,code=sm_30
# - Uses: --generate-code=arch=compute_35,code=sm_35
# 4 - maxwell
# - Uses: --generate-code=arch=compute_50,code=sm_50
# 5 - pascal
# - Uses: --generate-code=arch=compute_60,code=sm_60
# 6 - volta
# - Uses: --generate-code=arch=compute_70,code=sm_70
# 7 - turing
# - Uses: --generate-code=arch=compute_75,code=sm_75
# 8 - ampere
# - Uses: --generate-code=arch=compute_80,code=sm_80
# - Uses: --generate-code=arch=compute_86,code=sm_86
# 8 - all
# - Uses: --generate-code=arch=compute_30,code=sm_30
# - Uses: --generate-code=arch=compute_35,code=sm_35
# - Uses: --generate-code=arch=compute_50,code=sm_50
# - Uses: --generate-code=arch=compute_60,code=sm_60
# - Uses: --generate-code=arch=compute_70,code=sm_70
# - Uses: --generate-code=arch=compute_75,code=sm_75
# - Uses: --generate-code=arch=compute_80,code=sm_80
# - Uses: --generate-code=arch=compute_86,code=sm_86
# 8 - none
#
#run execute_process to do auto_detection
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(args "-ccbin" "${CMAKE_CXX_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu")
elseif(CUDA_HOST_COMPILER)
set(args "-ccbin" "${CUDA_HOST_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu")
#specify the property
set(VTKm_CUDA_Architecture "native" CACHE STRING "Which GPU Architecture(s) to compile for")
set_property(CACHE VTKm_CUDA_Architecture PROPERTY STRINGS native fermi kepler maxwell pascal volta turing ampere all none)
#detect what the property is set too
if(VTKm_CUDA_Architecture STREQUAL "native")
if(VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT)
#Use the cached value
set(arch_flags ${VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT})
else()
set(args "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu")
endif()
execute_process(
COMMAND ${CMAKE_CUDA_COMPILER} ${args}
RESULT_VARIABLE ran_properly
OUTPUT_VARIABLE run_output
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
#run execute_process to do auto_detection
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set(args "-ccbin" "${CMAKE_CXX_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu")
elseif(CUDA_HOST_COMPILER)
set(args "-ccbin" "${CUDA_HOST_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu")
else()
set(args "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu")
endif()
if(ran_properly EQUAL 0)
#find the position of the "--generate-code" output. With some compilers such as
#msvc we get compile output plus run output. So we need to strip out just the
#run output
string(FIND "${run_output}" "--generate-code" position)
string(SUBSTRING "${run_output}" ${position} -1 run_output)
execute_process(
COMMAND ${CMAKE_CUDA_COMPILER} ${args}
RESULT_VARIABLE ran_properly
OUTPUT_VARIABLE run_output
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set(arch_flags ${run_output})
set(VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT ${run_output} CACHE INTERNAL
"device type(s) for cuda[native]")
else()
message(FATAL_ERROR "Error detecting architecture flags for CUDA. Please set VTKm_CUDA_Architecture manually.")
if(ran_properly EQUAL 0)
#find the position of the "--generate-code" output. With some compilers such as
#msvc we get compile output plus run output. So we need to strip out just the
#run output
string(FIND "${run_output}" "--generate-code" position)
string(SUBSTRING "${run_output}" ${position} -1 run_output)
set(arch_flags ${run_output})
set(VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT ${run_output} CACHE INTERNAL
"device type(s) for cuda[native]")
else()
message(FATAL_ERROR "Error detecting architecture flags for CUDA. Please set VTKm_CUDA_Architecture manually.")
endif()
endif()
endif()
if(VTKm_CUDA_Architecture STREQUAL "fermi")
set(arch_flags --generate-code=arch=compute_20,code=sm_20)
elseif(VTKm_CUDA_Architecture STREQUAL "kepler")
set(arch_flags --generate-code=arch=compute_30,code=sm_30
--generate-code=arch=compute_35,code=sm_35)
elseif(VTKm_CUDA_Architecture STREQUAL "maxwell")
set(arch_flags --generate-code=arch=compute_50,code=sm_50)
elseif(VTKm_CUDA_Architecture STREQUAL "pascal")
set(arch_flags --generate-code=arch=compute_60,code=sm_60
--generate-code=arch=compute_61,code=sm_61)
elseif(VTKm_CUDA_Architecture STREQUAL "volta")
set(arch_flags --generate-code=arch=compute_70,code=sm_70)
elseif(VTKm_CUDA_Architecture STREQUAL "turing")
set(arch_flags --generate-code=arch=compute_75,code=sm_75)
elseif(VTKm_CUDA_Architecture STREQUAL "ampere")
set(arch_flags --generate-code=arch=compute_80,code=sm_80
--generate-code=arch=compute_86,code=sm_86)
elseif(VTKm_CUDA_Architecture STREQUAL "all")
set(arch_flags --generate-code=arch=compute_30,code=sm_30
--generate-code=arch=compute_35,code=sm_35
--generate-code=arch=compute_50,code=sm_50
--generate-code=arch=compute_60,code=sm_60
--generate-code=arch=compute_70,code=sm_70
--generate-code=arch=compute_75,code=sm_75
--generate-code=arch=compute_80,code=sm_80
--generate-code=arch=compute_86,code=sm_86)
endif()
string(REPLACE ";" " " arch_flags "${arch_flags}")
if(POLICY CMP0105)
cmake_policy(GET CMP0105 policy_105_enabled)
endif()
if(policy_105_enabled STREQUAL "NEW")
target_compile_options(vtkm_cuda INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:${arch_flags}>)
target_link_options(vtkm_cuda INTERFACE $<DEVICE_LINK:${arch_flags}>)
else()
# Before 3.18 we had to use CMAKE_CUDA_FLAGS as we had no way
# to propagate flags to the device link step
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${arch_flags}")
endif()
# This needs to be lower-case for the property to be properly exported
# CMake 3.15 we can add `cuda_architecture_flags` to the EXPORT_PROPERTIES
# target property to have this automatically exported for us
set(VTKm_CUDA_Architecture_Flags "${arch_flags}")
set_target_properties(vtkm_cuda PROPERTIES cuda_architecture_flags "${arch_flags}")
unset(arch_flags)
endif()
if(VTKm_CUDA_Architecture STREQUAL "fermi")
set(arch_flags --generate-code=arch=compute_20,code=sm_20)
elseif(VTKm_CUDA_Architecture STREQUAL "kepler")
set(arch_flags --generate-code=arch=compute_30,code=sm_30
--generate-code=arch=compute_35,code=sm_35)
elseif(VTKm_CUDA_Architecture STREQUAL "maxwell")
set(arch_flags --generate-code=arch=compute_50,code=sm_50)
elseif(VTKm_CUDA_Architecture STREQUAL "pascal")
set(arch_flags --generate-code=arch=compute_60,code=sm_60)
elseif(VTKm_CUDA_Architecture STREQUAL "volta")
set(arch_flags --generate-code=arch=compute_70,code=sm_70)
elseif(VTKm_CUDA_Architecture STREQUAL "turing")
set(arch_flags --generate-code=arch=compute_75,code=sm_75)
elseif(VTKm_CUDA_Architecture STREQUAL "ampere")
set(arch_flags --generate-code=arch=compute_80,code=sm_80
--generate-code=arch=compute_86,code=sm_86)
elseif(VTKm_CUDA_Architecture STREQUAL "all")
set(arch_flags --generate-code=arch=compute_30,code=sm_30
--generate-code=arch=compute_35,code=sm_35
--generate-code=arch=compute_50,code=sm_50
--generate-code=arch=compute_60,code=sm_60
--generate-code=arch=compute_70,code=sm_70
--generate-code=arch=compute_75,code=sm_75
--generate-code=arch=compute_80,code=sm_80
--generate-code=arch=compute_86,code=sm_86)
endif()
string(REPLACE ";" " " arch_flags "${arch_flags}")
if(POLICY CMP0105)
cmake_policy(GET CMP0105 policy_105_enabled)
endif()
if(policy_105_enabled STREQUAL "NEW")
set(CMAKE_CUDA_ARCHITECTURES OFF)
target_compile_options(vtkm_cuda INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:${arch_flags}>)
target_link_options(vtkm_cuda INTERFACE $<DEVICE_LINK:${arch_flags}>)
else()
# Before 3.18 we had to use CMAKE_CUDA_FLAGS as we had no way
# to propagate flags to the device link step
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${arch_flags}")
endif()
# This needs to be lower-case for the property to be properly exported
# CMake 3.15 we can add `cuda_architecture_flags` to the EXPORT_PROPERTIES
# target property to have this automatically exported for us
set(VTKm_CUDA_Architecture_Flags "${arch_flags}")
set_target_properties(vtkm_cuda PROPERTIES cuda_architecture_flags "${arch_flags}")
unset(arch_flags)
endif()
endif()

@ -373,8 +373,6 @@ function(vtkm_add_target_information uses_vtkm_target)
set_target_properties(${targets} PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(${targets} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
endif()
# CUDA_ARCHITECTURES added in CMake 3.18
set_target_properties(${targets} PROPERTIES CUDA_ARCHITECTURES OFF)
if(VTKm_TI_DROP_UNUSED_SYMBOLS)
foreach(target IN LISTS targets)
@ -547,78 +545,106 @@ function(vtkm_library)
endfunction(vtkm_library)
#-----------------------------------------------------------------------------
# Produce _instantiation-files_ given a filter.
#
# This function will parse the header file of a given filter and for each of
# the extern template found on it, it will produce its corresponding
# _instantiation-files_. Those produced `instantiation-files` are stored in
# the build directory and are not versioned.
#
# Usage:
# vtkm_add_instantiations(
# instantiations_list
# FILTER <name>
# [ INSTANTIATIONS_FILE <path> ]
# )
#
# instantiations_list: Output variable which contain the path of the newly
# produced _instantiation-files_.
#
# FILTER: The name of the filter of which we wish to produce those
# instantiations from.
#
# INSTANTIATIONS_FILE: _Optional_ parameter with the relative path of the file
# which contains the extern template instantiations. When omitted,
# `vtkm_add_instantiations` will default to `${FILTER}.h`.
#
#[==[
-----------------------------------------------------------------------------
Produce _instantiation-files_ given a filter.
VTK-m makes use of a lot of headers. It is often the case when building a
library that you have to compile several instantiations of the template to
cover all the types expected. However, when you try to do this in a single
cxx file, you can end up with some very long compiles, especially when
using a GPU device compiler. In this case, it is helpful to split up the
instantiations across multiple files.
This function will parse a given header file and look for pairs of
`VTKM_INSTANTIATION_BEGIN` and `VTKM_INSTANTIATION_END`. (These are defined
in `vtkm/internal/Instantiations.h`.) Between these two macros there should
be the definition of a single extern template instantiation. The definition
needs to fully qualify the namespace of all symbols. The declaration
typically looks something like this.
```cpp
VTKM_INSTANTIATION_BEGIN
extern template vtkm::cont::ArrayHandle<vtkm::Float32> vtkm::filter::foo::RunFooWorklet(
const vtkm::cont::CellSetExplicit<>& inCells,
const vtkm::cont::ArrayHandle<vtkm::Vec3f_32>& inField);
VTKM_INSTANTIATION_END
```
For each one of these found, a source file will be produced that compiles
the template for the given instantiation. Those produced files are stored
in the build directory and are not versioned.
_Important note_: The `extern template` should not be of an inline function
or method. If the function or method is inline, then a compiler might compile
ts own instance of the template regardless of the known export, which defeats
the purpose of making the instances. In particular, if the `extern template`
is referring to a method, make sure the implementation for that method is
defined _outside_ of the class. Implementations defined inside of a class are
implicitly considered inline.
Usage:
vtkm_add_instantiations(
instantiations_list
INSTANTIATIONS_FILE <path>
[ TEMPLATE_SOURCE <path> ]
)
instantiations_list: Output variable which contain the path of the newly
produced _instantiation-files_.
INSTANTIATIONS_FILE: Parameter with the relative path of the file that
contains the extern template instantiations.
TEMPLATE_SOURCE: _Optional_ parameter with the relative path to the header
file that contains the implementation of the template. If not given, the
template source is set to be the same as the INSTANTIATIONS_FILE.
#]==]
function(vtkm_add_instantiations instantiations_list)
# Parse and validate parameters
set(oneValueArgs FILTER INSTANTIATIONS_FILE)
set(oneValueArgs INSTANTIATIONS_FILE TEMPLATE_SOURCE)
cmake_parse_arguments(VTKm_instantiations "" "${oneValueArgs}" "" ${ARGN})
if(NOT VTKm_instantiations_FILTER)
message(FATAL_ERROR "vtkm_add_instantiations needs a valid FILTER parameter")
if(NOT VTKm_instantiations_INSTANTIATIONS_FILE)
message(FATAL_ERROR "vtkm_add_instantiations needs a valid INSTANTIATIONS_FILE parameter")
endif()
set(filter ${VTKm_instantiations_FILTER})
set(file_header "${filter}.h")
set(instantiations_file ${VTKm_instantiations_INSTANTIATIONS_FILE})
set(file_template_source "${filter}.h")
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${filter}.hxx")
set(file_template_source "${filter}.hxx")
if(VTKm_instantiations_TEMPLATE_SOURCE)
set(file_template_source ${VTKm_instantiations_TEMPLATE_SOURCE})
else()
set(file_template_source ${instantiations_file})
endif()
# Extract explicit instantiations
set(instantiations_file ${file_header})
if(VTKm_instantiations_INSTANTIATIONS_FILE)
set(instantiations_file ${VTKm_instantiations_INSTANTIATIONS_FILE})
endif()
_vtkm_extract_instantiations(instantiations ${instantiations_file})
# Compute relative path of header files
file(RELATIVE_PATH INSTANTIATION_FILTER_HEADER
${VTKm_SOURCE_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/${file_header}"
)
file(RELATIVE_PATH INSTANTIATION_FILTER_TEMPLATE_SOURCE
file(RELATIVE_PATH INSTANTIATION_TEMPLATE_SOURCE
${VTKm_SOURCE_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/${file_template_source}"
)
# Make a guard macro name so that the TEMPLATE_SOURCE can determine if it is compiling
# the instances (if necessary).
get_filename_component(instantations_name "${instantiations_file}" NAME_WE)
set(INSTANTIATION_INC_GUARD "vtkm_${instantations_name}Instantiation")
# Generate instatiation file in the build directory
set(counter 0)
foreach(instantiation IN LISTS instantiations)
string(REPLACE "$" ";" instantiation ${instantiation})
set(INSTANTIATION_FILTER_METHOD "${instantiation}")
set(INSTANTIATION_FILTER_INC_GUARD "vtkm_filter_${filter}Instantiation${counter}_cxx")
set(INSTANTIATION_DECLARATION "${instantiation}")
# Create instantiation in build directory
set(instantiation_path "${CMAKE_CURRENT_BINARY_DIR}/${filter}Instantiation${counter}.cxx")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/InstantiationTemplate.cxx.in"
set(instantiation_path
"${CMAKE_CURRENT_BINARY_DIR}/${instantations_name}Instantiation${counter}.cxx"
)
configure_file("${VTKm_SOURCE_DIR}/CMake/InstantiationTemplate.cxx.in"
${instantiation_path}
@ONLY)
@ONLY
)
# Return value
list(APPEND _instantiations_list ${instantiation_path})

@ -106,10 +106,11 @@ if (NOT DEFINED VTKm_ENABLE_TESTING)
endif()
endif()
# By default: VTKm_ENABLE_TESTING -> VTKm_ENABLE_TESTING_LIB
# By default: (VTKm_ENABLE_TESTING OR VTKm_ENABLE_BENCHMARKS) -> VTKm_ENABLE_TESTING_LIBRARY
include(CMakeDependentOption)
cmake_dependent_option(VTKm_ENABLE_TESTING_LIBRARY "Enable VTKm Testing Library" OFF "NOT VTKm_ENABLE_TESTING" ON)
mark_as_advanced(VTKm_ENABLE_TESTING_LIB)
cmake_dependent_option(VTKm_ENABLE_TESTING_LIBRARY "Enable VTKm Testing Library"
OFF "NOT VTKm_ENABLE_TESTING;NOT VTKm_ENABLE_BENCHMARKS" ON)
mark_as_advanced(VTKm_ENABLE_TESTING_LIBRARY)
vtkm_option(VTKm_USE_DOUBLE_PRECISION "Use double precision for floating point calculations" OFF)
vtkm_option(VTKm_USE_64BIT_IDS "Use 64-bit indices." ON)

@ -54,6 +54,5 @@ vtkm/cont/tbb/internal/parallel_sort.h
vtkm/cont/tbb/internal/parallel_radix_sort_tbb.h
vtkm/cont/tbb/internal/kxsort.h
vtkm/thirdparty
vtkm/internal/brigand.hpp
version.txt
.gitlab/cmake

@ -36,8 +36,9 @@ You can find out more about the design of VTK-m on the [VTK-m Wiki].
+ Community discussion takes place on the [VTK-m users email list].
+ Doxygen-generated nightly reference documentation is available
[online][VTK-m Doxygen].
+ Doxygen-generated reference documentation is available for both:
+ Last Nightly build [VTK-m Doxygen nightly]
+ Last release [VTK-m Doxygen latest]
## Contributing ##
@ -226,7 +227,8 @@ See [LICENSE.txt](LICENSE.txt) for details.
[VTK-m]: https://gitlab.kitware.com/vtk/vtk-m/
[VTK-m Coding Conventions]: docs/CodingConventions.md
[VTK-m Doxygen]: http://m.vtk.org/documentation/
[VTK-m Doxygen latest]: https://docs-m.vtk.org/latest/index.html
[VTK-m Doxygen nightly]: https://docs-m.vtk.org/nightly/
[VTK-m download page]: http://m.vtk.org/index.php/VTK-m_Releases
[VTK-m git repository]: https://gitlab.kitware.com/vtk/vtk-m/
[VTK-m Issue Tracker]: https://gitlab.kitware.com/vtk/vtk-m/-/issues

@ -85,8 +85,18 @@ namespace
vtkm::cont::InitializeResult Config;
// The input dataset we'll use on the filters:
static vtkm::cont::DataSet InputDataSet;
static vtkm::cont::DataSet UnstructuredInputDataSet;
vtkm::cont::DataSet* InputDataSet;
vtkm::cont::DataSet* UnstructuredInputDataSet;
vtkm::cont::DataSet& GetInputDataSet()
{
return *InputDataSet;
}
vtkm::cont::DataSet& GetUnstructuredInputDataSet()
{
return *UnstructuredInputDataSet;
}
// The point scalars to use:
static std::string PointScalarsName;
// The cell scalars to use:
@ -98,9 +108,9 @@ bool FileAsInput = false;
bool InputIsStructured()
{
return InputDataSet.GetCellSet().IsType<vtkm::cont::CellSetStructured<3>>() ||
InputDataSet.GetCellSet().IsType<vtkm::cont::CellSetStructured<2>>() ||
InputDataSet.GetCellSet().IsType<vtkm::cont::CellSetStructured<1>>();
return GetInputDataSet().GetCellSet().IsType<vtkm::cont::CellSetStructured<3>>() ||
GetInputDataSet().GetCellSet().IsType<vtkm::cont::CellSetStructured<2>>() ||
GetInputDataSet().GetCellSet().IsType<vtkm::cont::CellSetStructured<1>>();
}
enum GradOpts : int
@ -128,11 +138,11 @@ void BenchGradient(::benchmark::State& state, int options)
throw vtkm::cont::ErrorInternal("A requested gradient output is "
"incompatible with scalar input.");
}
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::Points);
}
else
{
filter.SetActiveField(PointVectorsName, vtkm::cont::Field::Association::POINTS);
filter.SetActiveField(PointVectorsName, vtkm::cont::Field::Association::Points);
}
filter.SetComputeGradient(static_cast<bool>(options & Gradient));
@ -151,11 +161,13 @@ void BenchGradient(::benchmark::State& state, int options)
}
vtkm::cont::Timer timer{ device };
//vtkm::cont::DataSet input = static_cast<bool>(options & Structured) ? GetInputDataSet() : GetUnstructuredInputDataSet();
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(InputDataSet);
auto result = filter.Execute(GetInputDataSet());
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -186,7 +198,7 @@ void BenchThreshold(::benchmark::State& state)
// Lookup the point scalar range
const auto range = []() -> vtkm::Range {
auto ptScalarField =
InputDataSet.GetField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
GetInputDataSet().GetField(PointScalarsName, vtkm::cont::Field::Association::Points);
return ptScalarField.GetRange().ReadPortal().Get(0);
}();
@ -195,7 +207,7 @@ void BenchThreshold(::benchmark::State& state)
vtkm::Float64 mid = range.Center();
vtkm::filter::entity_extraction::Threshold filter;
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::Points);
filter.SetLowerThreshold(mid - quarter);
filter.SetUpperThreshold(mid + quarter);
@ -204,7 +216,7 @@ void BenchThreshold(::benchmark::State& state)
{
(void)_;
timer.Start();
auto result = filter.Execute(InputDataSet);
auto result = filter.Execute(GetInputDataSet());
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -221,7 +233,7 @@ void BenchThresholdPoints(::benchmark::State& state)
// Lookup the point scalar range
const auto range = []() -> vtkm::Range {
auto ptScalarField =
InputDataSet.GetField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
GetInputDataSet().GetField(PointScalarsName, vtkm::cont::Field::Association::Points);
return ptScalarField.GetRange().ReadPortal().Get(0);
}();
@ -230,7 +242,7 @@ void BenchThresholdPoints(::benchmark::State& state)
vtkm::Float64 mid = range.Center();
vtkm::filter::entity_extraction::ThresholdPoints filter;
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::Points);
filter.SetLowerThreshold(mid - quarter);
filter.SetUpperThreshold(mid + quarter);
filter.SetCompactPoints(compactPoints);
@ -240,7 +252,7 @@ void BenchThresholdPoints(::benchmark::State& state)
{
(void)_;
timer.Start();
auto result = filter.Execute(InputDataSet);
auto result = filter.Execute(GetInputDataSet());
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -254,14 +266,14 @@ void BenchCellAverage(::benchmark::State& state)
const vtkm::cont::DeviceAdapterId device = Config.Device;
vtkm::filter::field_conversion::CellAverage filter;
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::Points);
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(InputDataSet);
auto result = filter.Execute(GetInputDataSet());
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -275,14 +287,14 @@ void BenchPointAverage(::benchmark::State& state)
const vtkm::cont::DeviceAdapterId device = Config.Device;
vtkm::filter::field_conversion::PointAverage filter;
filter.SetActiveField(CellScalarsName, vtkm::cont::Field::Association::CELL_SET);
filter.SetActiveField(CellScalarsName, vtkm::cont::Field::Association::Cells);
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(InputDataSet);
auto result = filter.Execute(GetInputDataSet());
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -297,15 +309,15 @@ void BenchWarpScalar(::benchmark::State& state)
vtkm::filter::field_transform::WarpScalar filter{ 2. };
filter.SetUseCoordinateSystemAsField(true);
filter.SetNormalField(PointVectorsName, vtkm::cont::Field::Association::POINTS);
filter.SetScalarFactorField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
filter.SetNormalField(PointVectorsName, vtkm::cont::Field::Association::Points);
filter.SetScalarFactorField(PointScalarsName, vtkm::cont::Field::Association::Points);
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(InputDataSet);
auto result = filter.Execute(GetInputDataSet());
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -320,14 +332,14 @@ void BenchWarpVector(::benchmark::State& state)
vtkm::filter::field_transform::WarpVector filter{ 2. };
filter.SetUseCoordinateSystemAsField(true);
filter.SetVectorField(PointVectorsName, vtkm::cont::Field::Association::POINTS);
filter.SetVectorField(PointVectorsName, vtkm::cont::Field::Association::Points);
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(InputDataSet);
auto result = filter.Execute(GetInputDataSet());
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -347,12 +359,13 @@ void BenchContour(::benchmark::State& state)
const bool fastNormals = static_cast<bool>(state.range(4));
vtkm::filter::contour::Contour filter;
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::Points);
// Set up some equally spaced contours, with the min/max slightly inside the
// scalar range:
const vtkm::Range scalarRange = []() -> vtkm::Range {
auto field = InputDataSet.GetField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
auto field =
GetInputDataSet().GetField(PointScalarsName, vtkm::cont::Field::Association::Points);
return field.GetRange().ReadPortal().Get(0);
}();
const auto step = scalarRange.Length() / static_cast<vtkm::Float64>(numIsoVals + 1);
@ -371,7 +384,7 @@ void BenchContour(::benchmark::State& state)
vtkm::cont::Timer timer{ device };
vtkm::cont::DataSet input = isStructured ? InputDataSet : UnstructuredInputDataSet;
vtkm::cont::DataSet input = isStructured ? GetInputDataSet() : GetUnstructuredInputDataSet();
for (auto _ : state)
{
@ -421,7 +434,7 @@ void BenchExternalFaces(::benchmark::State& state)
{
(void)_;
timer.Start();
auto result = filter.Execute(InputDataSet);
auto result = filter.Execute(GetInputDataSet());
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -447,7 +460,7 @@ void BenchTetrahedralize(::benchmark::State& state)
{
(void)_;
timer.Start();
auto result = filter.Execute(InputDataSet);
auto result = filter.Execute(GetInputDataSet());
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -476,7 +489,7 @@ void BenchVertexClustering(::benchmark::State& state)
(void)_;
timer.Start();
auto result = filter.Execute(UnstructuredInputDataSet);
auto result = filter.Execute(GetUnstructuredInputDataSet());
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -541,7 +554,7 @@ void BenchReverseConnectivityGen(::benchmark::State& state)
state.SkipWithError("ReverseConnectivityGen requires unstructured data (--use tetra).");
}
auto cellset = UnstructuredInputDataSet.GetCellSet();
auto cellset = GetUnstructuredInputDataSet().GetCellSet();
PrepareForInput functor;
for (auto _ : state)
{
@ -624,10 +637,10 @@ void FindFields()
{
if (PointScalarsName.empty())
{
for (vtkm::Id i = 0; i < InputDataSet.GetNumberOfFields(); ++i)
for (vtkm::Id i = 0; i < GetInputDataSet().GetNumberOfFields(); ++i)
{
auto field = InputDataSet.GetField(i);
if (field.GetAssociation() == vtkm::cont::Field::Association::POINTS &&
auto field = GetInputDataSet().GetField(i);
if (field.GetAssociation() == vtkm::cont::Field::Association::Points &&
NumberOfComponents::Check(field) == 1)
{
PointScalarsName = field.GetName();
@ -639,10 +652,10 @@ void FindFields()
if (CellScalarsName.empty())
{
for (vtkm::Id i = 0; i < InputDataSet.GetNumberOfFields(); ++i)
for (vtkm::Id i = 0; i < GetInputDataSet().GetNumberOfFields(); ++i)
{
auto field = InputDataSet.GetField(i);
if (field.GetAssociation() == vtkm::cont::Field::Association::CELL_SET &&
auto field = GetInputDataSet().GetField(i);
if (field.GetAssociation() == vtkm::cont::Field::Association::Cells &&
NumberOfComponents::Check(field) == 1)
{
CellScalarsName = field.GetName();
@ -654,10 +667,10 @@ void FindFields()
if (PointVectorsName.empty())
{
for (vtkm::Id i = 0; i < InputDataSet.GetNumberOfFields(); ++i)
for (vtkm::Id i = 0; i < GetInputDataSet().GetNumberOfFields(); ++i)
{
auto field = InputDataSet.GetField(i);
if (field.GetAssociation() == vtkm::cont::Field::Association::POINTS &&
auto field = GetInputDataSet().GetField(i);
if (field.GetAssociation() == vtkm::cont::Field::Association::Points &&
NumberOfComponents::Check(field) == 3)
{
PointVectorsName = field.GetName();
@ -674,7 +687,7 @@ void CreateMissingFields()
if (PointVectorsName.empty())
{
// Construct them from the coordinates:
auto coords = InputDataSet.GetCoordinateSystem();
auto coords = GetInputDataSet().GetCoordinateSystem();
auto bounds = coords.GetBounds();
auto points = coords.GetData();
vtkm::cont::ArrayHandle<vtkm::Vec3f> pvecs;
@ -682,8 +695,8 @@ void CreateMissingFields()
PointVectorGenerator worklet(bounds);
vtkm::worklet::DispatcherMapField<PointVectorGenerator> dispatch(worklet);
dispatch.Invoke(points, pvecs);
InputDataSet.AddField(
vtkm::cont::Field("GeneratedPointVectors", vtkm::cont::Field::Association::POINTS, pvecs));
GetInputDataSet().AddField(
vtkm::cont::Field("GeneratedPointVectors", vtkm::cont::Field::Association::Points, pvecs));
PointVectorsName = "GeneratedPointVectors";
std::cerr << "[CreateFields] Generated point vectors '" << PointVectorsName
<< "' from coordinate data.\n";
@ -694,11 +707,11 @@ void CreateMissingFields()
if (!CellScalarsName.empty())
{ // Generate from found cell field:
vtkm::filter::field_conversion::PointAverage avg;
avg.SetActiveField(CellScalarsName, vtkm::cont::Field::Association::CELL_SET);
avg.SetActiveField(CellScalarsName, vtkm::cont::Field::Association::Cells);
avg.SetOutputFieldName("GeneratedPointScalars");
auto outds = avg.Execute(InputDataSet);
InputDataSet.AddField(
outds.GetField("GeneratedPointScalars", vtkm::cont::Field::Association::POINTS));
auto outds = avg.Execute(GetInputDataSet());
GetInputDataSet().AddField(
outds.GetField("GeneratedPointScalars", vtkm::cont::Field::Association::Points));
PointScalarsName = "GeneratedPointScalars";
std::cerr << "[CreateFields] Generated point scalars '" << PointScalarsName
<< "' from cell scalars, '" << CellScalarsName << "'.\n";
@ -708,11 +721,11 @@ void CreateMissingFields()
// Compute the magnitude of the vectors:
VTKM_ASSERT(!PointVectorsName.empty());
vtkm::filter::vector_analysis::VectorMagnitude mag;
mag.SetActiveField(PointVectorsName, vtkm::cont::Field::Association::POINTS);
mag.SetActiveField(PointVectorsName, vtkm::cont::Field::Association::Points);
mag.SetOutputFieldName("GeneratedPointScalars");
auto outds = mag.Execute(InputDataSet);
InputDataSet.AddField(
outds.GetField("GeneratedPointScalars", vtkm::cont::Field::Association::POINTS));
auto outds = mag.Execute(GetInputDataSet());
GetInputDataSet().AddField(
outds.GetField("GeneratedPointScalars", vtkm::cont::Field::Association::Points));
PointScalarsName = "GeneratedPointScalars";
std::cerr << "[CreateFields] Generated point scalars '" << PointScalarsName
<< "' from point vectors, '" << PointVectorsName << "'.\n";
@ -723,11 +736,11 @@ void CreateMissingFields()
{ // Attempt to construct them from a point field:
VTKM_ASSERT(!PointScalarsName.empty());
vtkm::filter::field_conversion::CellAverage avg;
avg.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
avg.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::Points);
avg.SetOutputFieldName("GeneratedCellScalars");
auto outds = avg.Execute(InputDataSet);
InputDataSet.AddField(
outds.GetField("GeneratedCellScalars", vtkm::cont::Field::Association::CELL_SET));
auto outds = avg.Execute(GetInputDataSet());
GetInputDataSet().AddField(
outds.GetField("GeneratedCellScalars", vtkm::cont::Field::Association::Cells));
CellScalarsName = "GeneratedCellScalars";
std::cerr << "[CreateFields] Generated cell scalars '" << CellScalarsName
<< "' from point scalars, '" << PointScalarsName << "'.\n";
@ -950,7 +963,8 @@ void InitDataSet(int& argc, char** argv)
{
std::cerr << "[InitDataSet] Loading file: " << filename << "\n";
vtkm::io::VTKDataSetReader reader(filename);
InputDataSet = reader.ReadDataSet();
InputDataSet = new vtkm::cont::DataSet;
*InputDataSet = reader.ReadDataSet();
FileAsInput = true;
}
else
@ -960,7 +974,8 @@ void InitDataSet(int& argc, char** argv)
vtkm::source::Wavelet source;
source.SetExtent({ 0 }, { waveletDim - 1 });
InputDataSet = source.Execute();
InputDataSet = new vtkm::cont::DataSet;
*InputDataSet = source.Execute();
}
FindFields();
@ -969,12 +984,13 @@ void InitDataSet(int& argc, char** argv)
std::cerr
<< "[InitDataSet] Create UnstructuredInputDataSet from Tetrahedralized InputDataSet...\n";
vtkm::filter::geometry_refinement::Tetrahedralize tet;
tet.SetFieldsToPass(vtkm::filter::FieldSelection(vtkm::filter::FieldSelection::MODE_ALL));
UnstructuredInputDataSet = tet.Execute(InputDataSet);
tet.SetFieldsToPass(vtkm::filter::FieldSelection(vtkm::filter::FieldSelection::Mode::All));
UnstructuredInputDataSet = new vtkm::cont::DataSet;
*UnstructuredInputDataSet = tet.Execute(GetInputDataSet());
if (tetra)
{
InputDataSet = UnstructuredInputDataSet;
GetInputDataSet() = GetUnstructuredInputDataSet();
}
inputGenTimer.Stop();
@ -1004,10 +1020,12 @@ int main(int argc, char* argv[])
const std::string dataSetSummary = []() -> std::string {
std::ostringstream out;
InputDataSet.PrintSummary(out);
GetInputDataSet().PrintSummary(out);
return out.str();
}();
// handle benchmarking related args and run benchmarks:
VTKM_EXECUTE_BENCHMARKS_PREAMBLE(argc, args.data(), dataSetSummary);
delete InputDataSet;
delete UnstructuredInputDataSet;
}

@ -120,11 +120,11 @@ void BuildInputDataSet(uint32_t cycle, bool isStructured, bool isMultiBlock, vtk
// Generate Perln Noise Gradient point vector field
vtkm::filter::vector_analysis::Gradient gradientFilter;
gradientFilter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
gradientFilter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::Points);
gradientFilter.SetComputePointGradient(true);
gradientFilter.SetOutputFieldName(PointVectorsName);
gradientFilter.SetFieldsToPass(
vtkm::filter::FieldSelection(vtkm::filter::FieldSelection::MODE_ALL));
vtkm::filter::FieldSelection(vtkm::filter::FieldSelection::Mode::All));
if (isMultiBlock)
{
partitionedInputDataSet = gradientFilter.Execute(partitionedInputDataSet);
@ -139,7 +139,7 @@ void BuildInputDataSet(uint32_t cycle, bool isStructured, bool isMultiBlock, vtk
{
vtkm::filter::geometry_refinement::Tetrahedralize destructizer;
destructizer.SetFieldsToPass(
vtkm::filter::FieldSelection(vtkm::filter::FieldSelection::MODE_ALL));
vtkm::filter::FieldSelection(vtkm::filter::FieldSelection::Mode::All));
if (isMultiBlock)
{
partitionedInputDataSet = destructizer.Execute(partitionedInputDataSet);
@ -294,7 +294,7 @@ void BenchContour(::benchmark::State& state)
inputGenTimer.Stop();
vtkm::filter::contour::Contour filter;
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::POINTS);
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::Points);
filter.SetMergeDuplicatePoints(true);
filter.SetGenerateNormals(true);
filter.SetComputeFastNormalsForStructured(true);

@ -16,7 +16,9 @@
#include <vtkm/cont/RuntimeDeviceTracker.h>
#include <vtkm/cont/Timer.h>
#include <vtkm/internal/brigand.hpp>
#include <vtkm/List.h>
#include <vtkm/internal/Meta.h>
#include <benchmark/benchmark.h>
@ -265,9 +267,9 @@
static ::benchmark::internal::Function* GetFunction() { return BenchFunc<Ts...>; } \
}; \
} /* end anon namespace */ \
int BENCHMARK_PRIVATE_NAME(BenchFunc) = vtkm::bench::detail::GenerateTemplateBenchmarks< \
brigand::bind<VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc)>, \
TypeList>::Register(#BenchFunc, ApplyFunctor)
int BENCHMARK_PRIVATE_NAME(BenchFunc) = \
vtkm::bench::detail::GenerateTemplateBenchmarks<VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc), \
TypeList>::Register(#BenchFunc, ApplyFunctor)
// Internal use only:
#define VTKM_BENCHMARK_WRAPPER_NAME(BenchFunc) \
@ -286,17 +288,14 @@ static inline void NullApply(::benchmark::internal::Benchmark*) {}
/// instead.
// TypeLists could be expanded to compute cross products if we ever have that
// need.
template <typename BoundBench, typename TypeLists>
struct GenerateTemplateBenchmarks;
template <template <typename...> class BenchType, typename TypeList>
struct GenerateTemplateBenchmarks<brigand::bind<BenchType>, TypeList>
struct GenerateTemplateBenchmarks
{
private:
template <typename T>
using MakeBenchType = BenchType<T>;
using Benchmarks = brigand::transform<TypeList, brigand::bind<MakeBenchType, brigand::_1>>;
using Benchmarks = vtkm::ListTransform<TypeList, MakeBenchType>;
template <typename ApplyFunctor>
struct RegisterImpl
@ -305,7 +304,7 @@ private:
ApplyFunctor Apply;
template <typename P>
void operator()(brigand::type_<BenchType<P>>) const
void operator()(vtkm::internal::meta::Type<BenchType<P>>) const
{
std::ostringstream name;
name << this->BenchName << "<" << vtkm::cont::TypeToString<P>() << ">";
@ -323,8 +322,8 @@ public:
template <typename ApplyFunctor>
static int Register(const std::string& benchName, ApplyFunctor&& apply)
{
brigand::for_each<Benchmarks>(
RegisterImpl<ApplyFunctor>{ benchName, std::forward<ApplyFunctor>(apply) });
vtkm::ListForEach(RegisterImpl<ApplyFunctor>{ benchName, std::forward<ApplyFunctor>(apply) },
vtkm::ListTransform<Benchmarks, vtkm::internal::meta::Type>{});
return 0;
}
};

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dc0d600511b6cecc7b17c6ac39f108b1891b3711ac44166d87958fe361aeb625
size 3358
oid sha256:558028eae0ddb162a3c437b7d12c30857f7b964b3dc9bda601e9750db0813fe5
size 31393

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6080d76845175339023139297f67baca21fa1c09421c566f1b51d145a65f210b
size 4029
oid sha256:a879c39ef99c13722da91b7178e41a70ac0aaa5735e7cd201899639464f2f151
size 35281

@ -0,0 +1,10 @@
## Enable CMAKE_CUDA_ARCHITECTURES
When using _CMake_ > 3.18, `CMAKE_CUDA_ARCHITECTURES` can now be used instead of
`VTKm_CUDA_Architecture` to specify the list of architectures desired for the
compilation of _CUDA_ sources.
Since `CMAKE_CUDA_ARCHITECTURES` is the canonical method of specifying _CUDA_
architectures in _CMake_ and it is more flexible, for instance we can also
specify _CUDA_ virtual architectures, from _CMake_ 3.18 explicitly setting
`VTKm_CUDA_Architecture` will be deprecated whilst still supported.

@ -0,0 +1,14 @@
# Generalized instantiation
Recently, an instantiation method was added to the VTK-m configuration
files to set up a set of source files that compile instances of a template.
This allows the template instances to be compiled exactly once in separate
build files.
However, the implementation made the assumption that the instantiations
were happening for VTK-m filters. Now that the VTK-m filters are being
redesigned, this assumption is broken.
Thus, the instantiation code has been redesigned to be more general. It can
now be applied to code within the new filter structure. It can also be
applied anywhere else in the VTK-m source code.

@ -0,0 +1,57 @@
# New `vtkm::List` features
New features were added to those available in `vtkm/List.h`. These new
features provide new operations on lists.
## Reductions
The new `vtkm::ListReduce` allows a reduction on a list. This template
takes three arguments: a `vtkm::List`, an operation, and an initial value.
The operation is itself a template that has two type arguments.
`vtkm::ListReduce` applies the initial value and the first item of the list
to the operator. The result of that template is then iteratively applied to
the operator with the next item in the list and so on.
``` cpp
// Operation to use
template <typename T1, typename T2>
using Add = std::integral_constant<typename T1::type, T1::value + T2::value>;
using MyList = vtkm::List<std::integral_constant<int, 25>,
std::integral_constant<int, 60>,
std::integral_constant<int, 87>,
std::integral_constant<int, 62>>;
using MySum = vtkm::ListReduce<MyList, Add, std::integral_constant<int, 0>>;
// MySum becomes std::integral_constant<int, 234> (25+60+87+62 = 234)
```
## All and Any
Because they are very common, two reductions that are automatically
supported are `vtkm::ListAll` and `vtkm::ListAny`. These both take a
`vtkm::List` containing either `std::true_type` or `std::false_type` (or
some other "compatible" type that has a constant static `bool` named
`value`). `vtkm::ListAll` will become `std::false_type` if any of the
entries in the list are `std::false_type`. `vtkm::ListAny` becomes
`std::true_type` if any of the entires in the list are `std::true_type`.
``` cpp
using MyList = vtkm::List<std::integral_constant<int, 25>,
std::integral_constant<int, 60>,
std::integral_constant<int, 87>,
std::integral_constant<int, 62>>;
template <typename T>
using IsEven = std::integral_constant<bool, ((T % 2) == 0)>;
// Note that vtkm::ListTransform<MyList, IsEven> becomes
// vtkm::List<std::false_type, std::true_type, std::false_type, std::true_type>
using AllEven = vtkm::ListAll<vtkm::ListTransform<MyList, IsEven>>;
// AllEven becomes std::false_type
using AnyEven = vtkm::ListAny<vtkm::ListTransform<MyList, IsEven>>;
// AnyEven becomes std::true_type
```

@ -0,0 +1,19 @@
# No longer use brigand.hpp
Remove brigand.hpp from VTK-m's source and all references to it. This was
declared in an internal directory, so making this backward-incompatible
changes should be OK.
Brigand is a third-party library to support template meta-programming. Over
the years, we have had to make a few modifications to make sure it compiles
with all compilers supported by VTK-m. Unfortunately, because brigand was
added before our standard third-party library management was set up, these
changes are not managed well. Thus, we cannot easily update with any
changes from the project. Thus, our version is slowly diverging from the
original, and maintaining it is a hassle.
Also, we have been using brigand less and less throughout the years. Now
that we have moved on to C++11 (and now C++14) with variadic templates and
other useful `std` features, the features of brigand have become less
critical. Thus, we have implemented all the features we need from brigand
internally and have moved our code away from using it.

@ -0,0 +1,9 @@
# Fix compile when testing is turned off
There were some places in VTK-m's code that included test header files even
though they were not tests. As more code goes into libraries, this can
break the build.
Remove VTK-m library dependence on testing code where found. Also added a
CI build that turns off all testing to check for this condition in the
future.

@ -0,0 +1,20 @@
# Rename field associations
The symbols in `vtkm::cont::Field::Association` have been changed from
`ANY`, `WHOLE_MESH`, `POINTS`, and `CELL_SET` to `Any`, `WholeMesh`,
`Points`, and `Cells`, respectively. The reason for this change is twofold:
* The general standard that VTK-m follows for `enum struct` enumerators
is to use camel case (with the first character capitalized), not all
upper case.
* The use of `CELL_SET` for fields associated with cells is obsolete. A
`DataSet` used to support having more than one `CellSet`, and so a
field association on cells was actually bound to a particular
`CellSet`. However, that is no longer the case. A `DataSet` has exactly
one `CellSet`, so a cell field no longer has to point to a `CellSet`.
Thus the enumeration symbol for `Cells` should match the one for
`Points`.
For backward compatibility, the old enumerations still exist. They are
aliases for the new names, and they are marked as deprecated, so using them
will result in a compiler warning (on some systems).

@ -0,0 +1,12 @@
# Favor scoped `enum`s
Several `enum` declarations were changed from a standard `enum` to a
"scoped" `enum` (i.e. `enum struct`). The advantage of a scoped enum is
that they provide better type safety because they won't be converted
willy-nilly to other types. They also prevent the names they define from
being accessible on the inner scope.
There are some cases where you do want the `enum` to convert to other types
(but still want the scope of the symbols to be contained in the `enum`
type). In this case, we worked around the problem by placing an unscoped
`enum` inside of a standard `struct`.

@ -115,7 +115,7 @@ public:
const vtkm::cont::UnknownCellSet cells = input.GetCellSet();
//get the previous state of the game
input.GetField("state", vtkm::cont::Field::Association::POINTS).GetData().CopyTo(prevstate);
input.GetField("state", vtkm::cont::Field::Association::Points).GetData().CopyTo(prevstate);
//Update the game state
this->Invoke(
@ -200,7 +200,7 @@ struct RenderGameOfLife
vtkm::Int32 arraySize = (vtkm::Int32)data.GetNumberOfPoints();
UploadData task(&this->ColorState,
data.GetField("colors", vtkm::cont::Field::Association::POINTS));
data.GetField("colors", vtkm::cont::Field::Association::Points));
vtkm::cont::TryExecute(task);
vtkm::Float32 mvp[16] = { 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f,
@ -332,7 +332,7 @@ int main(int argc, char** argv)
vtkm::cont::DataSet data = builder.Create(vtkm::Id2(x, y));
auto stateField =
vtkm::cont::make_Field("state", vtkm::cont::Field::Association::POINTS, input_state);
vtkm::cont::make_Field("state", vtkm::cont::Field::Association::Points, input_state);
data.AddField(stateField);
GameOfLife filter;

@ -140,7 +140,7 @@ inline VTKM_CONT vtkm::cont::DataSet HistogramMPI::DoExecute(
this->BinDelta = static_cast<vtkm::Float64>(delta);
vtkm::cont::DataSet output;
vtkm::cont::Field rfield(
this->GetOutputFieldName(), vtkm::cont::Field::Association::WHOLE_MESH, binArray);
this->GetOutputFieldName(), vtkm::cont::Field::Association::WholeMesh, binArray);
output.AddField(rfield);
return output;
}
@ -182,7 +182,7 @@ inline VTKM_CONT void HistogramMPI::PostExecute(const vtkm::cont::PartitionedDat
vtkm::cont::DataSet output;
vtkm::cont::Field rfield(this->GetOutputFieldName(),
vtkm::cont::Field::Association::WHOLE_MESH,
vtkm::cont::Field::Association::WholeMesh,
helper.ReduceAll(this->NumberOfBins));
output.AddField(rfield);

@ -258,7 +258,7 @@ int main(int argc, char* argv[])
// A cell metric is now computed for every shape type that exists in the
// input dataset.
vtkm::filter::mesh_info::CellMetric shapeMetric = vtkm::filter::mesh_info::CellMetric::VOLUME;
vtkm::filter::mesh_info::CellMetric shapeMetric = vtkm::filter::mesh_info::CellMetric::Volume;
try
{

@ -90,7 +90,7 @@ void partition_processing(TaskQueue<vtkm::cont::PartitionedDataSet>& queue)
// std::cout << std::endl << std::endl << std::endl;
// std::cout << "partition: " << std::endl;
// partition.PrintSummary(std::cout);
if (!partition.HasField("Gradients", vtkm::cont::Field::Association::POINTS))
if (!partition.HasField("Gradients", vtkm::cont::Field::Association::Points))
{
std::cerr << "Gradient filter failed!" << std::endl;
std::cerr << "Missing Gradient field on output partition." << std::endl;

@ -319,7 +319,7 @@ int main(int argc, char** argv)
if (generateOutput)
{
vtkm::cont::ArrayHandleBasic<vtkm::Float64> tmp;
rdata.GetField("oscillating", vtkm::cont::Field::Association::POINTS).GetData().CopyTo(tmp);
rdata.GetField("oscillating", vtkm::cont::Field::Association::Points).GetData().CopyTo(tmp);
const double* values = tmp.GetReadPointer();
writeData(outputDirectory, count++, sizeX, sizeY, sizeZ, values);
}

@ -34,7 +34,7 @@ set(headers
Hash.h
ImplicitFunction.h
List.h
ListTag.h
ListTag.h # Deprecated, replaced by List.h
LowerBound.h
Math.h
Matrix.h
@ -51,7 +51,7 @@ set(headers
Transform3D.h
Tuple.h
TypeList.h
TypeListTag.h
TypeListTag.h # Deprecated, replaced by TypeList.h
Types.h
TypeTraits.h
VecAxisAlignedPointCoordinates.h

@ -10,22 +10,70 @@
#ifndef vtk_m_CellClassification_h
#define vtk_m_CellClassification_h
#include <vtkm/Deprecated.h>
#include <vtkm/Types.h>
namespace vtkm
{
enum CellClassification : vtkm::UInt8
/// \brief Bit flags used in ghost arrays to identify what type a cell is.
///
/// `CellClassification` contains several bit flags that determine whether a cell is
/// normal or if it should be treated as duplicated or removed in some way. The flags
/// can be (and should be) treated as `vtkm::UInt8` and or-ed together.
///
class CellClassification
{
NORMAL = 0, //Valid cell
GHOST = 1 << 0, //Ghost cell
INVALID = 1 << 1, //Cell is invalid
UNUSED0 = 1 << 2,
BLANKED = 1 << 3, //Blanked cell in AMR
UNUSED3 = 1 << 4,
UNUSED4 = 1 << 5,
UNUSED5 = 1 << 6,
// Implementation note: An enum would be a natural representation for these flags.
// However, a non-scoped enum leaks the names into the broader namespace and a
// scoped enum is too difficult to convert to the `vtkm::UInt8` we really want to
// treat it as. Thus, use constexpr to define the `vtkm::UInt8`s.
vtkm::UInt8 Flags;
public:
// Use an unscoped enum here, where it will be properly scoped in the class.
// Using unscoped enums in this way is sort of obsolete, but prior to C++17
// a `static constexpr` may require a definition in a .cxx file, and that is
// not really possible for this particular class (which could be used on a GPU).
enum : vtkm::UInt8
{
Normal = 0, //Valid cell
Ghost = 1 << 0, //Ghost cell
Invalid = 1 << 1, //Cell is invalid
Unused0 = 1 << 2,
Blanked = 1 << 3, //Blanked cell in AMR
Unused3 = 1 << 4,
Unused4 = 1 << 5,
Unused5 = 1 << 6,
NORMAL VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Normal") = Normal,
GHOST VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Ghost") = Ghost,
INVALID VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Invalid") = Invalid,
UNUSED0 VTKM_DEPRECATED(1.8) = Unused0,
BLANKED VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Blanked") = Blanked,
UNUSED3 VTKM_DEPRECATED(1.8) = Unused3,
UNUSED4 VTKM_DEPRECATED(1.8) = Unused4,
UNUSED5 VTKM_DEPRECATED(1.8) = Unused5,
};
VTKM_EXEC constexpr CellClassification(vtkm::UInt8 flags = vtkm::UInt8{ Normal })
: Flags(flags)
{
}
VTKM_EXEC constexpr operator vtkm::UInt8() const { return this->Flags; }
};
}
// Deprecated scoping.
VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Normal.")
constexpr vtkm::CellClassification NORMAL = vtkm::CellClassification::Normal;
VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Ghost.")
constexpr vtkm::CellClassification GHOST = vtkm::CellClassification::Ghost;
VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Invalid.")
constexpr vtkm::CellClassification INVALID = vtkm::CellClassification::Invalid;
VTKM_DEPRECATED(1.8, "Use vtkm::CellClassification::Blanked.")
constexpr vtkm::CellClassification BLANKED = vtkm::CellClassification::Blanked;
} // namespace vtkm
#endif // vtk_m_CellClassification_h

@ -12,6 +12,8 @@
#include <vtkm/Types.h>
#include <vtkm/internal/Meta.h>
namespace vtkm
{
@ -807,6 +809,111 @@ template <typename List1, typename List2>
using ListCross =
typename detail::ListCrossImpl<internal::AsList<List1>, internal::AsList<List2>>::type;
namespace detail
{
template <typename L, template <typename T1, typename T2> class Operator, typename Result>
struct ListReduceImpl;
template <template <typename T1, typename T2> class Operator, typename Result>
struct ListReduceImpl<vtkm::List<>, Operator, Result>
{
using type = Result;
};
template <typename T0,
typename... Ts,
template <typename O1, typename O2>
class Operator,
typename Result>
struct ListReduceImpl<vtkm::List<T0, Ts...>, Operator, Result>
{
using type = typename ListReduceImpl<vtkm::List<Ts...>, Operator, Operator<Result, T0>>::type;
};
template <typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename... Ts,
template <typename O1, typename O2>
class Operator,
typename Result>
struct ListReduceImpl<vtkm::List<T0, T1, T2, T3, T4, T5, T6, T7, T8, Ts...>, Operator, Result>
{
using type = typename ListReduceImpl<
vtkm::List<T8, Ts...>,
Operator,
typename ListReduceImpl<vtkm::List<T0, T1, T2, T3, T4, T5, T6, T7>, Operator, Result>::type>::
type;
};
} // namespace detail
/// \brief Reduces a list to a single type using an operator.
///
/// `ListReduce` takes a `vtkm::List`, an operator template, and an initial type. `ListReduce`
/// first applies the initial type and the first item in the list to the operator and gets
/// that type. That then applies the operator to that result and the next item in the list.
/// This continues until a single value is left.
///
template <typename List, template <typename T1, typename T2> class Operator, typename Initial>
using ListReduce = typename detail::ListReduceImpl<internal::AsList<List>, Operator, Initial>::type;
/// \brief Determines whether all the types in the list are "true."
///
/// `ListAll` expects a `vtkm::List` with types that have a `value` that is either true or false
/// (such as `std::true_type` and `std::false_type`. Resolves to `std::true_type` if all the types
/// are true, `std::false_type` otherwise. If the list is empty, resolves to `std::true_type`.
///
/// `ListAll` also accepts an optional second argument that is a template that is a predicate
/// applied to each item in the input list before checking for the `value` type.
///
/// ```cpp
/// using NumberList1 = vtkm::List<int, char>;
/// using NumberList2 = vtkm::List<int, float>;
///
/// // Resolves to std::true_type
/// using AllInt1 = vtkm::ListAll<NumberList1, std::is_integral>;
///
/// // Resolves to std::false_type (because float is not integral)
/// using AllInt2 = vtkm::ListAll<NumberList2, std::is_integral>;
/// ```
///
template <typename List, template <typename> class Predicate = vtkm::internal::meta::Identity>
using ListAll =
vtkm::ListReduce<vtkm::ListTransform<List, Predicate>, vtkm::internal::meta::And, std::true_type>;
/// \brief Determines whether any of the types in the list are "true."
///
/// `ListAny` expects a `vtkm::List` with types that have a `value` that is either true or false
/// (such as `std::true_type` and `std::false_type`. Resolves to `std::true_type` if any of the
/// types are true, `std::false_type` otherwise. If the list is empty, resolves to
/// `std::false_type`.
///
/// `ListAny` also accepts an optional second argument that is a template that is a predicate
/// applied to each item in the input list before checking for the `value` type.
///
/// ```cpp
/// using NumberList1 = vtkm::List<int, float>;
/// using NumberList2 = vtkm::List<float, double>;
///
/// // Resolves to std::true_type
/// using AnyInt1 = vtkm::ListAny<NumberList1, std::is_integral>;
///
/// // Resolves to std::false_type
/// using AnyInt2 = vtkm::ListAny<NumberList2, std::is_integral>;
/// ```
///
template <typename List, template <typename> class Predicate = vtkm::internal::meta::Identity>
using ListAny =
vtkm::ListReduce<vtkm::ListTransform<List, Predicate>, vtkm::internal::meta::Or, std::false_type>;
#undef VTKM_CHECK_LIST_SIZE
} // namespace vtkm

@ -16,10 +16,19 @@
#include <vtkm/StaticAssert.h>
#include <vtkm/internal/ExportMacros.h>
#include <vtkm/internal/brigand.hpp>
#include <type_traits>
struct VTKM_DEPRECATED(1.6, "ListTag.h is deprecated. Include List.h and use vtkm::List instead.")
VTKmListTagHeaderDeprecationWarning
{
};
inline VTKmListTagHeaderDeprecationWarning IssueVTKmListTagHeaderDeprecationWarning()
{
return {};
}
namespace vtkm
{
namespace detail
@ -35,7 +44,7 @@ struct ListRoot
};
template <class... T>
using ListBase = brigand::list<T...>;
using ListBase = vtkm::List<T...>;
/// list value that is used to represent a list actually matches all values
struct UniversalTag
@ -115,7 +124,7 @@ namespace detail
/// @cond NONE
template <typename ListTag>
struct ListTagAsBrigandListImpl
struct ListTagAsListImpl
{
VTKM_DEPRECATED_SUPPRESS_BEGIN
VTKM_IS_LIST_TAG(ListTag);
@ -126,10 +135,10 @@ struct ListTagAsBrigandListImpl
} // namespace detail
/// Converts a ListTag to a brigand::list.
/// Converts a ListTag to a vtkm::List.
///
template <typename ListTag>
using ListTagAsBrigandList = typename detail::ListTagAsBrigandListImpl<ListTag>::type;
using ListTagAsList = typename detail::ListTagAsListImpl<ListTag>::type;
VTKM_DEPRECATED_SUPPRESS_BEGIN
namespace detail
@ -159,27 +168,13 @@ struct AsListImpl
VTKM_DEPRECATED_SUPPRESS_BEGIN
using type = typename std::conditional<std::is_base_of<vtkm::ListTagUniversal, T>::value,
vtkm::ListUniversal,
brigand::wrap<ListTagAsBrigandList<T>, vtkm::List>>::type;
ListTagAsList<T>>::type;
VTKM_DEPRECATED_SUPPRESS_END
};
} // namespace internal
namespace detail
{
template <typename BrigandList, template <typename...> class Target>
struct ListTagApplyImpl;
template <typename... Ts, template <typename...> class Target>
struct ListTagApplyImpl<brigand::list<Ts...>, Target>
{
using type = Target<Ts...>;
};
} // namespace detail
/// \brief Applies the list of types to a template.
///
/// Given a ListTag and a templated class, returns the class instantiated with the types
@ -187,7 +182,7 @@ struct ListTagApplyImpl<brigand::list<Ts...>, Target>
///
template <typename ListTag, template <typename...> class Target>
using ListTagApply VTKM_DEPRECATED(1.6, "ListTagApply replaced by ListApply.") =
typename detail::ListTagApplyImpl<internal::ListTagAsBrigandList<ListTag>, Target>::type;
vtkm::ListApply<ListTag, Target>;
/// A special tag for an empty list.
///
@ -285,26 +280,18 @@ struct VTKM_DEPRECATED(
};
/// @endcond
namespace detail
{
// Old stlye ListCrossProduct expects brigand::list instead of vtkm::List. Transform back
template <typename List>
using ListToBrigand = vtkm::ListApply<List, brigand::list>;
} // namespace detail
/// Generate a tag that is the cross product of two other tags. The resulting
/// tag has the form of Tag< brigand::list<A1,B1>, brigand::list<A1,B2> .... >
/// tag has the form of Tag< vtkm::List<A1,B1>, vtkm::List<A1,B2> .... >
///
/// Note that as of VTK-m 1.8, the behavior of this (already depreciated) operation
/// was changed to return pairs in vtkm::List instead of brigand::list.
///
/// @cond NONE
template <typename ListTag1, typename ListTag2>
struct VTKM_DEPRECATED(
1.6,
"ListCrossProduct replaced by ListCross. Note that LIstCross cannot be subclassed.")
ListCrossProduct
: vtkm::internal::ListAsListTag<
vtkm::ListTransform<vtkm::ListCross<ListTag1, ListTag2>, detail::ListToBrigand>>
"ListCrossProduct replaced by ListCross. Note that ListCross cannot be subclassed.")
ListCrossProduct : vtkm::internal::ListAsListTag<vtkm::ListCross<ListTag1, ListTag2>>
{
};
/// @endcond
@ -332,8 +319,7 @@ struct VTKM_DEPRECATED(1.6, "ListTypeAt::type replaced by ListAt.") ListTypeAt
VTKM_DEPRECATED_SUPPRESS_BEGIN
VTKM_IS_LIST_TAG(ListTag);
VTKM_DEPRECATED_SUPPRESS_END
using type = brigand::at<internal::ListTagAsBrigandList<ListTag>,
std::integral_constant<vtkm::IdComponent, Index>>;
using type = vtkm::ListAt<ListTag, Index>;
};
} // namespace vtkm

@ -11,6 +11,17 @@
#define vtk_m_TypeListTag_h
// Everything in this header file is deprecated and movded to TypeList.h.
#include <vtkm/Deprecated.h>
struct VTKM_DEPRECATED(1.6, "TypeListTag.h is deprecated. Include TypeList.h and use vtkm::TypeList* instead.")
VTKmTypeListTagHeaderDeprecationWarning
{
};
inline VTKmTypeListTagHeaderDeprecationWarning IssueVTKmTypeListTagHeaderDeprecationWarning()
{
return {};
}
#ifndef VTKM_DEFAULT_TYPE_LIST_TAG
#define VTKM_DEFAULT_TYPE_LIST_TAG ::vtkm::internal::TypeListTagDefault

@ -126,13 +126,11 @@ using IsWritableArrayHandle =
///
template <typename T>
struct ArrayHandleCheck
: std::is_base_of<vtkm::cont::internal::ArrayHandleBase, std::decay_t<T>>::type
{
using U = typename std::remove_pointer<T>::type;
using type = typename std::is_base_of<::vtkm::cont::internal::ArrayHandleBase, U>::type;
};
#define VTKM_IS_ARRAY_HANDLE(T) \
VTKM_STATIC_ASSERT(::vtkm::cont::internal::ArrayHandleCheck<T>::type::value)
#define VTKM_IS_ARRAY_HANDLE(T) VTKM_STATIC_ASSERT(::vtkm::cont::internal::ArrayHandleCheck<T>{})
} // namespace internal

@ -18,8 +18,6 @@
#include <vtkm/Tuple.h>
#include <vtkm/VecTraits.h>
#include <vtkm/internal/brigand.hpp>
#include <vtkmstd/integer_sequence.h>
#include <type_traits>
@ -34,8 +32,7 @@ namespace compvec
template <typename... PortalList>
using AllPortalsAreWritable =
typename brigand::all<brigand::list<PortalList...>,
brigand::bind<vtkm::internal::PortalSupportsSets, brigand::_1>>::type;
vtkm::ListAll<vtkm::List<PortalList...>, vtkm::internal::PortalSupportsSets>;
// GetValueType: ---------------------------------------------------------------
// Determines the output `ValueType` of the set of `ArrayHandle` objects. For example, if the input

@ -14,12 +14,12 @@
#include <vtkm/cont/ErrorBadType.h>
#include <vtkm/cont/Storage.h>
#include <vtkm/List.h>
#include <vtkm/StaticAssert.h>
#include <vtkm/Tuple.h>
#include <vtkm/VecTraits.h>
#include <vtkm/internal/ArrayPortalHelpers.h>
#include <vtkm/internal/brigand.hpp>
#include <vtkmstd/integer_sequence.h>
@ -109,8 +109,7 @@ namespace decor
// Ensures that all types in variadic container ArrayHandleList are subclasses
// of ArrayHandleBase.
template <typename ArrayHandleList>
using AllAreArrayHandles =
brigand::all<ArrayHandleList, std::is_base_of<ArrayHandleBase, brigand::_1>>;
using AllAreArrayHandles = vtkm::ListAll<ArrayHandleList, vtkm::cont::internal::ArrayHandleCheck>;
namespace detail
{
@ -219,11 +218,11 @@ typename std::decay<ArrayT>::type::ReadPortalType GetWritePortalImpl(
// array handles, since these may throw. On non-writable handles, use the
// const array handles so we can at least read from them in the inverse
// functors.
template <typename ArrayT,
typename Portal = typename std::decay<ArrayT>::type::WritePortalType,
typename PortalConst = typename std::decay<ArrayT>::type::ReadPortalType>
using GetWritePortalType =
typename brigand::if_<vtkm::internal::PortalSupportsSets<Portal>, Portal, PortalConst>::type;
template <typename ArrayT>
using GetWritePortalType = std::conditional_t<
vtkm::internal::PortalSupportsSets<typename std::decay<ArrayT>::type::WritePortalType>::value,
typename std::decay<ArrayT>::type::WritePortalType,
typename std::decay<ArrayT>::type::ReadPortalType>;
template <typename ArrayT>
using GetReadPortalType = typename std::decay<ArrayT>::type::ReadPortalType;
@ -249,9 +248,7 @@ GetReadPortalType<typename std::decay<ArrayT>::type> ReadPortal(const ArrayT& ar
// Equivalent to std::true_type if *any* portal in PortalList can be written to.
// If all are read-only, std::false_type is used instead.
template <typename PortalList>
using AnyPortalIsWritable =
typename brigand::any<PortalList,
brigand::bind<vtkm::internal::PortalSupportsSets, brigand::_1>>::type;
using AnyPortalIsWritable = vtkm::ListAny<PortalList, vtkm::internal::PortalSupportsSets>;
// Set to std::true_type if DecoratorImplT::CreateInverseFunctor can be called
// with the supplied portals, or std::false_type otherwise.
@ -268,8 +265,8 @@ using IsDecoratorAllocatable =
// std::true_type/std::false_type depending on whether the decorator impl has a
// CreateInversePortal method AND any of the arrays are writable.
template <typename DecoratorImplT, typename PortalList>
using CanWriteToFunctor = typename brigand::and_<IsFunctorInvertible<DecoratorImplT, PortalList>,
AnyPortalIsWritable<PortalList>>::type;
using CanWriteToFunctor = vtkm::internal::meta::And<IsFunctorInvertible<DecoratorImplT, PortalList>,
AnyPortalIsWritable<PortalList>>;
// The FunctorType for the provided implementation and portal types.
template <typename DecoratorImplT, typename PortalList>
@ -286,22 +283,28 @@ using GetInverseFunctorType =
// Convert a sequence of array handle types to a list of portals:
// Some notes on this implementation:
// - MSVC 2015 ICEs when using brigand::transform to convert a brigand::list
// of arrayhandles to portals. So instead we pass the ArrayTs.
// - Just using brigand::list<GetWritePortalType<ArrayTs>...> fails, as
// apparently that is an improper parameter pack expansion
// - A more straightforward way to implement these to types would be to take
// a simple template that takes a vtkm::List of array types and convert
// that with vtkm::ListTransform<ArrayList, GetWritePortalType>. However,
// this causes a strange compiler error in VS 2017 when evaluating the
// `ValueType` in `DecoratorStorageTraits`. (It does not recognize the
// decorator impl functor as a function taking one argument, even when it
// effectively is.) A previous similar implementation caused an ICE in
// VS 2015 (although that compiler is no longer supported anyway).
// - The same problem happens with VS 2017 if you just try to create a list
// with vtkm::List<GetWritePortalType<ArrayTs>...>.
// - So we jump through some decltype/declval hoops here to get this to work:
template <typename... ArrayTs>
using GetReadPortalList =
brigand::list<decltype((ReadPortal(std::declval<ArrayTs&>(),
std::declval<vtkm::cont::DeviceAdapterId>(),
std::declval<vtkm::cont::Token&>())))...>;
vtkm::List<decltype((ReadPortal(std::declval<ArrayTs&>(),
std::declval<vtkm::cont::DeviceAdapterId>(),
std::declval<vtkm::cont::Token&>())))...>;
template <typename... ArrayTs>
using GetWritePortalList =
brigand::list<decltype((WritePortal(std::declval<ArrayTs&>(),
std::declval<vtkm::cont::DeviceAdapterId>(),
std::declval<vtkm::cont::Token&>())))...>;
vtkm::List<decltype((WritePortal(std::declval<ArrayTs&>(),
std::declval<vtkm::cont::DeviceAdapterId>(),
std::declval<vtkm::cont::Token&>())))...>;
template <vtkm::IdComponent I, typename ArrayTupleType>
struct BufferIndexImpl
@ -340,7 +343,7 @@ struct DecoratorMetaData
template <typename DecoratorImplT, typename... ArrayTs>
struct DecoratorStorageTraits
{
using ArrayList = brigand::list<ArrayTs...>;
using ArrayList = vtkm::List<ArrayTs...>;
VTKM_STATIC_ASSERT_MSG(sizeof...(ArrayTs) > 0,
"Must specify at least one source array handle for "
@ -387,7 +390,7 @@ struct DecoratorStorageTraits
// Portal lists:
// NOTE we have to pass the parameter pack here instead of using ArrayList
// with brigand::transform, since that's causing MSVC 2015 to ice:
// with vtkm::ListTransform, since that's causing problems with VS 2017:
using WritePortalList = GetWritePortalList<ArrayTs...>;
using ReadPortalList = GetReadPortalList<ArrayTs...>;
@ -682,7 +685,7 @@ VTKM_CONT ArrayHandleDecorator<typename std::decay<DecoratorImplT>::type,
typename std::decay<ArrayTs>::type...>
make_ArrayHandleDecorator(vtkm::Id numValues, DecoratorImplT&& f, ArrayTs&&... arrays)
{
using AHList = brigand::list<typename std::decay<ArrayTs>::type...>;
using AHList = vtkm::List<typename std::decay<ArrayTs>::type...>;
VTKM_STATIC_ASSERT_MSG(sizeof...(ArrayTs) > 0,
"Must specify at least one source array handle for "
"ArrayHandleDecorator. Consider using "

@ -10,14 +10,19 @@
#ifndef vtk_m_cont_AtomicArray_h
#define vtk_m_cont_AtomicArray_h
#include <vtkm/Deprecated.h>
#include <vtkm/List.h>
#include <vtkm/ListTag.h>
#include <vtkm/StaticAssert.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/DeviceAdapter.h>
#include <vtkm/cont/ExecutionObjectBase.h>
#include <vtkm/exec/AtomicArrayExecutionObject.h>
// Support deprecated features
VTKM_DEPRECATED_SUPPRESS_BEGIN
#include <vtkm/ListTag.h>
VTKM_DEPRECATED_SUPPRESS_END
namespace vtkm
{
namespace cont

@ -38,7 +38,7 @@ VTKM_CONT CoordinateSystem::CoordinateSystem()
VTKM_CONT CoordinateSystem::CoordinateSystem(std::string name,
const vtkm::cont::UnknownArrayHandle& data)
: Superclass(name, Association::POINTS, data)
: Superclass(name, Association::Points, data)
{
}
@ -50,7 +50,7 @@ CoordinateSystem::CoordinateSystem(std::string name,
vtkm::Vec3f origin,
vtkm::Vec3f spacing)
: Superclass(name,
Association::POINTS,
Association::Points,
vtkm::cont::ArrayHandleUniformPointCoordinates(dimensions, origin, spacing))
{
}

@ -137,7 +137,7 @@ public:
template <typename T, typename Storage>
VTKM_CONT CoordinateSystem(std::string name, const ArrayHandle<T, Storage>& data)
: Superclass(name, Association::POINTS, data)
: Superclass(name, Association::Points, data)
{
}

@ -48,7 +48,7 @@ public:
VTKM_CONT
bool HasField(const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY) const
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any) const
{
bool found = false;
this->FindFieldIndex(name, assoc, found);
@ -59,7 +59,7 @@ public:
bool HasCellField(const std::string& name) const
{
bool found = false;
this->FindFieldIndex(name, vtkm::cont::Field::Association::CELL_SET, found);
this->FindFieldIndex(name, vtkm::cont::Field::Association::Cells, found);
return found;
}
@ -67,7 +67,7 @@ public:
bool HasPointField(const std::string& name) const
{
bool found = false;
this->FindFieldIndex(name, vtkm::cont::Field::Association::POINTS, found);
this->FindFieldIndex(name, vtkm::cont::Field::Association::Points, found);
return found;
}
@ -77,7 +77,7 @@ public:
VTKM_CONT
vtkm::Id GetFieldIndex(
const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY) const;
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any) const;
/// Returns the field that matches the provided name and association
/// Will throw an exception if no match is found
@ -85,7 +85,7 @@ public:
VTKM_CONT
const vtkm::cont::Field& GetField(
const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY) const
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any) const
{
return this->GetField(this->GetFieldIndex(name, assoc));
}
@ -93,7 +93,7 @@ public:
VTKM_CONT
vtkm::cont::Field& GetField(
const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY)
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any)
{
return this->GetField(this->GetFieldIndex(name, assoc));
}
@ -105,13 +105,13 @@ public:
VTKM_CONT
const vtkm::cont::Field& GetCellField(const std::string& name) const
{
return this->GetField(name, vtkm::cont::Field::Association::CELL_SET);
return this->GetField(name, vtkm::cont::Field::Association::Cells);
}
VTKM_CONT
vtkm::cont::Field& GetCellField(const std::string& name)
{
return this->GetField(name, vtkm::cont::Field::Association::CELL_SET);
return this->GetField(name, vtkm::cont::Field::Association::Cells);
}
//@}
@ -121,13 +121,13 @@ public:
VTKM_CONT
const vtkm::cont::Field& GetPointField(const std::string& name) const
{
return this->GetField(name, vtkm::cont::Field::Association::POINTS);
return this->GetField(name, vtkm::cont::Field::Association::Points);
}
VTKM_CONT
vtkm::cont::Field& GetPointField(const std::string& name)
{
return this->GetField(name, vtkm::cont::Field::Association::POINTS);
return this->GetField(name, vtkm::cont::Field::Association::Points);
}
//@}
@ -148,14 +148,14 @@ public:
VTKM_CONT void AddPointField(const std::string& fieldName, const std::vector<T>& field)
{
this->AddField(
make_Field(fieldName, vtkm::cont::Field::Association::POINTS, field, vtkm::CopyFlag::On));
make_Field(fieldName, vtkm::cont::Field::Association::Points, field, vtkm::CopyFlag::On));
}
template <typename T>
VTKM_CONT void AddPointField(const std::string& fieldName, const T* field, const vtkm::Id& n)
{
this->AddField(
make_Field(fieldName, vtkm::cont::Field::Association::POINTS, field, n, vtkm::CopyFlag::On));
make_Field(fieldName, vtkm::cont::Field::Association::Points, field, n, vtkm::CopyFlag::On));
}
//Cell centered field
@ -176,14 +176,14 @@ public:
VTKM_CONT void AddCellField(const std::string& fieldName, const std::vector<T>& field)
{
this->AddField(
make_Field(fieldName, vtkm::cont::Field::Association::CELL_SET, field, vtkm::CopyFlag::On));
make_Field(fieldName, vtkm::cont::Field::Association::Cells, field, vtkm::CopyFlag::On));
}
template <typename T>
VTKM_CONT void AddCellField(const std::string& fieldName, const T* field, const vtkm::Id& n)
{
this->AddField(make_Field(
fieldName, vtkm::cont::Field::Association::CELL_SET, field, n, vtkm::CopyFlag::On));
this->AddField(
make_Field(fieldName, vtkm::cont::Field::Association::Cells, field, n, vtkm::CopyFlag::On));
}
@ -286,8 +286,8 @@ private:
bool operator()(const T& a, const T& b) const
{
if (a.first == b.first)
return a.second < b.second && a.second != vtkm::cont::Field::Association::ANY &&
b.second != vtkm::cont::Field::Association::ANY;
return a.second < b.second && a.second != vtkm::cont::Field::Association::Any &&
b.second != vtkm::cont::Field::Association::Any;
return a.first < b.first;
}

@ -50,7 +50,7 @@ public:
const std::vector<T>& field)
{
dataSet.AddField(
make_Field(fieldName, vtkm::cont::Field::Association::POINTS, field, vtkm::CopyFlag::On));
make_Field(fieldName, vtkm::cont::Field::Association::Points, field, vtkm::CopyFlag::On));
}
template <typename T>
@ -60,7 +60,7 @@ public:
const vtkm::Id& n)
{
dataSet.AddField(
make_Field(fieldName, vtkm::cont::Field::Association::POINTS, field, n, vtkm::CopyFlag::On));
make_Field(fieldName, vtkm::cont::Field::Association::Points, field, n, vtkm::CopyFlag::On));
}
//Cell centered field
@ -86,7 +86,7 @@ public:
const std::vector<T>& field)
{
dataSet.AddField(
make_Field(fieldName, vtkm::cont::Field::Association::CELL_SET, field, vtkm::CopyFlag::On));
make_Field(fieldName, vtkm::cont::Field::Association::Cells, field, vtkm::CopyFlag::On));
}
template <typename T>
@ -95,8 +95,8 @@ public:
const T* field,
const vtkm::Id& n)
{
dataSet.AddField(make_Field(
fieldName, vtkm::cont::Field::Association::CELL_SET, field, n, vtkm::CopyFlag::On));
dataSet.AddField(
make_Field(fieldName, vtkm::cont::Field::Association::Cells, field, n, vtkm::CopyFlag::On));
}
};
}

@ -10,21 +10,8 @@
#ifndef vtk_m_cont_DynamicCellSet_h
#define vtk_m_cont_DynamicCellSet_h
#include <vtkm/cont/CastAndCall.h>
#include <vtkm/cont/CellSet.h>
#include <vtkm/cont/CellSetList.h>
#include <vtkm/cont/DefaultTypes.h>
#include <vtkm/cont/ErrorBadValue.h>
#include <vtkm/cont/Logging.h>
#include <vtkm/cont/UncertainCellSet.h>
#include <vtkm/Deprecated.h>
namespace vtkm
{
namespace cont
{
struct VTKM_DEPRECATED(1.8, "Use UnknownCellSet.h or UncertainCellSet.h.")
DynamicCellSet_h_header_is_deprecated
{
@ -37,218 +24,4 @@ inline void EmitDynamicCellSetHDeprecationWarning()
++x.x;
}
// This is a deprecated class. Don't warn about deprecation while implementing
// deprecated functionality.
VTKM_DEPRECATED_SUPPRESS_BEGIN
/// \brief Holds a cell set without having to specify concrete type.
///
/// \c DynamicCellSet holds a \c CellSet object using runtime polymorphism to
/// manage different subclass types and template parameters of the subclasses
/// rather than compile-time templates. This adds a programming convenience
/// that helps avoid a proliferation of templates. It also provides the
/// management necessary to interface VTK-m with data sources where types will
/// not be known until runtime.
///
/// To interface between the runtime polymorphism and the templated algorithms
/// in VTK-m, \c DynamicCellSet contains a method named \c CastAndCall that
/// will determine the correct type from some known list of cell set types.
/// This mechanism is used internally by VTK-m's worklet invocation mechanism
/// to determine the type when running algorithms.
///
/// By default, \c DynamicCellSet will assume that the value type in the array
/// matches one of the types specified by \c VTKM_DEFAULT_CELL_SET_LIST.
/// This list can be changed by using the \c ResetCellSetList method. It is
/// worthwhile to match these lists closely to the possible types that might be
/// used. If a type is missing you will get a runtime error. If there are more
/// types than necessary, then the template mechanism will create a lot of
/// object code that is never used, and keep in mind that the number of
/// combinations grows exponentially when using multiple \c Dynamic* objects.
///
/// The actual implementation of \c DynamicCellSet is in a templated class
/// named \c DynamicCellSetBase, which is templated on the list of cell set
/// types. \c DynamicCellSet is really just a typedef of \c DynamicCellSetBase
/// with the default cell set list.
///
template <typename CellSetList>
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.8,
"Use vtkm::cont::UncertainCellSet.") DynamicCellSetBase
: public vtkm::cont::UncertainCellSet<CellSetList>
{
using Superclass = vtkm::cont::UncertainCellSet<CellSetList>;
public:
using Superclass::Superclass;
VTKM_CONT DynamicCellSetBase<CellSetList> NewInstance() const
{
return DynamicCellSetBase<CellSetList>(this->Superclass::NewInstance());
}
template <typename NewCellSetList>
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList(NewCellSetList) const
{
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
}
template <typename NewCellSetList>
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList() const
{
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
}
};
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.8, "Use vtkm::cont::UnknownCellSet.") DynamicCellSet
: public vtkm::cont::UnknownCellSet
{
using UnknownCellSet::UnknownCellSet;
DynamicCellSet() = default;
DynamicCellSet(const vtkm::cont::UnknownCellSet& src)
: UnknownCellSet(src)
{
}
operator vtkm::cont::DynamicCellSetBase<VTKM_DEFAULT_CELL_SET_LIST>() const
{
return vtkm::cont::DynamicCellSetBase<VTKM_DEFAULT_CELL_SET_LIST>{ *this };
}
VTKM_CONT vtkm::cont::DynamicCellSet NewInstance() const
{
return vtkm::cont::DynamicCellSet(this->UnknownCellSet::NewInstance());
}
template <typename NewCellSetList>
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList(NewCellSetList) const
{
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
}
template <typename NewCellSetList>
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList() const
{
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
}
};
namespace internal
{
template <typename CellSetList>
struct DynamicTransformTraits<vtkm::cont::DynamicCellSetBase<CellSetList>>
{
using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall;
};
template <>
struct DynamicTransformTraits<vtkm::cont::DynamicCellSet>
{
using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall;
};
} // namespace internal
namespace internal
{
/// Checks to see if the given object is a dynamic cell set. It contains a
/// typedef named \c type that is either std::true_type or std::false_type.
/// Both of these have a typedef named value with the respective boolean value.
///
template <typename T>
struct DynamicCellSetCheck
{
using type = vtkm::cont::internal::UnknownCellSetCheck<T>;
};
#define VTKM_IS_DYNAMIC_CELL_SET(T) \
VTKM_STATIC_ASSERT(::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
#define VTKM_IS_DYNAMIC_OR_STATIC_CELL_SET(T) \
VTKM_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value || \
::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
} // namespace internal
}
} // namespace vtkm::cont
//=============================================================================
// Specializations of serialization related classes
/// @cond SERIALIZATION
namespace mangled_diy_namespace
{
namespace internal
{
struct DynamicCellSetSerializeFunctor
{
template <typename CellSetType>
void operator()(const CellSetType& cs, BinaryBuffer& bb) const
{
vtkmdiy::save(bb, vtkm::cont::SerializableTypeString<CellSetType>::Get());
vtkmdiy::save(bb, cs);
}
};
template <typename CellSetTypes>
struct DynamicCellSetDeserializeFunctor
{
template <typename CellSetType>
void operator()(CellSetType,
vtkm::cont::DynamicCellSetBase<CellSetTypes>& dh,
const std::string& typeString,
bool& success,
BinaryBuffer& bb) const
{
if (!success && (typeString == vtkm::cont::SerializableTypeString<CellSetType>::Get()))
{
CellSetType cs;
vtkmdiy::load(bb, cs);
dh = vtkm::cont::DynamicCellSetBase<CellSetTypes>(cs);
success = true;
}
}
};
} // internal
template <typename CellSetTypes>
struct Serialization<vtkm::cont::DynamicCellSetBase<CellSetTypes>>
{
private:
using Type = vtkm::cont::DynamicCellSetBase<CellSetTypes>;
public:
static VTKM_CONT void save(BinaryBuffer& bb, const Type& obj)
{
obj.CastAndCall(internal::DynamicCellSetSerializeFunctor{}, bb);
}
static VTKM_CONT void load(BinaryBuffer& bb, Type& obj)
{
std::string typeString;
vtkmdiy::load(bb, typeString);
bool success = false;
vtkm::ListForEach(internal::DynamicCellSetDeserializeFunctor<CellSetTypes>{},
CellSetTypes{},
obj,
typeString,
success,
bb);
if (!success)
{
throw vtkm::cont::ErrorBadType("Error deserializing DynamicCellSet. Message TypeString: " +
typeString);
}
}
};
} // diy
/// @endcond SERIALIZATION
VTKM_DEPRECATED_SUPPRESS_END
#endif //vtk_m_cont_DynamicCellSet_h

@ -85,16 +85,16 @@ void Field::PrintSummary(std::ostream& out) const
out << " assoc= ";
switch (this->GetAssociation())
{
case Association::ANY:
case Association::Any:
out << "Any ";
break;
case Association::WHOLE_MESH:
case Association::WholeMesh:
out << "Mesh ";
break;
case Association::POINTS:
case Association::Points:
out << "Points ";
break;
case Association::CELL_SET:
case Association::Cells:
out << "Cells ";
break;
}

@ -33,10 +33,14 @@ class VTKM_CONT_EXPORT Field
public:
enum struct Association
{
ANY,
WHOLE_MESH,
POINTS,
CELL_SET
Any,
WholeMesh,
Points,
Cells,
ANY VTKM_DEPRECATED(1.8, "Use vtkm::cont::Field::Association::Any.") = Any,
WHOLE_MESH VTKM_DEPRECATED(1.8, "Use vtkm::cont::Field::Association::WholeMesh.") = WholeMesh,
POINTS VTKM_DEPRECATED(1.8, "Use vtkm::cont::Field::Association::Points.") = Points,
CELL_SET VTKM_DEPRECATED(1.8, "Use vtkm::cont::Field::Association::Cells.") = Cells
};
VTKM_CONT
@ -61,9 +65,9 @@ public:
VTKM_CONT Field& operator=(const vtkm::cont::Field& src);
VTKM_CONT Field& operator=(vtkm::cont::Field&& src) noexcept;
VTKM_CONT bool IsFieldCell() const { return this->FieldAssociation == Association::CELL_SET; }
VTKM_CONT bool IsFieldPoint() const { return this->FieldAssociation == Association::POINTS; }
VTKM_CONT bool IsFieldGlobal() const { return this->FieldAssociation == Association::WHOLE_MESH; }
VTKM_CONT bool IsFieldCell() const { return this->FieldAssociation == Association::Cells; }
VTKM_CONT bool IsFieldPoint() const { return this->FieldAssociation == Association::Points; }
VTKM_CONT bool IsFieldGlobal() const { return this->FieldAssociation == Association::WholeMesh; }
/// Returns true if the array of the field has a value type that matches something in
/// `VTKM_FIELD_TYPE_LIST` and a storage that matches something in `VTKM_FIELD_STORAGE_LIST`.
@ -165,7 +169,7 @@ public:
private:
std::string Name; ///< name of field
Association FieldAssociation = Association::ANY;
Association FieldAssociation = Association::Any;
vtkm::cont::UnknownArrayHandle Data;
mutable vtkm::cont::ArrayHandle<vtkm::Range> Range;
mutable bool ModifiedFlag = true;
@ -246,21 +250,21 @@ vtkm::cont::Field make_Field(std::string name,
template <typename T, typename S>
vtkm::cont::Field make_FieldPoint(std::string name, const vtkm::cont::ArrayHandle<T, S>& data)
{
return vtkm::cont::Field(name, vtkm::cont::Field::Association::POINTS, data);
return vtkm::cont::Field(name, vtkm::cont::Field::Association::Points, data);
}
/// Convenience function to build point fields from vtkm::cont::UnknownArrayHandle
inline vtkm::cont::Field make_FieldPoint(std::string name,
const vtkm::cont::UnknownArrayHandle& data)
{
return vtkm::cont::Field(name, vtkm::cont::Field::Association::POINTS, data);
return vtkm::cont::Field(name, vtkm::cont::Field::Association::Points, data);
}
/// Convenience function to build cell fields from vtkm::cont::ArrayHandle
template <typename T, typename S>
vtkm::cont::Field make_FieldCell(std::string name, const vtkm::cont::ArrayHandle<T, S>& data)
{
return vtkm::cont::Field(name, vtkm::cont::Field::Association::CELL_SET, data);
return vtkm::cont::Field(name, vtkm::cont::Field::Association::Cells, data);
}
@ -268,7 +272,7 @@ vtkm::cont::Field make_FieldCell(std::string name, const vtkm::cont::ArrayHandle
inline vtkm::cont::Field make_FieldCell(std::string name,
const vtkm::cont::UnknownArrayHandle& data)
{
return vtkm::cont::Field(name, vtkm::cont::Field::Association::CELL_SET, data);
return vtkm::cont::Field(name, vtkm::cont::Field::Association::Cells, data);
}
} // namespace cont

@ -36,7 +36,7 @@ VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
const vtkm::cont::DataSet& dataset,
const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY);
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any);
template <typename TypeList>
VTKM_DEPRECATED(1.6, "FieldRangeCompute no longer supports TypeList.")
@ -79,7 +79,7 @@ VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeCompute(
const vtkm::cont::PartitionedDataSet& pds,
const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY);
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any);
template <typename TypeList>
VTKM_DEPRECATED(1.6, "FieldRangeCompute no longer supports TypeList.")

@ -41,7 +41,7 @@ VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
const vtkm::cont::DataSet& dataset,
const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY);
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any);
template <typename TypeList>
VTKM_DEPRECATED(1.6, "FieldRangeGlobalCompute no longer supports TypeList.")
@ -73,7 +73,7 @@ VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> FieldRangeGlobalCompute(
const vtkm::cont::PartitionedDataSet& pds,
const std::string& name,
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::ANY);
vtkm::cont::Field::Association assoc = vtkm::cont::Field::Association::Any);
template <typename TypeList>
VTKM_DEPRECATED(1.6, "FieldRangeGlobalCompute no longer supports TypeList.")

@ -321,10 +321,10 @@ vtkm::cont::Field MergeField(const vtkm::cont::PartitionedDataSet& partitionedDa
vtkm::Id totalSize = 0;
switch (referenceField.GetAssociation())
{
case vtkm::cont::Field::Association::POINTS:
case vtkm::cont::Field::Association::Points:
totalSize = numPointsTotal;
break;
case vtkm::cont::Field::Association::CELL_SET:
case vtkm::cont::Field::Association::Cells:
totalSize = numCellsTotal;
break;
default:
@ -350,10 +350,10 @@ vtkm::cont::Field MergeField(const vtkm::cont::PartitionedDataSet& partitionedDa
<< referenceField.GetName());
switch (referenceField.GetAssociation())
{
case vtkm::cont::Field::Association::POINTS:
case vtkm::cont::Field::Association::Points:
partitionSize = partition.GetNumberOfPoints();
break;
case vtkm::cont::Field::Association::CELL_SET:
case vtkm::cont::Field::Association::Cells:
partitionSize = partition.GetNumberOfCells();
break;
default:

@ -10,13 +10,28 @@
#ifndef vtk_m_cont_StorageListTag_h
#define vtk_m_cont_StorageListTag_h
// Everything in this header file is deprecated and movded to StorageList.h.
// Everything in this header file is deprecated and moved to StorageList.h.
#include <vtkm/Deprecated.h>
struct VTKM_DEPRECATED(
1.6,
"TypeListTag.h is deprecated. Include TypeList.h and use vtkm::TypeList* instead.")
VTKmTypeListTagHeaderDeprecationWarning
{
};
inline VTKmTypeListTagHeaderDeprecationWarning IssueVTKmTypeListTagHeaderDeprecationWarning()
{
return {};
}
#ifndef VTKM_DEFAULT_STORAGE_LIST_TAG
#define VTKM_DEFAULT_STORAGE_LIST_TAG ::vtkm::cont::detail::StorageListTagDefault
#endif
VTKM_DEPRECATED_SUPPRESS_BEGIN
#include <vtkm/ListTag.h>
VTKM_DEPRECATED_SUPPRESS_END
#include <vtkm/cont/StorageList.h>

@ -201,4 +201,142 @@ public:
/// @endcond SERIALIZATION
// Implement the deprecated functionality of DynamicCellSetBase, which was replaced
// by UnknownCellSet/UncertainCellSet. Everything below this line (up to the #endif
// for the include guard) can be deleted once the deprecated functionality is removed.
namespace vtkm
{
namespace cont
{
// This is a deprecated class. Don't warn about deprecation while implementing
// deprecated functionality.
VTKM_DEPRECATED_SUPPRESS_BEGIN
template <typename CellSetList>
class VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.8,
"Use vtkm::cont::UncertainCellSet.") DynamicCellSetBase
: public vtkm::cont::UncertainCellSet<CellSetList>
{
using Superclass = vtkm::cont::UncertainCellSet<CellSetList>;
public:
using Superclass::Superclass;
VTKM_CONT DynamicCellSetBase<CellSetList> NewInstance() const
{
return DynamicCellSetBase<CellSetList>(this->Superclass::NewInstance());
}
template <typename NewCellSetList>
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList(NewCellSetList) const
{
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
}
template <typename NewCellSetList>
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList() const
{
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
}
};
inline DynamicCellSet::operator vtkm::cont::DynamicCellSetBase<VTKM_DEFAULT_CELL_SET_LIST>() const
{
return vtkm::cont::DynamicCellSetBase<VTKM_DEFAULT_CELL_SET_LIST>{ *this };
}
namespace internal
{
template <typename CellSetList>
struct DynamicTransformTraits<vtkm::cont::DynamicCellSetBase<CellSetList>>
{
using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall;
};
} // namespace internal
}
} // namespace vtkm::cont
//=============================================================================
// Specializations of serialization related classes
/// @cond SERIALIZATION
namespace mangled_diy_namespace
{
namespace internal
{
struct DynamicCellSetSerializeFunctor
{
template <typename CellSetType>
void operator()(const CellSetType& cs, BinaryBuffer& bb) const
{
vtkmdiy::save(bb, vtkm::cont::SerializableTypeString<CellSetType>::Get());
vtkmdiy::save(bb, cs);
}
};
template <typename CellSetTypes>
struct DynamicCellSetDeserializeFunctor
{
template <typename CellSetType>
void operator()(CellSetType,
vtkm::cont::DynamicCellSetBase<CellSetTypes>& dh,
const std::string& typeString,
bool& success,
BinaryBuffer& bb) const
{
if (!success && (typeString == vtkm::cont::SerializableTypeString<CellSetType>::Get()))
{
CellSetType cs;
vtkmdiy::load(bb, cs);
dh = vtkm::cont::DynamicCellSetBase<CellSetTypes>(cs);
success = true;
}
}
};
} // internal
template <typename CellSetTypes>
struct Serialization<vtkm::cont::DynamicCellSetBase<CellSetTypes>>
{
private:
using Type = vtkm::cont::DynamicCellSetBase<CellSetTypes>;
public:
static VTKM_CONT void save(BinaryBuffer& bb, const Type& obj)
{
obj.CastAndCall(internal::DynamicCellSetSerializeFunctor{}, bb);
}
static VTKM_CONT void load(BinaryBuffer& bb, Type& obj)
{
std::string typeString;
vtkmdiy::load(bb, typeString);
bool success = false;
vtkm::ListForEach(internal::DynamicCellSetDeserializeFunctor<CellSetTypes>{},
CellSetTypes{},
obj,
typeString,
success,
bb);
if (!success)
{
throw vtkm::cont::ErrorBadType("Error deserializing DynamicCellSet. Message TypeString: " +
typeString);
}
}
};
} // diy
/// @endcond SERIALIZATION
VTKM_DEPRECATED_SUPPRESS_END
#endif //vtk_m_cont_UncertainCellSet_h

@ -14,6 +14,8 @@
#include <vtkm/cont/CellSet.h>
#include <vtkm/cont/DefaultTypes.h>
#include <vtkm/Deprecated.h>
#include <vtkm/cont/vtkm_cont_export.h>
#include <memory>
@ -23,7 +25,7 @@ namespace vtkm
namespace cont
{
// Forward declaration. Include UncertainCellSet.h if using this.
// Forward declaration.
template <typename CellSetList>
class UncertainCellSet;
@ -392,4 +394,124 @@ public:
/// @endcond SERIALIZATION
// Implement the deprecated functionality of DynamicCellSet, which was replaced
// by UnknownCellSet/UncertainCellSet. Everything below this line (up to the #endif
// for the include guard) can be deleted once the deprecated functionality is removed.
// Headers originally included from DynamicCellSet.h but not UnknownCellSet.h
#include <vtkm/cont/CellSetList.h>
#include <vtkm/cont/ErrorBadValue.h>
#include <vtkm/cont/Logging.h>
namespace vtkm
{
namespace cont
{
// This is a deprecated class. Don't warn about deprecation while implementing
// deprecated functionality.
VTKM_DEPRECATED_SUPPRESS_BEGIN
// Forward declaration
template <typename CellSetList>
class DynamicCellSetBase;
/// \brief Holds a cell set without having to specify concrete type.
///
/// \c DynamicCellSet holds a \c CellSet object using runtime polymorphism to
/// manage different subclass types and template parameters of the subclasses
/// rather than compile-time templates. This adds a programming convenience
/// that helps avoid a proliferation of templates. It also provides the
/// management necessary to interface VTK-m with data sources where types will
/// not be known until runtime.
///
/// To interface between the runtime polymorphism and the templated algorithms
/// in VTK-m, \c DynamicCellSet contains a method named \c CastAndCall that
/// will determine the correct type from some known list of cell set types.
/// This mechanism is used internally by VTK-m's worklet invocation mechanism
/// to determine the type when running algorithms.
///
/// By default, \c DynamicCellSet will assume that the value type in the array
/// matches one of the types specified by \c VTKM_DEFAULT_CELL_SET_LIST.
/// This list can be changed by using the \c ResetCellSetList method. It is
/// worthwhile to match these lists closely to the possible types that might be
/// used. If a type is missing you will get a runtime error. If there are more
/// types than necessary, then the template mechanism will create a lot of
/// object code that is never used, and keep in mind that the number of
/// combinations grows exponentially when using multiple \c Dynamic* objects.
///
/// The actual implementation of \c DynamicCellSet is in a templated class
/// named \c DynamicCellSetBase, which is templated on the list of cell set
/// types. \c DynamicCellSet is really just a typedef of \c DynamicCellSetBase
/// with the default cell set list.
///
struct VTKM_ALWAYS_EXPORT VTKM_DEPRECATED(1.8, "Use vtkm::cont::UnknownCellSet.") DynamicCellSet
: public vtkm::cont::UnknownCellSet
{
using UnknownCellSet::UnknownCellSet;
DynamicCellSet() = default;
DynamicCellSet(const vtkm::cont::UnknownCellSet& src)
: UnknownCellSet(src)
{
}
operator vtkm::cont::DynamicCellSetBase<VTKM_DEFAULT_CELL_SET_LIST>() const;
VTKM_CONT vtkm::cont::DynamicCellSet NewInstance() const
{
return vtkm::cont::DynamicCellSet(this->UnknownCellSet::NewInstance());
}
template <typename NewCellSetList>
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList(NewCellSetList) const
{
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
}
template <typename NewCellSetList>
VTKM_CONT vtkm::cont::DynamicCellSetBase<NewCellSetList> ResetCellSetList() const
{
return vtkm::cont::DynamicCellSetBase<NewCellSetList>(*this);
}
};
namespace internal
{
template <>
struct DynamicTransformTraits<vtkm::cont::DynamicCellSet>
{
using DynamicTag = vtkm::cont::internal::DynamicTransformTagCastAndCall;
};
/// Checks to see if the given object is a dynamic cell set. It contains a
/// typedef named \c type that is either std::true_type or std::false_type.
/// Both of these have a typedef named value with the respective boolean value.
///
template <typename T>
struct DynamicCellSetCheck
{
using type = vtkm::cont::internal::UnknownCellSetCheck<T>;
};
#define VTKM_IS_DYNAMIC_CELL_SET(T) \
VTKM_STATIC_ASSERT(::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
#define VTKM_IS_DYNAMIC_OR_STATIC_CELL_SET(T) \
VTKM_STATIC_ASSERT(::vtkm::cont::internal::CellSetCheck<T>::type::value || \
::vtkm::cont::internal::DynamicCellSetCheck<T>::type::value)
} // namespace internal
}
} // namespace vtkm::cont
VTKM_DEPRECATED_SUPPRESS_END
// Include the implementation of UncertainCellSet. This should be included because there
// are methods in UnknownCellSet that produce objects of this type. It has to be included
// at the end to resolve the circular dependency.
#include <vtkm/cont/UncertainCellSet.h>
#endif //vtk_m_cont_UnknownCellSet_h

@ -34,7 +34,14 @@ void KokkosReallocate(void*& memory,
VTKM_ASSERT(memory == container);
if (newSize > oldSize)
{
memory = container = vtkm::cont::kokkos::internal::Reallocate(container, newSize);
if (oldSize == 0)
{
memory = container = vtkm::cont::kokkos::internal::Allocate(newSize);
}
else
{
memory = container = vtkm::cont::kokkos::internal::Reallocate(container, newSize);
}
}
}
}

@ -115,6 +115,12 @@ vtkm_library(
)
target_link_libraries(vtkm_cont_testing PUBLIC vtkm_cont)
# Supports external code using deprecated functionality. In particular, MakeTestDataSet.cxx
# now needs symbols compiled in vtkm_cont_testing, but the code may expect to only need
# to include vtkm_cont. Add this circular link to let this continue to work.
# THIS SHOULD BE REMOVED FOR THE 2.0 RELEASE!!!!
target_link_libraries(vtkm_cont INTERFACE vtkm_cont_testing)
if(VTKm_ENABLE_TESTING)
vtkm_unit_tests(SOURCES ${unit_tests} DEFINES VTKM_NO_ERROR_ON_MIXED_CUDA_CXX_TAG)

@ -415,12 +415,12 @@ vtkm::cont::DataSet MakeTestDataSet::Make3DRegularDataSet0()
//Set point scalar
dataSet.AddField(make_Field(
"pointvar", vtkm::cont::Field::Association::POINTS, vars, nVerts, vtkm::CopyFlag::On));
"pointvar", vtkm::cont::Field::Association::Points, vars, nVerts, vtkm::CopyFlag::On));
//Set cell scalar
vtkm::Float32 cellvar[4] = { 100.1f, 100.2f, 100.3f, 100.4f };
dataSet.AddField(make_Field(
"cellvar", vtkm::cont::Field::Association::CELL_SET, cellvar, 4, vtkm::CopyFlag::On));
dataSet.AddField(
make_Field("cellvar", vtkm::cont::Field::Association::Cells, cellvar, 4, vtkm::CopyFlag::On));
static constexpr vtkm::IdComponent dim = 3;
vtkm::cont::CellSetStructured<dim> cellSet;
@ -442,12 +442,12 @@ vtkm::cont::DataSet MakeTestDataSet::Make3DRegularDataSet1()
//Set point scalar
dataSet.AddField(make_Field(
"pointvar", vtkm::cont::Field::Association::POINTS, vars, nVerts, vtkm::CopyFlag::On));
"pointvar", vtkm::cont::Field::Association::Points, vars, nVerts, vtkm::CopyFlag::On));
//Set cell scalar
vtkm::Float32 cellvar[1] = { 100.1f };
dataSet.AddField(make_Field(
"cellvar", vtkm::cont::Field::Association::CELL_SET, cellvar, 1, vtkm::CopyFlag::On));
dataSet.AddField(
make_Field("cellvar", vtkm::cont::Field::Association::Cells, cellvar, 1, vtkm::CopyFlag::On));
static constexpr vtkm::IdComponent dim = 3;
vtkm::cont::CellSetStructured<dim> cellSet;
@ -661,12 +661,12 @@ vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet1()
//Set point scalar
dataSet.AddField(make_Field(
"pointvar", vtkm::cont::Field::Association::POINTS, vars, nVerts, vtkm::CopyFlag::On));
"pointvar", vtkm::cont::Field::Association::Points, vars, nVerts, vtkm::CopyFlag::On));
//Set cell scalar
vtkm::Float32 cellvar[2] = { 100.1f, 100.2f };
dataSet.AddField(make_Field(
"cellvar", vtkm::cont::Field::Association::CELL_SET, cellvar, 2, vtkm::CopyFlag::On));
dataSet.AddField(
make_Field("cellvar", vtkm::cont::Field::Association::Cells, cellvar, 2, vtkm::CopyFlag::On));
return dataSet;
}
@ -694,12 +694,12 @@ vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet2()
//Set point scalar
dataSet.AddField(make_Field(
"pointvar", vtkm::cont::Field::Association::POINTS, vars, nVerts, vtkm::CopyFlag::On));
"pointvar", vtkm::cont::Field::Association::Points, vars, nVerts, vtkm::CopyFlag::On));
//Set cell scalar
vtkm::Float32 cellvar[2] = { 100.1f };
dataSet.AddField(make_Field(
"cellvar", vtkm::cont::Field::Association::CELL_SET, cellvar, 1, vtkm::CopyFlag::On));
dataSet.AddField(
make_Field("cellvar", vtkm::cont::Field::Association::Cells, cellvar, 1, vtkm::CopyFlag::On));
vtkm::cont::CellSetExplicit<> cellSet;
vtkm::Vec<vtkm::Id, 8> ids;
@ -750,12 +750,12 @@ vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet4()
//Set point scalar
dataSet.AddField(make_Field(
"pointvar", vtkm::cont::Field::Association::POINTS, vars, nVerts, vtkm::CopyFlag::On));
"pointvar", vtkm::cont::Field::Association::Points, vars, nVerts, vtkm::CopyFlag::On));
//Set cell scalar
vtkm::Float32 cellvar[2] = { 100.1f, 110.f };
dataSet.AddField(make_Field(
"cellvar", vtkm::cont::Field::Association::CELL_SET, cellvar, 2, vtkm::CopyFlag::On));
dataSet.AddField(
make_Field("cellvar", vtkm::cont::Field::Association::Cells, cellvar, 2, vtkm::CopyFlag::On));
vtkm::cont::CellSetExplicit<> cellSet;
vtkm::Vec<vtkm::Id, 8> ids;
@ -803,12 +803,12 @@ vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet3()
//Set point scalar
dataSet.AddField(make_Field(
"pointvar", vtkm::cont::Field::Association::POINTS, vars, nVerts, vtkm::CopyFlag::On));
"pointvar", vtkm::cont::Field::Association::Points, vars, nVerts, vtkm::CopyFlag::On));
//Set cell scalar
vtkm::Float32 cellvar[2] = { 100.1f };
dataSet.AddField(make_Field(
"cellvar", vtkm::cont::Field::Association::CELL_SET, cellvar, 1, vtkm::CopyFlag::On));
dataSet.AddField(
make_Field("cellvar", vtkm::cont::Field::Association::Cells, cellvar, 1, vtkm::CopyFlag::On));
vtkm::cont::CellSetExplicit<> cellSet;
vtkm::Id4 ids;
@ -854,13 +854,13 @@ vtkm::cont::DataSet MakeTestDataSet::Make3DExplicitDataSet5()
//Set point scalar
dataSet.AddField(make_Field(
"pointvar", vtkm::cont::Field::Association::POINTS, vars, nVerts, vtkm::CopyFlag::On));
"pointvar", vtkm::cont::Field::Association::Points, vars, nVerts, vtkm::CopyFlag::On));
//Set cell scalar
const int nCells = 4;
vtkm::Float32 cellvar[nCells] = { 100.1f, 110.f, 120.2f, 130.5f };
dataSet.AddField(make_Field(
"cellvar", vtkm::cont::Field::Association::CELL_SET, cellvar, nCells, vtkm::CopyFlag::On));
"cellvar", vtkm::cont::Field::Association::Cells, cellvar, nCells, vtkm::CopyFlag::On));
vtkm::cont::CellSetExplicit<> cellSet;
vtkm::Vec<vtkm::Id, 8> ids;

@ -52,7 +52,7 @@ private:
std::mt19937 urng(rng());
std::shuffle(data, data + nvals, urng);
auto field = vtkm::cont::make_Field(
"TestField", vtkm::cont::Field::Association::POINTS, data, nvals, vtkm::CopyFlag::Off);
"TestField", vtkm::cont::Field::Association::Points, data, nvals, vtkm::CopyFlag::Off);
vtkm::Range result;
field.GetRange(&result);
@ -79,7 +79,7 @@ private:
}
}
auto field = vtkm::cont::make_Field(
"TestField", vtkm::cont::Field::Association::POINTS, fieldData, nvals, vtkm::CopyFlag::Off);
"TestField", vtkm::cont::Field::Association::Points, fieldData, nvals, vtkm::CopyFlag::Off);
vtkm::Range result[NumberOfComponents];
field.GetRange(result);

@ -63,15 +63,15 @@ private:
// test various field-getting methods and associations
const vtkm::cont::Field& f1 = ds.GetField("pointvar");
VTKM_TEST_ASSERT(f1.GetAssociation() == vtkm::cont::Field::Association::POINTS,
"Association of 'pointvar' was not Association::POINTS");
VTKM_TEST_ASSERT(f1.GetAssociation() == vtkm::cont::Field::Association::Points,
"Association of 'pointvar' was not Association::Points");
try
{
ds.GetCellField("cellvar");
}
catch (...)
{
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::CELL_SET.");
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::Cells.");
}
try

@ -41,7 +41,7 @@ void ValidateDataSet(const vtkm::cont::DataSet& ds,
}
catch (...)
{
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::CELL_SET.");
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::Cells.");
}
try

@ -52,7 +52,7 @@ void ValidateDataSet(const vtkm::cont::DataSet& ds,
}
catch (...)
{
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::CELL_SET.");
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::Cells.");
}
try

@ -42,7 +42,7 @@ void ValidateDataSet(const vtkm::cont::DataSet& ds,
}
catch (...)
{
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::CELL_SET.");
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::Cells.");
}
try

@ -43,7 +43,7 @@ void ValidateDataSet(const vtkm::cont::DataSet& ds,
}
catch (...)
{
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::CELL_SET.");
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::Cells.");
}
try

@ -55,7 +55,7 @@ static void TwoDimRectilinearTest()
}
catch (...)
{
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::CELL_SET.");
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::Cells.");
}
try
@ -143,7 +143,7 @@ static void ThreeDimRectilinearTest()
}
catch (...)
{
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::CELL_SET.");
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::Cells.");
}
try

@ -58,7 +58,7 @@ static void TwoDimUniformTest()
}
catch (...)
{
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::CELL_SET.");
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::Cells.");
}
try
@ -152,7 +152,7 @@ static void ThreeDimUniformTest()
}
catch (...)
{
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::CELL_SET.");
VTKM_TEST_FAIL("Failed to get field 'cellvar' with Association::Cells.");
}
try

@ -9,6 +9,8 @@
//============================================================================
// This tests deprecated code until it is deleted.
#include <vtkm/Deprecated.h>
VTKM_DEPRECATED_SUPPRESS_BEGIN
#include <vtkm/cont/StorageListTag.h>
@ -16,8 +18,6 @@
#include <vector>
VTKM_DEPRECATED_SUPPRESS_BEGIN
namespace
{

@ -32,9 +32,14 @@
// Eg: TestExecObject::TestExecObject, MyOutputToInputMapPortal::Get,
// TestWorkletProxy::operator()
#pragma push
#if (CUDART_VERSION >= 11050)
#pragma nv_diag_suppress 177
#else
#pragma diag_suppress 177
#endif
#endif
namespace
{

@ -54,7 +54,7 @@ struct GenerateGhostTypeWorklet : vtkm::worklet::WorkletVisitCellsWithPoints
(Dim == 3 && boundsIntersection.Volume() > 0.5 * boundsCell.Volume()))
{
// std::cout<<boundsCell<<" is (partly) contained in "<<BoundsChild<<" "<<boundsIntersection<<" "<<boundsIntersection.Area()<<std::endl;
ghostArray = ghostArray + vtkm::CellClassification::BLANKED;
ghostArray = ghostArray + vtkm::CellClassification::Blanked;
}
}
@ -223,7 +223,7 @@ void AmrArrays::ComputeGenerateGhostType()
vtkm::cont::CellSetStructured<Dim> cellset;
partition.GetCellSet().AsCellSet(cellset);
vtkm::cont::ArrayHandle<vtkm::UInt8> ghostField;
if (!partition.HasField("vtkGhostType", vtkm::cont::Field::Association::CELL_SET))
if (!partition.HasField("vtkGhostType", vtkm::cont::Field::Association::Cells))
{
vtkm::cont::ArrayCopy(
vtkm::cont::ArrayHandleConstant<vtkm::UInt8>(0, partition.GetNumberOfCells()),

@ -34,6 +34,7 @@ set(deprecated_headers
ImageConnectivity.h
ImageDifference.h
ImageMedian.h
Instantiations.h
Mask.h
MaskPoints.h
MeshQuality.h
@ -46,7 +47,7 @@ set(deprecated_headers
PointTransform.h
Slice.h
SplitSharpEdges.h
SurfaceNormal.h
SurfaceNormals.h
Tetrahedralize.h
Threshold.h
ThresholdPoints.h
@ -79,7 +80,6 @@ set(common_headers
FilterTraits.h
PolicyBase.h
PolicyDefault.h
Instantiations.h
)
vtkm_declare_headers(${common_headers})

@ -28,12 +28,6 @@ inline void CellAverage_deprecated_warning()
CellAverage_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::field_conversion::CellAverage.") CellAverage
: public vtkm::filter::field_conversion::CellAverage
{
using field_conversion::CellAverage::CellAverage;
};
}
} // namespace vtkm::filter

@ -13,68 +13,6 @@
#include <vtkm/Deprecated.h>
#include <vtkm/filter/mesh_info/CellMeasures.h>
namespace vtkm
{
struct VTKM_DEPRECATED(1.8, "IntegrateOver is no longer supported") IntegrateOver
{
};
struct VTKM_DEPRECATED(1.8, "IntegrateOverCurve is no longer supported") IntegrateOverCurve
: IntegrateOver
{
static constexpr IntegrationType value = ArcLength;
};
struct VTKM_DEPRECATED(1.8, "IntegrateOverSurface is no longer supported") IntegrateOverSurface
: IntegrateOver
{
static constexpr IntegrationType value = Area;
};
struct VTKM_DEPRECATED(1.8, "IntegrateOverSurface is no longer supported") IntegrateOverSolid
: IntegrateOver
{
static constexpr IntegrationType value = Volume;
};
// Lists of acceptable types of integration
using ArcLength VTKM_DEPRECATED(1.8, "Use vtkm::filter::mesh_info::IntegrationType::ArcLength") =
vtkm::List<IntegrateOverCurve>;
using Area VTKM_DEPRECATED(1.8, "Use vtkm::filter::mesh_info::IntegrationType::Area") =
vtkm::List<IntegrateOverSurface>;
using Volume VTKM_DEPRECATED(1.8, "Use vtkm::filter::mesh_info::IntegrationType::Volume") =
vtkm::List<IntegrateOverSolid>;
using AllMeasures VTKM_DEPRECATED(1.8,
"Use vtkm::filter::mesh_info::IntegrationType::AllMeasures") =
vtkm::List<IntegrateOverSolid, IntegrateOverSurface, IntegrateOverCurve>;
namespace detail
{
IntegrationType OldToNewIntegrationType(vtkm::List<>)
{
return static_cast<IntegrationType>(0);
}
template <typename T, typename... Ts>
IntegrationType OldToNewIntegrationType(vtkm::List<T, Ts...>)
{
return T::value | OldToNewIntegrationType(vtkm::List<Ts...>{});
}
} // namespace detail
namespace filter
{
template <typename IntegrationTypeList>
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::mesh_info::CellMeasures.") CellMeasures
: public vtkm::filter::mesh_info::CellMeasures
{
public:
CellMeasures()
: vtkm::filter::mesh_info::CellMeasures(vtkm::detail::OldToNewIntegrationType(IntegrationTypeList{})
{
}
};
VTKM_DEPRECATED(1.8,
"Use vtkm/filter/mesh_info/CellMeasures.h instead of vtkm/filter/CellMeasures.h.")
inline void CellMeasures_deprecated() {}
@ -83,7 +21,4 @@ inline void CellMeasures_deprecated_warning()
{
CellMeasures_deprecated();
}
} // namespace filter
} // namespace vtkm
#endif //vtk_m_filter_CellMeasures_h

@ -28,12 +28,6 @@ inline void CellSetConnectivity_deprecated_warning()
CellSetConnectivity_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::connected_components::CellSetConnectivity.")
CellSetConnectivity : public vtkm::filter::connected_components::CellSetConnectivity
{
using connected_components::CellSetConnectivity::CellSetConnectivity;
};
}
} // namespace vtkm::filter

@ -26,12 +26,6 @@ inline void CleanGrid_deprecated_warning()
CleanGrid_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::clean_grid::CleanGrid.") CleanGrid
: public vtkm::filter::clean_grid::CleanGrid
{
using clean_grid::CleanGrid::CleanGrid;
};
}
} // namespace vtkm::filter

@ -27,12 +27,6 @@ inline void ClipWithField_deprecated_warning()
ClipWithField_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::contour::ClipWithField.") ClipWithField
: public vtkm::filter::contour::ClipWithField
{
using contour::ClipWithField::ClipWithField;
};
}
} // namespace vtkm::filter

@ -28,12 +28,6 @@ inline void ClipWithImplicitFunction_deprecated_warning()
ClipWithImplicitFunction_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::contour::ClipWithImplicitFunction.")
ClipWithImplicitFunction : public vtkm::filter::contour::ClipWithImplicitFunction
{
using contour::ClipWithImplicitFunction::ClipWithImplicitFunction;
};
}
} // namespace vtkm::filter

@ -28,12 +28,6 @@ inline void ComputeMoments_deprecated_warning()
ComputeMoments_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::image_processing::ComputeMoments.") ComputeMoments
: public vtkm::filter::image_processing::ComputeMoments
{
using image_processing::ComputeMoments::ComputeMoments;
};
}
} // namespace vtkm::filter

@ -26,12 +26,6 @@ inline void Contour_deprecated_warning()
Contour_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::contour::Contour.") Contour
: public vtkm::filter::contour::Contour
{
using contour::Contour::Contour;
};
}
} // namespace vtkm::filter

@ -212,7 +212,7 @@ vtkm::cont::DataSet ContourTreeAugmented::DoExecute(
// Create the result object
vtkm::cont::DataSet result;
vtkm::cont::Field rfield(
this->GetOutputFieldName(), vtkm::cont::Field::Association::WHOLE_MESH, sortedValues);
this->GetOutputFieldName(), vtkm::cont::Field::Association::WholeMesh, sortedValues);
result.AddField(rfield);
return result;
}
@ -455,7 +455,7 @@ VTKM_CONT void ContourTreeAugmented::DoPostExecute(
// TODO the result we return for the parallel and serial case are different right now. This should be made consistent. However, only in the parallel case are we useing the result output
vtkm::cont::DataSet temp;
vtkm::cont::Field rfield(this->GetOutputFieldName(),
vtkm::cont::Field::Association::WHOLE_MESH,
vtkm::cont::Field::Association::WholeMesh,
contourTreeMeshOut.SortedValues);
temp.AddField(rfield);
output = vtkm::cont::PartitionedDataSet(temp);

@ -997,20 +997,20 @@ VTKM_CONT void ContourTreeUniformDistributed::DoPostExecute(
// Create data set from output
vtkm::cont::Field dataValuesField(
"DataValues", vtkm::cont::Field::Association::WHOLE_MESH, blockHierarchcialTree.DataValues);
"DataValues", vtkm::cont::Field::Association::WholeMesh, blockHierarchcialTree.DataValues);
hierarchicalTreeOutputDataSet[blockData->LocalBlockNo].AddField(dataValuesField);
vtkm::cont::Field regularNodeGlobalIdsField("RegularNodeGlobalIds",
vtkm::cont::Field::Association::WHOLE_MESH,
vtkm::cont::Field::Association::WholeMesh,
blockHierarchcialTree.RegularNodeGlobalIds);
hierarchicalTreeOutputDataSet[blockData->LocalBlockNo].AddField(regularNodeGlobalIdsField);
vtkm::cont::Field superarcsField(
"Superarcs", vtkm::cont::Field::Association::WHOLE_MESH, blockHierarchcialTree.Superarcs);
"Superarcs", vtkm::cont::Field::Association::WholeMesh, blockHierarchcialTree.Superarcs);
hierarchicalTreeOutputDataSet[blockData->LocalBlockNo].AddField(superarcsField);
vtkm::cont::Field supernodesField(
"Supernodes", vtkm::cont::Field::Association::WHOLE_MESH, blockHierarchcialTree.Supernodes);
"Supernodes", vtkm::cont::Field::Association::WholeMesh, blockHierarchcialTree.Supernodes);
hierarchicalTreeOutputDataSet[blockData->LocalBlockNo].AddField(supernodesField);
vtkm::cont::Field superparentsField("Superparents",
vtkm::cont::Field::Association::WHOLE_MESH,
vtkm::cont::Field::Association::WholeMesh,
blockHierarchcialTree.Superparents);
hierarchicalTreeOutputDataSet[blockData->LocalBlockNo].AddField(superparentsField);
@ -1177,10 +1177,10 @@ VTKM_CONT void ContourTreeUniformDistributed::DoPostExecute(
hierarchical_hyper_sweep_master.foreach (
[&](HyperSweepBlock* b, const vtkmdiy::Master::ProxyWithLink&) {
vtkm::cont::Field intrinsicVolumeField(
"IntrinsicVolume", vtkm::cont::Field::Association::WHOLE_MESH, b->IntrinsicVolume);
"IntrinsicVolume", vtkm::cont::Field::Association::WholeMesh, b->IntrinsicVolume);
hierarchicalTreeOutputDataSet[b->LocalBlockNo].AddField(intrinsicVolumeField);
vtkm::cont::Field dependentVolumeField(
"DependentVolume", vtkm::cont::Field::Association::WHOLE_MESH, b->DependentVolume);
"DependentVolume", vtkm::cont::Field::Association::WholeMesh, b->DependentVolume);
hierarchicalTreeOutputDataSet[b->LocalBlockNo].AddField(dependentVolumeField);
#ifdef DEBUG_PRINT
VTKM_LOG_S(vtkm::cont::LogLevel::Info, "Block " << b->GlobalBlockId);

@ -11,7 +11,8 @@
#define vtk_m_filter_CoordinateSystemTransform_h
#include <vtkm/Deprecated.h>
#include <vtkm/filter/field_transform/CoordinateSystemTransform.h>
#include <vtkm/filter/field_transform/CylindricalCoordinateTransform.h>
#include <vtkm/filter/field_transform/SphericalCoordinateTransform.h>
namespace vtkm
{
@ -19,7 +20,8 @@ namespace filter
{
VTKM_DEPRECATED(1.8,
"Use vtkm/filter/field_transform/CoordinateSystemTransform.h instead of "
"Use vtkm/filter/field_transform/CylindricalCoordinateTransform.h or "
"vtkm/filter/field_transform/SphericalCoordinateTransform.h instead of "
"vtkm/filter/CoordinateSystemTransform.h.")
inline void CoordinateSystemTransform_deprecated() {}
@ -28,12 +30,6 @@ inline void CoordinateSystemTransform_deprecated_warning()
CoordinateSystemTransform_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::field_transform::CoordinateSystemTransform.")
CoordinateSystemTransform : public vtkm::filter::field_transform::CoordinateSystemTransform
{
using field_transform::CoordinateSystemTransform::CoordinateSystemTransform;
};
}
} // namespace vtkm::filter

@ -29,12 +29,6 @@ inline void CrossProduct_deprecated_warning()
CrossProduct_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::vector_analysis::CrossProduct.") CrossProduct
: public vtkm::filter::vector_analysis::CrossProduct
{
using vector_analysis::CrossProduct::CrossProduct;
};
}
} // namespace vtkm::filter

@ -27,11 +27,6 @@ inline void DotProduct_deprecated_warning()
DotProduct_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::vector_analysis::DotProduct.") DotProduct
: public vtkm::filter::vector_analysis::DotProduct
{
using vector_analysis::DotProduct::DotProduct;
};
}
} // namespace vtkm::filter

@ -26,12 +26,6 @@ inline void Entropy_deprecated_warning()
Entropy_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::density_estimate::Entropy.") Entropy
: public vtkm::filter::density_estimate::Entropy
{
using density_estimate::Entropy::Entropy;
};
}
} // namespace vtkm::filter

@ -28,12 +28,6 @@ inline void ExternalFaces_deprecated_warning()
ExternalFaces_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::entity_extraction::ExternalFaces.") ExternalFaces
: public vtkm::filter::entity_extraction::ExternalFaces
{
using entity_extraction::ExternalFaces::ExternalFaces;
};
}
} // namespace vtkm::filter

@ -28,12 +28,6 @@ inline void ExtractGeometry_deprecated_warning()
ExtractGeometry_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::entity_extraction::ExtractGeometry.") ExtractGeometry
: public vtkm::filter::entity_extraction::ExtractGeometry
{
using entity_extraction::ExtractGeometry::ExtractGeometry;
};
}
} // namespace vtkm::filter

@ -28,12 +28,6 @@ inline void ExtractPoints_deprecated_warning()
ExtractPoints_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::entity_extraction::ExtractPoints.") ExtractPoints
: public vtkm::filter::entity_extraction::ExtractPoints
{
using entity_extraction::ExtractPoints::ExtractPoints;
};
}
} // namespace vtkm::filter

@ -28,13 +28,6 @@ inline void ExtractStructured_deprecated_warning()
ExtractStructured_deprecated();
}
class VTKM_DEPRECATED(1.8,
"Use vtkm::filter::entity_extraction::ExtractStructured.") ExtractStructured
: public vtkm::filter::entity_extraction::ExtractStructured
{
using entity_extraction::ExtractStructured::ExtractStructured;
};
}
} // namespace vtkm::filter

@ -25,7 +25,7 @@ public:
VTKM_CONT
FieldMetadata()
: Name()
, Association(vtkm::cont::Field::Association::ANY)
, Association(vtkm::cont::Field::Association::Any)
{
}
@ -44,10 +44,10 @@ public:
}
VTKM_CONT
bool IsPointField() const { return this->Association == vtkm::cont::Field::Association::POINTS; }
bool IsPointField() const { return this->Association == vtkm::cont::Field::Association::Points; }
VTKM_CONT
bool IsCellField() const { return this->Association == vtkm::cont::Field::Association::CELL_SET; }
bool IsCellField() const { return this->Association == vtkm::cont::Field::Association::Cells; }
VTKM_CONT
const std::string& GetName() const { return this->Name; }

@ -12,6 +12,7 @@
#include <initializer_list>
#include <set>
#include <vtkm/Deprecated.h>
#include <vtkm/Pair.h>
#include <vtkm/cont/Field.h>
@ -28,17 +29,25 @@ namespace filter
class FieldSelection
{
public:
enum ModeEnum
enum struct Mode
{
MODE_NONE,
MODE_ALL,
MODE_SELECT,
MODE_EXCLUDE
None,
All,
Select,
Exclude
};
VTKM_DEPRECATED(1.8, "Use FieldSelection::Mode::None.")
static constexpr Mode MODE_NONE = Mode::None;
VTKM_DEPRECATED(1.8, "Use FieldSelection::Mode::All.") static constexpr Mode MODE_ALL = Mode::All;
VTKM_DEPRECATED(1.8, "Use FieldSelection::Mode::Select.")
static constexpr Mode MODE_SELECT = Mode::Select;
VTKM_DEPRECATED(1.8, "Use FieldSelection::Mode::Exclude.")
static constexpr Mode MODE_EXCLUDE = Mode::Exclude;
using ModeEnum VTKM_DEPRECATED(1.8, "Use FieldSelection::Mode.") = Mode;
VTKM_CONT
FieldSelection(ModeEnum mode = MODE_SELECT)
: Mode(mode)
FieldSelection(Mode mode = Mode::Select)
: ModeType(mode)
{
}
@ -47,10 +56,10 @@ public:
/// FieldSelection("field_name");
/// \endcode
VTKM_CONT
FieldSelection(const std::string& field, ModeEnum mode = MODE_SELECT)
: Mode(mode)
FieldSelection(const std::string& field, Mode mode = Mode::Select)
: ModeType(mode)
{
this->AddField(field, vtkm::cont::Field::Association::ANY);
this->AddField(field, vtkm::cont::Field::Association::Any);
}
/// Use this constructor to create a field selection given a single field name
@ -58,21 +67,21 @@ public:
/// FieldSelection("field_name");
/// \endcode
VTKM_CONT
FieldSelection(const char* field, ModeEnum mode = MODE_SELECT)
: Mode(mode)
FieldSelection(const char* field, Mode mode = Mode::Select)
: ModeType(mode)
{
this->AddField(field, vtkm::cont::Field::Association::ANY);
this->AddField(field, vtkm::cont::Field::Association::Any);
}
/// Use this constructor to create a field selection given a single name and association.
/// \code{cpp}
/// FieldSelection("field_name", vtkm::cont::Field::Association::POINTS)
/// FieldSelection("field_name", vtkm::cont::Field::Association::Points)
/// \endcode{cpp}
VTKM_CONT
FieldSelection(const std::string& field,
vtkm::cont::Field::Association association,
ModeEnum mode = MODE_SELECT)
: Mode(mode)
Mode mode = Mode::Select)
: ModeType(mode)
{
this->AddField(field, association);
}
@ -82,12 +91,12 @@ public:
/// FieldSelection({"field_one", "field_two"});
/// \endcode
VTKM_CONT
FieldSelection(std::initializer_list<std::string> fields, ModeEnum mode = MODE_SELECT)
: Mode(mode)
FieldSelection(std::initializer_list<std::string> fields, Mode mode = Mode::Select)
: ModeType(mode)
{
for (const std::string& afield : fields)
{
this->AddField(afield, vtkm::cont::Field::Association::ANY);
this->AddField(afield, vtkm::cont::Field::Association::Any);
}
}
@ -96,14 +105,14 @@ public:
/// @code{cpp}
/// using pair_type = std::pair<std::string, vtkm::cont::Field::Association>;
/// FieldSelection({
/// pair_type{"field_one", vtkm::cont::Field::Association::POINTS},
/// pair_type{"field_two", vtkm::cont::Field::Association::CELL_SET} });
/// pair_type{"field_one", vtkm::cont::Field::Association::Points},
/// pair_type{"field_two", vtkm::cont::Field::Association::Cells} });
/// @endcode
VTKM_CONT
FieldSelection(
std::initializer_list<std::pair<std::string, vtkm::cont::Field::Association>> fields,
ModeEnum mode = MODE_SELECT)
: Mode(mode)
Mode mode = Mode::Select)
: ModeType(mode)
{
for (const auto& item : fields)
{
@ -116,14 +125,14 @@ public:
/// @code{cpp}
/// using pair_type = vtkm::Pair<std::string, vtkm::cont::Field::Association>;
/// FieldSelection({
/// pair_type{"field_one", vtkm::cont::Field::Association::POINTS},
/// pair_type{"field_two", vtkm::cont::Field::Association::CELL_SET} });
/// pair_type{"field_one", vtkm::cont::Field::Association::Points},
/// pair_type{"field_two", vtkm::cont::Field::Association::Cells} });
/// @endcode
VTKM_CONT
FieldSelection(
std::initializer_list<vtkm::Pair<std::string, vtkm::cont::Field::Association>> fields,
ModeEnum mode = MODE_SELECT)
: Mode(mode)
Mode mode = Mode::Select)
: ModeType(mode)
{
for (const auto& item : fields)
{
@ -135,24 +144,24 @@ public:
// but we don't want any of them compiled for devices (like CUDA), so we have
// to explicitly mark them as VTKM_CONT.
VTKM_CONT FieldSelection(const FieldSelection& src)
: Mode(src.Mode)
: ModeType(src.ModeType)
, Fields(src.Fields)
{
}
VTKM_CONT FieldSelection(FieldSelection&& rhs)
: Mode(rhs.Mode)
: ModeType(rhs.ModeType)
, Fields(std::move(rhs.Fields))
{
}
VTKM_CONT FieldSelection& operator=(const FieldSelection& src)
{
this->Mode = src.Mode;
this->ModeType = src.ModeType;
this->Fields = src.Fields;
return *this;
}
VTKM_CONT FieldSelection& operator=(FieldSelection&& rhs)
{
this->Mode = rhs.Mode;
this->ModeType = rhs.ModeType;
this->Fields = std::move(rhs.Fields);
return *this;
}
@ -168,21 +177,21 @@ public:
bool IsFieldSelected(
const std::string& name,
vtkm::cont::Field::Association association = vtkm::cont::Field::Association::ANY) const
vtkm::cont::Field::Association association = vtkm::cont::Field::Association::Any) const
{
switch (this->Mode)
switch (this->ModeType)
{
case MODE_NONE:
case Mode::None:
return false;
case MODE_ALL:
case Mode::All:
return true;
case MODE_SELECT:
case Mode::Select:
default:
return this->HasField(name, association);
case MODE_EXCLUDE:
case Mode::Exclude:
return !this->HasField(name, association);
}
}
@ -198,7 +207,7 @@ public:
VTKM_CONT
void AddField(const std::string& fieldName,
vtkm::cont::Field::Association association = vtkm::cont::Field::Association::ANY)
vtkm::cont::Field::Association association = vtkm::cont::Field::Association::Any)
{
this->Fields.insert(Field(fieldName, association));
}
@ -216,19 +225,19 @@ public:
bool HasField(
const std::string& name,
vtkm::cont::Field::Association association = vtkm::cont::Field::Association::ANY) const
vtkm::cont::Field::Association association = vtkm::cont::Field::Association::Any) const
{
if (this->Fields.find(Field(name, association)) != this->Fields.end())
{
return true;
}
// if not exact match, let's lookup for Association::ANY.
// if not exact match, let's lookup for Association::Any.
for (const auto& aField : this->Fields)
{
if (aField.Name == name)
{
if (aField.Association == vtkm::cont::Field::Association::ANY ||
association == vtkm::cont::Field::Association::ANY)
if (aField.Association == vtkm::cont::Field::Association::Any ||
association == vtkm::cont::Field::Association::Any)
{
return true;
}
@ -242,11 +251,11 @@ public:
void ClearFields() { this->Fields.clear(); }
VTKM_CONT
ModeEnum GetMode() const { return this->Mode; }
void SetMode(ModeEnum val) { this->Mode = val; }
Mode GetMode() const { return this->ModeType; }
void SetMode(Mode val) { this->ModeType = val; }
private:
ModeEnum Mode; ///< mode
Mode ModeType; ///< mode
struct Field
{

@ -28,12 +28,6 @@ inline void FieldToColors_deprecated_warning()
FieldToColors_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::field_transform::FieldToColors.") FieldToColors
: public vtkm::filter::field_transform::FieldToColors
{
using field_transform::FieldToColors::FieldToColors;
};
}
} // namespace vtkm::filter

@ -261,7 +261,7 @@ public:
VTKM_CONT
void SetFieldsToPass(const vtkm::filter::FieldSelection& fieldsToPass,
vtkm::filter::FieldSelection::ModeEnum mode)
vtkm::filter::FieldSelection::Mode mode)
{
this->FieldsToPass = fieldsToPass;
this->FieldsToPass.SetMode(mode);
@ -271,7 +271,7 @@ public:
void SetFieldsToPass(
const std::string& fieldname,
vtkm::cont::Field::Association association,
vtkm::filter::FieldSelection::ModeEnum mode = vtkm::filter::FieldSelection::MODE_SELECT)
vtkm::filter::FieldSelection::Mode mode = vtkm::filter::FieldSelection::Mode::Select)
{
this->SetFieldsToPass({ fieldname, association }, mode);
}

@ -294,7 +294,7 @@ void CallPostExecute(Derived* self,
template <typename Derived>
inline VTKM_CONT Filter<Derived>::Filter()
: Invoke()
, FieldsToPass(vtkm::filter::FieldSelection::MODE_ALL)
, FieldsToPass(vtkm::filter::FieldSelection::Mode::All)
{
}

@ -43,10 +43,10 @@ public:
/// These are provided to satisfy the Filter API requirements.
//From the field we can extract the association component
// Association::ANY -> unable to map
// Association::WHOLE_MESH -> (I think this is points)
// Association::POINTS -> map using point mapping
// Association::CELL_SET -> how do we map this?
// Association::Any -> unable to map
// Association::WholeMesh -> (I think this is points)
// Association::Points -> map using point mapping
// Association::Cells -> how do we map this?
template <typename DerivedPolicy>
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
const vtkm::cont::Field& field,

@ -46,7 +46,7 @@ public:
VTKM_CONT
void SetActiveField(
const std::string& name,
vtkm::cont::Field::Association association = vtkm::cont::Field::Association::ANY)
vtkm::cont::Field::Association association = vtkm::cont::Field::Association::Any)
{
this->ActiveFieldName = name;
this->ActiveFieldAssociation = association;
@ -69,10 +69,10 @@ public:
//@}
//From the field we can extract the association component
// Association::ANY -> unable to map
// Association::WHOLE_MESH -> (I think this is points)
// Association::POINTS -> map using point mapping
// Association::CELL_SET -> how do we map this?
// Association::Any -> unable to map
// Association::WholeMesh -> (I think this is points)
// Association::Points -> map using point mapping
// Association::Cells -> how do we map this?
template <typename DerivedPolicy>
VTKM_CONT bool MapFieldOntoOutput(vtkm::cont::DataSet& result,
const vtkm::cont::Field& field,

@ -33,7 +33,7 @@ inline VTKM_CONT FilterDataSetWithField<Derived>::FilterDataSetWithField()
: OutputFieldName()
, CoordinateSystemIndex(0)
, ActiveFieldName()
, ActiveFieldAssociation(vtkm::cont::Field::Association::ANY)
, ActiveFieldAssociation(vtkm::cont::Field::Association::Any)
, UseCoordinateSystemAsField(false)
{
}

@ -46,7 +46,7 @@ public:
VTKM_CONT
void SetActiveField(
const std::string& name,
vtkm::cont::Field::Association association = vtkm::cont::Field::Association::ANY)
vtkm::cont::Field::Association association = vtkm::cont::Field::Association::Any)
{
this->ActiveFieldName = name;
this->ActiveFieldAssociation = association;

@ -32,7 +32,7 @@ inline VTKM_CONT FilterField<Derived>::FilterField()
: OutputFieldName()
, CoordinateSystemIndex(0)
, ActiveFieldName()
, ActiveFieldAssociation(vtkm::cont::Field::Association::ANY)
, ActiveFieldAssociation(vtkm::cont::Field::Association::Any)
, UseCoordinateSystemAsField(false)
{
}

@ -28,12 +28,6 @@ inline void GenerateIds_deprecated_warning()
GenerateIds_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::field_transform::GenerateIds.") GenerateIds
: public vtkm::filter::field_transform::GenerateIds
{
using field_transform::GenerateIds::GenerateIds;
};
}
} // namespace vtkm::filter

@ -28,12 +28,6 @@ inline void GhostCellClassify_deprecated_warning()
GhostCellClassify_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::mesh_info::GhostCellClassify.") GhostCellClassify
: public vtkm::filter::mesh_info::GhostCellClassify
{
using mesh_info::GhostCellClassify::GhostCellClassify;
};
}
} // namespace vtkm::filter

@ -28,12 +28,6 @@ inline void GhostCellRemove_deprecated_warning()
GhostCellRemove_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::entity_extraction::GhostCellRemove.") GhostCellRemove
: public vtkm::filter::entity_extraction::GhostCellRemove
{
using entity_extraction::GhostCellRemove::GhostCellRemove;
};
}
} // namespace vtkm::filter

@ -27,12 +27,6 @@ inline void Gradient_deprecated_warning()
Gradient_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::vector_analysis::Gradient.") Gradient
: public vtkm::filter::vector_analysis::Gradient
{
using vector_analysis::Gradient::Gradient;
};
}
} // namespace vtkm::filter

@ -27,12 +27,6 @@ inline void Histogram_deprecated_warning()
Histogram_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::density_estimate::Histogram.") Histogram
: public vtkm::filter::density_estimate::Histogram
{
using density_estimate::Histogram::Histogram;
};
}
} // namespace vtkm::filter

@ -28,12 +28,6 @@ inline void ImageConnectivity_deprecated_warning()
ImageConnectivity_deprecated();
}
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::connected_components::ImageConnectivity.")
ImageConnectivity : public vtkm::filter::connected_components::ImageConnectivity
{
using connected_components::ImageConnectivity::ImageConnectivity;
};
}
} // namespace vtkm::filter

Some files were not shown because too many files have changed in this diff Show More