Merge remote-tracking branch 'origin/master' into update-to-2.0.0

* origin/master: (76 commits)
  PerfTest: Fixes report.json name
  README: Updated VTK-m example for vtkm 2.0.0
  Hide Particle class members
  cmake: namespace vtkm export targets
  CI: CUDA build jobs dont need cuda-rt
  Change auto seed behavior in PerlinNoise source
  Split up the filters benchmark tests
  Add performance configuration options
  Rename NewFilter base classes to Filter
  Handle random seed generation better for PerlinNoise
  Make source parameters more clear
  Remove Filter::CreateResult that takes a vector of CoordinateSystems
  Change wavelet dim to 256 and numPart to 1.
  Add header for vtkm::cont::PartitionedDataSet
  Update ReleaseRoadmap; add instructions NewRelease
  Change default waveletdim back to 256.
  Add multiblock benchmarks for filters.
  Fix unresolved external symbol __popcnt on win-arm64
  Fix unresolved external symbol __popcnt on win-arm64
  Update CMakeLists.txt
  ...
This commit is contained in:
Vicente Adolfo Bolea Sanchez 2022-12-15 17:26:48 -05:00
commit 3eae3fbaab
775 changed files with 7660 additions and 23001 deletions

3
.gitattributes vendored

@ -10,7 +10,8 @@ data/** filter=lfs diff=lfs merge=lfs -text
/**/data/** filter=lfs diff=lfs merge=lfs -text
*.cmake whitespace=tab-in-indent
*.md whitespace=tab-in-indent conflict-marker-size=79 -whitespace
*.md whitespace=tab-in-indent whitespace=-blank-at-eol conflict-marker-size=79 -whitespace
*.md.tmpl whitespace=tab-in-indent whitespace=-blank-at-eol conflict-marker-size=79 -whitespace
*.rst whitespace=tab-in-indent conflict-marker-size=79
*.txt whitespace=tab-in-indent

@ -1,51 +1,3 @@
# Docker Images:
#
# * .gitlab/ci/docker/centos7/cuda10.2/
# - cuda
# - gcc 7.3.1
# * .gitlab/ci/docker/centos8/base/
# - gcc 8.3.1
# - clang 8.0.1
# - openmp
# - asan, ubsan
# * .gitlab/ci/docker/rhel8/cuda10.2/
# - cuda
# - gcc 8.2.1
# * .gitlab/ci/docker/ubuntu1604/base/
# - gcc 5.4.0
# - clang 3.8
# - clang 5.0
# - tbb
# - openmpi
# * .gitlab/ci/docker/ubuntu1604/cuda9.2/
# - cuda
# - gcc 5.4
# - tbb
# - openmp
# - openmpi
# * .gitlab/ci/docker/ubuntu1804/base/
# - gcc 6.5
# - gcc 7.4
# - gcc 9
# - clang 8
# - tbb
# - openmp
# - mpich2
# - hdf5
# * .gitlab/ci/docker/ubuntu1804/cuda11.1/
# - cuda
# - gcc 7
# - gcc 8
# - tbb
# - openmp
# - mpich2
# * .gitlab/ci/docker/ubuntu2004/doxygen/
# - gcc 9.3
# - tbb
# - openmp
# - mpich2
.docker_image: &docker_image
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/gitlab-kitware-sciviz-ci
@ -81,7 +33,7 @@
- .docker_image
.ubuntu1804_cuda: &ubuntu1804_cuda
image: "kitware/vtkm:ci-ubuntu1804_cuda11.6-20220407"
image: "kitware/vtkm:ci-ubuntu1804_cuda11-20220919"
extends:
- .docker_image
@ -96,7 +48,7 @@
- .docker_image
.ubuntu2004: &ubuntu2004
image: "kitware/vtkm:ci-ubuntu2004-20210920"
image: "kitware/vtkm:ci-ubuntu2004-20220623"
extends:
- .docker_image
@ -118,6 +70,12 @@
when: on_success
- when: never
.run_only_merge_requests: &run_only_merge_requests
rules:
- if: '$CI_MERGE_REQUEST_ID && $CI_PROJECT_PATH == "vtk/vtk-m"'
when: on_success
- when: never
.run_scheduled: &run_scheduled
rules:
- if: '$CI_PROJECT_PATH == "vtk/vtk-m" && $CI_COMMIT_TAG'
@ -132,12 +90,18 @@
when: on_success
- when: never
.run_ecp_ci: &run_ecp_ci
.run_ascent_ci: &run_ascent_ci
rules:
- if: '$CI_PROJECT_PATH == "ecpcitest/vtk-m"'
when: on_success
- when: never
.run_spock_ci: &run_spock_ci
rules:
- if: '$CI_PROJECT_PATH == "ci/csc331_crusher/dev/vtk-m"'
when: on_success
- when: never
# General Longer Term Tasks:
# - Setup clang tidy as sub-pipeline
# - Setup a machine to replicate the issue in https://gitlab.kitware.com/vtk/vtk-m/-/issues/447
@ -250,6 +214,7 @@ stages:
include:
- local: '/.gitlab/ci/ascent.yml'
- local: '/.gitlab/ci/spock.yml'
- local: '/.gitlab/ci/centos7.yml'
- local: '/.gitlab/ci/centos8.yml'
- local: '/.gitlab/ci/doxygen.yml'

@ -1,86 +1,83 @@
# Ad-hoc build that runs in the ECP Hardware, concretely in OLCF Ascent.
.ascent_gcc_cuda:
variables:
CCACHE_BASEDIR: "/gpfs/wolf/"
CCACHE_DIR: "/gpfs/wolf/proj-shared/csc331/vtk-m/ci/ccache/"
# -isystem= is not affected by CCACHE_BASEDIR, thus we must ignore it
CCACHE_IGNOREOPTIONS: "-isystem=*"
CCACHE_NOHASHDIR: "true"
CC: "gcc"
CXX: "g++"
CMAKE_BUILD_TYPE: "RelWithDebInfo"
CMAKE_GENERATOR: "Ninja"
CUDAHOSTCXX: "g++"
CUSTOM_CI_BUILDS_DIR: "/gpfs/wolf/proj-shared/csc331/vtk-m/ci/runtime"
VTKM_SETTINGS: cuda+ascent+ccache
JOB_MODULES: >-
git-lfs
zstd
cuda/11.4.2
gcc/10.2.0
ninja
spectrum-mpi
lsf-tools
cmake
interruptible: true
.setup_env_ecpci: &setup_env_ecpci |
module purge
module load ${JOB_MODULES}
module list
export PATH="/gpfs/wolf/proj-shared/csc331/vtk-m/ci/utils:$PATH"
build:ascent_gcc_cuda:
stage: build
tags: [olcf, ascent, nobatch]
extends:
- .ascent_gcc_cuda
- .ascent_build
- .run_ecp_ci
- .cmake_build_artifacts
- .run_ascent_ci
before_script:
- *setup_env_ecpci
- ccache -z
- git remote add lfs https://gitlab.kitware.com/vtk/vtk-m.git
- git fetch lfs
- git-lfs install
- git-lfs pull lfs
script:
- CTEST_MAX_PARALLELISM=32 cmake -V -P .gitlab/ci/config/gitlab_ci_setup.cmake
- ctest -VV -S .gitlab/ci/ctest_configure.cmake
artifacts:
expire_in: 24 hours
when: always
paths:
- build/
timeout: 10 minutes
test:ascent_gcc_cuda:
stage: test
tags: [olcf, ascent, batch]
extends:
- .ascent_gcc_cuda
- .ascent_test
- .run_ecp_ci
- .run_ascent_ci
- .cmake_test_artifacts
needs:
- build:ascent_gcc_cuda
dependencies:
- build:ascent_gcc_cuda
.ascent_gcc_cuda:
variables:
CCACHE_BASEDIR: /gpfs/wolf/
CCACHE_DIR: "/gpfs/wolf/proj-shared/csc331/vtk-m/ci/ccache/"
# -isystem= is not affected by CCACHE_BASEDIR, thus we must ignore it
CCACHE_IGNOREOPTIONS: "-isystem=*"
CCACHE_NOHASHDIR: "true"
CMAKE_BUILD_TYPE: RelWithDebInfo
CMAKE_GENERATOR: Ninja
CUSTOM_CI_BUILDS_DIR: "/gpfs/wolf/proj-shared/csc331/vtk-m/ci/runtime"
CC: gcc
CXX: g++
CUDAHOSTCXX: g++
JOB_MODULES: git cmake ninja gcc/10.2.0 spectrum-mpi lsf-tools cuda/11.4.2
VTKM_SETTINGS: cuda+ascent+ccache
.ascent_build:
stage: build
variables:
CTEST_MAX_PARALLELISM: 4
SCHEDULER_PARAMETERS: -P CSC331 -W 2:00 -nnodes 1 -alloc_flags gpudefault
# We need this to skip ctest_submit from being run inside a jsrun job
GITLAB_CI_EMULATION: 1
before_script:
# Prep the environment
- module purge
- echo ${JOB_MODULES}
- module load git-lfs zstd ${JOB_MODULES}
- export PATH="/gpfs/wolf/proj-shared/csc331/vtk-m/ci/utils:$PATH"
- ccache -p
- ccache -z
- git remote add lfs https://gitlab.kitware.com/vtk/vtk-m.git
- git fetch lfs
- git-lfs install
- git-lfs pull lfs
# Start running the builds scripts
- cmake --version
- "cmake -V -P .gitlab/ci/config/gitlab_ci_setup.cmake"
- "ctest -VV -S .gitlab/ci/ctest_configure.cmake"
- *setup_env_ecpci
script:
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
- jsrun -n1 -a1 -g1 -c42 ctest -VV -S .gitlab/ci/ctest_build.cmake
- CTEST_MAX_PARALLELISM=4 jsrun -n1 -a1 -g1 -c8 ctest -VV -S .gitlab/ci/ctest_test.cmake
after_script:
- *setup_env_ecpci
- ccache -s
.ascent_test:
stage: test
variables:
SCHEDULER_PARAMETERS: -P CSC331 -W 1:00 -nnodes 1 -alloc_flags gpudefault
CTEST_MAX_PARALLELISM: 8
# Tests errors to address due to different env/arch in Ascent
# Refer to issue: https://gitlab.kitware.com/vtk/vtk-m/-/issues/652
CTEST_EXCLUSIONS: >-
before_script:
# Prep the environment
- module purge
- module load ${JOB_MODULES}
script:
- "jsrun -n1 -r1 -a1 -g1 -c7 ctest -VV -S .gitlab/ci/ctest_test.cmake || test_output=$?"
- ctest -VV -S .gitlab/ci/ctest_test_submit.cmake
- $(exit $test_output)
- ctest -VV -S .gitlab/ci/ctest_submit_build.cmake
- ctest -VV -S .gitlab/ci/ctest_submit_test.cmake
timeout: 120 minutes

@ -7,7 +7,6 @@ build:centos7_gcc73:
- vtkm
- docker
- linux
- cuda-rt
- large-memory
extends:
- .centos7
@ -31,6 +30,7 @@ test:centos7_gcc73:
- .centos7
- .cmake_test_linux
- .run_automatically
- .use_minimum_supported_cmake
dependencies:
- build:centos7_gcc73
needs:

@ -53,4 +53,4 @@ build:centos8:
variables:
CMAKE_BUILD_TYPE: RelWithDebInfo
CMAKE_GENERATOR: "Unix Makefiles"
VTKM_SETTINGS: "serial+no_testing"
VTKM_SETTINGS: "serial+no_testing+min_build"

@ -43,14 +43,14 @@ if(NOT DEFINED full_url)
endif()
file(DOWNLOAD
"${full_url}" .gitlab/${tarball}
"${full_url}" $ENV{CCACHE_INSTALL_DIR}/${tarball}
EXPECTED_HASH SHA256=${sha256sum}
SHOW_PROGRESS
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xf ${tarball}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitlab
WORKING_DIRECTORY $ENV{CCACHE_INSTALL_DIR}
RESULT_VARIABLE extract_results
)
@ -58,4 +58,4 @@ if(extract_results)
message(FATAL_ERROR "Extracting `${tarball}` failed: ${extract_results}.")
endif()
file(RENAME .gitlab/${filename} .gitlab/ccache)
file(RENAME $ENV{CCACHE_INSTALL_DIR}/${filename} $ENV{CCACHE_INSTALL_DIR}/ccache)

@ -1,31 +1,25 @@
#!/usr/bin/env bash
# shellcheck disable=SC2079
set -x
set -ex
version="${1:-3.21.1}"
version="${1:-3.23.4}"
case "$( uname -s )" in
Linux)
shatool="sha256sum"
# We require CMake >= 3.13 in the CI to support CUDA builds
readonly -A linuxParamsByVersion=(
['3.13.5']='e2fd0080a6f0fc1ec84647acdcd8e0b4019770f48d83509e6a5b0b6ea27e5864 Linux'
['3.21.1']='bf496ce869d0aa8c1f57e4d1a2e50c8f2fb12a6cd7ccb37ad743bb88f6b76a1e linux'
readonly -A sumsByVersion=(
# We require CMake >= 3.13 in the CI to support CUDA builds
['3.13.5']='e2fd0080a6f0fc1ec84647acdcd8e0b4019770f48d83509e6a5b0b6ea27e5864'
['3.23.4']='3fbcbff85043d63a8a83c8bdf8bd5b1b2fd5768f922de7dc4443de7805a2670d'
)
if [ -z "${linuxParamsByVersion[$version]}" ]
then
echo "Given version ($version) is unsupported"
exit 1
fi
sha256sum=$(cut -f 1 <<<"${linuxParamsByVersion[$version]}")
platform=$(cut -f 2 <<<"${linuxParamsByVersion[$version]}")
shatool="sha256sum"
sha256sum="${sumsByVersion[$version]}"
platform="linux"
arch="x86_64"
;;
Darwin)
shatool="shasum -a 256"
sha256sum="9dc2978c4d94a44f71336fa88c15bb0eee47cf44b6ece51b10d1dfae95f82279"
sha256sum="98cac043cdf321caa4fd07f27da3316db6c8bc48c39997bf78e27e5c46c4eb68"
platform="macos"
arch="universal"
;;
@ -39,16 +33,17 @@ readonly sha256sum
readonly platform
readonly arch
readonly filename="cmake-$version-$platform-$arch"
readonly tarball="$filename.tar.gz"
cd .gitlab || exit
readonly tarball="cmake-$version-$platform-$arch.tar.gz"
curl -SOL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball"
echo "$sha256sum $tarball" > cmake.sha256sum
curl -OL "https://github.com/Kitware/CMake/releases/download/v$version/$tarball"
$shatool --check cmake.sha256sum
tar xf "$tarball"
mv "$filename" cmake
# Extract cmake install root into director named cmake
mkdir cmake
tar xf "$tarball" --strip-components=1 -C cmake
if [ "$( uname -s )" = "Darwin" ]; then
ln -s CMake.app/Contents/bin cmake/bin

@ -0,0 +1,14 @@
#!/bin/bash -e
# shellcheck disable=SC2155
git rev-parse @ > ./ORIGINAL_COMMIT_SHA
git add ./ORIGINAL_COMMIT_SHA
readonly name="$(git show --quiet --format='%cn')"
readonly email="$(git show --quiet --format='%ce')"
git config --global user.name "$name"
git config --global user.email "$email"
git commit --amend --no-edit -a
git rev-parse @ > "$1"

@ -0,0 +1,44 @@
#!/usr/bin/env python3
import json
import ssl
import sys
import urllib.request
class ecpci_url_reader:
def __init__(self, base_url, token):
self.base_url = base_url
self.token = token
def to_string(self, url):
opener = urllib.request.build_opener(
urllib.request.HTTPSHandler(
context=ssl._create_unverified_context()))
opener.addheaders = [('PRIVATE-TOKEN', token)]
return opener.open(base_url + url).read().decode('utf-8')
def to_json(self, url):
return json.loads(self.to_string(url))
base_url = sys.argv[1]
commit = sys.argv[2]
token = sys.argv[3]
handler = ecpci_url_reader(base_url, token)
commit_info = handler.to_json("/repository/commits/" + commit)
last_pipeline_id = str(commit_info['last_pipeline']['id'])
jobs = handler.to_json("/pipelines/" + last_pipeline_id + "/jobs")
build_job_id = str(jobs[1]['id'])
test_job_id = str(jobs[0]['id'])
print("ECPCITEST CONFIGURE OUTPUT============================================")
print(handler.to_string("/jobs/" + build_job_id + "/trace"))
print("ECPCITEST CONFIGURE END===============================================")
print("ECPCITEST TEST OUTPUT=================================================")
print(handler.to_string("/jobs/" + test_job_id + "/trace"))
print("ECPCITEST TEST OUTPUT END=============================================")

@ -0,0 +1,4 @@
#!/bin/bash -ex
git lfs uninstall
git -c http.sslVerify=false push -f "$1" "HEAD:refs/heads/${2}"

@ -0,0 +1,3 @@
#!/bin/bash -ex
git -c http.sslVerify=false push --delete "$1" "$2"

@ -0,0 +1,68 @@
#!/bin/bash -e
# shellcheck disable=SC2155
declare -r POLL_INTERVAL_SECONDS="10"
function fetch_commit_status()
{
local -r url="$1"
local -r commit="$2"
local output=$(curl --insecure --silent "${url}/repository/commits/${commit}" \
| tr ',{}[]' '\n' \
| grep -Po -m1 '(?<=^"status":")\w+(?=")' \
)
# No status means that the pipeline has not being created yet
[ -z "$output" ] && output="empty"
echo "$output"
}
function print_pipeline_url()
{
local -r url="$1"
local -r commit="$2"
local web_url=$(curl --insecure --silent "${url}" \
| tr ',{}[]' '\n' \
| grep -Po -m1 '(?<=^"web_url":").+(?=")' \
)
local pipeline_id=$(curl --insecure --silent "${url}/repository/commits/${commit}" \
| tr ',{}[]' '\n' \
| grep -Po '(?<=^"id":)\d+$' \
)
echo "######################################################################"
echo "ECP Pipeline: ${web_url}/-/pipelines/$pipeline_id"
echo "######################################################################"
}
function wait_commit_pipeline_status()
{
local -r base_url="$1"
local -r commit="$2"
local is_url_printed="no"
while true
do
local ret="$(fetch_commit_status "$base_url" "$commit")"
if [ "$ret" != "empty" ] && [ "$is_url_printed" == "no" ]
then
print_pipeline_url "$base_url" "$commit"
is_url_printed="yes"
fi
case "$ret" in
success)
return 0 ;;
failed|canceled|skipped)
echo "ERROR: The pipeline exited with \`${ret}\` status" > /dev/stderr
return 1 ;;
esac
sleep "$POLL_INTERVAL_SECONDS"
done
}
wait_commit_pipeline_status "$1" "$2"

@ -94,6 +94,12 @@ if(DEFINED ENV{CTEST_MEMORYCHECK_SANITIZER_OPTIONS})
list(APPEND optional_variables "set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS ${env_value})")
endif()
# Override revision (Git Commit) if ORIGINAL_COMMIT_SHA is found in source code
if (EXISTS "ORIGINAL_COMMIT_SHA")
file(READ "ORIGINAL_COMMIT_SHA" commit_sha)
list(APPEND optional_variables "set(CTEST_UPDATE_VERSION_OVERRIDE ${commit_sha})")
endif()
#We need to do write this information out to a file in the build directory
file(TO_CMAKE_PATH "${CTEST_SOURCE_DIRECTORY}" src_path) #converted so we can run on windows
file(TO_CMAKE_PATH "${CTEST_BINARY_DIRECTORY}" bin_path) #converted so we can run on windows

@ -22,6 +22,9 @@ tar xf "$tarball"
mkdir build
mkdir "$install_dir"
cmake -GNinja -S benchmark* -B build -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON
cmake -GNinja -S benchmark* -B build \
-DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON \
-DCMAKE_BUILD_TYPE="Release"
cmake --build build
cmake --install build --prefix "$install_dir"

@ -53,9 +53,6 @@ foreach(option IN LISTS options)
elseif(no_rendering STREQUAL option)
set(VTKm_ENABLE_RENDERING "OFF" CACHE STRING "")
elseif(use_virtuals STREQUAL option)
set(VTKm_NO_DEPRECATED_VIRTUAL "OFF" CACHE STRING "")
elseif(no_testing STREQUAL option)
set(VTKm_ENABLE_TESTING "OFF" CACHE STRING "")
set(VTKm_ENABLE_TESTING_LIBRARY "OFF" CACHE STRING "")
@ -71,6 +68,10 @@ foreach(option IN LISTS options)
set(VTKm_ENABLE_BENCHMARKS "ON" CACHE STRING "")
set(ENV{CMAKE_PREFIX_PATH} "$ENV{CMAKE_PREFIX_PATH}:$ENV{HOME}/gbench")
elseif(min_build STREQUAL option)
set(VTKm_BUILD_ALL_LIBRARIES "OFF" CACHE STRING "")
set(VTKm_VERBOSE_MODULES "ON" CACHE STRING "")
elseif(mpi STREQUAL option)
set(VTKm_ENABLE_MPI "ON" CACHE STRING "")
@ -107,15 +108,19 @@ foreach(option IN LISTS options)
set(VTKm_CUDA_Architecture "turing" CACHE STRING "")
endif()
elseif(ampere STREQUAL option)
set(CMAKE_CUDA_ARCHITECTURES "80" CACHE STRING "")
elseif(hip STREQUAL option)
if(CMAKE_VERSION VERSION_LESS_EQUAL 3.20)
message(FATAL_ERROR "VTK-m requires cmake > 3.20 to enable HIP support")
endif()
set(CMAKE_C_COMPILER "/opt/rocm/llvm/bin/clang" CACHE FILEPATH "")
set(CMAKE_CXX_COMPILER "/opt/rocm/llvm/bin/clang++" CACHE FILEPATH "")
set(VTKm_ENABLE_KOKKOS_HIP ON CACHE STRING "")
set(CMAKE_HIP_ARCHITECTURES "gfx900" CACHE STRING "")
# -O1 and -O2 results in ridiculous build times in ROCm < 5.3
set(CMAKE_HIP_FLAGS "-O0 " CACHE STRING "")
set(CMAKE_HIP_FLAGS_RELWITHDEBINFO "-g" CACHE STRING "")
elseif(ascent STREQUAL option)
set(CMAKE_C_FLAGS "-mcpu=power9" CACHE STRING "")
@ -150,6 +155,9 @@ foreach(option IN LISTS options)
else()
message(FATAL_ERROR "CCACHE version [${CCACHE_VERSION}] is <= 4")
endif()
elseif(perftest STREQUAL option)
set(VTKm_ENABLE_PERFORMANCE_TESTING "ON" CACHE STRING "")
endif()
endforeach()

@ -0,0 +1,23 @@
##=============================================================================
##
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##
##=============================================================================
# We need this CMake versions for tests
cmake_minimum_required(VERSION 3.18)
# Read the files from the build directory that contain
# host information ( name, parallel level, etc )
include("$ENV{CI_PROJECT_DIR}/build/CIState.cmake")
ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
ctest_start(APPEND)
ctest_submit(PARTS Build BUILD_ID build_id)
message(STATUS "Build submission build_id: ${build_id}")

@ -11,7 +11,7 @@
##=============================================================================
# We need this CMake versions for tests
cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.12..3.15 FATAL_ERROR)
# Read the files from the build directory that contain
# host information ( name, parallel level, etc )
@ -29,30 +29,49 @@ set(test_exclusions
string(REPLACE " " ";" test_exclusions "${test_exclusions}")
string(REPLACE ";" "|" test_exclusions "${test_exclusions}")
if (test_exclusions)
set(test_exclusions "(${test_exclusions})")
set(test_exclusions EXCLUDE "(${test_exclusions})")
endif ()
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.21)
set(junit_args OUTPUT_JUNIT "${CTEST_BINARY_DIRECTORY}/junit.xml")
endif()
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
set(repeat_args REPEAT "UNTIL_PASS:${CTEST_REPEAT_UNTIL_PASS}")
endif()
set(PARALLEL_LEVEL "10")
if (DEFINED ENV{CTEST_MAX_PARALLELISM})
set(PARALLEL_LEVEL $ENV{CTEST_MAX_PARALLELISM})
endif()
if (DEFINED ENV{TEST_INCLUSIONS})
set(test_inclusions INCLUDE $ENV{TEST_INCLUSIONS})
unset(test_exclusions)
endif()
ctest_test(APPEND
PARALLEL_LEVEL ${PARALLEL_LEVEL}
RETURN_VALUE test_result
EXCLUDE "${test_exclusions}"
REPEAT "UNTIL_PASS:3"
${test_exclusions}
${test_inclusions}
${repeat_args}
${junit_args}
)
message(STATUS "ctest_test RETURN_VALUE: ${test_result}")
if(VTKm_ENABLE_PERFORMANCE_TESTING)
file(GLOB note_files
"${CTEST_BINARY_DIRECTORY}/benchmark_*.stdout"
"${CTEST_BINARY_DIRECTORY}/compare_*.stdout"
"${CTEST_BINARY_DIRECTORY}/$ENV{CI_COMMIT_SHA}_*.json")
list(APPEND CTEST_NOTES_FILES ${note_files})
endif()
if(NOT DEFINED ENV{GITLAB_CI_EMULATION})
ctest_submit(PARTS Test BUILD_ID build_id)
message(STATUS "Test submission build_id: ${build_id}")
ctest_submit(PARTS Test Notes)
message(STATUS "Test submission done")
endif()
if (test_result)

@ -0,0 +1,24 @@
FROM nvidia/cuda:11.7.1-devel-ubuntu18.04
LABEL maintainer "Vicente Adolfo Bolea Sanchez <vicente.bolea@kitware.com>"
# Base dependencies for building VTK-m projects
RUN apt-get update && apt-get install -y --no-install-recommends \
clang-8 \
curl \
g++-8 \
git \
libmpich-dev \
libomp-dev \
libtbb-dev \
mpich \
ninja-build \
python3 \
python3-scipy \
&& \
rm -rf /var/lib/apt/lists/*
# Install Git LFS from official tarball, repo version is too old
RUN curl -OL https://github.com/git-lfs/git-lfs/releases/download/v3.2.0/git-lfs-linux-amd64-v3.2.0.tar.gz && \
tar -xvzf git-lfs-linux-amd64-v3.2.0.tar.gz && \
./git-lfs-3.2.0/install.sh && \
rm -rf ./git-lfs-3.2.0

@ -1,38 +0,0 @@
FROM nvidia/cuda:11.6.1-devel-ubuntu18.04
LABEL maintainer "Robert Maynard<robert.maynard@kitware.com>"
# Base dependencies for building VTK-m projects
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
g++-8 \
clang-8 \
git \
git-lfs \
libmpich-dev \
libomp-dev \
libtbb-dev \
mpich \
ninja-build \
&& \
rm -rf /var/lib/apt/lists/*
# Need to run git-lfs install manually on ubuntu based images when using the
# system packaged version
RUN git-lfs install
# Provide a consistent CMake path across all images
# Allow tests that require CMake to work correctly
RUN mkdir /opt/cmake && \
curl -L https://github.com/Kitware/CMake/releases/download/v3.16.7/cmake-3.16.7-Linux-x86_64.sh > cmake-3.16.7-Linux-x86_64.sh && \
sh cmake-3.16.7-Linux-x86_64.sh --prefix=/opt/cmake/ --exclude-subdir --skip-license && \
rm cmake-3.16.7-Linux-x86_64.sh
# Provide CMake 3.17 so we can re-run tests easily
# This will be used when we run just the tests
RUN mkdir /opt/cmake-latest/ && \
curl -L https://github.com/Kitware/CMake/releases/download/v3.17.3/cmake-3.17.3-Linux-x86_64.sh > cmake-3.17.3-Linux-x86_64.sh && \
sh cmake-3.17.3-Linux-x86_64.sh --prefix=/opt/cmake-latest/ --exclude-subdir --skip-license && \
rm cmake-3.17.3-Linux-x86_64.sh && \
ln -s /opt/cmake-latest/bin/ctest /opt/cmake-latest/bin/ctest-latest
ENV PATH "/opt/cmake/bin:/opt/cmake-latest/bin:${PATH}"

@ -4,7 +4,7 @@ LABEL maintainer "Vicente Adolfo Bolea Sanchez<vicente.bolea@kitware.com>"
ENV TZ=America/New_York
# Base dependencies for building VTK-m projects
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
RUN apt update && DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \
cmake \
curl \
g++ \
@ -16,7 +16,10 @@ RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-i
libhdf5-dev \
mpich \
ninja-build \
software-properties-common
python \
python3-scipy \
software-properties-common && \
apt clean
# Need to run git-lfs install manually on ubuntu based images when using the
# system packaged version

@ -39,6 +39,7 @@ test:macos_xcode13:
CCACHE_COMPILERCHECK: "content"
CCACHE_NOHASHDIR: "true"
CCACHE_RESHARE: "true"
CCACHE_INSTALL_DIR: "$CI_PROJECT_DIR/.gitlab"
before_script:
- .gitlab/ci/config/cmake.sh
- export PATH=$PWD/.gitlab/cmake/bin:$PATH

@ -13,7 +13,7 @@ build:rhel8:
- .run_automatically
variables:
CMAKE_GENERATOR: "Unix Makefiles"
VTKM_SETTINGS: "serial+shared+64bit_floats+32bit_ids+use_virtuals"
VTKM_SETTINGS: "serial+shared+64bit_floats+32bit_ids"
test:rhel8:
tags:

111
.gitlab/ci/spock.yml Normal file

@ -0,0 +1,111 @@
# Ad-hoc build that runs in the ECP Hardware, concretely in OLCF Spock.
.spock_gcc_hip:
variables:
CCACHE_BASEDIR: "/gpfs/alpine/world-shared/csc331/"
CCACHE_DIR: "/gpfs/alpine/world-shared/csc331/vtk-m/ci/ccache"
CUSTOM_CI_BUILDS_DIR: "/gpfs/alpine/world-shared/csc331/vtk-m/ci/runtime"
# -isystem= is not affected by CCACHE_BASEDIR, thus we must ignore it
CCACHE_IGNOREOPTIONS: "-isystem=*"
CCACHE_NOHASHDIR: "true"
CCACHE_INSTALL_DIR: "$CI_PROJECT_DIR/build"
CMAKE_BUILD_TYPE: "RelWithDebInfo"
CMAKE_GENERATOR: "Ninja"
# This is needed for the smoke_test, while we use rocm 5 to build VTK-m the
# smoke_test needs 4.5 since Kokkos is built agains rocm 4.5
LD_LIBRARY_PATH: "/opt/rocm-4.5.0/lib:${LD_LIBRARY_PATH}"
LIBRARY_PATH: "/opt/rocm-4.5.0/lib:${LIBRARY_PATH}"
# While Kokkos and VTK-m uses ROCm 4.5.0 runtime/sdk, we need to build
# VTK-m with HIPCC from ROCM 5
CMAKE_HIP_COMPILER: "/opt/rocm-default/llvm/bin/clang++"
Kokkos_CXX_COMPILER: "/opt/rocm-default/llvm/bin/clang++"
CMAKE_HIP_ARCHITECTURES: "gfx908"
CC: gcc
CXX: g++
# DefApps/default;craype;rocm;gcc should be loaded first
JOB_MODULES: >-
DefApps/default
craype-accel-amd-gfx90a
rocm/5
gcc/10
cmake/3.22
git
git-lfs
kokkos/3.5.00
lsf-tools
ninja
spectrum-mpi
zstd
VTKM_SETTINGS: kokkos+hip+spock+ccache+no_rendering
interruptible: true
.setup_env_ecpci: &setup_env_ecpci |
module purge
module load ${JOB_MODULES}
module list
export PATH="${CCACHE_INSTALL_DIR}/ccache:$PATH"
build:spock_gcc_hip:
stage: build
tags: [spock, shell]
extends:
- .spock_gcc_hip
- .run_spock_ci
before_script:
- *setup_env_ecpci
- mkdir -p "$CCACHE_INSTALL_DIR"
- cmake --version
- cmake -VV -P .gitlab/ci/config/ccache.cmake
- ccache -z
- ccache -s
- git remote add lfs https://gitlab.kitware.com/vtk/vtk-m.git
- git fetch lfs
- git-lfs install
- git-lfs pull lfs
script:
- cmake -V -P .gitlab/ci/config/gitlab_ci_setup.cmake
- ctest -VV -S .gitlab/ci/ctest_configure.cmake
artifacts:
expire_in: 24 hours
when: always
paths:
- build/
- .gitlab/ccache/ccache
test:spock_gcc_hip:
stage: test
tags: [spock, slurm]
extends:
- .spock_gcc_hip
- .run_spock_ci
needs:
- build:spock_gcc_hip
dependencies:
- build:spock_gcc_hip
variables:
SCHEDULER_PARAMETERS: "-ACSC331 -pecp -t120 --nice=0 -c32 --gpus=4 -N 1"
# We need this to skip ctest_submit from being run inside a jsrun job
GITLAB_CI_EMULATION: 1
# Tests errors to address due to different env in Spock
# Refer to issue: https://gitlab.kitware.com/vtk/vtk-m/-/issues/743
CTEST_EXCLUSIONS: >-
UnitTestMIRFilter
UnitTestDistributedBranchDecompositionFilter
UnitTestWorkletParticleAdvection
UnitTestLagrangianFilter
before_script:
- *setup_env_ecpci
script:
- CTEST_MAX_PARALLELISM=32 ctest -VV -S .gitlab/ci/ctest_build.cmake
- CTEST_MAX_PARALLELISM=4 ctest -VV -S .gitlab/ci/ctest_test.cmake
after_script:
- *setup_env_ecpci
- ccache -s
- ctest -VV -S .gitlab/ci/ctest_submit_build.cmake
- ctest -VV -S .gitlab/ci/ctest_submit_test.cmake
timeout: 150 minutes

@ -7,7 +7,6 @@ build:ubuntu1604_gcc5:
- vtkm
- docker
- linux
- cuda-rt
- large-memory
extends:
- .ubuntu1604_cuda
@ -32,6 +31,7 @@ test:ubuntu1604_gcc5:
- .ubuntu1604_cuda
- .cmake_test_linux
- .run_automatically
- .use_minimum_supported_cmake
dependencies:
- build:ubuntu1604_gcc5
needs:
@ -45,7 +45,6 @@ build:ubuntu1604_gcc5_2:
- vtkm
- docker
- linux
- cuda-rt
- large-memory
extends:
- .ubuntu1604_cuda
@ -70,6 +69,7 @@ test:ubuntu1804_test_ubuntu1604_gcc5_2:
- .ubuntu1804_cuda
- .cmake_test_linux
- .run_upstream_branches
- .use_minimum_supported_cmake
variables:
CTEST_EXCLUSIONS: "built_against_test_install"
dependencies:
@ -106,6 +106,7 @@ test:ubuntu1604_clang5:
- .ubuntu1604
- .cmake_test_linux
- .run_automatically
- .use_minimum_supported_cmake
dependencies:
- build:ubuntu1604_clang5
needs:

@ -46,7 +46,6 @@ build:ubuntu1804_gcc7:
- vtkm
- docker
- linux
- cuda-rt
- large-memory
extends:
- .ubuntu1804_cuda
@ -85,7 +84,6 @@ build:ubuntu1804_clang_cuda:
- vtkm
- docker
- linux
- cuda-rt
- large-memory
extends:
- .ubuntu1804_cuda
@ -193,7 +191,6 @@ build:ubuntu1804_kokkos:
- vtkm
- docker
- linux
- cuda-rt
- large-memory
extends:
- .ubuntu1804_cuda_kokkos
@ -220,3 +217,39 @@ test:ubuntu1804_kokkos:
- build:ubuntu1804_kokkos
needs:
- build:ubuntu1804_kokkos
build:ubuntu1804_cuda_perftest:
tags:
- build
- vtkm
- docker
- linux
extends:
- .ubuntu1804_cuda
- .cmake_build_linux
- .run_automatically
variables:
CMAKE_BUILD_TYPE: Release
VTKM_SETTINGS: "benchmarks+ampere+perftest+cuda+mpi+shared"
test:ubuntu1804_cuda_perftest:
tags:
- benchmark
- vtkm
- docker
- cuda-rt
- linux
extends:
- .ubuntu1804_cuda
- .cmake_test_linux
- .run_automatically
dependencies:
- build:ubuntu1804_cuda_perftest
needs:
- build:ubuntu1804_cuda_perftest
variables:
TEST_INCLUSIONS: "PerformanceTest"
VTKm_PERF_REMOTE_URL: "https://vbolea:$VTKM_BENCH_RECORDS_TOKEN@gitlab.kitware.com/vbolea/vtk-m-benchmark-records.git"
VTKm_PERF_ALPHA: "0.05"
VTKm_PERF_REPETITIONS: "10"
VTKm_PERF_DIST: "t"

@ -10,7 +10,7 @@ build:ubuntu2004_gcc9:
- .run_automatically
variables:
CMAKE_BUILD_TYPE: Debug
VTKM_SETTINGS: "benchmarks+tbb+openmp+mpi+shared+hdf5"
VTKM_SETTINGS: "benchmarks+tbb+openmp+mpi+shared+hdf5+min_build"
test:ubuntu2004_gcc9:
tags:
@ -69,23 +69,26 @@ build:ubuntu2004_hip_kokkos:
extends:
- .ubuntu2004_hip_kokkos
- .cmake_build_linux
- .run_upstream_branches
- .run_automatically
variables:
CMAKE_BUILD_TYPE: RelWithDebInfo
VTKM_SETTINGS: "benchmarks+kokkos+hip+no_virtual+no_rendering+ccache"
CMAKE_PREFIX_PATH: "/opt/rocm/lib/cmake"
CMAKE_BUILD_TYPE: "RelWithDebInfo"
VTKM_SETTINGS: "benchmarks+kokkos+hip+no_rendering+ccache"
CCACHE_BASEDIR: "$CI_PROJECT_DIR"
CMAKE_PREFIX_PATH: "/opt/rocm/lib/cmake"
LD_LIBRARY_PATH: "/opt/rocm/lib"
CMAKE_HIP_COMPILER: "/opt/rocm/llvm/bin/clang++"
Kokkos_CXX_COMPILER: "/opt/rocm/llvm/bin/clang++"
CMAKE_HIP_ARCHITECTURES: "gfx900"
# -isystem= is not affected by CCACHE_BASEDIR, thus we must ignore it
CCACHE_IGNOREOPTIONS: "-isystem=*"
CCACHE_COMPILERCHECK: "content"
CCACHE_NOHASHDIR: "true"
CCACHE_RESHARE: "true"
CCACHE_IGNOREOPTIONS: "-isystem=*"
CCACHE_BASEDIR: "$CI_PROJECT_DIR"
CCACHE_COMPILERCHECK: "content"
CCACHE_NOHASHDIR: "true"
CCACHE_RESHARE: "true"
after_script:
- ccache -v -s
- ccache -z
timeout: 10 hours
test:ubuntu2004_hip_kokkos:
tags:
@ -98,9 +101,33 @@ test:ubuntu2004_hip_kokkos:
- .cmake_test_linux
- .run_upstream_branches
variables:
CTEST_TIMEOUT: "30"
CTEST_MAX_PARALLELISM: 1
dependencies:
- build:ubuntu2004_hip_kokkos
needs:
- build:ubuntu2004_hip_kokkos
timeout: 3 hours
# This is only for merge-requests
build:ascent:
stage: build
variables:
BRANCH_NAME: "mr${CI_MERGE_REQUEST_IID}-${CI_COMMIT_REF_NAME}"
ASCENT_REST_URL: "https://code.ornl.gov/api/v4/projects/7035"
ASCENT_GIT_URL: "https://vbolea:${ECPTEST_TOKEN}@code.ornl.gov/ecpcitest/vtk-m.git"
tags:
- vtkm
- docker
extends:
- .ubuntu2004
- .run_only_merge_requests
script:
# A new commit is needed to symbolize a restart of a build from the same original commit
- .gitlab/ci/config/ecpci-amend-commit.sh "NEW_COMMIT_SHA"
- .gitlab/ci/config/ecpci-push-branch.sh "$ASCENT_GIT_URL" "$BRANCH_NAME"
- timeout 130m .gitlab/ci/config/ecpci-wait-commit-status.sh "$ASCENT_REST_URL" "$(cat NEW_COMMIT_SHA)"
after_script:
- .gitlab/ci/config/ecpci-remove-branch.sh "$ASCENT_GIT_URL" "$BRANCH_NAME" || true
- .gitlab/ci/config/ecpci-fetch-commit-trace.py "$ASCENT_REST_URL" "$(cat NEW_COMMIT_SHA)" "$ECPTEST_TOKEN"
timeout: 150 minutes
interruptible: true

@ -5,7 +5,8 @@
# change between the build and test stages which CMake doesn't support.
# Even if we could, it could change if other runners on the machine
# could run at the same time, so we drop it.
GIT_CLONE_PATH: "$CI_BUILDS_DIR\\vtkm ci"
GIT_CLONE_PATH: "$CI_BUILDS_DIR\\vtkm ci"
CCACHE_INSTALL_DIR: "$CI_PROJECT_DIR\\.gitlab"
artifacts:
reports:
junit:
@ -32,13 +33,17 @@
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\cmake\bin;$env:PATH"
- "cmake --version"
- "cmake -V -P .gitlab/ci/config/ccache.cmake"
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab\ccache;$env:PATH"
- Set-Item -Force -Path "env:PATH" -Value "$env:CCACHE_INSTALL_DIR\ccache;$env:PATH"
- "cmake -V -P .gitlab/ci/config/ninja.cmake"
- Set-Item -Force -Path "env:PATH" -Value "$pwdpath\.gitlab;$env:PATH"
- "cmake -V -P .gitlab/ci/config/gitlab_ci_setup.cmake"
- "ctest -VV -S .gitlab/ci/ctest_configure.cmake"
script:
- "ctest -VV -S .gitlab/ci/ctest_build.cmake"
after_script:
# This is needed since sometimes this process hangs holding files
# in the build directory. Blocking new builds
- "tskill cvtres"
artifacts:
expire_in: 24 hours
when: always

@ -1,248 +0,0 @@
<!--
This template is for tracking a release of VTKm. Please replace the
following strings with the associated values:
- `@VERSION@` - replace with base version, e.g., 1.6.0
- `@RC@` - for release candidates, replace with "-rc?". For final, replace with "".
- `@MAJOR@` - replace with major version number
- `@MINOR@` - replace with minor version number
Please remove this comment.
-->
## Update VTK-m
- [ ] Update `release` branch for **vtk-m** and create update branch
```
git fetch origin
git checkout release
git merge --ff-only origin/release
git submodule update --recursive --init
```
## Create update branch
- [ ] Create update branch `git checkout -b update-to-v@VERSION@`
<!-- if @RC@ == "-rc1"-->
- [ ] Bring as a second parent the history of master (Solve conflicts always
taking master's version)
```
git merge --no-ff origin/master
```
<!-- endif -->
<!-- if not a patch release -->
- [ ] Update the major and minor version in `version.txt`:
```
echo "@MAJOR@.@MINOR@.9999" > version.txt
git add version.txt`
```
<!-- endif -->
- [ ] Update the version (not in patch releases) and date in the LICENSE.md
file `git add LICENSE.md`.
- [ ] Create commit that updates the License (and version.txt if modified):
```
git commit -m 'release: update version and License'
```
<!-- Do we have new release notes? -->
- [ ] Craft or update [changelog](#generate-change-log)
`docs/changelog/@VERSION@/release-notes.md` file.
- [ ] Create release notes commit.
```
git add docs/changelog/@VERSION@/release-notes.md
git rm docs/changelog/*.md
git commit -m 'release: @VERSION@@RC@ release notes'
```
<!-- endif -->
- [ ] Create update version commit:
```
echo @VERSION@@RC@ > version.txt
git add version.txt
# Create commit with the following template
# Nth is counted by the number of final release tags
git commit -m '@VERSION@@RC@ is our Nth official release of VTK-m.
The major changes to VTK-m from (previous release) can be found in:
docs/changelog/@VERSION@/release-notes.md' version.txt
```
- [ ] `git tag -a -m 'VTKm @VERSION@@RC@' v@VERSION@@RC@ HEAD`
- Integrate changes to `release` branch
- [ ] Create a MR using the [release-mr script][1]
(see [notes](#notes-about-update-mr)).
<!-- if not patch release -->
- [ ] Add (or ensure) at the bottom of the description of the merge request:
`Backport: master:HEAD~1`
<!-- elseif patch release -->
- [ ] Remove (or ensure) that at the bottom of the description of the merge
request there is no `Backport` instruction.
<!-- endif -->
- [ ] Get +1
- [ ] `Do: merge`
- Push tags
- [ ] `git push origin v@VERSION@@RC@`
## Update Spack
- [ ] Update Spack package: https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/vtk-m/package.py
## Post-release
- [ ] Copy the contents of docs/changelog/@VERSION@/release-notes.md to
the GitLab release.
<!-- if not patch release -->
- [ ] Tag new version of the [VTK-m User Guide][2].
<!-- endif -->
- [ ] Post an [Email Announcements](#email-announcements) VTK-m mailing list.
<!-- if not patch release -->
- [ ] Ensure that the content of `version.txt` in master is
`[@MAJOR@ @MINOR@](@MAJOR@.@MINOR@.9999)`.
<!-- endif release -->
---
# Annex
## Generate change log
Construct a `docs/changelog/@VERSION@/` folder.
Construct a `docs/changelog/@VERSION@/release-notes.md` file
Use the following template for `release-notes.md`:
```md
VTK-m N Release Notes
=======================
<!-- if is a patch release -->
| Merge request description | Merge request id |
| ------------------------------------------------------------------- | ---------------- |
| Update the link to register with the VTK-m dashboard | !2629 |
.
.
.
| CMAKE: CUDA ampere generate sm_80/86 | !2688 |
<!-- else -->
# Table of Contents
1. [Core](#Core)
- Core change 1
2. [ArrayHandle](#ArrayHandle)
3. [Control Environment](#Control-Environment)
4. [Execution Environment](#Execution-Environment)
5. [Worklets and Filters](#Worklets-and-Filters)
6. [Build](#Build)
7. [Other](#Other)
<!-- endif -->
# Core
## Core change 1 ##
changes in core 1
# ArrayHandle
# Control Enviornment
# Execution Environment
# Execution Environment
# Worklets and Filters
# Build
# Other
```
For each individual file in `docs/changelog` move them
to the relevant `release-notes` section.
- Make sure each title and entry in the table of contents use full vtkm names
`vtkm::cont::Field` instead of Field.
- Make sure each title and entry DOESN'T have a period at the end.
- Make sure any sub-heading as part of the changelog is transformed from `##`
to `###`.
- Entries for `Core` are reserved for large changes that significantly improve
VTK-m users life, or are major breaking changes.
## Notes about update-mr
[`update-mr` script][1] has the following requirements to work:
1. It needs a token to for authentication (reach @ben.boeckel for this)
2. It needs `kwrobot.release.vtkm` to have developer perms in your vtk-m repo.
Lastly, `update-mr` can be used multiple times with different commit in the same
branch.
## Notes about version.txt
Master and release branch do not share the same version.txt scheme. In the
release branch the patch and release-candidate version is observed whereas in
master the patch field is fixed to _9999_ indicating that each of its commit is
a developing release.
- Master: `@MAJOR@.@MINOR@.9999`
- Release: `@MAJOR@.@MINOR@.@PATCH@@RC@`
## Email Announcements
Announce the new VTK-m release on the mailing list. You will need to compute
the number of merge requests, changelog entries, and maybe # of authors.
Example to compute the number of unique committers
```
git log --format="%an" v1.4.0..v1.5.0 | sort -u | wc -l
```
Example to compute the number of merge requests
```
git log v1.4.0..v1.5.0 | grep 'Merge | wc -l
```
A standard template to use is:
```
Hi All,
VTK-m 1.5.0 is now released, and a special thanks to everyone that has
contributed to VTK-m since our last release. The 1.5.0 release contains
over 100000 merge requests, and 100000 entries to the changelog .
Below are all the entries in the changelog, with more details at (
https://gitlab.kitware.com/vtk/vtk-m/-/tags/v@VERSION@) or in the vtkm
repository at `docs/@VERSION@/release-notes.md`
<!-- if is a patch release -->
- Update the link to register with the VTK-m dashboard
.
.
.
- CMAKE: CUDA ampere generate sm_80/86
<!-- else -->
1. Core
- Core change 1
2. ArrayHandle
3. Control Environment
4. Execution Environment
5. Worklets and Filters
6. Build
7. Other
<!-- endif -->
```
/cc @ben.boeckel
/cc @vbolea
/label ~"priority:required"
[1]: https://gitlab.kitware.com/utils/release-utils/-/blob/master/release-mr.py
[2]: https://gitlab.kitware.com/vtk/vtk-m-user-guide

@ -62,6 +62,12 @@ if(TARGET vtkm_vectorization_flags)
endif()
add_library(vtkm_vectorization_flags INTERFACE)
set_target_properties(
vtkm_vectorization_flags
PROPERTIES
EXPORT_NAME vectorization_flags
)
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(TARGETS vtkm_vectorization_flags EXPORT ${VTKm_EXPORT_NAME})
endif()
@ -193,7 +199,7 @@ target_compile_options(vtkm_vectorization_flags
INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${flags}>
)
if(TARGET vtkm::cuda AND flags AND NOT CMAKE_CUDA_HOST_COMPILER)
if(TARGET vtkm_cuda AND flags AND NOT CMAKE_CUDA_HOST_COMPILER)
# Also propagate down these optimizations when building host side code
# with cuda. To be safe we only do this when we know the C++ and CUDA
# host compiler are from the same vendor

@ -30,6 +30,11 @@ endif()
# vtkm_compiler_flags is used by all the vtkm targets and consumers of VTK-m
# The flags on vtkm_compiler_flags are needed when using/building vtk-m
add_library(vtkm_compiler_flags INTERFACE)
set_target_properties(
vtkm_compiler_flags
PROPERTIES
EXPORT_NAME compiler_flags
)
# When building libraries/tests that are part of the VTK-m repository
# inherit the properties from vtkm_vectorization_flags.
@ -50,12 +55,12 @@ target_compile_features(vtkm_compiler_flags INTERFACE cxx_std_14)
# they don't use.
if(VTKM_COMPILER_IS_MSVC)
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:/Gy>)
if(TARGET vtkm::cuda)
if(TARGET vtkm_cuda)
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler="/Gy">)
endif()
elseif(NOT (VTKM_COMPILER_IS_PGI OR VTKM_COMPILER_IS_XL)) #can't find an equivalant PGI/XL flag
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-ffunction-sections>)
if(TARGET vtkm::cuda)
if(TARGET vtkm_cuda)
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-ffunction-sections>)
endif()
endif()
@ -63,7 +68,7 @@ endif()
# Enable large object support so we can have 2^32 addressable sections
if(VTKM_COMPILER_IS_MSVC)
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:/bigobj>)
if(TARGET vtkm::cuda)
if(TARGET vtkm_cuda)
target_compile_options(vtkm_compiler_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler="/bigobj">)
endif()
endif()
@ -79,6 +84,11 @@ target_include_directories(vtkm_compiler_flags INTERFACE
# vtkm_developer_flags is used ONLY BY libraries that are built as part of this
# repository
add_library(vtkm_developer_flags INTERFACE)
set_target_properties(
vtkm_developer_flags
PROPERTIES
EXPORT_NAME developer_flags
)
# Additional warnings just for Clang 3.5+, and AppleClang 7+
# about failures to vectorize.
@ -101,7 +111,7 @@ if(VTKM_COMPILER_IS_MSVC)
#Setup MSVC warnings with CUDA and CXX
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${cxx_flags}>)
if(TARGET vtkm::cuda)
if(TARGET vtkm_cuda)
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:${cuda_flags} -Xcudafe=--diag_suppress=1394,--diag_suppress=766>)
endif()
@ -109,7 +119,7 @@ if(VTKM_COMPILER_IS_MSVC)
# In VS2013 the C4127 warning has a bug in the implementation and
# generates false positive warnings for lots of template code
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:-wd4127>)
if(TARGET vtkm::cuda)
if(TARGET vtkm_cuda)
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=-wd4127>)
endif()
endif()
@ -165,7 +175,7 @@ elseif(VTKM_COMPILER_IS_GNU OR VTKM_COMPILER_IS_CLANG)
endif()
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${cxx_flags}>)
if(TARGET vtkm::cuda)
if(TARGET vtkm_cuda)
target_compile_options(vtkm_developer_flags INTERFACE $<$<COMPILE_LANGUAGE:CUDA>:${cuda_flags}>)
endif()
endif()
@ -176,10 +186,10 @@ function(setup_cuda_flags)
endfunction()
#common warnings for all platforms when building cuda
if ((TARGET vtkm::cuda) OR (TARGET vtkm::kokkos_cuda))
if ((TARGET vtkm_cuda) OR (TARGET vtkm::kokkos_cuda))
setup_cuda_flags()
endif()
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
install(TARGETS vtkm_compiler_flags vtkm_developer_flags EXPORT ${VTKm_EXPORT_NAME})
vtkm_install_targets(TARGETS vtkm_compiler_flags vtkm_developer_flags)
endif()

@ -10,22 +10,22 @@
# When this file is run by CMake through the find_package command, the
# following targets will exist:
# vtkm_cont Target that contains most of VTK-m
# vtkm::cont Target that contains most of VTK-m
#
# vtkm_rendering Target that contains all the rendering code
# vtkm::rendering Target that contains all the rendering code
#
# vtkm_filter Target that contains all of VTK-m pre-built filters
# vtkm::filter Target that contains all of VTK-m pre-built filters
#
# vtkm_source Target that contains all of VTK-m pre-built sources
# vtkm::source Target that contains all of VTK-m pre-built sources
#
# vtkm::tbb Target that contains tbb related link information
# implicitly linked to by `vtkm_cont` if tbb is enabled
# vtkm::tbb Target that contains tbb related link information
# implicitly linked to by `vtkm_cont` if tbb is enabled
#
# vtkm::openmp Target that contains openmp related link information
# implicitly linked to by `vtkm_cont` if openmp is enabled
# vtkm::openmp Target that contains openmp related link information
# implicitly linked to by `vtkm_cont` if openmp is enabled
#
# vtkm::cuda Target that contains cuda related link information
# implicitly linked to by `vtkm_cont` if cuda is enabled
# vtkm::cuda Target that contains cuda related link information
# implicitly linked to by `vtkm_cont` if cuda is enabled
#
# The following local variables will also be defined:
#
@ -47,7 +47,6 @@
# VTKm_ENABLE_OSMESA_CONTEXT Will be enabled if VTK-m rendering was built with a osmesa context
# VTKm_ENABLE_EGL_CONTEXT Will be enabled if VTK-m rendering was built with a EGL context
#
#
if (CMAKE_VERSION VERSION_LESS "3.12")
message(FATAL_ERROR "VTK-m requires CMake 3.12+")
@ -109,18 +108,27 @@ set(VTKM_FROM_INSTALL_DIR FALSE)
if(NOT "${CMAKE_BINARY_DIR}" STREQUAL "@VTKm_BINARY_DIR@")
set(VTKM_FROM_INSTALL_DIR TRUE)
include(${VTKm_CONFIG_DIR}/VTKmTargets.cmake)
if(DEFINED PACKAGE_FIND_VERSION AND PACKAGE_FIND_VERSION VERSION_LESS 2.0)
add_library(vtkm_cont ALIAS vtkm::cont)
add_library(vtkm_filter ALIAS vtkm::filter)
add_library(vtkm_io ALIAS vtkm::io)
add_library(vtkm_rendering ALIAS vtkm::rendering)
add_library(vtkm_source ALIAS vtkm::source)
add_library(vtkm_worklet ALIAS vtkm::worklet)
endif()
endif()
# Once we can require CMake 3.15 for all cuda builds we can
# replace this with setting `cuda_architecture_flags` as part of the
# EXPORT_PROPERTIES of the vtkm_cuda target
# EXPORT_PROPERTIES of the vtkm::cuda target
if(VTKm_ENABLE_CUDA AND VTKM_FROM_INSTALL_DIR)
# Canonical way of setting CUDA arch
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.18)
set_target_properties(vtkm::cuda PROPERTIES CUDA_ARCHITECTURES "@CMAKE_CUDA_ARCHITECTURES@")
endif()
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)

@ -8,6 +8,14 @@
## PURPOSE. See the above copyright notice for more information.
##============================================================================
macro(vtkm_diy_get_general_target target)
if(CMAKE_PROJECT_NAME STREQUAL "VTKm")
set(${target} "vtkm_diy")
else()
set(${target} "vtkm::diy")
endif()
endmacro()
macro(_vtkm_diy_target flag target)
set(${target} "vtkmdiympi")
if (NOT ${flag})
@ -19,7 +27,8 @@ function(vtkm_diy_init_target)
set(vtkm_diy_default_flag "${VTKm_ENABLE_MPI}")
_vtkm_diy_target(vtkm_diy_default_flag vtkm_diy_default_target)
set_target_properties(vtkm_diy PROPERTIES
vtkm_diy_get_general_target(diy_target)
set_target_properties(${diy_target} PROPERTIES
vtkm_diy_use_mpi_stack ${vtkm_diy_default_flag}
vtkm_diy_target ${vtkm_diy_default_target})
endfunction()
@ -30,30 +39,33 @@ function(vtkm_diy_use_mpi_push)
if (NOT ARGC EQUAL 0)
set(topval ${ARGV0})
endif()
get_target_property(stack vtkm_diy vtkm_diy_use_mpi_stack)
vtkm_diy_get_general_target(diy_target)
get_target_property(stack ${diy_target} vtkm_diy_use_mpi_stack)
list (APPEND stack ${topval})
_vtkm_diy_target(topval target)
set_target_properties(vtkm_diy PROPERTIES
set_target_properties(${diy_target} PROPERTIES
vtkm_diy_use_mpi_stack "${stack}"
vtkm_diy_target "${target}")
endfunction()
function(vtkm_diy_use_mpi value)
get_target_property(stack vtkm_diy vtkm_diy_use_mpi_stack)
vtkm_diy_get_general_target(diy_target)
get_target_property(stack ${diy_target} vtkm_diy_use_mpi_stack)
list (REMOVE_AT stack -1)
list (APPEND stack ${value})
_vtkm_diy_target(value target)
set_target_properties(vtkm_diy PROPERTIES
set_target_properties(${diy_target} PROPERTIES
vtkm_diy_use_mpi_stack "${stack}"
vtkm_diy_target "${target}")
endfunction()
function(vtkm_diy_use_mpi_pop)
get_target_property(stack vtkm_diy vtkm_diy_use_mpi_stack)
vtkm_diy_get_general_target(diy_target)
get_target_property(stack ${diy_target} vtkm_diy_use_mpi_stack)
list (GET stack -1 value)
list (REMOVE_AT stack -1)
_vtkm_diy_target(value target)
set_target_properties(vtkm_diy PROPERTIES
set_target_properties(${diy_target} PROPERTIES
vtkm_diy_use_mpi_stack "${stack}"
vtkm_diy_target "${target}")
endfunction()

@ -41,38 +41,39 @@ function(vtkm_extract_real_library library real_library)
endif()
endfunction()
if(VTKm_ENABLE_TBB AND NOT TARGET vtkm::tbb)
if(VTKm_ENABLE_TBB AND NOT TARGET vtkm_tbb)
# Skip find_package(TBB) if we already have it
if (NOT TARGET TBB::tbb)
find_package(TBB REQUIRED)
endif()
add_library(vtkmTBB INTERFACE)
add_library(vtkm::tbb ALIAS vtkmTBB)
target_link_libraries(vtkmTBB INTERFACE TBB::tbb)
target_compile_definitions(vtkmTBB INTERFACE "TBB_VERSION_MAJOR=${TBB_VERSION_MAJOR}")
set_target_properties(vtkmTBB PROPERTIES EXPORT_NAME vtkm::tbb)
install(TARGETS vtkmTBB EXPORT ${VTKm_EXPORT_NAME})
add_library(vtkm_tbb INTERFACE)
target_link_libraries(vtkm_tbb INTERFACE TBB::tbb)
target_compile_definitions(vtkm_tbb INTERFACE "TBB_VERSION_MAJOR=${TBB_VERSION_MAJOR}")
set_target_properties(vtkm_tbb PROPERTIES EXPORT_NAME tbb)
install(TARGETS vtkm_tbb EXPORT ${VTKm_EXPORT_NAME})
endif()
if(VTKm_ENABLE_OPENMP AND NOT TARGET vtkm::openmp)
if(VTKm_ENABLE_OPENMP AND NOT TARGET vtkm_openmp)
find_package(OpenMP 4.0 REQUIRED COMPONENTS CXX QUIET)
add_library(vtkm::openmp INTERFACE IMPORTED GLOBAL)
add_library(vtkm_openmp INTERFACE)
set_target_properties(vtkm_openmp PROPERTIES EXPORT_NAME openmp)
if(OpenMP_CXX_FLAGS)
set_property(TARGET vtkm::openmp
set_property(TARGET vtkm_openmp
APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $<$<COMPILE_LANGUAGE:CXX>:${OpenMP_CXX_FLAGS}>)
if(VTKm_ENABLE_CUDA)
string(REPLACE ";" "," openmp_cuda_flags "-Xcompiler=${OpenMP_CXX_FLAGS}")
set_property(TARGET vtkm::openmp
set_property(TARGET vtkm_openmp
APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $<$<COMPILE_LANGUAGE:CUDA>:${openmp_cuda_flags}>)
endif()
endif()
if(OpenMP_CXX_LIBRARIES)
set_target_properties(vtkm::openmp PROPERTIES
set_target_properties(vtkm_openmp PROPERTIES
INTERFACE_LINK_LIBRARIES "${OpenMP_CXX_LIBRARIES}")
endif()
install(TARGETS vtkm_openmp EXPORT ${VTKm_EXPORT_NAME})
endif()
if(VTKm_ENABLE_CUDA)
@ -84,10 +85,9 @@ 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)
set_target_properties(vtkm_cuda PROPERTIES EXPORT_NAME cuda)
install(TARGETS vtkm_cuda EXPORT ${VTKm_EXPORT_NAME})
# Reserve `requires_static_builds` to potential work around issues
@ -323,6 +323,11 @@ if(VTKm_ENABLE_KOKKOS AND NOT TARGET vtkm::kokkos)
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
find_package(Kokkos REQUIRED)
# We must empty this property for every kokkos backend device since it
# contains a generator expresion which breaks some of our users builds.
set_property(TARGET Kokkos::kokkoscore PROPERTY INTERFACE_COMPILE_DEFINITIONS "")
if (CUDA IN_LIST Kokkos_DEVICES)
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
enable_language(CUDA)
@ -344,7 +349,6 @@ if(VTKm_ENABLE_KOKKOS AND NOT TARGET vtkm::kokkos)
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
enable_language(HIP)
add_library(vtkm::kokkos_hip INTERFACE IMPORTED GLOBAL)
set_property(TARGET Kokkos::kokkoscore PROPERTY INTERFACE_COMPILE_DEFINITIONS "")
set_property(TARGET Kokkos::kokkoscore PROPERTY INTERFACE_COMPILE_OPTIONS "")
set_property(TARGET Kokkos::kokkoscore PROPERTY INTERFACE_LINK_OPTIONS "")
endif()

660
CMake/VTKmModules.cmake Normal file

@ -0,0 +1,660 @@
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##============================================================================
option(VTKm_VERBOSE_MODULES
"When on, extra information about what modules are found and why they are \
built or not is added as CMake status messages."
OFF
)
mark_as_advanced(VTKm_VERBOSE_MODULES)
# -----------------------------------------------------------------------------
#[==[
Sets a property for a module of a particular name. The module property is
available globally and can be retrieved with `vtkm_module_get_property`.
#]==]
function(vtkm_module_set_property module_name property_name property_value)
set_property(GLOBAL PROPERTY
"_vtkm_module_${module_name}_${property_name}" "${property_value}")
endfunction()
#[==[
Gets a property for a value of a particular name.
#]==]
function(vtkm_module_get_property out_var module_name property_name)
get_property(_vtkm_module_property GLOBAL PROPERTY
"_vtkm_module_${module_name}_${property_name}")
set("${out_var}" "${_vtkm_module_property}" PARENT_SCOPE)
endfunction()
#[==[
Sets out_var to true if a module of the given name exists, false otherwise.
A module does not need to be built for this to return true. Only the
associated vtkm.module file needs to exist.
#]==]
function(vtkm_module_exists out_var module_name)
vtkm_module_get_property(_vtkm_module_exists_name ${module_name} NAME)
if(_vtkm_module_exists_name)
set("${out_var}" TRUE PARENT_SCOPE)
else()
set("${out_var}" FALSE PARENT_SCOPE)
endif()
endfunction()
#[==[
Sets out_var to a list of all modules that are being built. This list includes
all modules that are enabled and have an associated target. Any modules not being
built will not be listed.
The modules are listed in an order such that any module will be listed _after_
any modules that it depends on.
#]==]
function(vtkm_module_get_list out_var)
get_property(_vtkm_module_list GLOBAL PROPERTY "_vtkm_module_list")
set("${out_var}" "${_vtkm_module_list}" PARENT_SCOPE)
endfunction()
#[==[
Forces the enable value of a module group to be a particular value. This is
useful for converting a CMake `option` to a group of modules to turn on or
off. When a group of modules is forced with this function, a CMake cache
variable is not made, thus not allowing the user to change the value.
(Presumably, the value is changed via other, easier means.)
```cmake
vtkm_module_force_group(group_name
[VALUE <value>] | [ENABLE_OPTION <name>] | [DISABLE_OPTION <name>]
[ENABLE_VALUE <value>]
[DISABLE_VALUE <value>]
[REASON <string>]
)
The first argument is always the name of the group to force. Exactly
one of VALUE, ENABLE_OPTION, or DISABLE_OPTION must be provided.
* `VALUE`: The specific value to set the group enable/disable flag.
Must be `YES`, `NO`, `WANT`, `DONT_WANT`, `NO`, or `DEFAULT`.
* `ENABLE_OPTION`: The name of a CMake variable (usually a cache
variable) that sets the flag to `ENABLE_VALUE` if true or
`DISABLE_VALUE` if false.
* `DISABLE_OPTION`: The name of a CMake variable (usually a cache
variable) that sets the flag to `DISABLE_VALUE` if true or
`ENABLE_VALUE` if false.
* `ENABLE_VALUE`: Value used to turn on the group. Defaults to `YES`.
* `DISABLE_VALUE`: Value used to turn off the group. Defaults to `NO`.
* `REASON`: String given to inform users how the group enable/disable
flag got its value.
```
#]==]
function(vtkm_module_force_group group_name)
cmake_parse_arguments(PARSE_ARGV 1 force
""
"VALUE;ENABLE_OPTION;DISABLE_OPTION;ENABLE_VALUE;DISABLE_VALUE;REASON"
"")
if(force_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Bad arguments to vtkm_module_force_group")
endif()
if(NOT DEFINED force_ENABLE_VALUE)
set(force_ENABLE_VALUE "YES")
endif()
if(NOT DEFINED force_DISABLE_VALUE)
set(force_DISABLE_VALUE "NO")
endif()
if(DEFINED force_VALUE)
if(NOT force_REASON)
set(force_REASON "Forced value")
endif()
elseif(force_ENABLE_OPTION)
if(${${force_ENABLE_OPTION}})
set(force_VALUE ${force_ENABLE_VALUE})
else()
set(force_VALUE ${force_DISABLE_VALUE})
endif()
if(NOT force_REASON)
set(force_REASON "${force_ENABLE_OPTION} set to ${${force_ENABLE_OPTION}}")
endif()
elseif(force_DISABLE_OPTION)
if(NOT ${${force_DISABLE_OPTION}})
set(force_VALUE ${force_ENABLE_VALUE})
else()
set(force_VALUE ${force_DISABLE_VALUE})
endif()
if(NOT force_REASON)
set(force_REASON "${force_DISABLE_OPTION} set to ${${force_DISABLE_OPTION}}")
endif()
else()
message(FATAL_ERROR
"vtkm_module_force_group must be given VALUE, ENABLE_OPTION, or DISABLE_OPTION")
endif()
set(force_REASON "${force_REASON} (forcing VTKm_GROUP_ENABLE_${group_name} to ${force_VALUE})")
set_property(GLOBAL PROPERTY
"_vtkm_module_group_enable_${group_name}_override" TRUE)
set_property(GLOBAL PROPERTY
"_vtkm_module_group_enable_${group_name}_value" "${force_VALUE}")
set_property(GLOBAL PROPERTY
"_vtkm_module_group_enable_${group_name}_reason" "${force_REASON}")
endfunction()
#[==[
Creates a CMake variable to enable/disable the module with the given name.
This cached variable can be set by the user to turn the module on or off.
If the cache variable already exists, then this call has no effect.
#]==]
function(vtkm_module_enable_module_variable module_name default_value)
set(VTKm_MODULE_ENABLE_${module_name} ${default_value}
CACHE STRING
"Enable the ${module_name} module.
YES - Always create the module (it is an error otherwise).
WANT - Create the module if possible.
DONT_WANT - Create the module only if there is a dependency that requires it.
NO - Never create the module.
DEFAULT - Do the default behavior."
)
mark_as_advanced(VTKm_MODULE_ENABLE_${module_name})
set_property(CACHE VTKm_MODULE_ENABLE_${module_name}
PROPERTY STRINGS "YES;WANT;DONT_WANT;NO;DEFAULT"
)
endfunction()
#[==[
Creates a CMake variable to enable/disable the modules with the given group name.
This cached variable can be set by the user to turn the module on or off.
This cache variable only has an effect on modules that belong to this group and
have their own ENABLE flag set to DEFAULT.
If the cache variable already exists, then this call has no effect.
#]==]
function(vtkm_module_enable_group_variable group_name default_value)
get_property(override_exists GLOBAL PROPERTY _vtkm_module_group_enable_${group_name}_override)
if(override_exists)
# There is a force of this group overriding any setting, in which case
# don't even give the option.
return()
endif()
set(VTKm_GROUP_ENABLE_${group_name} ${default_value}
CACHE STRING
"Enable the ${group_name} module group.
YES - Always create the group of modules (it is an error otherwise).
WANT - Create the group of modules if possible.
DONT_WANT - Create the module only if there is a dependency that requires it.
NO - Never create the module.
DEFAULT - Do the default behavior."
)
mark_as_advanced(VTKm_GROUP_ENABLE_${group_name})
set_property(CACHE VTKm_GROUP_ENABLE_${group_name}
PROPERTY STRINGS "YES;WANT;DONT_WANT;NO;DEFAULT"
)
endfunction()
# -----------------------------------------------------------------------------
#[==[
Parses the given `module_file`. The name of the module (extracted from the file)
is returned in `name_var`.
For each module option expected in the module file, a module property with the
same name is created to hold that option. Additionally, a `DIRECTORY` property
is created to point to the source directory containing the module. The module
properties can be retrieved with the vtkm_module_get_property function.
#]==]
function(_vtkm_module_parse_module_file module_file name_var)
# Read the file
if(NOT IS_ABSOLUTE "${module_file}")
string(PREPEND module_file "${CMAKE_CURRENT_SOURCE_DIR}/")
endif()
file(READ ${module_file} module_file_contents)
# Remove comments
string(REGEX REPLACE "#[^\n]*\n" "\n" module_file_contents "${module_file_contents}")
# Separate arguments with `;` to treat it like a list.
string(REGEX REPLACE "( |\n)+" ";" module_file_contents "${module_file_contents}")
# Parse module file as arguments to a function
set(options NO_TESTING)
set(oneValueArgs NAME)
set(multiValueArgs
GROUPS DEPENDS PRIVATE_DEPENDS OPTIONAL_DEPENDS TEST_DEPENDS TEST_OPTIONAL_DEPENDS)
cmake_parse_arguments(_vtkm_module
"${options}"
"${oneValueArgs}"
"${multiValueArgs}"
${module_file_contents})
# Check required arguments
if(_vtkm_module_UNPARSED_ARGUMENTS)
message(FATAL_ERROR
"Module file ${module_file} contains unknown options: ${_vtkm_module_UNPARSED_ARGUMENTS}")
endif()
if(NOT _vtkm_module_NAME)
message(FATAL_ERROR "Module file ${module_file} does not specify a NAME option.")
endif()
set(NAME ${_vtkm_module_NAME})
# Stash the information in variables
foreach(module_var_name IN LISTS options oneValueArgs multiValueArgs)
vtkm_module_set_property(${NAME} ${module_var_name} "${_vtkm_module_${module_var_name}}")
endforeach()
get_filename_component(directory "${module_file}" DIRECTORY)
vtkm_module_set_property(${NAME} DIRECTORY "${directory}")
# Add a build dependency that reruns CMake whenever the vtkm.module file changes.
set_property(DIRECTORY "${PROJECT_SOURCE_DIR}"
APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${module_file}")
set(${name_var} ${NAME} PARENT_SCOPE)
endfunction()
# -----------------------------------------------------------------------------
#[==[
Scans the given directories recursively for `vtkm.module` files and put the
paths into the output variable. Note that the module files are assumed to
live next to the `CMakeLists.txt` file, which will build the module.
#]==]
function(_vtkm_modules_find output)
set(all_modules)
foreach(search_directory IN LISTS ARGN)
file(GLOB_RECURSE found_modules "${search_directory}/vtkm.module")
list(APPEND all_modules ${found_modules})
endforeach()
set(${output} ${all_modules} PARENT_SCOPE)
endfunction()
# -----------------------------------------------------------------------------
#[==[
Scans for modules and builds the appropriate cached variables to optionally
build them. Modules are found by looking for files named `vtkm.module`.
This module file is assumed to live next to the `CMakeLists.txt` file that
can build the module.
```cmake
vtkm_modules_scan(
SCAN_DIRECTORIES <file>...
PROVIDED_MODULES <variable>
)
The arguments are as follows:
* `SCAN_DIRECTORIES`: (Required) A list of directories to (recursively) scan
for modules (indicated by a `vtkm.module` file).
* `PROVIDED_MODULES`: (Required) The name of a variable that will be set with
a list of modules that exist.
All the directories in `SCAN_DIRECTORIES` are recursively searched for files
named `vtkm.module`. See docs/Modules.md for information on the format of
`vtkm.module` files.
#]==]
function(vtkm_modules_scan)
cmake_parse_arguments(PARSE_ARGV 0 _scan
""
"PROVIDED_MODULES"
"SCAN_DIRECTORIES"
)
if(_scan_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Invalid arguments given to vtkm_module_scan.")
endif()
if(NOT _scan_PROVIDED_MODULES)
message(FATAL_ERROR "vtkm_scan_modules must have a `PROVIDED_MODULES` argument.")
endif()
_vtkm_modules_find(_scan_module_files ${_scan_SCAN_DIRECTORIES})
if (NOT _scan_module_files)
message(FATAL_ERROR "No vtkm.module files found in '${_scan_SCAN_DIRECTORIES}'")
endif()
set(_scan_module_names)
# Read all of the module files passed in.
foreach(module_file IN LISTS _scan_module_files)
_vtkm_module_parse_module_file(${module_file} name)
if(VTKm_VERBOSE_MODULES)
message(STATUS "Found module ${name} in ${module_file}")
endif()
vtkm_module_enable_module_variable(${name} "DEFAULT")
vtkm_module_get_property(module_groups ${name} GROUPS)
foreach(group_name IN LISTS module_groups)
vtkm_module_enable_group_variable(${group_name} "DEFAULT")
endforeach()
list(APPEND _scan_module_names "${name}")
endforeach()
set(${_scan_PROVIDED_MODULES} ${_scan_module_names} PARENT_SCOPE)
endfunction()
# -----------------------------------------------------------------------------
function(_vtkm_module_check_enable_flag variable_name)
set(valid_flags YES WANT DONT_WANT NO DEFAULT)
if(NOT "${${variable_name}}" IN_LIST valid_flags)
message(FATAL_ERROR
"${variable_name} must be set to one of ${valid_flags}, not `${${variable_name}}`.")
endif()
endfunction()
function(_vtkm_module_get_enable_flag module output)
set(reasons_output "${ARGV2}")
_vtkm_module_check_enable_flag(VTKm_MODULE_ENABLE_${module})
set(enable_flag ${VTKm_MODULE_ENABLE_${module}})
if(reasons_output)
set(reasons "VTKm_MODULE_ENABLE_${module} is set to `${VTKm_MODULE_ENABLE_${module}}`")
else()
set(reasons)
endif()
if(enable_flag STREQUAL "DEFAULT")
vtkm_module_get_property(module_groups ${module} GROUPS)
foreach(group IN LISTS module_groups)
get_property(override_exists GLOBAL PROPERTY _vtkm_module_group_enable_${group}_override)
if(override_exists)
get_property(group_enable_flag GLOBAL PROPERTY _vtkm_module_group_enable_${group}_value)
if(reasons_output)
get_property(force_reason
GLOBAL PROPERTY _vtkm_module_group_enable_${group}_reason)
list(APPEND reasons "${force_reason}")
endif()
else()
_vtkm_module_check_enable_flag(VTKm_GROUP_ENABLE_${group})
set(group_enable_flag "${VTKm_GROUP_ENABLE_${group}}")
if(reasons_output)
list(APPEND reasons "VTKm_GROUP_ENABLE_${group} is set to `${group_enable_flag}`")
endif()
endif()
if(NOT ${group_enable_flag} STREQUAL "DEFAULT")
set(enable_flag ${group_enable_flag})
break()
endif()
endforeach()
endif()
if(enable_flag STREQUAL "DEFAULT")
if(_vtkm_modules_want_by_default)
set(enable_flag "WANT")
else()
set(enable_flag "DONT_WANT")
endif()
if(reasons_output)
list(APPEND reasons "${_vtkm_modules_want_by_default_reason}")
endif()
endif()
set(${output} ${enable_flag} PARENT_SCOPE)
if(reasons_output)
set(${reasons_output} ${reasons} PARENT_SCOPE)
endif()
endfunction()
function(_vtkm_modules_print_enable_flag module)
_vtkm_module_get_enable_flag(${module} enable_flag reasons)
message(STATUS "Module ${module} is `${enable_flag}` because:")
foreach(reason IN LISTS reasons)
message(STATUS " ${reason}")
endforeach()
endfunction()
function(_vtkm_modules_print_dependency_chain first_module)
set(last_module ${first_module})
foreach(dep IN LISTS ARGN)
message(STATUS "Module `${last_module}` depends on module `${dep}`")
set(last_module ${dep})
endforeach()
endfunction()
# -----------------------------------------------------------------------------
function(_vtkm_modules_try_build target_module dependent_module dependency_chain)
vtkm_module_exists(exists ${target_module})
if(NOT exists)
# The calling code should check to make sure something is a module before calling this.
message(FATAL_ERROR "\
Internal error: _vtkm_modules_try_build called for a non-existant module `${target_module}`.")
endif()
if(TARGET ${target_module})
# This module is already created. Everything is good.
return()
endif()
# Detect circular dependencies (to prevent infinite CMake loops)
list(FIND dependency_chain ${target_module} chain_index)
if(chain_index GREATER -1)
message("Circular dependency in modules detected!")
list(SUBLIST dependency_chain ${chain_index} -1 subchain)
_vtkm_modules_print_dependency_chain(${subchain} ${target_module})
message(FATAL_ERROR "\
Detected a circular dependency for module `${target_module}`. See the previous \
messages for the dependency chain. Modify the dependencies in the vtkm.module \
files to break the dependency cycle.")
endif()
_vtkm_module_get_enable_flag(${target_module} enable_flag)
if(enable_flag STREQUAL "NO")
# Cannot build this module.
if(dependent_module)
message("\
Unable to enable module ${dependent_module} because module ${depends_on_module}, \
on which it depends, cannot be enabled. See the following status messages \
for more information.")
_vtkm_modules_print_enable_flag(${dependent_module})
_vtkm_modules_print_enable_flag(${target_module})
_vtkm_modules_print_dependency_chain(${dependent_module} ${dependency_chain} ${target_module})
message(FATAL_ERROR "Inconsistent module enable states. See previous status for details.")
endif()
if(VTKm_VERBOSE_MODULES)
message(STATUS "Not building module ${target_module} because enable flag set to NO.")
_vtkm_modules_print_enable_flag(${target_module})
endif()
return()
endif()
if((enable_flag STREQUAL "DONT_WANT") AND (NOT dependent_module))
# Have no reason to build this module.
if(VTKm_VERBOSE_MODULES)
message(STATUS "\
Not building module ${target_module} because enable flag set to `DONT_WANT` \
unless a dependency is found.")
_vtkm_modules_print_enable_flag(${target_module})
endif()
return()
endif()
# At this point, we either want or need the module.
if((enable_flag STREQUAL "YES") AND (NOT dependent_module))
# Found new target_module
set(dependent_module ${target_module})
endif()
list(APPEND dependency_chain ${target_module})
# Attempt to build all dependent modules first.
vtkm_module_get_property(module_dependencies ${target_module} DEPENDS)
vtkm_module_get_property(module_private_dependencies ${target_module} PRIVATE_DEPENDS)
foreach(depends_on_module IN LISTS module_dependencies module_private_dependencies)
# A module can depend on either a module (which defines a target) or a target created
# somewhere else. If it depends on a module, allow that module to create the target.
vtkm_module_exists(depends_on_is_module ${depends_on_module})
if(depends_on_is_module)
_vtkm_modules_try_build(${depends_on_module} "${dependent_module}" "${dependency_chain}")
endif()
if(NOT TARGET ${depends_on_module})
# The module target_module depends on is not being built. Thus, we cannot compile
# this module. Customize the messages based on whether this module was needed to
# be on for correctness and whether the dependency is actually a module or just an
# expected library.
if(dependent_module)
if(depends_on_is_module)
# Internal error. If the dependent module could not be built, it should have already
# issued a FATAL_ERROR.
message(FATAL_ERROR "Internal error: Required module not built.")
else()
_vtkm_modules_print_enable_flag(${target_module})
message(FATAL_ERROR "\
Unable to enable module `${target_module}` because it depends on `${depends_on_module}`. \
There is no module of that name. Either create a module of that name (using a `vtkm.module` \
file) or create a CMake target of that name before the modules are built.")
endif()
elseif(VTKm_VERBOSE_MODULES)
if(depends_on_is_module)
message(STATUS "\
Not building module `${target_module}` because it depends on module `${depends_on_module}`, \
which is not built.")
else()
message(STATUS "\
Not building module `${target_module}` because it depends on `${depends_on_module}`, which \
is neither a module or an existing target. Either create a module of that name (using a \
`vtkm.module` file) or create a CMake target of that name before the modules are built.")
endif()
_vtkm_modules_print_enable_flag(${target_module})
endif()
return()
endif()
endforeach()
# Also attempt to build optional dependent modules. These behave the same except we do
# not generate an error if the module cannot be loaded by removing the "dependent_module"
# and ignoring whether the dependent module actually gets built.
vtkm_module_get_property(module_optional_dependencies ${target_module} OPTIONAL_DEPENDS)
foreach(depends_on_module IN LISTS module_optional_dependencies)
vtkm_module_exists(depends_on_is_module ${depends_on_module})
if(depends_on_is_module)
_vtkm_modules_try_build(${depends_on_module} "" "${dependency_chain}")
endif()
endforeach()
# We have verified that we can enable this module.
if(VTKm_VERBOSE_MODULES)
if(enable_flag STREQUAL "DONT_WANT")
list(GET dependency_chain -2 needed_by)
message(STATUS "Enabling module `${target_module}` because it is needed by `${needed_by}`")
else()
message(STATUS "Enabling module `${target_module}`")
endif()
_vtkm_modules_print_enable_flag(${target_module})
endif()
vtkm_module_get_property(src_directory ${target_module} DIRECTORY)
file(RELATIVE_PATH rel_directory "${VTKm_SOURCE_DIR}" "${src_directory}")
set(vtkm_module_current ${target_module})
add_subdirectory("${src_directory}" "${VTKm_BINARY_DIR}/${rel_directory}")
set(vtkm_module_current)
if(NOT TARGET ${target_module})
if(VTKm_VERBOSE_MODULES)
message(STATUS "\
Module `${target_module}` did not create the expected target. Creating a 'fake' target \
so that other modules know this module is loaded.")
endif()
add_library(${target_module} INTERFACE)
endif()
get_property(_vtkm_module_list GLOBAL PROPERTY "_vtkm_module_list")
list(APPEND _vtkm_module_list ${target_module})
set_property(GLOBAL PROPERTY "_vtkm_module_list" "${_vtkm_module_list}")
endfunction()
# -----------------------------------------------------------------------------
function(_vtkm_modules_try_build_tests target_module)
if(NOT TARGET ${target_module})
# This module was never created, so don't compile tests for it.
return()
endif()
vtkm_module_get_property(no_testing ${target_module} NO_TESTING)
if(no_testing)
if(VTKm_VERBOSE_MODULES)
message(STATUS
"Not building tests for `${target_module}` because it has the NO_TESTING option.")
endif()
return()
endif()
vtkm_module_get_property(target_dependencies ${target_module} TEST_DEPENDS)
foreach(dependency IN LISTS target_dependencies)
if(NOT TARGET ${dependency})
if(VTKm_VERBOSE_MODULES)
message(STATUS
"Not building tests for `${target_module}` because missing dependency `${dependency}`")
endif()
return()
endif()
endforeach()
vtkm_module_get_property(src_directory ${target_module} DIRECTORY)
file(RELATIVE_PATH rel_directory "${VTKm_SOURCE_DIR}" "${src_directory}")
set(vtkm_module_current_test ${target_module})
add_subdirectory("${src_directory}/testing" "${VTKm_BINARY_DIR}/${rel_directory}/testing")
set(vtkm_module_current_test)
endfunction()
# -----------------------------------------------------------------------------
#[==[
Determines which modules should be built and then calls `add_subdirectory` on those
modules to build them.
```cmake
vtkm_modules_build(
PROVIDED_MODULES <name>...
[WANT_BY_DEFAULT <ON|OFF>]
[WANT_BY_DEFAULT_REASON <string>]
)
The arguments are as follows:
* `PROVIDED_MODULES`: (Required) A list of module names that are available.
This list typically provided by `vtkm_modules_scan`.
* `WANT_BY_DEFAULT`: (Defaults to `OFF`) Whether modules should by default be
built if possible.
* `WANT_BY_DEFAULT_REASON`: When `VTKm_VERBOSE_MODULES` and a module's enable
is set to the default value (dictated by `WANT_BY_DEFAULT`), then this string
is given as the reason.
```
#]==]
function(vtkm_modules_build)
cmake_parse_arguments(PARSE_ARGV 0 _build
""
"WANT_BY_DEFAULT;WANT_BY_DEFAULT_REASON"
"PROVIDED_MODULES"
)
if(_build_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Invalid arguments given to vtkm_modules_build.")
endif()
if(NOT _build_PROVIDED_MODULES)
message(FATAL_ERROR "vtkm_modules_build requires PROVIDED_MODULES variable.")
endif()
if(_build_WANT_BY_DEFAULT)
set(_vtkm_modules_want_by_default ${_build_WANT_BY_DEFAULT})
else()
set(_vtkm_modules_want_by_default OFF)
endif()
if(_build_WANT_BY_DEFAULT_REASON)
set(_vtkm_modules_want_by_default_reason "${_build_WANT_BY_DEFAULT_REASON}")
else()
set(_vtkm_modules_want_by_default_reason "WANT_BY_DEFAULT is ${_vtkm_modules_want_by_default}")
endif()
foreach(module IN LISTS _build_PROVIDED_MODULES)
_vtkm_modules_try_build(${module} "" "")
endforeach()
if(VTKm_ENABLE_TESTING)
foreach(module IN LISTS _build_PROVIDED_MODULES)
_vtkm_modules_try_build_tests(${module})
endforeach()
endif()
endfunction()

@ -92,6 +92,10 @@ endif()
#-----------------------------------------------------------------------------
if(VTKm_ENABLE_RENDERING AND NOT TARGET vtkm_rendering_gl_context)
add_library(vtkm_rendering_gl_context INTERFACE)
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
vtkm_install_targets(TARGETS vtkm_rendering_gl_context)
endif()
endif()
#-----------------------------------------------------------------------------

@ -197,7 +197,7 @@ endfunction()
#
# If VTK-m was built with CMake 3.18+ and you are using CMake 3.18+ and have
# a cmake_minimum_required of 3.18 or have set policy CMP0105 to new, this will
# return an empty string as the `vtkm::cuda` target will correctly propagate
# return an empty string as the `vtkm_cuda` target will correctly propagate
# all the necessary flags.
#
# This is required for CMake < 3.18 as they don't support the `$<DEVICE_LINK>`
@ -211,11 +211,11 @@ endfunction()
#
function(vtkm_get_cuda_flags settings_var)
if(TARGET vtkm::cuda)
if(TARGET vtkm_cuda)
if(POLICY CMP0105)
cmake_policy(GET CMP0105 does_device_link)
get_property(arch_flags
TARGET vtkm::cuda
TARGET vtkm_cuda
PROPERTY INTERFACE_LINK_OPTIONS)
if(arch_flags AND CMP0105 STREQUAL "NEW")
return()
@ -223,7 +223,7 @@ function(vtkm_get_cuda_flags settings_var)
endif()
get_property(arch_flags
TARGET vtkm::cuda
TARGET vtkm_cuda
PROPERTY cuda_architecture_flags)
set(${settings_var} "${${settings_var}} ${arch_flags}" PARENT_SCOPE)
endif()
@ -259,6 +259,66 @@ function(vtkm_add_drop_unused_function_flags uses_vtkm_target)
endif()
endfunction()
#-----------------------------------------------------------------------------
# This function takes a target name and returns the mangled version of its name
# in a form that complies with the VTK-m export target naming scheme.
macro(vtkm_target_mangle output target)
string(REPLACE "vtkm_" "" ${output} ${target})
endmacro()
#-----------------------------------------------------------------------------
# Enable VTK-m targets to be installed.
#
# This function decorates the `install` CMake function mangling the exported
# target names to comply with the VTK-m exported target names scheme. Use this
# function instead of the canonical CMake `install` function for VTK-m targets.
#
# Signature:
# vtkm_install_targets(
# TARGETS <target[s]>
# [EXPORT <export_name>]
# [ARGS <cmake_install_args>]
# )
#
# Usage:
# add_library(vtkm_library)
# vtkm_install_targets(TARGETS vtkm_library ARGS COMPONENT core)
#
# TARGETS: List of targets to be installed.
#
# EXPORT: [OPTIONAL] The name of the export set to which this target will be
# added. If omitted vtkm_install_targets will use the value of
# VTKm_EXPORT_NAME by default.
#
# ARGS: [OPTIONAL] Any argument other than `TARGETS` and `EXPORT` accepted
# by the `install` CMake function:
# <https://cmake.org/cmake/help/latest/command/install.html>
#
function(vtkm_install_targets)
set(oneValueArgs EXPORT)
set(multiValueArgs TARGETS ARGS)
cmake_parse_arguments(VTKm_INSTALL "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(export_name ${VTKm_EXPORT_NAME})
if(VTKm_INSTALL_EXPORT)
set(export_name ${VTKm_INSTALL_EXPORT})
endif()
if(NOT DEFINED VTKm_INSTALL_TARGETS)
message(FATAL_ERROR "vtkm_install_targets invoked without TARGETS arguments.")
endif()
if(DEFINED VTKm_INSTALL_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "vtkm_install_targets missing ARGS keyword prepending install arguments")
endif()
foreach(tgt IN LISTS VTKm_INSTALL_TARGETS)
vtkm_target_mangle(tgt_mangled ${tgt})
set_target_properties(${tgt} PROPERTIES EXPORT_NAME ${tgt_mangled})
endforeach()
install(TARGETS ${VTKm_INSTALL_TARGETS} EXPORT ${export_name} ${VTKm_INSTALL_ARGS})
endfunction(vtkm_install_targets)
#-----------------------------------------------------------------------------
# Add a relevant information to target that wants to use VTK-m.
@ -301,7 +361,7 @@ endfunction()
#
# If VTK-m was built with CMake 3.18+ and you are using CMake 3.18+ and have
# a cmake_minimum_required of 3.18 or have set policy CMP0105 to new, this will
# return an empty string as the `vtkm::cuda` target will correctly propagate
# return an empty string as the `vtkm_cuda` target will correctly propagate
# all the necessary flags.
#
# Note: calling `vtkm_add_target_information` multiple times with
@ -368,62 +428,18 @@ function(vtkm_add_target_information uses_vtkm_target)
endif()
endforeach()
# set the required target properties
if(NOT VTKm_NO_DEPRECATED_VIRTUAL)
set_target_properties(${targets} PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(${targets} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
endif()
if(VTKm_TI_DROP_UNUSED_SYMBOLS)
foreach(target IN LISTS targets)
vtkm_add_drop_unused_function_flags(${target})
endforeach()
endif()
if((TARGET vtkm::cuda) OR (TARGET vtkm::kokkos_cuda))
if((TARGET vtkm_cuda) OR (TARGET vtkm::kokkos_cuda))
set_source_files_properties(${VTKm_TI_DEVICE_SOURCES} PROPERTIES LANGUAGE "CUDA")
elseif(TARGET vtkm::kokkos_hip)
set_source_files_properties(${VTKm_TI_DEVICE_SOURCES} PROPERTIES LANGUAGE "HIP")
kokkos_compilation(SOURCE ${VTKm_TI_DEVICE_SOURCES})
endif()
# Validate that following:
# - We are building with CUDA enabled.
# - We are building a VTK-m library or a library that wants cross library
# device calls.
#
# This is required as CUDA currently doesn't support device side calls across
# dynamic library boundaries.
if((NOT VTKm_NO_DEPRECATED_VIRTUAL) AND ((TARGET vtkm::cuda) OR (TARGET vtkm::kokkos_cuda)))
foreach(target IN LISTS targets)
get_target_property(lib_type ${target} TYPE)
if (TARGET vtkm::cuda)
get_target_property(requires_static vtkm::cuda requires_static_builds)
endif()
if (TARGET vtkm::kokkos)
get_target_property(requires_static vtkm::kokkos requires_static_builds)
endif()
if(requires_static AND ${lib_type} STREQUAL "SHARED_LIBRARY" AND VTKm_TI_EXTENDS_VTKM)
#We provide different error messages based on if we are building VTK-m
#or being called by a consumer of VTK-m. We use PROJECT_NAME so that we
#produce the correct error message when VTK-m is a subdirectory include
#of another project
if(PROJECT_NAME STREQUAL "VTKm")
message(SEND_ERROR "${target} needs to be built STATIC as CUDA doesn't"
" support virtual methods across dynamic library boundaries. You"
" need to set the CMake option BUILD_SHARED_LIBS to `OFF` or"
" (better) turn VTKm_NO_DEPRECATED_VIRTUAL to `ON`.")
else()
message(SEND_ERROR "${target} needs to be built STATIC as CUDA doesn't"
" support virtual methods across dynamic library boundaries. You"
" should either explicitly call add_library with the `STATIC` keyword"
" or set the CMake option BUILD_SHARED_LIBS to `OFF` or"
" (better) turn VTKm_NO_DEPRECATED_VIRTUAL to `ON`.")
endif()
endif()
endforeach()
endif()
endfunction()
@ -499,8 +515,8 @@ function(vtkm_library)
if (NOT VTKm_SKIP_LIBRARY_VERSIONS)
# Setup the SOVERSION and VERSION information for this vtkm library
set_property(TARGET ${lib_name} PROPERTY VERSION 1)
set_property(TARGET ${lib_name} PROPERTY SOVERSION 1)
set_property(TARGET ${lib_name} PROPERTY VERSION ${VTKm_VERSION}.${VTKm_VERSION_PATCH})
set_property(TARGET ${lib_name} PROPERTY SOVERSION ${VTKm_VERSION})
endif ()
# Support custom library suffix names, for other projects wanting to inject
@ -512,6 +528,32 @@ function(vtkm_library)
endif()
set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME ${lib_name}${_lib_suffix})
# Include any module information
if(vtkm_module_current)
if(NOT lib_name STREQUAL vtkm_module_current)
# We do want each library to be in its own module. (VTK's module allows you to declare
# multiple libraries per module. We may want that in the future, but right now we should
# not need it.)
message(FATAL_ERROR
"Library name `${lib_name}` does not match module name `${vtkm_module_current}`")
endif()
vtkm_module_get_property(depends ${vtkm_module_current} DEPENDS)
vtkm_module_get_property(private_depends ${vtkm_module_current} PRIVATE_DEPENDS)
vtkm_module_get_property(optional_depends ${vtkm_module_current} OPTIONAL_DEPENDS)
target_link_libraries(${lib_name}
PUBLIC ${depends}
PRIVATE ${private_depends}
)
foreach(opt_dep IN LISTS optional_depends)
if(TARGET ${opt_dep})
target_link_libraries(${lib_name} PRIVATE ${opt_dep})
endif()
endforeach()
else()
# Might need to add an argument to vtkm_library to create an exception to this rule
message(FATAL_ERROR "Library `${lib_name}` is not created inside of a VTK-m module.")
endif()
#generate the export header and install it
vtkm_generate_export_header(${lib_name})
@ -531,8 +573,7 @@ function(vtkm_library)
endif()
#install the library itself
install(TARGETS ${lib_name}
EXPORT ${VTKm_EXPORT_NAME}
vtkm_install_targets(TARGETS ${lib_name} ARGS
ARCHIVE DESTINATION ${VTKm_INSTALL_LIB_DIR}
LIBRARY DESTINATION ${VTKm_INSTALL_LIB_DIR}
RUNTIME DESTINATION ${VTKm_INSTALL_BIN_DIR}

@ -16,8 +16,7 @@
# -DVTKm_SOURCE_DIR=<VTKm_SOURCE_DIR>
# -DVTKm_BINARY_DIR=<VTKm_BINARY_DIR>
# -DVTKm_INSTALL_INCLUDE_DIR=<VTKm_INSTALL_INCLUDE_DIR>
# -DVTKm_ENABLE_RENDERING=<VTKm_ENABLE_RENDERING>
# -DVTKm_ENABLE_LOGGING=<VTKm_ENABLE_LOGGING>
# -DDIR_EXCEPTIONS=<dir>:<dir>:...
# -DVTKm_ENABLE_HDF5_IO=<VTKm_ENABLE_HDF5_IO>
# -P <VTKm_SOURCE_DIR>/CMake/testing/VTKMCheckSourceInInstall.cmake
##
@ -34,12 +33,9 @@ endif ()
if (NOT VTKm_INSTALL_INCLUDE_DIR)
message(FATAL_ERROR "VTKm_INSTALL_INCLUDE_DIR not defined.")
endif ()
if (NOT DEFINED VTKm_ENABLE_RENDERING)
message(FATAL_ERROR "VTKm_ENABLE_RENDERING not defined.")
endif ()
if (NOT DEFINED VTKm_ENABLE_LOGGING)
message(FATAL_ERROR "VTKm_ENABLE_LOGGING not defined.")
endif ()
if (NOT DEFINED DIR_EXCEPTIONS)
message(FATAL_ERROR "DIR_EXCEPTIONS not defined.")
endif()
if (NOT DEFINED VTKm_ENABLE_HDF5_IO)
message(FATAL_ERROR "VTKm_ENABLE_HDF5_IO not defined.")
endif()
@ -116,41 +112,13 @@ function(do_verify root_dir prefix)
thirdparty/diy/vtkmdiy/cmake/mpi_types.h
thirdparty/lodepng/vtkmlodepng/lodepng.h
thirdparty/loguru/vtkmloguru/loguru.hpp
# Ignore deprecated virtual classes (which are not installed if VTKm_NO_DEPRECATED_VIRTUAL
# is on). These exceptions can be removed when these files are completely removed.
cont/ArrayHandleVirtual.h
cont/ArrayHandleVirtual.hxx
cont/ArrayHandleVirtualCoordinates.h
cont/CellLocator.h
cont/PointLocator.h
cont/StorageVirtual.h
cont/StorageVirtual.hxx
cont/VirtualObjectHandle.h
cont/cuda/internal/VirtualObjectTransferCuda.h
cont/internal/TransferInfo.h
cont/internal/VirtualObjectTransfer.h
cont/internal/VirtualObjectTransferInstantiate.h
cont/internal/VirtualObjectTransferShareWithControl.h
cont/kokkos/internal/VirtualObjectTransferKokkos.h
cont/openmp/internal/VirtualObjectTransferOpenMP.h
cont/serial/internal/VirtualObjectTransferSerial.h
cont/tbb/internal/VirtualObjectTransferTBB.h
exec/CellLocator.h
exec/PointLocator.h
internal/ArrayPortalVirtual.h
)
string(REPLACE ":" ";" directory_exceptions "${DIR_EXCEPTIONS}")
#by default every header in a testing directory doesn't need to be installed
set(directory_exceptions ".*/testing" )
list(APPEND directory_exceptions ".*/testing")
# These exceptions should be based on the status of the associated
# cmake option
if(NOT VTKm_ENABLE_RENDERING)
list(APPEND directory_exceptions rendering)
endif()
if(NOT VTKm_ENABLE_LOGGING)
list(APPEND directory_exceptions thirdparty/loguru)
endif()
if (NOT VTKm_ENABLE_HDF5_IO)
list(APPEND file_exceptions
io/ImageWriterHDF5.h

@ -0,0 +1,149 @@
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##============================================================================
#-----------------------------------------------------------------------------
# Adds a performance benchmark test
#
# Usage:
# add_benchmark_test(benchmark
# [ NAME <name> ]
# [ ARGS <args...> ]
# [ REGEX <benchmark_regex...> ]
# )
#
# benchmark: Target of an executable that uses Google Benchmark.
#
# NAME: The name given to the CMake tests. The benchmark target name is used
# if NAME is not specified.
#
# ARGS: Extra arguments passed to the benchmark executable when run.
#
# REGEX: Regular expressions that select the specific benchmarks within the binary
# to be used. It populates the Google Benchmark
# --benchmark_filter parameter. When multiple regexes are passed
# as independent positional arguments, they are joined using the "|"
# regex operator before populating the `--benchmark_filter` parameter.
#
function(add_benchmark_test benchmark)
# We need JSON support among other things for this to work
if (CMAKE_VERSION VERSION_LESS 3.19)
message(FATAL_ERROR "Performance regression testing needs CMAKE >= 3.19")
return()
endif()
###TEST VARIABLES############################################################
set(options)
set(one_value_keywords NAME)
set(multi_value_keywords ARGS REGEX)
cmake_parse_arguments(PARSE_ARGV 1 VTKm_PERF "${options}" "${one_value_keywords}" "${multi_value_keywords}")
if (VTKm_PERF_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Bad arguments to add_benchmark_test (${VTKm_PERF_UNPARSED_ARGUMENTS}).")
endif()
if (NOT VTKm_PERF_NAME)
set(VTKm_PERF_NAME ${benchmark})
endif()
if (VTKm_PERF_REGEX)
string(REPLACE ";" "|" VTKm_PERF_REGEX "${VTKm_PERF_REGEX}")
else()
set(VTKm_PERF_REGEX ".*")
endif()
set(VTKm_PERF_REMOTE_URL "https://gitlab.kitware.com/vbolea/vtk-m-benchmark-records.git")
# Parameters for the null hypothesis test
set(VTKm_PERF_ALPHA 0.05)
set(VTKm_PERF_REPETITIONS 10)
set(VTKm_PERF_MIN_TIME 1)
set(VTKm_PERF_DIST "normal")
set(VTKm_PERF_REPO "${CMAKE_BINARY_DIR}/vtk-m-benchmark-records")
set(VTKm_PERF_COMPARE_JSON "${CMAKE_BINARY_DIR}/nocommit_${VTKm_PERF_NAME}.json")
set(VTKm_PERF_STDOUT "${CMAKE_BINARY_DIR}/benchmark_${VTKm_PERF_NAME}.stdout")
set(VTKm_PERF_COMPARE_STDOUT "${CMAKE_BINARY_DIR}/compare_${VTKm_PERF_NAME}.stdout")
if (DEFINED ENV{CI_COMMIT_SHA})
set(VTKm_PERF_COMPARE_JSON "${CMAKE_BINARY_DIR}/$ENV{CI_COMMIT_SHA}_${VTKm_PERF_NAME}.json")
endif()
set(test_name "PerformanceTest${VTKm_PERF_NAME}")
###TEST INVOKATIONS##########################################################
add_test(NAME "${test_name}Run"
COMMAND ${CMAKE_COMMAND}
"-DVTKm_PERF_BENCH_DEVICE=Any"
"-DVTKm_PERF_BENCH_PATH=${CMAKE_BINARY_DIR}/bin/${benchmark}"
"-DVTKm_PERF_ARGS=${VTKm_PERF_ARGS}"
"-DVTKm_PERF_REGEX=${VTKm_PERF_REGEX}"
"-DVTKm_PERF_REPETITIONS=${VTKm_PERF_REPETITIONS}"
"-DVTKm_PERF_MIN_TIME=${VTKm_PERF_MIN_TIME}"
"-DVTKm_PERF_COMPARE_JSON=${VTKm_PERF_COMPARE_JSON}"
"-DVTKm_PERF_STDOUT=${VTKm_PERF_STDOUT}"
"-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}"
-P "${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestRun.cmake"
)
add_test(NAME "${test_name}Fetch"
COMMAND ${CMAKE_COMMAND}
"-DVTKm_PERF_REPO=${VTKm_PERF_REPO}"
"-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}"
"-DVTKm_PERF_REMOTE_URL=${VTKm_PERF_REMOTE_URL}"
-P "${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestFetch.cmake"
)
add_test(NAME "${test_name}Upload"
COMMAND ${CMAKE_COMMAND}
"-DVTKm_PERF_REPO=${VTKm_PERF_REPO}"
"-DVTKm_PERF_COMPARE_JSON=${VTKm_PERF_COMPARE_JSON}"
"-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}"
-P "${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestUpload.cmake"
)
add_test(NAME "${test_name}Report"
COMMAND ${CMAKE_COMMAND}
"-DVTKm_BINARY_DIR=${VTKm_BINARY_DIR}"
"-DVTKm_PERF_ALPHA=${VTKm_PERF_ALPHA}"
"-DVTKm_PERF_COMPARE_JSON=${VTKm_PERF_COMPARE_JSON}"
"-DVTKm_PERF_COMPARE_STDOUT=${VTKm_PERF_COMPARE_STDOUT}"
"-DVTKm_PERF_DIST=${VTKm_PERF_DIST}"
"-DVTKm_PERF_NAME=${VTKm_PERF_NAME}"
"-DVTKm_PERF_REPO=${VTKm_PERF_REPO}"
"-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}"
-P "${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestReport.cmake"
)
add_test(NAME "${test_name}CleanUp"
COMMAND ${CMAKE_COMMAND} -E rm -rf "${VTKm_PERF_REPO}"
)
###TEST PROPERTIES###########################################################
set_tests_properties("${test_name}Report" "${test_name}Upload"
PROPERTIES
FIXTURE_REQUIRED "${test_name}Run;${test_name}Fetch"
FIXTURE_CLEANUP "${test_name}CleanUp"
REQUIRED_FILES "${VTKm_PERF_COMPARE_JSON}")
set_tests_properties("${test_name}Run"
"${test_name}Report"
"${test_name}Upload"
"${test_name}Fetch"
"${test_name}CleanUp"
PROPERTIES RUN_SERIAL ON)
set_tests_properties(${test_name}Run PROPERTIES TIMEOUT 1800)
# Only upload when we are inside a CI build
if (NOT DEFINED ENV{CI_COMMIT_SHA} OR NOT DEFINED ENV{VTKM_BENCH_RECORDS_TOKEN})
set_tests_properties(${test_name}Upload PROPERTIES DISABLED TRUE)
endif()
endfunction()

@ -1,4 +1,3 @@
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
@ -9,9 +8,10 @@
## PURPOSE. See the above copyright notice for more information.
##============================================================================
set(deprecated_headers
ResolveFieldTypeAndExecute.h
ResolveFieldTypeAndMap.h
)
include(${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestLib.cmake)
vtkm_declare_headers(${deprecated_headers})
REQUIRE_FLAG_MUTABLE("VTKm_PERF_REPO")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_REMOTE_URL")
file(REMOVE_RECURSE vtk-m-benchmark-records)
execute(COMMAND /usr/bin/git clone -b records ${VTKm_PERF_REMOTE_URL} ${VTKm_PERF_REPO})

@ -0,0 +1,36 @@
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##============================================================================
macro(REQUIRE_FLAG flag)
if (NOT DEFINED ${flag})
message(FATAL_ERROR "Need to pass the ${flag}")
endif()
endmacro(REQUIRE_FLAG)
macro(REQUIRE_FLAG_MUTABLE flag)
REQUIRE_FLAG(${flag})
# Env var overrides default value
if (DEFINED ENV{${flag}})
set(${flag} "$ENV{${flag}}")
endif()
endmacro(REQUIRE_FLAG_MUTABLE)
macro(execute)
execute_process(
${ARGV}
COMMAND_ECHO STDOUT
ECHO_OUTPUT_VARIABLE
ECHO_ERROR_VARIABLE
COMMAND_ERROR_IS_FATAL ANY
)
endmacro()
message("CTEST_FULL_OUTPUT")

@ -0,0 +1,77 @@
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##============================================================================
include("${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestLib.cmake")
REQUIRE_FLAG("VTKm_PERF_NAME")
REQUIRE_FLAG("VTKm_PERF_COMPARE_JSON")
REQUIRE_FLAG("VTKm_PERF_COMPARE_STDOUT")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_REPO")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_ALPHA")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_DIST")
###FIND MOST RECENT BASELINE####################################################
execute(COMMAND /usr/bin/git -C "${VTKm_SOURCE_DIR}" merge-base origin/master @
OUTPUT_VARIABLE GIT_BASE_COMMIT)
string(STRIP "${GIT_BASE_COMMIT}" GIT_BASE_COMMIT)
execute_process(COMMAND /usr/bin/git -C "${VTKm_SOURCE_DIR}" log --format=%H --first-parent "${GIT_BASE_COMMIT}"
OUTPUT_VARIABLE GIT_ANCESTOR_COMMITS
COMMAND_ECHO STDOUT
ECHO_ERROR_VARIABLE
COMMAND_ERROR_IS_FATAL ANY
)
string(REPLACE "\n" ";" GIT_ANCESTOR_COMMITS ${GIT_ANCESTOR_COMMITS})
foreach(commit IN LISTS GIT_ANCESTOR_COMMITS)
if (EXISTS "${VTKm_PERF_REPO}/${commit}_${VTKm_PERF_NAME}.json")
set(BASELINE_REPORT "${VTKm_PERF_REPO}/${commit}_${VTKm_PERF_NAME}.json")
break()
endif()
endforeach()
if (NOT DEFINED BASELINE_REPORT)
message(FATAL_ERROR "PerformanceTestReport: no ancestor benchmarks record found")
endif()
###RUN COMPARE_PY SCRIPT########################################################
execute(COMMAND /usr/bin/python3
"${VTKm_SOURCE_DIR}/Utilities/Scripts/compare.py"
--alpha "${VTKm_PERF_ALPHA}"
--dist "${VTKm_PERF_DIST}"
benchmarks "${BASELINE_REPORT}" "${VTKm_PERF_COMPARE_JSON}"
OUTPUT_VARIABLE compare_py_output
)
# Write compare.py output to disk
file(WRITE "${VTKm_PERF_COMPARE_STDOUT}" "${compare_py_output}")
###PERFORM NULL HYPHOTESIS######################################################
string(REGEX MATCHALL "[^\n]*time_pvalue[^\n]*" pvalues_list ${compare_py_output})
foreach(pvalue_line IN LISTS pvalues_list)
# We only take into consideration the wall time of the test
string(REGEX MATCH "(.*)/manual_time_pvalue[ \t]+([0-9.]+)[ ]+" ignoreme ${pvalue_line})
if (CMAKE_MATCH_0)
set(benchmark_name "${CMAKE_MATCH_1}")
set(benchmark_pvalue "${CMAKE_MATCH_2}")
if("${benchmark_pvalue}" LESS "${VTKm_PERF_ALPHA}")
list(APPEND time_failed_benchs ${benchmark_name})
endif()
endif()
endforeach()
if(time_failed_benchs)
string(REPLACE ";" "\n" time_failed_benchs "${time_failed_benchs}")
message(FATAL_ERROR "Time-failed Benchmarks:\n${time_failed_benchs}")
endif()

@ -0,0 +1,36 @@
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##============================================================================
include("${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestLib.cmake")
REQUIRE_FLAG("VTKm_PERF_BENCH_PATH")
REQUIRE_FLAG("VTKm_PERF_REGEX")
REQUIRE_FLAG("VTKm_PERF_COMPARE_JSON")
REQUIRE_FLAG("VTKm_PERF_STDOUT")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_BENCH_DEVICE")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_REPETITIONS")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_MIN_TIME")
execute(
COMMAND "${VTKm_PERF_BENCH_PATH}"
--vtkm-device "${VTKm_PERF_BENCH_DEVICE}"
${VTKm_PERF_ARGS}
"--benchmark_filter=${VTKm_PERF_REGEX}"
"--benchmark_out=${VTKm_PERF_COMPARE_JSON}"
"--benchmark_repetitions=${VTKm_PERF_REPETITIONS}"
"--benchmark_min_time=${VTKm_PERF_MIN_TIME}"
--benchmark_out_format=json
--benchmark_counters_tabular=true
OUTPUT_VARIABLE report_output
)
# Write compare.py output to disk
file(WRITE "${VTKm_PERF_STDOUT}" "${report_output}")

@ -0,0 +1,23 @@
##============================================================================
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##============================================================================
include("${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTestLib.cmake")
REQUIRE_FLAG("VTKm_PERF_COMPARE_JSON")
REQUIRE_FLAG_MUTABLE("VTKm_PERF_REPO")
file(COPY "${VTKm_PERF_COMPARE_JSON}" DESTINATION "${VTKm_PERF_REPO}/")
get_filename_component(perf_report_name "${VTKm_PERF_COMPARE_JSON}" NAME)
execute(COMMAND /usr/bin/git -C "${VTKm_PERF_REPO}" config --local user.name vtk-m\ benchmark\ job)
execute(COMMAND /usr/bin/git -C "${VTKm_PERF_REPO}" config --local user.email do_not_email_the_robot@kitware.com)
execute(COMMAND /usr/bin/git -C "${VTKm_PERF_REPO}" add "${perf_report_name}")
execute(COMMAND /usr/bin/git -C "${VTKm_PERF_REPO}" commit -m "Added ${perf_report_name} record")
execute(COMMAND /usr/bin/git -C "${VTKm_PERF_REPO}" push origin records)

@ -11,12 +11,23 @@
# -----------------------------------------------------------------------------
function(vtkm_test_install )
if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
# Find all modules that are not-compiled. Skip these directories.
set(dir_exceptions)
foreach(module IN LISTS all_modules)
if(NOT TARGET ${module})
vtkm_module_get_property(directory ${module} DIRECTORY)
file(RELATIVE_PATH directory "${VTKm_SOURCE_DIR}/vtkm" "${directory}")
list(APPEND dir_exceptions ${directory})
endif()
endforeach()
# Replace ';' list separator with ':' to preserve them as a single argument
string(REPLACE ";" ":" dir_exceptions "${dir_exceptions}")
set(command_args
"-DVTKm_SOURCE_DIR=${VTKm_SOURCE_DIR}"
"-DVTKm_BINARY_DIR=${VTKm_BINARY_DIR}"
"-DVTKm_INSTALL_INCLUDE_DIR=${VTKm_INSTALL_INCLUDE_DIR}"
"-DVTKm_ENABLE_RENDERING=${VTKm_ENABLE_RENDERING}"
"-DVTKm_ENABLE_LOGGING=${VTKm_ENABLE_LOGGING}"
"-DDIR_EXCEPTIONS=${dir_exceptions}"
"-DVTKm_ENABLE_HDF5_IO=${VTKm_ENABLE_HDF5_IO}"
)
@ -71,7 +82,7 @@ set(CMAKE_CXX_STANDARD \"${CMAKE_CXX_STANDARD}\" CACHE STRING \"\")
set(CMAKE_CXX_STANDARD_REQUIRED ${CMAKE_CXX_STANDARD_REQUIRED} CACHE BOOL \"\")
set(CMAKE_CUDA_COMPILER \"${CMAKE_CUDA_COMPILER}\" CACHE FILEPATH \"\")
set(CMAKE_CUDA_FLAGS \"$CACHE{CMAKE_CUDA_FLAGS}\" CACHE STRING \"\")
set(CMAKE_CUDA_HOST_COMPILER \"${CMAKE_CUDA_HOST_COMPILER}\" CACHE FILEPATH \"\")
set(CMAKE_HIP_COMPILER \"${CMAKE_HIP_COMPILER}\" CACHE FILEPATH \"\")
"
)

@ -10,7 +10,7 @@
include(VTKmWrappers)
function(vtkm_create_test_executable
function(_vtkm_create_test_executable
prog_name
sources
device_sources
@ -206,35 +206,67 @@ function(vtkm_unit_tests)
# Add the path to the location where generated regression test images should be written
list(APPEND VTKm_UT_TEST_ARGS "--vtkm-write-dir=${VTKm_BINARY_DIR}")
set(test_libraries)
if(vtkm_module_current_test)
vtkm_module_get_property(module_dir ${vtkm_module_current_test} DIRECTORY)
vtkm_module_get_property(depends ${vtkm_module_current_test} TEST_DEPENDS)
vtkm_module_get_property(optional_depends ${vtkm_module_current_test} TEST_OPTIONAL_DEPENDS)
list(APPEND depends ${vtkm_module_current_test})
set(test_libraries ${depends})
foreach(lib IN LISTS VTKm_UT_LIBRARIES)
vtkm_module_exists(lib_is_module ${lib})
if((lib_is_module) AND (NOT ${lib} IN_LIST depends) AND (NOT ${lib} IN_LIST optional_depends))
message(WARNING "\
Test program for module `${vtkm_module_current_test}` lists `${lib} as a library in \
vtkm_unit_tests but not in its test dependencies. Add test dependencies to \
`${module_dir}/vtkm.module`.")
endif()
list(APPEND test_libraries ${lib})
endforeach()
foreach(module IN LISTS optional_depends)
if(TARGET ${module})
list(APPEND test_libraries ${module})
endif()
endforeach()
else()
if(NOT vtkm_module_current)
message(WARNING "TEST ${test_prog} is not associated with any module.")
endif()
endif()
if(vtkm_module_current)
message(WARNING "Test ${test_prog} is being created inside a module definition rather than tests.")
endif()
if(VTKm_UT_MPI)
if (VTKm_ENABLE_MPI)
vtkm_create_test_executable(
_vtkm_create_test_executable(
${test_prog}
"${VTKm_UT_SOURCES}"
"${VTKm_UT_DEVICE_SOURCES}"
"${VTKm_UT_LIBRARIES}"
"${test_libraries}"
"${VTKm_UT_DEFINES}"
ON # is_mpi_test
ON # use_mpi
${VTKm_UT_USE_VTKM_JOB_POOL})
endif()
if ((NOT VTKm_ENABLE_MPI) OR VTKm_ENABLE_DIY_NOMPI)
vtkm_create_test_executable(
_vtkm_create_test_executable(
${test_prog}
"${VTKm_UT_SOURCES}"
"${VTKm_UT_DEVICE_SOURCES}"
"${VTKm_UT_LIBRARIES}"
"${test_libraries}"
"${VTKm_UT_DEFINES}"
ON # is_mpi_test
OFF # use_mpi
${VTKm_UT_USE_VTKM_JOB_POOL})
endif()
else()
vtkm_create_test_executable(
_vtkm_create_test_executable(
${test_prog}
"${VTKm_UT_SOURCES}"
"${VTKm_UT_DEVICE_SOURCES}"
"${VTKm_UT_LIBRARIES}"
"${test_libraries}"
"${VTKm_UT_DEFINES}"
OFF # is_mpi_test
OFF # use_mpi

@ -112,6 +112,14 @@ 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)
# We may want to make finer controls on whether libraries/modules get built.
# VTK uses the concept of groups for its modules
vtkm_option(VTKm_BUILD_ALL_LIBRARIES
"Build all libraries by default. (Can be overridden for each library.)"
ON
)
mark_as_advanced(VTKm_BUILD_ALL_LIBRARIES)
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)
@ -169,12 +177,6 @@ vtkm_option(VTKm_ENABLE_DEVELOPER_FLAGS "Enable compiler flags that are useful w
# Some application might need not to install those, hence this option.
vtkm_option(VTKm_NO_INSTALL_README_LICENSE "disable the installation of README and LICENSE files" OFF)
# We are in the process of deprecating the use of virtual methods because they
# are not well supported on many accelerators. Turn this option on to remove
# the code entirely. In VTK-m 2.0 virtual methods should be removed entirely
# and this option will be removed.
vtkm_option(VTKm_NO_DEPRECATED_VIRTUAL "Do not compile support of deprecated virtual methods" ON)
# In Python wheels, having SONAME suffixes just ends up duplicating files.
# Allow VTK to turn off these symlinks for its wheel distribution.
vtkm_option(VTKm_SKIP_LIBRARY_VERSIONS "Skip versioning VTK-m libraries" OFF)
@ -188,10 +190,29 @@ mark_as_advanced(
VTKm_HIDE_PRIVATE_SYMBOLS
VTKm_ENABLE_DEVELOPER_FLAGS
VTKm_NO_INSTALL_README_LICENSE
VTKm_NO_DEPRECATED_VIRTUAL
VTKm_SKIP_LIBRARY_VERSIONS
)
#-----------------------------------------------------------------------------
# Force building of modules where specified by user-facing options.
include(VTKmModules)
vtkm_module_force_group(Core VALUE "YES" REASON "Core modules always built")
vtkm_module_force_group(Rendering ENABLE_OPTION VTKm_ENABLE_RENDERING)
vtkm_module_force_group(Logging ENABLE_OPTION VTKm_ENABLE_LOGGING)
vtkm_module_force_group(Testing
ENABLE_OPTION VTKm_ENABLE_TESTING_LIBRARY
ENABLE_VALUE "WANT"
DISABLE_VALUE "DONT_WANT"
)
vtkm_module_force_group(Benchmarking ENABLE_OPTION VTKm_ENABLE_BENCHMARKS)
# The tutorial requires several common filters. This logic might need to
# become more complicated (or less compliated if we decide to always
# compile these).
if(VTKm_ENABLE_TUTORIALS)
vtkm_module_force_group(FiltersCommon VALUE "YES" REASON "Tutorial needs common filters.")
endif()
#-----------------------------------------------------------------------------
# Setup default build types
@ -262,7 +283,18 @@ check_type_size("long long" VTKm_SIZE_LONG_LONG BUILTIN_TYPES_ONLY)
#-----------------------------------------------------------------------------
# Add subdirectories
add_subdirectory(vtkmstd)
add_subdirectory(vtkm)
#-----------------------------------------------------------------------------
# Process modules
vtkm_modules_scan(
SCAN_DIRECTORIES vtkm benchmarking
PROVIDED_MODULES all_modules
)
vtkm_modules_build(
PROVIDED_MODULES ${all_modules}
WANT_BY_DEFAULT ${VTKm_BUILD_ALL_LIBRARIES}
WANT_BY_DEFAULT_REASON "VTKm_BUILD_ALL_LIBRARIES is `${VTKm_BUILD_ALL_LIBRARIES}`"
)
#-----------------------------------------------------------------------------
# Build documentation
@ -291,6 +323,33 @@ write_basic_package_version_file(
VERSION ${VTKm_VERSION}
COMPATIBILITY ExactVersion )
#-----------------------------------------------------------------------------
# Create makefile/package files for projects not using CMake
set(lib_args)
vtkm_module_get_list(module_list)
list(REVERSE module_list)
foreach(module IN LISTS module_list)
get_target_property(type ${module} TYPE)
if (NOT type MATCHES "LIBRARY" OR type STREQUAL "INTERFACE_LIBRARY")
continue()
endif()
get_target_property(library ${module} OUTPUT_NAME)
if (NOT library)
continue()
endif()
set(lib_args "${lib_args} \\
-l${library}")
endforeach()
if (TARGET vtkmdiympi)
set(lib_args "${lib_args} \\
-lvtkmdiympi")
endif()
if (TARGET vtkmdiympi_nompi)
set(lib_args "${lib_args} \\
-lvtkmdiympi_nompi")
endif()
configure_file(${VTKm_SOURCE_DIR}/config/vtkm_config.mk.in
${VTKm_BINARY_DIR}/config/vtkm_config.mk @ONLY)
install(FILES ${VTKm_BINARY_DIR}/config/vtkm_config.mk
@ -353,9 +412,11 @@ if(NOT VTKm_INSTALL_ONLY_LIBRARIES)
# Create and install exports for external projects
export(EXPORT ${VTKm_EXPORT_NAME}
NAMESPACE vtkm::
FILE ${VTKm_BUILD_CMAKE_BASE_DIR}/${VTKm_INSTALL_CONFIG_DIR}/VTKmTargets.cmake
)
install(EXPORT ${VTKm_EXPORT_NAME}
NAMESPACE vtkm::
DESTINATION ${VTKm_INSTALL_CONFIG_DIR}
FILE VTKmTargets.cmake
)
@ -376,12 +437,6 @@ if (VTKm_ENABLE_CPACK)
include(CPack)
endif ()
#-----------------------------------------------------------------------------
#add the benchmarking folder
if(VTKm_ENABLE_BENCHMARKS)
add_subdirectory(benchmarking)
endif()
#-----------------------------------------------------------------------------
if (VTKm_ENABLE_TESTING)

@ -53,3 +53,11 @@ list(APPEND CTEST_CUSTOM_WARNING_MATCH
# Let CUDA compiler warn us about recursive functions we should avoid.
".*nvlink warning.*"
)
## Sometimes a few test hangs in HIP disable repeat until_pass for HIP builds
set(CTEST_REPEAT_UNTIL_PASS 3)
if (NOT x"@CMAKE_HIP_COMPILER@"x STREQUAL xx)
set(CTEST_REPEAT_UNTIL_PASS 0)
endif()
set(VTKm_ENABLE_PERFORMANCE_TESTING "@VTKm_ENABLE_PERFORMANCE_TESTING@")

@ -132,10 +132,10 @@ and then build. Here are some example *nix commands for the process
(individual commands may vary).
```sh
$ tar xvzf ~/Downloads/vtk-m-v1.9.0.tar.gz
$ tar xvzf ~/Downloads/vtk-m-v2.0.0.tar.gz
$ mkdir vtkm-build
$ cd vtkm-build
$ cmake-gui ../vtk-m-v1.9.0
$ cmake-gui ../vtk-m-v2.0.0
$ cmake --build -j . # Runs make (or other build program)
```
@ -246,9 +246,9 @@ project(VTKmDemo CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
if(TARGET vtkm_rendering)
if(TARGET vtkm::rendering)
add_executable(Demo Demo.cxx)
target_link_libraries(Demo PRIVATE vtkm_filter vtkm_rendering vtkm_source)
target_link_libraries(Demo PRIVATE vtkm::filter vtkm::rendering vtkm::source)
endif()
```

@ -55,6 +55,15 @@ def create_parser():
default=True,
action="store_false",
help="The tool can do a two-tailed Mann-Whitney U test with the null hypothesis that it is equally likely that a randomly selected value from one sample will be less than or greater than a randomly selected value from a second sample.\nWARNING: requires **LARGE** (no less than {}) number of repetitions to be meaningful!\nThe test is being done by default, if at least {} repetitions were done.\nThis option can disable the U Test.".format(report.UTEST_OPTIMAL_REPETITIONS, report.UTEST_MIN_REPETITIONS))
utest.add_argument(
'--dist',
dest='utest_dist',
choices=['mannwhitney', 'normal', 't'],
default='mannwhitney',
type=str,
help="Utest probabilistic distribution to use")
alpha_default = 0.05
utest.add_argument(
"--alpha",
@ -239,7 +248,7 @@ def main():
# Diff and output
output_lines = gbench.report.generate_difference_report(
json1, json2, args.display_aggregates_only,
args.utest, args.utest_alpha)
args.utest, args.utest_dist, args.utest_alpha, sys.stdout.isatty())
print(description)
for ln in output_lines:
print(ln)

@ -6,7 +6,11 @@ import re
import copy
from scipy.stats import mannwhitneyu
from scipy.stats import norm
from scipy.stats import t
from statistics import mean
from statistics import stdev
class BenchmarkColor(object):
def __init__(self, name, code):
@ -38,6 +42,7 @@ BC_UNDERLINE = BenchmarkColor('UNDERLINE', '\033[4m')
UTEST_MIN_REPETITIONS = 2
UTEST_OPTIMAL_REPETITIONS = 9 # Lowest reasonable number, More is better.
UTEST_COL_NAME = "_pvalue"
UTEST_NORM_MIN_STDEV = 0.05
def color_format(use_color, fmt_str, *args, **kwargs):
@ -154,7 +159,7 @@ def extract_field(partition, field_name):
rhs = [x[field_name] for x in partition[1]]
return [lhs, rhs]
def calc_utest(timings_cpu, timings_time):
def calc_utest(utest_dist, timings_cpu, timings_time):
min_rep_cnt = min(len(timings_time[0]),
len(timings_time[1]),
len(timings_cpu[0]),
@ -164,20 +169,30 @@ def calc_utest(timings_cpu, timings_time):
if min_rep_cnt < UTEST_MIN_REPETITIONS:
return False, None, None
time_pvalue = mannwhitneyu(
timings_time[0], timings_time[1], alternative='two-sided').pvalue
cpu_pvalue = mannwhitneyu(
timings_cpu[0], timings_cpu[1], alternative='two-sided').pvalue
pvalue_fn = str
if utest_dist == "normal":
pvalue_fn = lambda x : norm.sf(mean(x[1]), mean(x[0]),
max(stdev(x[0]), mean(x[0])*UTEST_NORM_MIN_STDEV))
elif utest_dist == "t":
pvalue_fn = lambda x : t.sf(mean(x[1]), len(x[0]) - 1, mean(x[0]),
max(stdev(x[0]), mean(x[0])*UTEST_NORM_MIN_STDEV))
elif utest_dist == "mannwhitney":
pvalue_fn = lambda x : mannwhitneyu(x[0], x[1], alternative='two-sided').pvalue
else:
return False, None, None
time_pvalue = pvalue_fn(timings_time)
cpu_pvalue = pvalue_fn(timings_cpu)
return (min_rep_cnt >= UTEST_OPTIMAL_REPETITIONS), cpu_pvalue, time_pvalue
def print_utest(partition, utest_alpha, first_col_width, use_color=True):
def print_utest(partition, utest_dist, utest_alpha, first_col_width, use_color=True):
def get_utest_color(pval):
return BC_FAIL if pval >= utest_alpha else BC_OKGREEN
timings_time = extract_field(partition, 'real_time')
timings_cpu = extract_field(partition, 'cpu_time')
have_optimal_repetitions, cpu_pvalue, time_pvalue = calc_utest(timings_cpu, timings_time)
have_optimal_repetitions, cpu_pvalue, time_pvalue = calc_utest(utest_dist, timings_cpu, timings_time)
# Check if we failed miserably with minimum required repetitions for utest
if not have_optimal_repetitions and cpu_pvalue is None and time_pvalue is None:
@ -212,6 +227,7 @@ def generate_difference_report(
json2,
display_aggregates_only=False,
utest=False,
utest_dist="mannwhitney",
utest_alpha=0.05,
use_color=True):
"""
@ -279,6 +295,7 @@ def generate_difference_report(
# After processing the whole partition, if requested, do the U test.
if utest:
output_strs += print_utest(partition,
utest_dist=utest_dist,
utest_alpha=utest_alpha,
first_col_width=first_col_width,
use_color=use_color)

@ -19,10 +19,6 @@
#include <vtkm/cont/Invoker.h>
#include <vtkm/cont/Timer.h>
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
#include <vtkm/cont/ArrayHandleVirtual.h>
#endif
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/WorkletMapTopology.h>
@ -225,21 +221,30 @@ public:
using ExecutionSignature = void(_1, _2, _3, _4);
using InputDomain = _1;
template <typename WeightType, typename T, typename S>
template <typename WeightType, typename PortalType, typename U>
VTKM_EXEC void operator()(const vtkm::Id2& low_high,
const WeightType& weight,
const vtkm::exec::ExecutionWholeArrayConst<T, S>& inPortal,
T& result) const
const PortalType& inPortal,
U& result) const
{
using T = typename PortalType::ValueType;
this->DoIt(low_high, weight, inPortal, result, typename std::is_same<T, U>::type{});
}
template <typename WeightType, typename PortalType>
VTKM_EXEC void DoIt(const vtkm::Id2& low_high,
const WeightType& weight,
const PortalType& inPortal,
typename PortalType::ValueType& result,
std::true_type) const
{
//fetch the low / high values from inPortal
result = vtkm::Lerp(inPortal.Get(low_high[0]), inPortal.Get(low_high[1]), weight);
}
template <typename WeightType, typename T, typename S, typename U>
VTKM_EXEC void operator()(const vtkm::Id2&,
const WeightType&,
const vtkm::exec::ExecutionWholeArrayConst<T, S>&,
U&) const
template <typename WeightType, typename PortalType, typename U>
VTKM_EXEC void DoIt(const vtkm::Id2&, const WeightType&, const PortalType&, U&, std::false_type)
const
{
//the inPortal and result need to be the same type so this version only
//exists to generate code when using dynamic arrays
@ -420,20 +425,6 @@ void BenchBlackScholesStatic(::benchmark::State& state)
};
VTKM_BENCHMARK_TEMPLATES(BenchBlackScholesStatic, ValueTypes);
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
template <typename ValueType>
void BenchBlackScholesDynamic(::benchmark::State& state)
{
VTKM_DEPRECATED_SUPPRESS_BEGIN
BenchBlackScholesImpl<ValueType> impl{ state };
impl.Run(vtkm::cont::make_ArrayHandleVirtual(impl.StockPrice),
vtkm::cont::make_ArrayHandleVirtual(impl.OptionStrike),
vtkm::cont::make_ArrayHandleVirtual(impl.OptionYears));
VTKM_DEPRECATED_SUPPRESS_END
};
VTKM_BENCHMARK_TEMPLATES(BenchBlackScholesDynamic, ValueTypes);
#endif //VTKM_NO_DEPRECATED_VIRTUAL
template <typename ValueType>
void BenchBlackScholesMultiplexer0(::benchmark::State& state)
{
@ -528,20 +519,6 @@ void BenchMathStatic(::benchmark::State& state)
};
VTKM_BENCHMARK_TEMPLATES(BenchMathStatic, ValueTypes);
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
template <typename ValueType>
void BenchMathDynamic(::benchmark::State& state)
{
VTKM_DEPRECATED_SUPPRESS_BEGIN
BenchMathImpl<ValueType> impl{ state };
impl.Run(vtkm::cont::make_ArrayHandleVirtual(impl.InputHandle),
vtkm::cont::make_ArrayHandleVirtual(impl.TempHandle1),
vtkm::cont::make_ArrayHandleVirtual(impl.TempHandle2));
VTKM_DEPRECATED_SUPPRESS_END
};
VTKM_BENCHMARK_TEMPLATES(BenchMathDynamic, ValueTypes);
#endif //VTKM_NO_DEPRECATED_VIRTUAL
template <typename ValueType>
void BenchMathMultiplexer0(::benchmark::State& state)
{
@ -631,18 +608,6 @@ void BenchFusedMathStatic(::benchmark::State& state)
};
VTKM_BENCHMARK_TEMPLATES(BenchFusedMathStatic, ValueTypes);
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
template <typename ValueType>
void BenchFusedMathDynamic(::benchmark::State& state)
{
VTKM_DEPRECATED_SUPPRESS_BEGIN
BenchFusedMathImpl<ValueType> impl{ state };
impl.Run(vtkm::cont::make_ArrayHandleVirtual(impl.InputHandle));
VTKM_DEPRECATED_SUPPRESS_END
};
VTKM_BENCHMARK_TEMPLATES(BenchFusedMathDynamic, ValueTypes);
#endif //VTKM_NO_DEPRECATED_VIRTUAL
template <typename ValueType>
void BenchFusedMathMultiplexer0(::benchmark::State& state)
{
@ -755,20 +720,6 @@ void BenchEdgeInterpStatic(::benchmark::State& state)
};
VTKM_BENCHMARK_TEMPLATES(BenchEdgeInterpStatic, InterpValueTypes);
#ifndef VTKM_NO_DEPRECATED_VIRTUAL
template <typename ValueType>
void BenchEdgeInterpDynamic(::benchmark::State& state)
{
VTKM_DEPRECATED_SUPPRESS_BEGIN
BenchEdgeInterpImpl<ValueType> impl{ state };
impl.Run(vtkm::cont::make_ArrayHandleVirtual(impl.EdgePairHandle),
vtkm::cont::make_ArrayHandleVirtual(impl.WeightHandle),
vtkm::cont::make_ArrayHandleVirtual(impl.FieldHandle));
VTKM_DEPRECATED_SUPPRESS_END
};
VTKM_BENCHMARK_TEMPLATES(BenchEdgeInterpDynamic, InterpValueTypes);
#endif //VTKM_NO_DEPRECATED_VIRTUAL
struct ImplicitFunctionBenchData
{
vtkm::cont::ArrayHandle<vtkm::Vec3f> Points;
@ -834,37 +785,6 @@ void BenchImplicitFunction(::benchmark::State& state)
}
VTKM_BENCHMARK(BenchImplicitFunction);
void BenchVirtualImplicitFunction(::benchmark::State& state)
{
using EvalWorklet = EvaluateImplicitFunction;
const vtkm::cont::DeviceAdapterId device = Config.Device;
auto data = MakeImplicitFunctionBenchData();
{
std::ostringstream desc;
desc << data.Points.GetNumberOfValues() << " points";
state.SetLabel(desc.str());
}
EvalWorklet eval;
vtkm::cont::Timer timer{ device };
vtkm::cont::Invoker invoker{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
invoker(eval, data.Points, data.Result, data.Sphere1);
timer.Stop();
state.SetIterationTime(timer.GetElapsedTime());
}
}
VTKM_BENCHMARK(BenchVirtualImplicitFunction);
void Bench2ImplicitFunctions(::benchmark::State& state)
{
using EvalWorklet = Evaluate2ImplicitFunctions;

@ -23,6 +23,7 @@
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/ErrorInternal.h>
#include <vtkm/cont/Logging.h>
#include <vtkm/cont/PartitionedDataSet.h>
#include <vtkm/cont/RuntimeDeviceTracker.h>
#include <vtkm/cont/Timer.h>
@ -96,6 +97,17 @@ vtkm::cont::DataSet& GetUnstructuredInputDataSet()
return *UnstructuredInputDataSet;
}
vtkm::cont::PartitionedDataSet* InputPartitionedData;
vtkm::cont::PartitionedDataSet* UnstructuredInputPartitionedData;
vtkm::cont::PartitionedDataSet& GetInputPartitionedData()
{
return *InputPartitionedData;
}
vtkm::cont::PartitionedDataSet& GetUnstructuredInputPartitionedData()
{
return *UnstructuredInputPartitionedData;
}
// The point scalars to use:
static std::string PointScalarsName;
// The cell scalars to use:
@ -120,7 +132,8 @@ enum GradOpts : int
Vorticity = 1 << 3,
QCriterion = 1 << 4,
RowOrdering = 1 << 5,
ScalarInput = 1 << 6
ScalarInput = 1 << 6,
PartitionedInput = 1 << 7
};
void BenchGradient(::benchmark::State& state, int options)
@ -162,11 +175,21 @@ void BenchGradient(::benchmark::State& state, int options)
vtkm::cont::Timer timer{ device };
//vtkm::cont::DataSet input = static_cast<bool>(options & Structured) ? GetInputDataSet() : GetUnstructuredInputDataSet();
vtkm::cont::PartitionedDataSet input;
if (options & PartitionedInput)
{
input = GetInputPartitionedData();
}
else
{
input = GetInputDataSet();
}
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(GetInputDataSet());
auto result = filter.Execute(input);
::benchmark::DoNotOptimize(result);
timer.Stop();
@ -179,7 +202,9 @@ void BenchGradient(::benchmark::State& state, int options)
VTKM_BENCHMARK(BenchGradient##Name)
VTKM_PRIVATE_GRADIENT_BENCHMARK(Scalar, Gradient | ScalarInput);
VTKM_PRIVATE_GRADIENT_BENCHMARK(ScalarPartitionedData, Gradient | ScalarInput | PartitionedInput);
VTKM_PRIVATE_GRADIENT_BENCHMARK(Vector, Gradient);
VTKM_PRIVATE_GRADIENT_BENCHMARK(VectorPartitionedData, Gradient | PartitionedInput);
VTKM_PRIVATE_GRADIENT_BENCHMARK(VectorRow, Gradient | RowOrdering);
VTKM_PRIVATE_GRADIENT_BENCHMARK(Point, PointGradient);
VTKM_PRIVATE_GRADIENT_BENCHMARK(Divergence, Divergence);
@ -190,7 +215,7 @@ VTKM_PRIVATE_GRADIENT_BENCHMARK(All,
#undef VTKM_PRIVATE_GRADIENT_BENCHMARK
void BenchThreshold(::benchmark::State& state)
void BenchThreshold(::benchmark::State& state, bool partitionedInput)
{
const vtkm::cont::DeviceAdapterId device = Config.Device;
@ -210,24 +235,33 @@ void BenchThreshold(::benchmark::State& state)
filter.SetLowerThreshold(mid - quarter);
filter.SetUpperThreshold(mid + quarter);
auto input = partitionedInput ? GetInputPartitionedData() : GetInputDataSet();
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(GetInputDataSet());
auto result = filter.Execute(input);
::benchmark::DoNotOptimize(result);
timer.Stop();
state.SetIterationTime(timer.GetElapsedTime());
}
}
VTKM_BENCHMARK(BenchThreshold);
#define VTKM_PRIVATE_THRESHOLD_BENCHMARK(Name, Opts) \
void BenchThreshold##Name(::benchmark::State& state) { BenchThreshold(state, Opts); } \
VTKM_BENCHMARK(BenchThreshold##Name)
VTKM_PRIVATE_THRESHOLD_BENCHMARK(BenchThreshold, false);
VTKM_PRIVATE_THRESHOLD_BENCHMARK(BenchThresholdPartitioned, true);
void BenchThresholdPoints(::benchmark::State& state)
{
const vtkm::cont::DeviceAdapterId device = Config.Device;
const bool compactPoints = static_cast<bool>(state.range(0));
const bool partitionedInput = static_cast<bool>(state.range(1));
// Lookup the point scalar range
const auto range = []() -> vtkm::Range {
@ -246,19 +280,33 @@ void BenchThresholdPoints(::benchmark::State& state)
filter.SetUpperThreshold(mid + quarter);
filter.SetCompactPoints(compactPoints);
vtkm::cont::PartitionedDataSet input;
input = partitionedInput ? GetInputPartitionedData() : GetInputDataSet();
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(GetInputDataSet());
auto result = filter.Execute(input);
::benchmark::DoNotOptimize(result);
timer.Stop();
state.SetIterationTime(timer.GetElapsedTime());
}
}
VTKM_BENCHMARK_OPTS(BenchThresholdPoints, ->ArgName("CompactPts")->DenseRange(0, 1));
void BenchThresholdPointsGenerator(::benchmark::internal::Benchmark* bm)
{
bm->ArgNames({ "CompactPts", "PartitionedInput" });
bm->Args({ 0, 0 });
bm->Args({ 1, 0 });
bm->Args({ 0, 1 });
bm->Args({ 1, 1 });
}
VTKM_BENCHMARK_APPLY(BenchThresholdPoints, BenchThresholdPointsGenerator);
void BenchCellAverage(::benchmark::State& state)
{
@ -284,68 +332,79 @@ VTKM_BENCHMARK(BenchCellAverage);
void BenchPointAverage(::benchmark::State& state)
{
const vtkm::cont::DeviceAdapterId device = Config.Device;
const bool isPartitioned = static_cast<bool>(state.range(0));
vtkm::filter::field_conversion::PointAverage filter;
filter.SetActiveField(CellScalarsName, vtkm::cont::Field::Association::Cells);
vtkm::cont::PartitionedDataSet input;
input = isPartitioned ? GetInputPartitionedData() : GetInputDataSet();
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(GetInputDataSet());
auto result = filter.Execute(input);
::benchmark::DoNotOptimize(result);
timer.Stop();
state.SetIterationTime(timer.GetElapsedTime());
}
}
VTKM_BENCHMARK(BenchPointAverage);
VTKM_BENCHMARK_OPTS(BenchPointAverage, ->ArgName("PartitionedInput")->DenseRange(0, 1));
void BenchWarpScalar(::benchmark::State& state)
{
const vtkm::cont::DeviceAdapterId device = Config.Device;
const bool isPartitioned = static_cast<bool>(state.range(0));
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);
vtkm::cont::PartitionedDataSet input;
input = isPartitioned ? GetInputPartitionedData() : GetInputDataSet();
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(GetInputDataSet());
auto result = filter.Execute(input);
::benchmark::DoNotOptimize(result);
timer.Stop();
state.SetIterationTime(timer.GetElapsedTime());
}
}
VTKM_BENCHMARK(BenchWarpScalar);
VTKM_BENCHMARK_OPTS(BenchWarpScalar, ->ArgName("PartitionedInput")->DenseRange(0, 1));
void BenchWarpVector(::benchmark::State& state)
{
const vtkm::cont::DeviceAdapterId device = Config.Device;
const bool isPartitioned = static_cast<bool>(state.range(0));
vtkm::filter::field_transform::WarpVector filter{ 2. };
filter.SetUseCoordinateSystemAsField(true);
filter.SetVectorField(PointVectorsName, vtkm::cont::Field::Association::Points);
vtkm::cont::PartitionedDataSet input;
input = isPartitioned ? GetInputPartitionedData() : GetInputDataSet();
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(GetInputDataSet());
auto result = filter.Execute(input);
::benchmark::DoNotOptimize(result);
timer.Stop();
state.SetIterationTime(timer.GetElapsedTime());
}
}
VTKM_BENCHMARK(BenchWarpVector);
VTKM_BENCHMARK_OPTS(BenchWarpVector, ->ArgName("PartitionedInput")->DenseRange(0, 1));
void BenchContour(::benchmark::State& state)
{
@ -356,6 +415,7 @@ void BenchContour(::benchmark::State& state)
const bool mergePoints = static_cast<bool>(state.range(2));
const bool normals = static_cast<bool>(state.range(3));
const bool fastNormals = static_cast<bool>(state.range(4));
const bool isPartitioned = static_cast<bool>(state.range(5));
vtkm::filter::contour::Contour filter;
filter.SetActiveField(PointScalarsName, vtkm::cont::Field::Association::Points);
@ -383,7 +443,15 @@ void BenchContour(::benchmark::State& state)
vtkm::cont::Timer timer{ device };
vtkm::cont::DataSet input = isStructured ? GetInputDataSet() : GetUnstructuredInputDataSet();
vtkm::cont::PartitionedDataSet input;
if (isPartitioned)
{
input = isStructured ? GetInputPartitionedData() : GetUnstructuredInputPartitionedData();
}
else
{
input = isStructured ? GetInputDataSet() : GetUnstructuredInputDataSet();
}
for (auto _ : state)
{
@ -399,17 +467,31 @@ void BenchContour(::benchmark::State& state)
void BenchContourGenerator(::benchmark::internal::Benchmark* bm)
{
bm->ArgNames({ "IsStructuredDataSet", "NIsoVals", "MergePts", "GenNormals", "FastNormals" });
bm->ArgNames({ "IsStructuredDataSet",
"NIsoVals",
"MergePts",
"GenNormals",
"FastNormals",
"MultiPartitioned" });
auto helper = [&](const vtkm::Id numIsoVals) {
bm->Args({ 0, numIsoVals, 0, 0, 0 });
bm->Args({ 0, numIsoVals, 1, 0, 0 });
bm->Args({ 0, numIsoVals, 0, 1, 0 });
bm->Args({ 0, numIsoVals, 0, 1, 1 });
bm->Args({ 1, numIsoVals, 0, 0, 0 });
bm->Args({ 1, numIsoVals, 1, 0, 0 });
bm->Args({ 1, numIsoVals, 0, 1, 0 });
bm->Args({ 1, numIsoVals, 0, 1, 1 });
bm->Args({ 0, numIsoVals, 0, 0, 0, 0 });
bm->Args({ 0, numIsoVals, 1, 0, 0, 0 });
bm->Args({ 0, numIsoVals, 0, 1, 0, 0 });
bm->Args({ 0, numIsoVals, 0, 1, 1, 0 });
bm->Args({ 1, numIsoVals, 0, 0, 0, 0 });
bm->Args({ 1, numIsoVals, 1, 0, 0, 0 });
bm->Args({ 1, numIsoVals, 0, 1, 0, 0 });
bm->Args({ 1, numIsoVals, 0, 1, 1, 0 });
bm->Args({ 0, numIsoVals, 0, 0, 0, 1 });
bm->Args({ 0, numIsoVals, 1, 0, 0, 1 });
bm->Args({ 0, numIsoVals, 0, 1, 0, 1 });
bm->Args({ 0, numIsoVals, 0, 1, 1, 1 });
bm->Args({ 1, numIsoVals, 0, 0, 0, 1 });
bm->Args({ 1, numIsoVals, 1, 0, 0, 1 });
bm->Args({ 1, numIsoVals, 0, 1, 0, 1 });
bm->Args({ 1, numIsoVals, 0, 1, 1, 1 });
};
helper(1);
@ -417,34 +499,48 @@ void BenchContourGenerator(::benchmark::internal::Benchmark* bm)
helper(12);
}
// :TODO: Disabled until SIGSEGV in Countour when passings field is resolved
VTKM_BENCHMARK_APPLY(BenchContour, BenchContourGenerator);
void BenchExternalFaces(::benchmark::State& state)
{
const vtkm::cont::DeviceAdapterId device = Config.Device;
const bool compactPoints = static_cast<bool>(state.range(0));
const bool isPartitioned = false; //static_cast<bool>(state.range(1));
vtkm::filter::entity_extraction::ExternalFaces filter;
filter.SetCompactPoints(compactPoints);
vtkm::cont::PartitionedDataSet input;
input = isPartitioned ? GetInputPartitionedData() : GetInputDataSet();
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(GetInputDataSet());
auto result = filter.Execute(input);
::benchmark::DoNotOptimize(result);
timer.Stop();
state.SetIterationTime(timer.GetElapsedTime());
}
}
VTKM_BENCHMARK_OPTS(BenchExternalFaces, ->ArgName("Compact")->DenseRange(0, 1));
void BenchExternalFacesGenerator(::benchmark::internal::Benchmark* bm)
{
bm->ArgNames({ "Compact", "PartitionedInput" });
bm->Args({ 0, 0 });
bm->Args({ 1, 0 });
bm->Args({ 0, 1 });
bm->Args({ 1, 1 });
}
VTKM_BENCHMARK_APPLY(BenchExternalFaces, BenchExternalFacesGenerator);
void BenchTetrahedralize(::benchmark::State& state)
{
const vtkm::cont::DeviceAdapterId device = Config.Device;
const bool isPartitioned = static_cast<bool>(state.range(0));
// This filter only supports structured datasets:
if (FileAsInput && !InputIsStructured())
@ -453,20 +549,23 @@ void BenchTetrahedralize(::benchmark::State& state)
}
vtkm::filter::geometry_refinement::Tetrahedralize filter;
vtkm::cont::PartitionedDataSet input;
input = isPartitioned ? GetInputPartitionedData() : GetInputDataSet();
vtkm::cont::Timer timer{ device };
for (auto _ : state)
{
(void)_;
timer.Start();
auto result = filter.Execute(GetInputDataSet());
auto result = filter.Execute(input);
::benchmark::DoNotOptimize(result);
timer.Stop();
state.SetIterationTime(timer.GetElapsedTime());
}
}
VTKM_BENCHMARK(BenchTetrahedralize);
VTKM_BENCHMARK_OPTS(BenchTetrahedralize, ->ArgName("PartitionedInput")->DenseRange(0, 1));
void BenchVertexClustering(::benchmark::State& state)
{
@ -803,6 +902,7 @@ enum optionIndex
CELL_SCALARS,
POINT_VECTORS,
WAVELET_DIM,
NUM_PARTITIONS,
TETRA
};
@ -810,6 +910,7 @@ void InitDataSet(int& argc, char** argv)
{
std::string filename;
vtkm::Id waveletDim = 256;
vtkm::Id numPartitions = 1;
bool tetra = false;
namespace option = vtkm::cont::internal::option;
@ -854,6 +955,12 @@ void InitDataSet(int& argc, char** argv)
Arg::Number,
" --wavelet-dim <N> \tThe size in each dimension of the wavelet grid "
"(if generated)." });
usage.push_back({ NUM_PARTITIONS,
0,
"",
"num-partitions",
Arg::Number,
" --num-partitions <N> \tThe number of partitions to create" });
usage.push_back({ TETRA,
0,
"",
@ -903,6 +1010,12 @@ void InitDataSet(int& argc, char** argv)
parse >> waveletDim;
}
if (options[NUM_PARTITIONS])
{
std::istringstream parse(options[NUM_PARTITIONS].arg);
parse >> numPartitions;
}
tetra = (options[TETRA] != nullptr);
// Now go back through the arg list and remove anything that is not in the list of
@ -992,6 +1105,19 @@ void InitDataSet(int& argc, char** argv)
GetInputDataSet() = GetUnstructuredInputDataSet();
}
//Create partitioned data.
if (numPartitions > 0)
{
std::cerr << "[InitDataSet] Creating " << numPartitions << " partitions." << std::endl;
InputPartitionedData = new vtkm::cont::PartitionedDataSet;
UnstructuredInputPartitionedData = new vtkm::cont::PartitionedDataSet;
for (vtkm::Id i = 0; i < numPartitions; i++)
{
GetInputPartitionedData().AppendPartition(GetInputDataSet());
GetUnstructuredInputPartitionedData().AppendPartition(GetUnstructuredInputDataSet());
}
}
inputGenTimer.Stop();
std::cerr << "[InitDataSet] DataSet initialization took " << inputGenTimer.GetElapsedTime()
@ -1027,4 +1153,6 @@ int main(int argc, char* argv[])
VTKM_EXECUTE_BENCHMARKS_PREAMBLE(argc, args.data(), dataSetSummary);
delete InputDataSet;
delete UnstructuredInputDataSet;
delete InputPartitionedData;
delete UnstructuredInputPartitionedData;
}

@ -118,7 +118,9 @@ void BuildInputDataSet(uint32_t cycle, bool isStructured, bool isMultiBlock, vtk
PointVectorsName = "perlinnoisegrad";
// Generate uniform dataset(s)
const vtkm::Id3 dims{ dim, dim, dim };
vtkm::source::PerlinNoise noise;
noise.SetPointDimensions({ dim, dim, dim });
noise.SetSeed(static_cast<vtkm::IdComponent>(cycle));
if (isMultiBlock)
{
for (auto i = 0; i < 2; ++i)
@ -127,12 +129,9 @@ void BuildInputDataSet(uint32_t cycle, bool isStructured, bool isMultiBlock, vtk
{
for (auto k = 0; k < 2; ++k)
{
const vtkm::Vec3f origin{ static_cast<vtkm::FloatDefault>(i),
static_cast<vtkm::FloatDefault>(j),
static_cast<vtkm::FloatDefault>(k) };
const vtkm::source::PerlinNoise noise{ dims,
origin,
static_cast<vtkm::IdComponent>(cycle) };
noise.SetOrigin({ static_cast<vtkm::FloatDefault>(i),
static_cast<vtkm::FloatDefault>(j),
static_cast<vtkm::FloatDefault>(k) });
const auto dataset = noise.Execute();
partitionedInputDataSet.AppendPartition(dataset);
}
@ -141,7 +140,6 @@ void BuildInputDataSet(uint32_t cycle, bool isStructured, bool isMultiBlock, vtk
}
else
{
const vtkm::source::PerlinNoise noise{ dims, static_cast<vtkm::IdComponent>(cycle) };
inputDataSet = noise.Execute();
}
@ -986,6 +984,34 @@ void ParseBenchmarkOptions(int& argc, char** argv)
std::cerr << "Using image size = " << ImageSize << "x" << ImageSize << std::endl;
}
// Adding a const char* or std::string to a vector of char* is harder than it sounds.
void AddArg(int& argc, std::vector<char*>& args, const std::string newArg)
{
// This object will be deleted when the program exits
static std::vector<std::vector<char>> stringPool;
// Add a new vector of chars to the back of stringPool
stringPool.emplace_back();
std::vector<char>& newArgData = stringPool.back();
// Copy the string to the std::vector.
// Yes, something like malloc or strdup would be easier. But that would technically create
// a memory leak that could be reported by a memory analyzer. By copying this way, the
// memory will be deleted on program exit and no leak will be reported.
newArgData.resize(newArg.length() + 1);
std::copy(newArg.begin(), newArg.end(), newArgData.begin());
newArgData.back() = '\0'; // Don't forget the terminating null character.
// Add the argument to the list.
if (args.size() <= static_cast<std::size_t>(argc))
{
args.resize(static_cast<std::size_t>(argc + 1));
}
args[static_cast<std::size_t>(argc)] = newArgData.data();
++argc;
}
} // end anon namespace
int main(int argc, char* argv[])
@ -1023,10 +1049,14 @@ int main(int argc, char* argv[])
if (benchmark_repetitions)
{
if (!benchmark_min_time)
args[argc++] = strdup("--benchmark_min_time=0.00000001");
{
AddArg(argc, args, "--benchmark_min_time=0.00000001");
}
if (!benchmark_report_aggregates_only)
args[argc++] = strdup("--benchmark_report_aggregates_only=true");
{
AddArg(argc, args, "--benchmark_report_aggregates_only=true");
}
}
VTKM_EXECUTE_BENCHMARKS(argc, args.data());

@ -39,9 +39,8 @@ vtkm::cont::InitializeResult Config;
void BenchRayTracing(::benchmark::State& state)
{
const vtkm::Id3 dims(128, 128, 128);
vtkm::source::Tangle maker(dims);
vtkm::source::Tangle maker;
maker.SetPointDimensions({ 128, 128, 128 });
vtkm::cont::DataSet dataset = maker.Execute();
vtkm::cont::CoordinateSystem coords = dataset.GetCoordinateSystem();

@ -8,23 +8,25 @@
## PURPOSE. See the above copyright notice for more information.
##============================================================================
if(NOT vtkm_module_current STREQUAL "benchmarking")
message(FATAL_ERROR "Benchmarking CMakeLists.txt not loaded by benchmarking module.")
endif()
#Find Google Benchmark.Note that benchmark_DIR must be pointed at an
#installation, not a build directory.
find_package(benchmark REQUIRED)
function(add_benchmark)
set(options)
set(oneValueArgs NAME FILE)
set(multiValueArgs LIBS)
cmake_parse_arguments(VTKm_AB
"${options}" "${oneValueArgs}" "${multiValueArgs}"
${ARGN}
)
set(exe_name ${VTKm_AB_NAME})
add_executable(${exe_name} ${VTKm_AB_FILE})
target_link_libraries(${exe_name} PRIVATE ${VTKm_AB_LIBS})
function(add_benchmark exe_name)
add_executable(${exe_name} ${exe_name}.cxx)
target_link_libraries(${exe_name} PRIVATE benchmark::benchmark)
vtkm_module_get_property(depends benchmarking DEPENDS)
target_link_libraries(${exe_name} PRIVATE ${depends})
vtkm_module_get_property(optional_depends benchmarking OPTIONAL_DEPENDS)
foreach(dep IN LISTS optional_depends)
if(TARGET ${dep})
target_link_libraries(${exe_name} PRIVATE ${dep})
endif()
endforeach()
vtkm_add_drop_unused_function_flags(${exe_name})
vtkm_add_target_information(${exe_name})
@ -34,7 +36,8 @@ function(add_benchmark)
CUDA_VISIBILITY_PRESET "hidden"
)
vtkm_add_target_information(${exe_name} DEVICE_SOURCES ${VTKm_AB_FILE})
# At some point, we might not want to compile benchmarks with device compilers.
vtkm_add_target_information(${exe_name} DEVICE_SOURCES ${exe_name}.cxx)
endfunction()
set(benchmarks
@ -48,18 +51,56 @@ set(benchmarks
BenchmarkTopologyAlgorithms
)
if(TARGET vtkm_rendering)
list(APPEND benchmarks
BenchmarkRayTracing
BenchmarkInSitu
)
endif()
set(VTKm_BENCHS_RANGE_LOWER_BOUNDARY 4096 CACHE STRING "Smallest sample for input size bench for BenchmarkDeviceAdapter")
set(VTKm_BENCHS_RANGE_UPPER_BOUNDARY 134217728 CACHE STRING "Biggest sample for input size bench for BenchmarkDeviceAdapter")
mark_as_advanced(VTKm_BENCHS_RANGE_LOWER_BOUNDARY VTKm_BENCHS_RANGE_UPPER_BOUNDARY)
foreach (benchmark ${benchmarks})
add_benchmark(NAME ${benchmark} FILE ${benchmark}.cxx LIBS vtkm_source vtkm_filter vtkm_io)
add_benchmark(${benchmark})
endforeach ()
target_compile_definitions(BenchmarkDeviceAdapter PUBLIC VTKm_BENCHS_RANGE_LOWER_BOUNDARY=${VTKm_BENCHS_RANGE_LOWER_BOUNDARY})
target_compile_definitions(BenchmarkDeviceAdapter PUBLIC VTKm_BENCHS_RANGE_UPPER_BOUNDARY=${VTKm_BENCHS_RANGE_UPPER_BOUNDARY})
if(TARGET vtkm_rendering)
add_benchmark(NAME BenchmarkRayTracing FILE BenchmarkRayTracing.cxx LIBS vtkm_rendering vtkm_source)
add_benchmark(NAME BenchmarkInSitu FILE BenchmarkInSitu.cxx LIBS vtkm_rendering vtkm_source vtkm_filter vtkm_io)
if(VTKm_ENABLE_PERFORMANCE_TESTING)
include("${VTKm_SOURCE_DIR}/CMake/testing/VTKmPerformanceTest.cmake")
add_benchmark_test(BenchmarkFilters
NAME BenchThreshold
REGEX BenchThreshold
)
add_benchmark_test(BenchmarkFilters
NAME BenchTetrahedralize
REGEX BenchTetrahedralize
)
add_benchmark_test(BenchmarkFilters
NAME BenchContour
REGEX
BenchContour/IsStructuredDataSet:1/NIsoVals:12/MergePts:1/GenNormals:0.*/MultiPartitioned:0
BenchContour/IsStructuredDataSet:1/NIsoVals:12/MergePts:0/GenNormals:1/FastNormals:1.*/MultiPartitioned:0
BenchContour/IsStructuredDataSet:0/NIsoVals:12/MergePts:1/GenNormals:0.*/MultiPartitioned:0
BenchContour/IsStructuredDataSet:0/NIsoVals:12/MergePts:0/GenNormals:1/FastNormals:1.*/MultiPartitioned:0
)
add_benchmark_test(BenchmarkFilters
NAME BenchContourPartitioned
ARGS --wavelet-dim=32 --num-partitions=128
REGEX
BenchContour/IsStructuredDataSet:1/NIsoVals:12/MergePts:1/GenNormals:0.*/MultiPartitioned:1
BenchContour/IsStructuredDataSet:1/NIsoVals:12/MergePts:0/GenNormals:1/FastNormals:1.*/MultiPartitioned:1
BenchContour/IsStructuredDataSet:0/NIsoVals:12/MergePts:1/GenNormals:0.*/MultiPartitioned:1
BenchContour/IsStructuredDataSet:0/NIsoVals:12/MergePts:0/GenNormals:1/FastNormals:1.*/MultiPartitioned:1
)
add_benchmark_test(BenchmarkFilters
NAME BenchVertexClustering
REGEX BenchVertexClustering/NumDivs:256
)
if(TARGET vtkm_rendering)
add_benchmark_test(BenchmarkInSitu REGEX "BenchContour")
endif()
endif()

19
benchmarking/vtkm.module Normal file

@ -0,0 +1,19 @@
NAME
benchmarking
GROUPS
Benchmarking
DEPENDS
vtkm_cont
vtkm_filter_contour
vtkm_filter_entity_extraction
vtkm_filter_field_conversion
vtkm_filter_field_transform
vtkm_filter_flow
vtkm_filter_geometry_refinement
vtkm_filter_mesh_info
vtkm_filter_vector_analysis
vtkm_io
vtkm_source
OPTIONAL_DEPENDS
vtkm_rendering
NO_TESTING

@ -18,14 +18,4 @@ Name: VTKm
Description: The VTKm library
Version: @VTKm_VERSION@
Cflags: -I${includedir}/vtkm-@CMAKE_INSTALL_PREFIX@
Libs: -L${libdir} \
-lvtkm_rendering-@VTKm_VERSION@ \
-lvtkm_filter_contour-@VTKm_VERSION@ \
-lvtkm_filter_gradient-@VTKm_VERSION@ \
-lvtkm_filter_extra-@VTKm_VERSION@ \
-lvtkm_filter_common-@VTKm_VERSION@ \
-lvtkm_worklet-@VTKm_VERSION@ \
-lvtkm_source-@VTKm_VERSION@ \
-lvtkm_io-@VTKm_VERSION@ \
-lvtkm_cont-@VTKm_VERSION@ \
-lvtkmdiympi_nompi
Libs: -L${libdir}@lib_args@

@ -25,14 +25,4 @@ VTKm_ENABLE_EGL_CONTEXT = @VTKm_ENABLE_EGL_CONTEXT@
VTKm_ENABLE_MPI = @VTKm_ENABLE_MPI@
VTKm_INCLUDE_FLAGS = -I $(VTKm_DIR)/include
VTKm_LIB_FLAGS = -L $(VTKm_DIR)/lib \
-lvtkm_rendering-$(VTKM_VERSION) \
-lvtkm_filter_contour-$(VTKM_VERSION) \
-lvtkm_filter_gradient-$(VTKM_VERSION) \
-lvtkm_filter_extra-$(VTKM_VERSION) \
-lvtkm_filter_common-$(VTKM_VERSION) \
-lvtkm_worklet-$(VTKM_VERSION) \
-lvtkm_source-$(VTKM_VERSION) \
-lvtkm_io-$(VTKM_VERSION) \
-lvtkm_cont-$(VTKM_VERSION) \
-lvtkmdiympi_nompi
VTKm_LIB_FLAGS = -L $(VTKm_DIR)/lib@lib_args@

@ -19,6 +19,10 @@ Gitlab CI
4. ECP Continuous Integration
- OLCF Ascent testing machine
5. Automated Performance Regression tests
- Overview
- Details
# Kitware Gitlab CI
GitLab CI/CD allows for software development through continous integration, delivery, and deployment.
@ -308,4 +312,103 @@ GCC8.
For a view of only ascent jobs refer to the following [link][cdash-ascent].
# Automated Performance Regression tests
## Overview
The design of the performance regression test is composed of the following
components:
1. The Kitware Gitlab instance which trigger the benchmark jobs when a git
commit is pushed.
2. Gitlab CI jobs for performing the benchmarks and for generating the
comparison with the historical results.
3. A Git repository that is used for storing the historical results.
4. The Kitware CDASH instance which files, displays the performance report and
inform the developer if a performance regression has occurred.
The performance regression test is performed whenever a git commit is pushed.
The job _performancetest_ which invoke the benchmark suite in a Gitlab runner
job and later compare its results against the historical results, stored in
CDASH, of its most immediate master ancestor. The results of this comparison are
then displayed in a brief report in the form of a comment in its corresponding
Gitlab merge-request.
![perftest_arch](perftest_arch.png)
## Details
### Selection of Benchmarks
While we can possibly run all of the provided benchmarks in the continuous
build track to avoid potential performance and latency issues in the CI, I
have initially limited the benchmark suites to:
- BenchmarkFilters
- BenchmarkInsitu
### Benchmark ctest
We provide a CMake function named `add_benchmark_test` which sets the
performance regression test for the given Google Benchmark suite. It admits one
argument to filter the number of benchmarks to be executed. If ran locally, it
will not upload the results to the online record repository.
### Requirements
- Python3 with the SciPy package
- Benchmark tests will be enabled in a CMAKE build that sets both
`VTKm_ENABLE_BENCHMARKS` and `VTKm_ENABLE_PERFORMANCE_TESTING`
### New Gitlab Runner requirements
- It must have disabled every type of CPU scaling option both at the BIOS and
Kernel level (`cpugovern`).
- It must provide a gitlab runner with a concurrency level 1 to avoid other
jobs being scheduled while the benchmark is being executed.
### How to make sense of the results
Results of both of the benchmark and the comparison against its most recent
commit ancestor can be accessed in the CDASH Notes for the performance
regression build. The CDASH Notes can be accessed by clicking the note-like
miniature image in the build name column.
Performance Regressions test that report a performance failure are reported in
the form of a test failure of the test `PerformanceTest($TestName)Report`. The
results of the comparison can be seen by clicking this failed test.
Performance regression test success is determined by the performance of a null
hypothesis test with the hypothesis that the given tests performs similarly
or better than the baseline test with a confidence level 1-alpha. If a pvalue is
small enough (less than alpha), we reject the null hypothesis and we report that
the current commit introduces a performance regression. By default we use a
t-distribution with an alpha value of 5%. The pvalues can be seen in the
uploaded reports.
The following parameters can be modified by editing the corresponding
environmental variables:
- Alpha value: `VTKm_PERF_ALPHA`
- Minimum number of repetitions for each benchmark: `VTKm_PERF_REPETITIONS`
- Minimum time to spend for each benchmark: `VTKm_PERF_MIN_TIME`
- Statistical distribution to use: `VTKm_PERF_DIST`
Below is an example of this raw output of the comparison of the current commit
against the baseline results:
```
Benchmark Time CPU Time Old Time New CPU Old CPU New
------------------------------------------------------------------------------------------------------------
BenchThreshold/manual_time +0.0043 +0.0036 73 73 92 92
BenchThreshold/manual_time +0.0074 +0.0060 73 73 91 92
BenchThreshold/manual_time -0.0003 -0.0007 73 73 92 92
BenchThreshold/manual_time -0.0019 -0.0018 73 73 92 92
BenchThreshold/manual_time -0.0021 -0.0017 73 73 92 92
BenchThreshold/manual_time +0.0001 +0.0006 73 73 92 92
BenchThreshold/manual_time +0.0033 +0.0031 73 73 92 92
BenchThreshold/manual_time -0.0071 -0.0057 73 73 92 92
BenchThreshold/manual_time -0.0050 -0.0041 73 73 92 92
```
[cdash-ascent]: https://open.cdash.org/index.php?project=VTKM&filtercount=1&showfilters=1&field1=site&compare1=63&value1=ascent

@ -89,7 +89,6 @@ ${cmake_build_dir}/bin/cmake -S ${vtkm_src_dir} -B ${vtkm_build_dir} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF\
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON\
-DVTKm_NO_DEPRECATED_VIRTUAL=ON \
-DVTKm_ENABLE_KOKKOS=ON \
-DVTKm_ENABLE_MPI=OFF\
-DVTKm_ENABLE_RENDERING=ON \

245
docs/Modules.md Normal file

@ -0,0 +1,245 @@
# Specifying modules in the VTK-m build system
The VTK-m build system comes with a module mechanism that allows a library
or other target be optionally compiled based on CMake configuration
variables. Additionally, modules can be optionally compiled based on their
dependencies. That is, a module can be turned on if a module that depends
on it wants to be compiled. Likewise, a module can be turned off if a
module that it depends on cannot be compiled.
## Module configuration
All modules have a "name" that is the same as the target created by the
module (for example, the name of a library). Every module has an associated
(advanced) CMake variable named `VTKm_MODULE_ENABLE_<name>`. For example,
the module that builds the `vtkm_filter_entity_extraction` filter has an
associated CMake variable named
`VTKm_MODULE_ENABLE_vtkm_filter_entity_extraction`. This CMake variable can
be used to control whether the module should be included in the build. It
can be set to one of the following values.
* `YES`: Always create the module. If it is not possible to create the
module, the CMake configuration fails.
* `WANT`: Create the module if possible. If it is possible to create all
modules it depends on, then this module will be created. If this is not
possible, this module will not be created, but this will not cause an
error in the configuration.
* `DONT_WANT`: Create the module only if there is a dependency that
requires it. This is useful for stripping out modules not directly
needed but required for a select list of modules desired.
* `NO`: Never create the module. Any module that depends on this module
will also not be built.
* `DEFAULT`: Does the default behavior. This is typically either `WANT`
or `DONT_WANT` depending on other configuration.
The advantage of having these multiple options is that it becomes possible
to turn off all modules except a select desired few and have the CMake
configuration automatically determine dependencies.
### Module groups
Modules can also declare themselves as part of a group. Module groups
provide a way to turn on/off the build of several related modules. For
example, there is a module group named `FiltersCommon` that contains
modules with the most commonly used filters in VTK-m.
Every module group has an associated (advanced) CMake variable named
`VTKm_GROUP_ENABLE_<name>`. For example, the `FiltersCommon` group has an
associated CMake variable named `VTKm_GROUP_ENABLE_FiltersCommon`. This
variable can be set to the same `YES`/`WANT`/`DONT_WANT`/`NO`/`DEFAULT`
values as those for the `VTKm_MODULE_ENABLE` variables described earlier.
### Default behavior
If a `VTKm_MODULE_ENABLE_*` variable is set to `DEFAULT`, then the
configuration first checks all the `VTKm_GROUP_ENABLE_*` variables
associated with the groups the module belongs to. It will use the first
value not set to `DEFAULT` that it encounters.
If all the module's group are also set to `DEFAULT` (or the module does not
belong to any groups) then the behavior is based on the
`VTKm_BUILD_ALL_LIBRARIES` CMake variable. If `VTKm_BUILD_ALL_LIBRARIES` is
`ON`, then the default behavior becomes `WANT`. Otherwise, it becomes
`DONT_WANT`.
## Specifying a module
A module is created in much the same way as a normal target is made in
CMake: Create a directory with the appropriate source material and add a
`CMakeLists.txt` file to specify how they are built. However, the main
difference is that you do _not_ link to the directory with a CMake
`add_subdirectory` command (or any other command like `include` or
`subdirs`).
Instead, you simply create a file named `vtkm.module` and place it in the
same directory with the `CMakeLists.txt` file. The VTK-m configuration will
automatically find this `vtkm.module` file, recognize the directory as
containing a module, and automatically include the associated
`CMakeLists.txt` in the build (given that the CMake configuration turns on
the module to be compiled).
Each `vtkm.module` is a simple text file that contains a list of options.
Each option is provided by giving the name of the option followed by the
arguments for that option. The following options can be defined in a
`vtkm.module` file. `NAME` is required, but the rest are optional.
* `NAME`: The name of the target created by the module.
* `GROUPS`: A list of all groups the module belongs to. If a module's
enable flag is set to `DEFAULT`, then the enable option is taken from
the groups it belongs to.
* `DEPENDS`: A list of all modules (or other libraries) on which this
module depends. Everything in this list is added as a link library to
the library created with `vtkm_library`.
* `PRIVATE_DEPENDS`: Same as `DEPENDS` except that these libraries are
added as private link libraries.
* `OPTIONAL_DEPENDS`: A list of all modules that that are not strictly
needed but will be used if available.
* `TEST_DEPENDS`: A list of all modules (or other libraries) on which the
tests for this module depends.
* `TEST_OPTIONAL_DEPENDS`: A list of all modules that the test executable
will like to if they exist, but are not necessary.
* `NO_TESTING`: Normally, a module is expected to have a subdirectory
named `testing`, which will build any necessary testing executables and
add ctest tests. If this option is given, no tests are added. (Note,
modules generally should have tests.)
A `vtkm.module` file may also have comments. Everything between a `#` and
the end of the line will be ignored.
As an example, the `vtkm_filter_entity_extraction` module (located in
`vtkm/filter/entity_extraction` has a `vtkm.module` file that looks like
the following.
``` cmake
NAME
vtkm_filter_entity_extraction
GROUPS
FiltersCommon
Filters
DEPENDS
vtkm_worklet
vtkm_filter_core
vtkm_filter_clean_grid
TEST_DEPENDS
vtkm_filter_clean_grid
vtkm_filter_entity_extraction
vtkm_source
```
## Building the module
As mentioned earlier, a VTK-m module directory has its own
`CMakeLists.txt`. There does not have to be anything particularly special
about the `CMakeLists.txt`. If the module is building a library target
(which is typical), it should use the `vtkm_library` CMake command to do so
to make sure the proper compiler flags are added.
Here is an example portion of the `CMakeLists.txt` for the
`vtkm_filter_entity_extraction` module. (Mainly, the definition of
variables containing source and header files is left out.)
``` cmake
vtkm_library(
NAME vtkm_filter_entity_extraction
HEADERS ${entity_extraction_headers}
DEVICE_SOURCES ${entity_extraction_sources_device}
USE_VTKM_JOB_POOL
)
target_link_libraries(vtkm_filter PUBLIC INTERFACE vtkm_filter_entity_extraction)
```
Note that if a library created by a module depends on the library created
by another module, it should be in the `DEPENDS` list of `vtkm.module`. For
example, the `vtkm.module` contains `vtkm_filter_clean_grid` in its
`DEPENDS` list, and that library will automatically be added as a target
link library to `vtkm_filter_entity_extraction`. You should avoid using
`target_link_libraries` to link one module to another as the modules will
not be able to guarantee that all the targets will be created correctly.
Also note that the `CMakeLists.txt` file should _not_ include its testing
directory with `add_subdirectory`. As described in the next section, the
testing directory will automatically be added, if possible. (Using
`add_subdirectory` for other subdirectories on which the module depends is
OK.)
## Module testing directory
All modules are expected to have a `testing` subdirectory. This
subdirectory should contain its own `CMakeLists.txt` that, typically,
builds a testing executable and adds the appropriate tests. (This is
usually done with the `vtkm_unit_tests` CMake function.)
However, a module should _not_ include its own `testing` directory with
`add_subdirectory`. This is because the tests for a module might have
dependencies that the module itself does not. For example, it is common for
filter tests to use a source to generate some test data. But what if the
CMake configuration has the source module turned off? Should the filter
module be turned off because the tests need the source module? No. Should
the source module be turned on just because some tests want it? No.
To resolve this issue, VTK-m modules allow for an extended set of
dependencies for the tests. This is specified with the `TEST_DEPENDS`
variable in `vtkm.module`. It will then add the test only if all the test
dependencies are met.
If the dependencies for both the module itself and the module's tests are
met, then the `testing` subdirectory of the module will be added to the
build. Like for the module itself, the `CMakeLists.txt` in the `testing`
directory should build tests just like any other CMake directory. Here is
an example `CMakeLists.txt` for the `vtkm_filter_entity_extraction` module.
``` cmake
set(unit_tests
UnitTestExternalFacesFilter.cxx
UnitTestExtractGeometryFilter.cxx
UnitTestExtractPointsFilter.cxx
UnitTestExtractStructuredFilter.cxx
UnitTestGhostCellRemove.cxx
UnitTestMaskFilter.cxx
UnitTestMaskPointsFilter.cxx
UnitTestThresholdFilter.cxx
UnitTestThresholdPointsFilter.cxx
)
set(libraries
vtkm_filter_clean_grid
vtkm_filter_entity_extraction
vtkm_source
)
vtkm_unit_tests(
SOURCES ${unit_tests}
LIBRARIES ${libraries}
USE_VTKM_JOB_POOL
)
```
## Testing if a module is being built
The easiest way to test if a module is being built (in CMake) is to check
whether the associated target exists.
``` cmake
if(TARGET vtkm_filter_entity_extraction)
# Do stuff dependent on vtkm_filter_entity_extraction library/module
endif()
```
Note that this only works in a module if the module properly depends on the
named target. It only works outside of modules if modules have already been
processed.
## Debugging modules
Because modules depend on each other, and these dependencies affect whether
a particular module will be built, it can sometimes be difficult to
understand why a particular module is or is not built. To help diagnose
problems with modules, you can turn on extra reporting with the
`VTKm_VERBOSE_MODULES` CMake variable.
When `VTKm_VERBOSE_MODULES` is set to `OFF` (the default), then the parsing
and dependency resolution of the modules is silent unless there is an
error. When `VTKm_VERBOSE_MODULES` is set to `ON`, then information about
what modules are found, which modules are built, and why they are or are
not built are added as status messages during CMake configuration.

287
docs/NewRelease.md.tmpl Normal file

@ -0,0 +1,287 @@
<!--
This template is for tracking a release of VTKm.
Process this file with the pyexpander script specifying the desired `version`:
expander.py --eval 'version="1.9.0-rc1"' docs/NewRelease.md.tmpl | xclip -selection c
Please remove this comment.
-->
$py(VERSION=str(version.partition("-")[0]))\
$py(MAJOR=int(VERSION.split(".")[0]))\
$py(MINOR=int(VERSION.split(".")[1]))\
$py(PATCH=int(VERSION.split(".")[2]))\
$py(RC="".join(version.partition("-")[1:3]))\
$if(PATCH == 0 and RC == "")\
## Prerequisites
- [ ] Make sure that the current VTK-m release branch builds in VTK.
- [ ] Make sure that the current VTK-m release branch builds in ECP Ascent.
$endif\
## Update VTK-m
- [ ] Update `release` branch for **vtk-m** and create update branch
```
git fetch origin
git checkout release
git merge --ff-only origin/release
git submodule update --recursive --init
```
$if(PATCH == 0 and RC == "-rc1")\
- [ ] Update `master` branch for **vtk-m** and create update branch
```
git fetch origin
git checkout master
git merge --ff-only origin/master
git submodule update --recursive --init
```
$endif\
## Create update branch
- [ ] Create update branch `git checkout -b update-to-$(VERSION)`
$if(PATCH == 0 and RC == "-rc1")\
- [ ] Bring as a second parent the history of master (Solve conflicts always
taking master's version)
```
git merge --no-ff origin/master
```
$else\
- [ ] Backport merge-requests belonging to the milestone $(VERSION)
$endif\
$if(PATCH == 0)\
- [ ] Set version to master
```
echo "$(MAJOR).$(MINOR).9999" > version.txt
git add version.txt
```
$endif\
- [ ] Update the version (not in patch releases) and date in the LICENSE.md
file `git add LICENSE.md`.
- [ ] Create commit that updates the License (and version.txt if modified):
```
git commit -m 'release: update version and License'
```
<!-- Do we have new release notes? -->
- [ ] Craft or update [changelog](#generate-change-log)
`docs/changelog/$(VERSION)/release-notes.md` file.
- [ ] Create release notes commit.
```
git add docs/changelog/$(MAJOR).$(MINOR)/release-notes.md
git rm docs/changelog/*.md
git commit -m 'release: $(VERSION)$(RC) release notes'
```
<!-- endif -->
- [ ] Create update version commit:
```
echo $(VERSION)$(RC) > version.txt
git add version.txt
# Create commit with the following template
# Nth is counted by the number of final release tags
git commit -m '$(VERSION)$(RC) is our Nth official release of VTK-m.
The major changes to VTK-m from (previous release) can be found in:
docs/changelog/$(VERSION)/release-notes.md' version.txt
```
- [ ] `git tag -a -m 'VTKm $(VERSION)$(RC)' v$(VERSION)$(RC) HEAD`
- Integrate changes to `release` branch
- [ ] Create a MR using the [release-mr script][1]
(see [notes](#notes-about-update-mr)).
$if(PATCH == 0)\
- [ ] Add (or ensure) at the bottom of the description of the merge request:
`Backport: master:HEAD~1`
$else\
- [ ] Remove (or ensure) that at the bottom of the description of the merge
request there is no `Backport` instruction.
$endif\
- [ ] Get +1
- [ ] `Do: merge`
- Push tags
- [ ] `git push origin v$(VERSION)$(RC)`
## Update Spack
- [ ] Update Spack package: https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/vtk-m/package.py
## Post-release
$if(PATCH == 0 and RC == "-rc1")\
- [ ] Create a release-specific branch of the previous major/minor release (Ask
@ben.boeckel). For more information on release-specific branch maintanance
schedule refer to `docs/ReleaseRoadmap.md`.
$endif\
- [ ] Copy the contents of docs/changelog/$(VERSION)/release-notes.md to
the GitLab release.
$if(PATCH == 0 and RC == "")\
- [ ] Tag new version of the [VTK-m User Guide][2].
$endif\
- [ ] Post an [Email Announcements](#email-announcements) VTK-m mailing list.
$if(RC == "")\
- [ ] Update this release Date, Delay and End-of-Support fields in `docs/ReleaseRoadmap.md`.
$endif\
$if(PATCH == 0)\
- [ ] Ensure that the content of `version.txt` in master is `$(MAJOR).$(MINOR).9999`.
$endif\
## Update VTK-m in VTK
VTK ships a particular VTK-m release in each of its releases, we need to open a
merge-request update the VTK-m commit in VTK as soon as possible even if the
newly VTK-m version does not correspond with the scheduled for the following VTK
release, the reason for opening the merge-request is that:
- We can test how compatible it is with VTK giving us the change to address
those issues in the following releases.
- We do not forget to update VTK-m commit in VTK when the time comes
- [ ] Update VTK-m submodule in VTK using: `git submodule update --remote`
---
# Annex
## Generate change log
Construct a `docs/changelog/$(VERSION)/` folder.
Construct a `docs/changelog/$(VERSION)/release-notes.md` file
Use the following template for `release-notes.md`:
```md
VTK-m N Release Notes
=======================
<!-- if is a patch release -->
| Merge request description | Merge request id |
| ------------------------------------------------------------------- | ---------------- |
| Update the link to register with the VTK-m dashboard | !2629 |
.
.
.
| CMAKE: CUDA ampere generate sm_80/86 | !2688 |
<!-- else -->
# Table of Contents
1. [Core](#Core)
- Core change 1
2. [ArrayHandle](#ArrayHandle)
3. [Control Environment](#Control-Environment)
4. [Execution Environment](#Execution-Environment)
5. [Worklets and Filters](#Worklets-and-Filters)
6. [Build](#Build)
7. [Other](#Other)
<!-- endif -->
# Core
## Core change 1 ##
changes in core 1
# ArrayHandle
# Control Enviornment
# Execution Environment
# Execution Environment
# Worklets and Filters
# Build
# Other
```
For each individual file in `docs/changelog` move them
to the relevant `release-notes` section.
- Make sure each title and entry in the table of contents use full vtkm names
`vtkm::cont::Field` instead of Field.
- Make sure each title and entry DOESN'T have a period at the end.
- Make sure any sub-heading as part of the changelog is transformed from `##`
to `###`.
- Entries for `Core` are reserved for large changes that significantly improve
VTK-m users life, or are major breaking changes.
## Notes about update-mr
[`update-mr` script][1] has the following requirements to work:
1. It needs a token to for authentication (reach @ben.boeckel for this)
2. It needs `kwrobot.release.vtkm` to have developer perms in your vtk-m repo.
Lastly, `update-mr` can be used multiple times with different commit in the same
branch.
## Notes about version.txt
Master and release branch do not share the same version.txt scheme. In the
release branch the patch and release-candidate version is observed whereas in
master the patch field is fixed to _9999_ indicating that each of its commit is
a developing release.
- Master: `$(MAJOR).$(MINOR).9999`
- Release: `$(MAJOR).$(MINOR).$(PATCH)$(RC)`
## Email Announcements
Announce the new VTK-m release on the mailing list. You will need to compute
the number of merge requests, changelog entries, and maybe # of authors.
Example to compute the number of unique committers
```
git log --format="%an" v1.4.0..v1.5.0 | sort -u | wc -l
```
Example to compute the number of merge requests
```
git log v1.4.0..v1.5.0 | grep 'Merge | wc -l
```
A standard template to use is:
```
Hi All,
VTK-m 1.5.0 is now released, and a special thanks to everyone that has
contributed to VTK-m since our last release. The 1.5.0 release contains
over 100000 merge requests, and 100000 entries to the changelog .
Below are all the entries in the changelog, with more details at (
https://gitlab.kitware.com/vtk/vtk-m/-/tags/v$(VERSION)) or in the vtkm
repository at `docs/$(VERSION)/release-notes.md`
$if(int(PATCH) > 0)\
- Update the link to register with the VTK-m dashboard
.
.
.
- CMAKE: CUDA ampere generate sm_80/86
$else\
1. Core
- Core change 1
2. ArrayHandle
3. Control Environment
4. Execution Environment
5. Worklets and Filters
6. Build
7. Other
$endif\
```
[1]: https://gitlab.kitware.com/utils/release-utils/-/blob/master/release-mr.py
[2]: https://gitlab.kitware.com/vtk/vtk-m-user-guide
@ben.boeckel
@vbolea
/label ~"area:release"
/milestone %"v$(VERSION)"
/assign @vbolea

@ -87,6 +87,9 @@ shown in here:
# Get started with a new Release
1. Go to `https://gitlab.kitware.com/vtkm/vtk-m/` and open a new issue.
2. At the _issue template_ dropdown menu select: `NewRelease.md`
3. Now remove the comments and substitute the variables surrounded by `@`.
4. Post the issue and follow the steps.
2. Generate and copy to clipboard the release script (-rcN is optional):
```
# Download pyexpander (Available in pip)
expander.py --eval 'version="X.Y.Z-rcN"' docs/NewRelease.md.tmpl | xclip -selection c
```
3. Paste the output in the issue and follow the steps.

@ -4,7 +4,7 @@
| --------- | ------------ | ------- | ----------- | ---------------- |
| 1.7.0 | 2021-12-01 | +8 | Long Term | 2022-12-01 |
| 1.8.0 | 2022-06-01 | +14 | Long Term | 2023-06-01 |
| 1.9.0 | 2022-09-01 | | Short Term* | TBD |
| 1.9.0 | 2022-09-01 | +41 | Short Term | next release |
| 2.0.0 | 2022-12-01 | | Long Term* | TBD |
| 2.1.0 | 2023-03-01 | | Short Term* | TBD |
| 2.2.0 | 2023-06-01 | | Long Term* | TBD |

@ -0,0 +1,9 @@
# More performance test options
More options are available for adding performance regression tests. These
options allow you to pass custom options to the benchmark test so that you
are not limited to the default values. They also allow multiple tests to be
created from the same benchmark executable. Separating out the benchmarks
allows the null hypothesis testing to better catch performance problems
when only one of the tested filters regresses. It also allows passing
different arguments to different benchmarks.

@ -0,0 +1,16 @@
# Added modules to the build system
VTK-m libraries and other targets can now be built as modules. The
advantage of modules is that you can selectively choose which
modules/libraries will be built. This makes it easy to create a more
stripped down compile of VTK-m. For example, you might want a reduced set
of libraries to save memory or you might want to turn off certain libraries
to save compile time.
The module system will automatically determine dependencies among the
modules. It is capable of weakly turning off a module where it will still
be compiled if needed. Likewise, it is capabile of weakly turning on a
module where the build will still work if it cannot be created.
The use of modules is described in the `Modules.md` file in the `docs`
directory of the VTK-m source.

@ -0,0 +1,21 @@
# Support providing a Token to ReadPortal and WritePortal
When managing portals in the execution environment, `ArrayHandle` uses the
`Token` object to ensure that the memory associated with a portal exists
for the length of time that it is needed. This is done by creating the
portal with a `Token` object, and the associated portal objects are
guaranteed to be valid while that `Token` object exists. This is supported
by essentially locking the array from further changes.
`Token` objects are typically used when creating a control-side portal with
the `ReadPortal` or `WritePortal`. This is not to say that a `Token` would
not be useful; a control-side portal going out of scope is definitely a
problem. But the creation and distruction of portals in the control
environment is generally too much work for the possible benefits.
However, under certain circumstances it could be useful to use a `Token` to
get a control-side portal. For example, if the `PrepareForExecution` method
of an `ExecutionObjectBase` needs to fill a small `ArrayHandle` on the
control side to pass to the execution side, it would be better to use the
provided `Token` object when doing so. This change allows you to optionally
provide that `Token` when creating these control-side portals.

@ -0,0 +1,29 @@
# Coordiante systems are stored as Fields
Previously, `DataSet` managed `CoordinateSystem`s separately from `Field`s.
However, a `CoordinateSystem` is really just a `Field` with some special
attributes. Thus, coordiante systems are now just listed along with the
rest of the fields, and the coordinate systems are simply strings that
point back to the appropriate field. (This was actually the original
concept for `DataSet`, but the coordinate systems were separated from
fields for some now obsolete reasons.)
This change should not be very noticible, but there are a few consequences
that should be noted.
1. The `GetCoordinateSystem` methods no longer return a reference to a
`CoordinateSystem` object. This is because the `CoordinateSystem` object
is made on the fly from the field.
2. When mapping fields in filters, the coordinate systems get mapped as
part of this process. This has allowed us to remove some of the special
cases needed to set the coordinate system in the output.
3. If a filter is generating a coordinate system in a special way
(different than mapping other point fields), then it can use the special
`CreateResultCoordianteSystem` method to attach this custom coordinate
system to the output.
4. The `DataSet::GetCoordianteSystems()` method to get a `vector<>` of all
coordiante systems is removed. `DataSet` no longer internally has this
structure. Although it could be built, the only reason for its existance
was to support passing coordinate systems in filters. Now that this is
done autmoatically, the method is no longer needed.

@ -0,0 +1,7 @@
# Delete deprecated features
With the major release of VTK-m 2.0, we are cleaning up the code by
removing deprecated features. For software using VTK-m 1.9, you should have
gotten deprecation warnings about any feature that is removed. Thus, to
ease porting to VTK-m 2.0, software should consider updating to VTK-m 1.9
first.

@ -0,0 +1,12 @@
# Expose the Variant helper class
For several versions, VTK-m has had a `Variant` templated class. This acts
like a templated union where the object will store one of a list of types
specified as the template arguments. (There are actually 2 versions for the
control and execution environments, respectively.)
Because this is a complex class that required several iterations to work
through performance and compiler issues, `Variant` was placed in the
`internal` namespace to avoid complications with backward compatibility.
However, the class has been stable for a while, so let us expose this
helpful tool for wider use.

@ -0,0 +1,11 @@
# Output complete list of libraries for external Makefiles
There is a Makefile include, `vtkm_config.mk`, and a package include,
`vtkm.pc`, that are configured so that external programs that do not use
CMake have a way of importing VTK-m's configuration. However, the set of
libraries was hardcoded. In particular, many of the new filter libraries
were missing.
Rather than try to maintain this list manually, the new module mechanism
in the CMake configuration is used to get a list of libraries built and
automatically build these lists.

@ -0,0 +1,12 @@
# Check to make sure that the fields in a DataSet are the proper length
It is possible in a `DataSet` to add a point field (or coordinate system)
that has a different number of points than reported in the cell set.
Likewise for the number of cells in cell fields. This is very bad practice
because it is likely to lead to crashes in worklets that are expecting
arrays of an appropriate length.
Although `DataSet` will still allow this, a warning will be added to the
VTK-m logging to alert users of the inconsistency introduced into the
`DataSet`. Since warnings are by default printed to standard error, users
are likely to see it.

@ -0,0 +1,5 @@
# Change name of method to set the cell ghost levels in a DataSet
Previously, the method was named `AddGhostCellField`. However, only one
ghost cell field can be marked at a time, so `SetGhostCellField` is more
appropriate.

@ -0,0 +1,7 @@
# Automatically make the fields with the global cell ghosts the cell ghosts
Previously, if you added a cell field to a `DataSet` with a name that was
the same as that returned from `GetGlobalCellFieldName`, it was still only
recognized as a normal field. Now, that field is automatically recognized
as a the cell ghost levels (unless the global cell field name is changed or
a different field is explicitly set as the cell ghost levels).

@ -0,0 +1,11 @@
# Particle class members are hidden
The member variables of the `vtkm::Particle` classes are now hidden. This
means that external code will not be directly able to access member
variables like `Pos`, `Time`, and `ID`. Instead, these need to be retrieved
and changed through accessor methods.
This follows standard C++ principles. It also helps us future-proof the
classes. It means that we can provide subclasses or alternate forms of
`Particle` that operate differently. It also makes it possible to change
interfaces while maintaining a deprecated interface.

@ -0,0 +1,21 @@
# Allow FieldSelection to simultaneously include and exclude fields
The basic use of `FieldSelection` is to construct the class with a mode
(`None`, `Any`, `Select`, `Exclude`), and then specify particular fields
based off of this mode. This works fine for basic uses where the same code
that constructs a `FieldSelection` sets all the fields.
But what happens, for example, if you have code that takes an existing
`FieldSelection` and wants to exclude the field named `foo`? If the
`FieldSelection` mode happens to be anything other than `Exclude`, the code
would have to go through several hoops to construct a new `FieldSelection`
object with this modified selection.
To make this case easier, `FieldSelection` now has the ability to specify
the mode independently for each field. The `AddField` method now has an
optional mode argument the specifies whether the mode for that field should
be `Select` or `Exclude`.
In the example above, the code can simply add the `foo` field with the
`Exclude` mode. Regardless of whatever state the `FieldSelection` was in
before, it will now report the `foo` field as not selected.

@ -0,0 +1,18 @@
# Removed ExecutionWholeArray class
`ExecutionWholeArray` is an archaic class in VTK-m that is a thin wrapper
around an array portal. In the early days of VTK-m, this class was used to
transfer whole arrays to the execution environment. However, now the
supported method is to use `WholeArray*` tags in the `ControlSignature` of
a worklet.
Nevertheless, the `WholeArray*` tags caused the array portal transferred to
the worklet to be wrapped inside of an `ExecutionWholeArray` class. This
is unnecessary and can cause confusion about the types of data being used.
Most code is unaffected by this change. Some code that had to work around
the issue of the portal wrapped in another class used the `GetPortal`
method which is no longer needed (for obvious reasons). One extra feature
that `ExecutionWholeArray` had was that it provided an subscript operator
(somewhat incorrectly). Thus, any use of '[..]' to index the array portal
have to be changed to use the `Get` method.

@ -0,0 +1,7 @@
# Correct particle density filter output field
The field being created by `ParticleDensityNearestGridPoint` was supposed
to be associated with cells, but it was sized to the number of points.
Although the number of points will always be more than the number of cells
(so the array will be big enough), having inappropriately sized arrays can
cause further problems downstream.

@ -0,0 +1,14 @@
# New partitioned cell locator class
A new version of a locator, `CellLocatorParitioned`, is now available. This version of a
locator takes a `PartitionedDataSet` and builds a structure that will find the partition Ids and
cell Ids for the input array of locations. It runs CellLocatorGeneral for each partition. We
expect multiple hits and only return the first one (lowest partition Id) where the detected cell
is of type REGULAR (no ghost, not blanked) in the vtkGhostType array. If this array does not
exist in a partition, we assume that all cells are regular.
vtkm::cont::CellLocatorPartitioned produces an Arrayhandle of the size of the number of
partitions filled with the execution objects of CellLocatorGeneral. It further produces an
Arrayhandle filled with the ReadPortals of the vtkGhost arrays to then select the non-blanked
cells from the potentially multiple detected cells on the different partitions. Its counterpart
on the exec side, vtkm::exec::CellLocatorPartitioned, contains the actual FindCell function.

@ -0,0 +1,8 @@
# Fix reading global ids of permuted cells
The legacy VTK reader sometimes has to permute cell data because some VTK
cells are not directly supported in VTK-m. (For example, triangle strips
are not supported. They have to be converted to triangles.)
The global and petigree identifiers were not properly getting permuted.
This is now fixed.

@ -0,0 +1,8 @@
# Remove deprecated features from VTK-m
With the major revision 2.0 of VTK-m, many items previously marked as
deprecated were removed. If updating to a new version of VTK-m, it is
recommended to first update to VTK-m 1.9, which will include the deprecated
features but provide warnings (with the right compiler) that will point to
the replacement code. Once the deprecations have been fixed, updating to
2.0 should be smoother.

@ -0,0 +1,11 @@
# Rename NewFilter base classes to Filter
During the VTK-m 1.8 and 1.9 development, the filter infrastructure was
overhauled. Part of this created a completely new set of base classes. To
avoid confusion with the original filter base classes and ease transition,
the new filter base classes were named `NewFilter*`. Eventually after all
filters were transitioned, the old filter base classes were deprecated.
With the release of VTK-m 2.0, the old filter base classes are removed. The
"new" filter base classes are no longer new. Thus, they have been renamed
simply `Filter` (and `FilterField`).

@ -0,0 +1,8 @@
# Setting source parameters is more clear
Originally, most of the sources used constructor parameters to set the
various options of the source. Although convenient, it was difficult to
keep track of what each parameter meant. To make the code more clear,
source parameters are now set with accessor functions (e.g.
`SetPointDimensions`). Although this makes code more verbose, it helps
prevent mistakes and makes the changes more resilient to future changes.

@ -0,0 +1,19 @@
# Fix handling of cell fields in Tube filter
The `Tube` filter wraps a tube of polygons around poly line cells.
During this process it had a strange (and wrong) handling of cell data.
It assumed that each line had an independent field entry for each
segment of each line. It thus had lots of extra code to find the length
and offsets of the segment data in the cell data.
This is simply not how cell fields work in VTK-m. In VTK-m, each cell
has exactly one entry in the cell field array. Even if a polyline has
100 segments, it only gets one cell field value. This behavior is
consistent with how VTK treats cell field arrays.
The behavior the `Tube` filter was trying to implement was closer to an
"edge" field. However, edge fields are currently not supported in VTK-m.
The proper implementation would be to add edge fields to VTK-m. (This
would also get around some problems with the implementation that was
removed here when mixing polylines with other cell types and degenerate
lines.)

@ -0,0 +1,42 @@
# VTK-m namespace for its exported CMake targets
VTK-m exported CMake targets are now prefixed with the `vtkm::` namespace.
## What it means for VTK-m users
VTK-m users will now need to prepend a `vtkm::` prefix when they refer to a
VTK-m CMake target in their projects as shown below:
```
add_executable(example example.cxx)
# Before:
target_link_libraries(example vtkm_cont vtkm_rendering)
# Now:
target_link_libraries(example vtkm::cont vtkm::rendering)
```
For compatibility purposes we still provide additional exported targets with the
previous naming scheme, in the form of `vtkm_TARGET`, when VTK-m is found
using:
```
# With any version less than 2.0
find_package(VTK-m 1.9)
add_executable(example example.cxx)
# This is still valid
target_link_libraries(example vtkm_cont vtkm_rendering)
```
Use with care since we might remove those targets in future releases.
## What it means for VTK-m developers
While VTK-m exported targets are now prefixed with the `vtkm::` prefix, internal
target names are still in the form of `vtkm_TARGET`.
To perform this name transformation in VTK-m targets a new CMake function has
been provided that decorates the canonical `install` routine. Use this functions
instead of `install` when creating new `VTK-m` targets, further information can
be found at the `vtkm_install_targets` function header at
`CMake/VTKmWrappers.cmake`.

@ -0,0 +1,8 @@
# Attach compressed ZFP data as WholeDatSet field
Previously, point fields compressed by ZFP were attached as point fields
on the output. However, using them as a point field would cause
problems. So, instead attache them as `WholeDataSet` fields.
Also fixed a problem where the 1D decompressor created an output of the
wrong size.

BIN
docs/perftest_arch.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

@ -8,10 +8,27 @@
## PURPOSE. See the above copyright notice for more information.
##============================================================================
#add the directory that contains the VTK-m config file to the cmake
#path so that our examples can find VTK-m
if(VTKm_ENABLE_EXAMPLES)
# VTKm examples expects vtkm libraries to be namespaced with the prefix vtkm::.
# However as the examples are also built as just another part of the VTK-m code
# those prefix are not added to the targets (This happens during the
# installation). To workaround this issue here, we create IMPORTED libs linking
# to the vtkm libraries used by the examples with expected the vtkm:: prefix.
vtkm_module_get_list(module_list)
foreach(tgt IN LISTS module_list)
if(TARGET ${tgt})
# The reason of creating this phony IMPORTED libraries instead of making
# ALIAS libraries is that ALIAS libraries are GLOBAL whereas IMPORTED are
# local at the directory level where they are created. We do not want these
# phony targets to be visible outside of the example directory.
vtkm_target_mangle(tgt_name_mangled ${tgt})
add_library("vtkm::${tgt_name_mangled}" INTERFACE IMPORTED)
target_link_libraries("vtkm::${tgt_name_mangled}" INTERFACE ${tgt})
endif()
endforeach()
#add the directory that contains the VTK-m config file to the cmake
#path so that our examples can find VTK-m
set(CMAKE_PREFIX_PATH ${VTKm_BINARY_DIR}/${VTKm_INSTALL_CONFIG_DIR})
add_subdirectory(clipping)
add_subdirectory(contour_tree)

@ -13,5 +13,7 @@ project(Clipping CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
add_executable(Clipping Clipping.cxx)
target_link_libraries(Clipping PRIVATE vtkm_filter vtkm_io)
if(TARGET vtkm::filter_contour AND TARGET vtkm::io)
add_executable(Clipping Clipping.cxx)
target_link_libraries(Clipping PRIVATE vtkm::filter_contour vtkm::io)
endif()

@ -13,8 +13,10 @@ project(ContourTree CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
add_executable(ContourTreeMesh2D ContourTreeMesh2D.cxx)
target_link_libraries(ContourTreeMesh2D vtkm_filter)
if (TARGET vtkm::filter_scalar_topology)
add_executable(ContourTreeMesh2D ContourTreeMesh2D.cxx)
target_link_libraries(ContourTreeMesh2D vtkm::filter_core vtkm::filter_scalar_topology)
add_executable(ContourTreeMesh3D ContourTreeMesh3D.cxx)
target_link_libraries(ContourTreeMesh3D vtkm_filter)
add_executable(ContourTreeMesh3D ContourTreeMesh3D.cxx)
target_link_libraries(ContourTreeMesh3D vtkm::filter_core vtkm::filter_scalar_topology)
endif()

@ -55,11 +55,16 @@ cmake_minimum_required(VERSION 3.12...3.15 FATAL_ERROR)
# Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
if(NOT TARGET vtkm::io OR NOT TARGET vtkm::filter_scalar_topology)
# Libraries needed are not built.
return()
endif()
####################################
# Serial
####################################
add_executable(ContourTree_Augmented ContourTreeApp.cxx)
target_link_libraries(ContourTree_Augmented vtkm_filter vtkm_io)
target_link_libraries(ContourTree_Augmented vtkm::filter_scalar_topology vtkm::io)
vtkm_add_target_information(ContourTree_Augmented
DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS
DEVICE_SOURCES ContourTreeApp.cxx)
@ -79,7 +84,7 @@ endif()
####################################
if (VTKm_ENABLE_MPI)
add_executable(ContourTree_Augmented_MPI ContourTreeApp.cxx)
target_link_libraries(ContourTree_Augmented_MPI vtkm_filter vtkm_io MPI::MPI_CXX)
target_link_libraries(ContourTree_Augmented_MPI vtkm::filter_scalar_topology vtkm::io MPI::MPI_CXX)
vtkm_add_target_information(ContourTree_Augmented_MPI
MODIFY_CUDA_FLAGS
DEVICE_SOURCES ContourTreeApp.cxx)

@ -64,7 +64,6 @@
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetBuilderUniform.h>
#include <vtkm/cont/DataSetFieldAdd.h>
#include <vtkm/cont/DeviceAdapterTag.h>
#include <vtkm/cont/Initialize.h>
#include <vtkm/cont/RuntimeDeviceTracker.h>

@ -58,9 +58,9 @@ find_package(VTKm REQUIRED QUIET)
####################################
# MPI
####################################
if (VTKm_ENABLE_MPI)
if (VTKm_ENABLE_MPI AND TARGET vtkm::filter_scalar_topology AND TARGET vtkm::io)
add_executable(ContourTree_Distributed ContourTreeApp.cxx)
target_link_libraries(ContourTree_Distributed vtkm_filter vtkm_io MPI::MPI_CXX)
target_link_libraries(ContourTree_Distributed vtkm::filter_scalar_topology vtkm::io MPI::MPI_CXX)
vtkm_add_target_information(ContourTree_Distributed
MODIFY_CUDA_FLAGS
DEVICE_SOURCES ContourTreeApp.cxx)
@ -78,11 +78,11 @@ if (VTKm_ENABLE_MPI)
endif()
add_executable(TreeCompiler TreeCompilerApp.cxx)
target_link_libraries(TreeCompiler vtkm_filter)
target_link_libraries(TreeCompiler vtkm::filter_core)
vtkm_add_target_information(TreeCompiler DROP_UNUSED_SYMBOLS)
add_executable(BranchCompiler BranchCompilerApp.cxx)
target_link_libraries(BranchCompiler vtkm_filter)
target_link_libraries(BranchCompiler vtkm::filter)
vtkm_add_target_information(BranchCompiler DROP_UNUSED_SYMBOLS)
configure_file(split_data_2d.py split_data_2d.py COPYONLY)

@ -15,8 +15,8 @@ find_package(VTKm REQUIRED QUIET)
add_executable(CosmoCenterFinder CosmoCenterFinder.cxx)
add_executable(CosmoHaloFinder CosmoHaloFinder.cxx)
target_link_libraries(CosmoCenterFinder PRIVATE vtkm_filter)
target_link_libraries(CosmoHaloFinder PRIVATE vtkm_filter)
target_link_libraries(CosmoCenterFinder PRIVATE vtkm::filter_core)
target_link_libraries(CosmoHaloFinder PRIVATE vtkm::filter_core)
vtkm_add_target_information(CosmoCenterFinder CosmoHaloFinder
DROP_UNUSED_SYMBOLS

@ -13,7 +13,7 @@ project(VTKmDemo CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
if(TARGET vtkm_rendering)
if(TARGET vtkm::rendering AND TARGET vtkm::filter_contour AND TARGET vtkm::source)
add_executable(Demo Demo.cxx)
target_link_libraries(Demo PRIVATE vtkm_filter vtkm_rendering vtkm_source)
target_link_libraries(Demo PRIVATE vtkm::rendering vtkm::filter_contour vtkm::source)
endif()

@ -34,7 +34,8 @@ int main(int argc, char* argv[])
{
vtkm::cont::Initialize(argc, argv, vtkm::cont::InitializeOptions::Strict);
auto tangle = vtkm::source::Tangle(vtkm::Id3{ 50, 50, 50 });
vtkm::source::Tangle tangle;
tangle.SetPointDimensions({ 50, 50, 50 });
vtkm::cont::DataSet tangleData = tangle.Execute();
std::string fieldName = "tangle";

@ -19,7 +19,7 @@ if(TARGET OpenGL::GL AND
TARGET GLEW::GLEW)
add_executable(GameOfLife GameOfLife.cxx LoadShaders.h)
target_link_libraries(GameOfLife PRIVATE vtkm_filter OpenGL::GL GLEW::GLEW GLUT::GLUT)
target_link_libraries(GameOfLife PRIVATE vtkm::filter_core OpenGL::GL GLEW::GLEW GLUT::GLUT)
vtkm_add_target_information(GameOfLife
DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS
DEVICE_SOURCES GameOfLife.cxx)

@ -26,7 +26,7 @@
#include <vtkm/interop/TransferToOpenGL.h>
#include <vtkm/filter/NewFilterField.h>
#include <vtkm/filter/FilterField.h>
#include <vtkm/worklet/WorkletPointNeighborhood.h>
#include <vtkm/cont/Invoker.h>
@ -95,7 +95,7 @@ struct UpdateLifeState : public vtkm::worklet::WorkletPointNeighborhood
};
class GameOfLife : public vtkm::filter::NewFilterField
class GameOfLife : public vtkm::filter::FilterField
{
public:
VTKM_CONT GameOfLife() { this->SetActiveField("state", vtkm::cont::Field::Association::Points); }
@ -138,7 +138,7 @@ struct UploadData
bool operator()(DeviceAdapterTag device)
{
vtkm::cont::ArrayHandle<vtkm::Vec4ui_8> colors;
this->Colors.GetData().CopyTo(colors);
this->Colors.GetData().AsArrayHandle(colors);
vtkm::interop::TransferToOpenGL(colors, *this->ColorState, device);
return true;
}
@ -316,8 +316,8 @@ int main(int argc, char** argv)
vtkm::cont::DataSetBuilderUniform builder;
vtkm::cont::DataSet data = builder.Create(vtkm::Id2(x, y));
auto stateField =
vtkm::cont::make_Field("state", vtkm::cont::Field::Association::Points, input_state);
auto stateField = vtkm::cont::make_FieldMove(
"state", vtkm::cont::Field::Association::Points, std::move(input_state));
data.AddField(stateField);
GameOfLife filter;

@ -13,9 +13,12 @@ project(HelloWorklet CXX)
#Find the VTK-m package
find_package(VTKm REQUIRED QUIET)
add_executable(HelloWorklet HelloWorklet.cxx)
target_link_libraries(HelloWorklet PRIVATE vtkm_filter vtkm_io)
if(TARGET vtkm::io)
add_executable(HelloWorklet HelloWorklet.cxx)
target_link_libraries(HelloWorklet PRIVATE vtkm::filter_core vtkm::io)
vtkm_add_target_information(HelloWorklet
DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS
DEVICE_SOURCES HelloWorklet.cxx)
vtkm_add_target_information(HelloWorklet
DROP_UNUSED_SYMBOLS
MODIFY_CUDA_FLAGS
DEVICE_SOURCES HelloWorklet.cxx)
endif()

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