diff --git a/lib/kokkos/CHANGELOG.md b/lib/kokkos/CHANGELOG.md index e3de6b048d7fdbcbda354497fa86cba7f03acf69..feb2bd547f034a5ef233667a3a9b5c3d0e02d3f8 100644 --- a/lib/kokkos/CHANGELOG.md +++ b/lib/kokkos/CHANGELOG.md @@ -1,5 +1,49 @@ # Change Log +## [2.6.00](https://github.com/kokkos/kokkos/tree/2.6.00) (2018-03-07) +[Full Changelog](https://github.com/kokkos/kokkos/compare/2.5.00...2.6.00) + +**Part of the Kokkos C++ Performance Portability Programming EcoSystem 2.6** + +**Implemented enhancements:** + +- Support NVIDIA Volta microarchitecture [\#1466](https://github.com/kokkos/kokkos/issues/1466) +- Kokkos - Define empty functions when profiling disabled [\#1424](https://github.com/kokkos/kokkos/issues/1424) +- Don't use \_\_constant\_\_ cache for lock arrays, enable once per run update instead of once per call [\#1385](https://github.com/kokkos/kokkos/issues/1385) +- task dag enhancement. [\#1354](https://github.com/kokkos/kokkos/issues/1354) +- Cuda task team collectives and stack size [\#1353](https://github.com/kokkos/kokkos/issues/1353) +- Replace View operator acceptance of more than rank integers with 'access' function [\#1333](https://github.com/kokkos/kokkos/issues/1333) +- Interoperability: Do not shut down backend execution space runtimes upon calling finalize. [\#1305](https://github.com/kokkos/kokkos/issues/1305) +- shmem\_size for LayoutStride [\#1291](https://github.com/kokkos/kokkos/issues/1291) +- Kokkos::resize performs poorly on 1D Views [\#1270](https://github.com/kokkos/kokkos/issues/1270) +- stride\(\) is inconsistent with dimension\(\), extent\(\), etc. [\#1214](https://github.com/kokkos/kokkos/issues/1214) +- Kokkos::sort defaults to std::sort on host [\#1208](https://github.com/kokkos/kokkos/issues/1208) +- DynamicView with host size grow [\#1206](https://github.com/kokkos/kokkos/issues/1206) +- Unmanaged View with Anonymous Memory Space [\#1175](https://github.com/kokkos/kokkos/issues/1175) +- Sort subset of Kokkos::DynamicView [\#1160](https://github.com/kokkos/kokkos/issues/1160) +- MDRange policy doesn't support lambda reductions [\#1054](https://github.com/kokkos/kokkos/issues/1054) +- Add ability to set hook on Kokkos::finalize [\#714](https://github.com/kokkos/kokkos/issues/714) +- Atomics with Serial Backend - Default should be Disable? [\#549](https://github.com/kokkos/kokkos/issues/549) +- KOKKOS\_ENABLE\_DEPRECATED\_CODE [\#1359](https://github.com/kokkos/kokkos/issues/1359) + +**Fixed bugs:** + +- cuda\_internal\_maximum\_warp\_count returns 8, but I believe it should return 16 for P100 [\#1269](https://github.com/kokkos/kokkos/issues/1269) +- Cuda: level 1 scratch memory bug \(reported by Stan Moore\) [\#1434](https://github.com/kokkos/kokkos/issues/1434) +- MDRangePolicy Reduction requires value\_type typedef in Functor [\#1379](https://github.com/kokkos/kokkos/issues/1379) +- Kokkos DeepCopy between empty views fails [\#1369](https://github.com/kokkos/kokkos/issues/1369) +- Several issues with new CMake build infrastructure \(reported by Eric Phipps\) [\#1365](https://github.com/kokkos/kokkos/issues/1365) +- deep\_copy between rank-1 host/device views of differing layouts without UVM no longer works \(reported by Eric Phipps\) [\#1363](https://github.com/kokkos/kokkos/issues/1363) +- Profiling can't be disabled in CMake, and a parallel\_for is missing for tasks \(reported by Kyungjoo Kim\) [\#1349](https://github.com/kokkos/kokkos/issues/1349) +- get\_work\_partition int overflow \(reported by berryj5\) [\#1327](https://github.com/kokkos/kokkos/issues/1327) +- Kokkos::deep\_copy must fence even if the two views are the same [\#1303](https://github.com/kokkos/kokkos/issues/1303) +- CudaUVMSpace::allocate/deallocate must fence [\#1302](https://github.com/kokkos/kokkos/issues/1302) +- ViewResize on CUDA fails in Debug because of too many resources requested [\#1299](https://github.com/kokkos/kokkos/issues/1299) +- Cuda 9 and intrepid2 calls from Panzer. [\#1183](https://github.com/kokkos/kokkos/issues/1183) +- Slowdown due to tracking\_enabled\(\) in 2.04.00 \(found by Albany app\) [\#1016](https://github.com/kokkos/kokkos/issues/1016) +- Bounds checking fails with zero-span Views \(reported by Stan Moore\) [\#1411](https://github.com/kokkos/kokkos/issues/1411) + + ## [2.5.00](https://github.com/kokkos/kokkos/tree/2.5.00) (2017-12-15) [Full Changelog](https://github.com/kokkos/kokkos/compare/2.04.11...2.5.00) diff --git a/lib/kokkos/CMakeLists.txt b/lib/kokkos/CMakeLists.txt index 9c708ded4a460a3b67224a8aeec9e80c6010157b..cd1f4ea981339a5ff01095be9bca144cdb5d9064 100644 --- a/lib/kokkos/CMakeLists.txt +++ b/lib/kokkos/CMakeLists.txt @@ -7,7 +7,7 @@ ELSE() ENDIF() IF(NOT KOKKOS_HAS_TRILINOS) - cmake_minimum_required(VERSION 3.1 FATAL_ERROR) + cmake_minimum_required(VERSION 3.3 FATAL_ERROR) # Define Project Name if this is a standalone build IF(NOT DEFINED ${PROJECT_NAME}) @@ -37,9 +37,19 @@ IF(NOT KOKKOS_HAS_TRILINOS) COMMAND ${KOKKOS_SETTINGS} make -f ${KOKKOS_SRC_PATH}/cmake/Makefile.generate_cmake_settings CXX=${CMAKE_CXX_COMPILER} generate_build_settings WORKING_DIRECTORY "${Kokkos_BINARY_DIR}" OUTPUT_FILE ${Kokkos_BINARY_DIR}/core_src_make.out - RESULT_VARIABLE res + RESULT_VARIABLE GEN_SETTINGS_RESULT ) + if (GEN_SETTINGS_RESULT) + message(FATAL_ERROR "Kokkos settings generation failed:\n" + "${KOKKOS_SETTINGS} make -f ${KOKKOS_SRC_PATH}/cmake/Makefile.generate_cmake_settings CXX=${CMAKE_CXX_COMPILER} generate_build_settings") + endif() include(${Kokkos_BINARY_DIR}/kokkos_generated_settings.cmake) + string(REPLACE " " ";" KOKKOS_TPL_INCLUDE_DIRS "${KOKKOS_GMAKE_TPL_INCLUDE_DIRS}") + string(REPLACE " " ";" KOKKOS_TPL_LIBRARY_DIRS "${KOKKOS_GMAKE_TPL_LIBRARY_DIRS}") + string(REPLACE " " ";" KOKKOS_TPL_LIBRARY_NAMES "${KOKKOS_GMAKE_TPL_LIBRARY_NAMES}") + list(REMOVE_ITEM KOKKOS_TPL_INCLUDE_DIRS "") + list(REMOVE_ITEM KOKKOS_TPL_LIBRARY_DIRS "") + list(REMOVE_ITEM KOKKOS_TPL_LIBRARY_NAMES "") set_kokkos_srcs(KOKKOS_SRC ${KOKKOS_SRC}) #------------ NOW BUILD ------------------------------------------------------ diff --git a/lib/kokkos/Copyright.txt b/lib/kokkos/Copyright.txt index 05980758fa8fe6317bb08fcc6eb70668b5fd1580..50b76995af47381395ba4b9d0ad72ac7f57e4655 100644 --- a/lib/kokkos/Copyright.txt +++ b/lib/kokkos/Copyright.txt @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/HOW_TO_SNAPSHOT b/lib/kokkos/HOW_TO_SNAPSHOT index 46bfb4167f9023a8273ebc872ac450c626603bf0..ad3f78efb4f8dd8399e3fb2889def7e841b531f9 100644 --- a/lib/kokkos/HOW_TO_SNAPSHOT +++ b/lib/kokkos/HOW_TO_SNAPSHOT @@ -19,7 +19,7 @@ snapshot Kokkos from github.com/kokkos to Trilinos. 3) Snapshot the current commit in the Kokkos clone into the Trilinos clone. This overwrites ${TRILINOS}/packages/kokkos with the content of ${KOKKOS}: - ${KOKKOS}/config/snapshot.py --verbose ${KOKKOS} ${TRILINOS}/packages + ${KOKKOS}/scripts/snapshot.py --verbose ${KOKKOS} ${TRILINOS}/packages 4) Verify the snapshot commit happened as expected cd ${TRILINOS}/packages/kokkos diff --git a/lib/kokkos/LICENSE b/lib/kokkos/LICENSE index 7341a699d6fc52c7863e7a4dbaab7ad892da4fd5..c68a8a2a9f98983e6bb7e02aaae0ce705a241ffc 100644 --- a/lib/kokkos/LICENSE +++ b/lib/kokkos/LICENSE @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/Makefile.kokkos b/lib/kokkos/Makefile.kokkos index 4315b009d5d2eb636079002dbcaed66afbf029ca..a7bb63f190348405267c3ea50e0f55dcf20645a3 100644 --- a/lib/kokkos/Makefile.kokkos +++ b/lib/kokkos/Makefile.kokkos @@ -9,8 +9,8 @@ KOKKOS_DEVICES ?= "OpenMP" #KOKKOS_DEVICES ?= "Pthreads" # Options: # Intel: KNC,KNL,SNB,HSW,BDW,SKX -# NVIDIA: Kepler,Kepler30,Kepler32,Kepler35,Kepler37,Maxwell,Maxwell50,Maxwell52,Maxwell53,Pascal60,Pascal61 -# ARM: ARMv80,ARMv81,ARMv8-ThunderX +# NVIDIA: Kepler,Kepler30,Kepler32,Kepler35,Kepler37,Maxwell,Maxwell50,Maxwell52,Maxwell53,Pascal60,Pascal61,Volta70,Volta72 +# ARM: ARMv80,ARMv81,ARMv8-ThunderX,ARMv8-TX2 # IBM: BGQ,Power7,Power8,Power9 # AMD-GPUS: Kaveri,Carrizo,Fiji,Vega # AMD-CPUS: AMDAVX,Ryzen,Epyc @@ -21,7 +21,7 @@ KOKKOS_DEBUG ?= "no" KOKKOS_USE_TPLS ?= "" # Options: c++11,c++1z KOKKOS_CXX_STANDARD ?= "c++11" -# Options: aggressive_vectorization,disable_profiling +# Options: aggressive_vectorization,disable_profiling,disable_deprecated_code KOKKOS_OPTIONS ?= "" # Default settings specific options. @@ -48,6 +48,7 @@ KOKKOS_INTERNAL_USE_MEMKIND := $(call kokkos_has_string,$(KOKKOS_USE_TPLS),exper KOKKOS_INTERNAL_ENABLE_COMPILER_WARNINGS := $(call kokkos_has_string,$(KOKKOS_OPTIONS),compiler_warnings) KOKKOS_INTERNAL_OPT_RANGE_AGGRESSIVE_VECTORIZATION := $(call kokkos_has_string,$(KOKKOS_OPTIONS),aggressive_vectorization) KOKKOS_INTERNAL_DISABLE_PROFILING := $(call kokkos_has_string,$(KOKKOS_OPTIONS),disable_profiling) +KOKKOS_INTERNAL_DISABLE_DEPRECATED_CODE := $(call kokkos_has_string,$(KOKKOS_OPTIONS),disable_deprecated_code) KOKKOS_INTERNAL_DISABLE_DUALVIEW_MODIFY_CHECK := $(call kokkos_has_string,$(KOKKOS_OPTIONS),disable_dualview_modify_check) KOKKOS_INTERNAL_ENABLE_PROFILING_LOAD_PRINT := $(call kokkos_has_string,$(KOKKOS_OPTIONS),enable_profile_load_print) KOKKOS_INTERNAL_CUDA_USE_LDG := $(call kokkos_has_string,$(KOKKOS_CUDA_OPTIONS),use_ldg) @@ -93,7 +94,7 @@ KOKKOS_INTERNAL_COMPILER_INTEL := $(call kokkos_has_string,$(KOKKOS_CXX_VE KOKKOS_INTERNAL_COMPILER_PGI := $(call kokkos_has_string,$(KOKKOS_CXX_VERSION),PGI) KOKKOS_INTERNAL_COMPILER_XL := $(strip $(shell $(CXX) -qversion 2>&1 | grep XL | wc -l)) KOKKOS_INTERNAL_COMPILER_CRAY := $(strip $(shell $(CXX) -craype-verbose 2>&1 | grep "CC-" | wc -l)) -KOKKOS_INTERNAL_COMPILER_NVCC := $(strip $(shell export OMPI_CXX=$(OMPI_CXX); export MPICH_CXX=$(MPICH_CXX); $(CXX) --version 2>&1 | grep nvcc | wc -l)) +KOKKOS_INTERNAL_COMPILER_NVCC := $(strip $(shell export OMPI_CXX=$(OMPI_CXX); export MPICH_CXX=$(MPICH_CXX); $(CXX) --version 2>&1 | grep nvcc | wc -l)) KOKKOS_INTERNAL_COMPILER_CLANG := $(call kokkos_has_string,$(KOKKOS_CXX_VERSION),clang) KOKKOS_INTERNAL_COMPILER_APPLE_CLANG := $(call kokkos_has_string,$(KOKKOS_CXX_VERSION),apple-darwin) KOKKOS_INTERNAL_COMPILER_HCC := $(call kokkos_has_string,$(KOKKOS_CXX_VERSION),HCC) @@ -229,12 +230,16 @@ KOKKOS_INTERNAL_USE_ARCH_MAXWELL52 := $(call kokkos_has_string,$(KOKKOS_ARCH),Ma KOKKOS_INTERNAL_USE_ARCH_MAXWELL53 := $(call kokkos_has_string,$(KOKKOS_ARCH),Maxwell53) KOKKOS_INTERNAL_USE_ARCH_PASCAL61 := $(call kokkos_has_string,$(KOKKOS_ARCH),Pascal61) KOKKOS_INTERNAL_USE_ARCH_PASCAL60 := $(call kokkos_has_string,$(KOKKOS_ARCH),Pascal60) +KOKKOS_INTERNAL_USE_ARCH_VOLTA70 := $(call kokkos_has_string,$(KOKKOS_ARCH),Volta70) +KOKKOS_INTERNAL_USE_ARCH_VOLTA72 := $(call kokkos_has_string,$(KOKKOS_ARCH),Volta72) KOKKOS_INTERNAL_USE_ARCH_NVIDIA := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_KEPLER30) \ + $(KOKKOS_INTERNAL_USE_ARCH_KEPLER32) \ + $(KOKKOS_INTERNAL_USE_ARCH_KEPLER35) \ + $(KOKKOS_INTERNAL_USE_ARCH_KEPLER37) \ + $(KOKKOS_INTERNAL_USE_ARCH_PASCAL61) \ + $(KOKKOS_INTERNAL_USE_ARCH_PASCAL60) \ + + $(KOKKOS_INTERNAL_USE_ARCH_VOLTA70) \ + + $(KOKKOS_INTERNAL_USE_ARCH_VOLTA72) \ + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL50) \ + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL52) \ + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL53)) @@ -249,6 +254,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_NVIDIA), 0) + $(KOKKOS_INTERNAL_USE_ARCH_KEPLER37) \ + $(KOKKOS_INTERNAL_USE_ARCH_PASCAL61) \ + $(KOKKOS_INTERNAL_USE_ARCH_PASCAL60) \ + + $(KOKKOS_INTERNAL_USE_ARCH_VOLTA70) \ + + $(KOKKOS_INTERNAL_USE_ARCH_VOLTA72) \ + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL50) \ + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL52) \ + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL53)) @@ -267,7 +274,8 @@ endif KOKKOS_INTERNAL_USE_ARCH_ARMV80 := $(call kokkos_has_string,$(KOKKOS_ARCH),ARMv80) KOKKOS_INTERNAL_USE_ARCH_ARMV81 := $(call kokkos_has_string,$(KOKKOS_ARCH),ARMv81) KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX := $(call kokkos_has_string,$(KOKKOS_ARCH),ARMv8-ThunderX) -KOKKOS_INTERNAL_USE_ARCH_ARM := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_ARMV80)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV81)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX) | bc)) +KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2 := $(call kokkos_has_string,$(KOKKOS_ARCH),ARMv8-TX2) +KOKKOS_INTERNAL_USE_ARCH_ARM := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_ARMV80)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV81)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2) | bc)) # IBM based. KOKKOS_INTERNAL_USE_ARCH_BGQ := $(call kokkos_has_string,$(KOKKOS_ARCH),BGQ) @@ -316,6 +324,9 @@ endif # Generating the list of Flags. KOKKOS_CPPFLAGS = -I./ -I$(KOKKOS_PATH)/core/src -I$(KOKKOS_PATH)/containers/src -I$(KOKKOS_PATH)/algorithms/src +KOKKOS_TPL_INCLUDE_DIRS = +KOKKOS_TPL_LIBRARY_DIRS = +KOKKOS_TPL_LIBRARY_NAMES = KOKKOS_CXXFLAGS = ifeq ($(KOKKOS_INTERNAL_ENABLE_COMPILER_WARNINGS), 1) @@ -323,7 +334,9 @@ ifeq ($(KOKKOS_INTERNAL_ENABLE_COMPILER_WARNINGS), 1) endif KOKKOS_LIBS = -ldl +KOKKOS_TPL_LIBRARY_NAMES += dl KOKKOS_LDFLAGS = -L$(shell pwd) +KOKKOS_LINK_FLAGS = KOKKOS_SRC = KOKKOS_HEADERS = @@ -437,21 +450,32 @@ ifeq ($(KOKKOS_INTERNAL_ENABLE_PROFILING_LOAD_PRINT), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_HWLOC), 1) - KOKKOS_CPPFLAGS += -I$(HWLOC_PATH)/include - KOKKOS_LDFLAGS += -L$(HWLOC_PATH)/lib + ifneq ($(HWLOC_PATH),) + KOKKOS_CPPFLAGS += -I$(HWLOC_PATH)/include + KOKKOS_LDFLAGS += -L$(HWLOC_PATH)/lib + KOKKOS_TPL_INCLUDE_DIRS += $(HWLOC_PATH)/include + KOKKOS_TPL_LIBRARY_DIRS += $(HWLOC_PATH)/lib + endif KOKKOS_LIBS += -lhwloc + KOKKOS_TPL_LIBRARY_NAMES += hwloc tmp := $(call kokkos_append_header,"\#define KOKKOS_HAVE_HWLOC") endif ifeq ($(KOKKOS_INTERNAL_USE_LIBRT), 1) tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_LIBRT") KOKKOS_LIBS += -lrt + KOKKOS_TPL_LIBRARY_NAMES += rt endif ifeq ($(KOKKOS_INTERNAL_USE_MEMKIND), 1) - KOKKOS_CPPFLAGS += -I$(MEMKIND_PATH)/include - KOKKOS_LDFLAGS += -L$(MEMKIND_PATH)/lib + ifneq ($(MEMKIND_PATH),) + KOKKOS_CPPFLAGS += -I$(MEMKIND_PATH)/include + KOKKOS_LDFLAGS += -L$(MEMKIND_PATH)/lib + KOKKOS_TPL_INCLUDE_DIRS += $(MEMKIND_PATH)/include + KOKKOS_TPL_LIBRARY_DIRS += $(MEMKIND_PATH)/lib + endif KOKKOS_LIBS += -lmemkind -lnuma + KOKKOS_TPL_LIBRARY_NAMES += memkind numa tmp := $(call kokkos_append_header,"\#define KOKKOS_HAVE_HBWSPACE") endif @@ -459,6 +483,10 @@ ifeq ($(KOKKOS_INTERNAL_DISABLE_PROFILING), 0) tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_PROFILING") endif +ifeq ($(KOKKOS_INTERNAL_DISABLE_DEPRECATED_CODE), 0) + tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_DEPRECATED_CODE") +endif + tmp := $(call kokkos_append_header,"/* Optimization Settings */") ifeq ($(KOKKOS_INTERNAL_OPT_RANGE_AGGRESSIVE_VECTORIZATION), 1) @@ -560,6 +588,24 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX), 1) endif endif +ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2), 1) + tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV81") + tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV8_THUNDERX2") + + ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) + KOKKOS_CXXFLAGS += + KOKKOS_LDFLAGS += + else + ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) + KOKKOS_CXXFLAGS += + KOKKOS_LDFLAGS += + else + KOKKOS_CXXFLAGS += -mtune=thunderx2t99 -mcpu=thunderx2t99 + KOKKOS_LDFLAGS += -mtune=thunderx2t99 -mcpu=thunderx2t99 + endif + endif +endif + ifeq ($(KOKKOS_INTERNAL_USE_ARCH_SSE42), 1) tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_SSE42") @@ -754,10 +800,11 @@ endif ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC), 1) KOKKOS_INTERNAL_CUDA_ARCH_FLAG=-arch - endif - ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - KOKKOS_INTERNAL_CUDA_ARCH_FLAG=--cuda-gpu-arch - KOKKOS_CXXFLAGS += -x cuda + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) + KOKKOS_INTERNAL_CUDA_ARCH_FLAG=--cuda-gpu-arch + KOKKOS_CXXFLAGS += -x cuda + else + $(error Makefile.kokkos: CUDA is enabled but the compiler is neither NVCC nor Clang) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KEPLER30), 1) @@ -805,6 +852,16 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_PASCAL61") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_61 endif + ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VOLTA70), 1) + tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA") + tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA70") + KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_70 + endif + ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VOLTA72), 1) + tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA") + tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA72") + KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_72 + endif ifneq ($(KOKKOS_INTERNAL_USE_ARCH_NVIDIA), 0) KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG) @@ -850,6 +907,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1) KOKKOS_CXXFLAGS += $(shell $(ROCM_HCC_PATH)/bin/hcc-config --cxxflags) KOKKOS_LDFLAGS += $(shell $(ROCM_HCC_PATH)/bin/hcc-config --ldflags) -lhc_am -lm + KOKKOS_TPL_LIBRARY_NAMES += hc_am m KOKKOS_LDFLAGS += $(KOKKOS_INTERNAL_ROCM_ARCH_FLAG) KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/ROCm/*.cpp) @@ -880,13 +938,17 @@ KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/containers/src/impl/*.cpp) ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/Cuda/*.cpp) KOKKOS_HEADERS += $(wildcard $(KOKKOS_PATH)/core/src/Cuda/*.hpp) - KOKKOS_CPPFLAGS += -I$(CUDA_PATH)/include - KOKKOS_LDFLAGS += -L$(CUDA_PATH)/lib64 - KOKKOS_LIBS += -lcudart -lcuda - - ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - KOKKOS_CXXFLAGS += --cuda-path=$(CUDA_PATH) + ifneq ($(CUDA_PATH),) + KOKKOS_CPPFLAGS += -I$(CUDA_PATH)/include + KOKKOS_LDFLAGS += -L$(CUDA_PATH)/lib64 + KOKKOS_TPL_INCLUDE_DIRS += $(CUDA_PATH)/include + KOKKOS_TPL_LIBRARY_DIRS += $(CUDA_PATH)/lib64 + ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) + KOKKOS_CXXFLAGS += --cuda-path=$(CUDA_PATH) + endif endif + KOKKOS_LIBS += -lcudart -lcuda + KOKKOS_TPL_LIBRARY_NAMES += cudart cuda endif ifeq ($(KOKKOS_INTERNAL_USE_OPENMPTARGET), 1) @@ -911,20 +973,27 @@ ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1) endif KOKKOS_LDFLAGS += $(KOKKOS_INTERNAL_OPENMP_FLAG) + KOKKOS_LINK_FLAGS += $(KOKKOS_INTERNAL_OPENMP_FLAG) endif ifeq ($(KOKKOS_INTERNAL_USE_PTHREADS), 1) KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/Threads/*.cpp) KOKKOS_HEADERS += $(wildcard $(KOKKOS_PATH)/core/src/Threads/*.hpp) KOKKOS_LIBS += -lpthread + KOKKOS_TPL_LIBRARY_NAMES += pthread endif ifeq ($(KOKKOS_INTERNAL_USE_QTHREADS), 1) KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/Qthreads/*.cpp) KOKKOS_HEADERS += $(wildcard $(KOKKOS_PATH)/core/src/Qthreads/*.hpp) - KOKKOS_CPPFLAGS += -I$(QTHREADS_PATH)/include - KOKKOS_LDFLAGS += -L$(QTHREADS_PATH)/lib + ifneq ($(QTHREADS_PATH),) + KOKKOS_CPPFLAGS += -I$(QTHREADS_PATH)/include + KOKKOS_LDFLAGS += -L$(QTHREADS_PATH)/lib + KOKKOS_TPL_INCLUDE_DIRS += $(QTHREADS_PATH)/include + KOKKOS_TPL_LIBRARY_DIRS += $(QTHREADS_PATH)/lib64 + endif KOKKOS_LIBS += -lqthread + KOKKOS_TPL_LIBRARY_NAMES += qthread endif # Explicitly set the GCC Toolchain for Clang. @@ -940,11 +1009,6 @@ ifneq ($(KOKKOS_INTERNAL_USE_MEMKIND), 1) KOKKOS_SRC := $(filter-out $(KOKKOS_PATH)/core/src/impl/Kokkos_HBWSpace.cpp,$(KOKKOS_SRC)) endif -# Don't include Kokkos_Profiling_Interface.cpp if not using profiling to avoid a link warning. -ifeq ($(KOKKOS_INTERNAL_DISABLE_PROFILING), 1) - KOKKOS_SRC := $(filter-out $(KOKKOS_PATH)/core/src/impl/Kokkos_Profiling_Interface.cpp,$(KOKKOS_SRC)) -endif - # Don't include Kokkos_Serial.cpp or Kokkos_Serial_Task.cpp if not using Serial # device to avoid a link warning. ifneq ($(KOKKOS_INTERNAL_USE_SERIAL), 1) diff --git a/lib/kokkos/README b/lib/kokkos/README index d6c66634dd3914fe0d5aeed52b3737588c2ae66d..31d134bf0add74cf9b36571a3649cf5724f48087 100644 --- a/lib/kokkos/README +++ b/lib/kokkos/README @@ -1,87 +1,101 @@ -Kokkos implements a programming model in C++ for writing performance portable +Kokkos Core implements a programming model in C++ for writing performance portable applications targeting all major HPC platforms. For that purpose it provides abstractions for both parallel execution of code and data management. Kokkos is designed to target complex node architectures with N-level memory hierarchies and multiple types of execution resources. It currently can use OpenMP, Pthreads and CUDA as backend programming models. -Kokkos is licensed under standard 3-clause BSD terms of use. For specifics -see the LICENSE file contained in the repository or distribution. +Kokkos Core is part of the Kokkos C++ Performance Portability Programming EcoSystem, +which also provides math kernels (https://github.com/kokkos/kokkos-kernels), as well as +profiling and debugging tools (https://github.com/kokkos/kokkos-tools). -The core developers of Kokkos are Carter Edwards and Christian Trott -at the Computer Science Research Institute of the Sandia National -Laboratories. +# Learning about Kokkos -The KokkosP interface and associated tools are developed by the Application -Performance Team and Kokkos core developers at Sandia National Laboratories. +A programming guide can be found on the Wiki, the API reference is under development. -To learn more about Kokkos consider watching one of our presentations: -GTC 2015: - http://on-demand.gputechconf.com/gtc/2015/video/S5166.html - http://on-demand.gputechconf.com/gtc/2015/presentation/S5166-H-Carter-Edwards.pdf +For questions find us on Slack: https://kokkosteam.slack.com or open a github issue. -A programming guide can be found under doc/Kokkos_PG.pdf. This is an initial version -and feedback is greatly appreciated. +For non-public questions send an email to +crtrott(at)sandia.gov A separate repository with extensive tutorial material can be found under https://github.com/kokkos/kokkos-tutorials. -If you have a patch to contribute please feel free to issue a pull request against -the develop branch. For major contributions it is better to contact us first -for guidance. - -For questions please send an email to -kokkos-users@software.sandia.gov +Furthermore, the 'example/tutorial' directory provides step by step tutorial +examples which explain many of the features of Kokkos. They work with +simple Makefiles. To build with g++ and OpenMP simply type 'make' +in the 'example/tutorial' directory. This will build all examples in the +subfolders. To change the build options refer to the Programming Guide +in the compilation section. -For non-public questions send an email to -hcedwar(at)sandia.gov and crtrott(at)sandia.gov - -============================================================================ -====Requirements============================================================ -============================================================================ - -Primary tested compilers on X86 are: - GCC 4.8.4 - GCC 4.9.3 - GCC 5.1.0 - GCC 5.3.0 - GCC 6.1.0 - Intel 15.0.2 - Intel 16.0.1 - Intel 17.1.043 - Intel 17.4.196 - Intel 18.0.128 - Clang 3.5.2 - Clang 3.6.1 - Clang 3.7.1 - Clang 3.8.1 - Clang 3.9.0 - Clang 4.0.0 - Clang 4.0.0 for CUDA (CUDA Toolkit 8.0.44) - PGI 17.10 - NVCC 7.0 for CUDA (with gcc 4.8.4) - NVCC 7.5 for CUDA (with gcc 4.8.4) - NVCC 8.0.44 for CUDA (with gcc 5.3.0) - -Primary tested compilers on Power 8 are: - GCC 5.4.0 (OpenMP,Serial) - IBM XL 13.1.5 (OpenMP, Serial) (There is a workaround in place to avoid a compiler bug) - NVCC 8.0.44 for CUDA (with gcc 5.4.0) - NVCC 9.0.103 for CUDA (with gcc 6.3.0) - -Primary tested compilers on Intel KNL are: - GCC 6.2.0 - Intel 16.4.258 (with gcc 4.7.2) - Intel 17.2.174 (with gcc 4.9.3) - Intel 18.0.128 (with gcc 4.9.3) - -Other compilers working: - X86: - Cygwin 2.1.0 64bit with gcc 4.9.3 - -Known non-working combinations: - Power8: - Pthreads backend +To learn more about Kokkos consider watching one of our presentations: +* GTC 2015: + - http://on-demand.gputechconf.com/gtc/2015/video/S5166.html + - http://on-demand.gputechconf.com/gtc/2015/presentation/S5166-H-Carter-Edwards.pdf + + +# Contributing to Kokkos + +We are open and try to encourage contributions from external developers. +To do so please first open an issue describing the contribution and then issue +a pull request against the develop branch. For larger features it may be good +to get guidance from the core development team first through the github issue. + +Note that Kokkos Core is licensed under standard 3-clause BSD terms of use. +Which means contributing to Kokkos allows anyone else to use your contributions +not just for public purposes but also for closed source commercial projects. +For specifics see the LICENSE file contained in the repository or distribution. + +# Requirements + +### Primary tested compilers on X86 are: + * GCC 4.8.4 + * GCC 4.9.3 + * GCC 5.1.0 + * GCC 5.3.0 + * GCC 6.1.0 + * Intel 15.0.2 + * Intel 16.0.1 + * Intel 17.1.043 + * Intel 17.4.196 + * Intel 18.0.128 + * Clang 3.6.1 + * Clang 3.7.1 + * Clang 3.8.1 + * Clang 3.9.0 + * Clang 4.0.0 + * Clang 4.0.0 for CUDA (CUDA Toolkit 8.0.44) + * Clang 6.0.0 for CUDA (CUDA Toolkit 9.1) + * PGI 17.10 + * NVCC 7.0 for CUDA (with gcc 4.8.4) + * NVCC 7.5 for CUDA (with gcc 4.8.4) + * NVCC 8.0.44 for CUDA (with gcc 5.3.0) + * NVCC 9.1 for CUDA (with gcc 6.1.0) + +### Primary tested compilers on Power 8 are: + * GCC 5.4.0 (OpenMP,Serial) + * IBM XL 13.1.6 (OpenMP, Serial) + * NVCC 8.0.44 for CUDA (with gcc 5.4.0) + * NVCC 9.0.103 for CUDA (with gcc 6.3.0 and XL 13.1.6) + +### Primary tested compilers on Intel KNL are: + * GCC 6.2.0 + * Intel 16.4.258 (with gcc 4.7.2) + * Intel 17.2.174 (with gcc 4.9.3) + * Intel 18.0.128 (with gcc 4.9.3) + +### Primary tested compilers on ARM + * GCC 6.1.0 + +### Other compilers working: + * X86: + - Cygwin 2.1.0 64bit with gcc 4.9.3 + +### Known non-working combinations: + * Power8: + - Pthreads backend + * ARM + - Pthreads backend Primary tested compiler are passing in release mode @@ -97,20 +111,7 @@ NVCC: -Wall -Wshadow -pedantic -Werror -Wsign-compare -Wtype-limits -Wuninitiali Other compilers are tested occasionally, in particular when pushing from develop to master branch, without -Werror and only for a select set of backends. -============================================================================ -====Getting started========================================================= -============================================================================ - -In the 'example/tutorial' directory you will find step by step tutorial -examples which explain many of the features of Kokkos. They work with -simple Makefiles. To build with g++ and OpenMP simply type 'make' -in the 'example/tutorial' directory. This will build all examples in the -subfolders. To change the build options refer to the Programming Guide -in the compilation section. - -============================================================================ -====Running Unit Tests====================================================== -============================================================================ +# Running Unit Tests To run the unit tests create a build directory and run the following commands @@ -121,30 +122,35 @@ make test Run KOKKOS_PATH/generate_makefile.bash --help for more detailed options such as changing the device type for which to build. -============================================================================ -====Install the library===================================================== -============================================================================ +# Installing the library To install Kokkos as a library create a build directory and run the following KOKKOS_PATH/generate_makefile.bash --prefix=INSTALL_PATH -make lib +make kokkoslib make install KOKKOS_PATH/generate_makefile.bash --help for more detailed options such as changing the device type for which to build. -============================================================================ -====CMakeFiles============================================================== -============================================================================ +Note that in many cases it is preferable to build Kokkos inline with an +application. The main reason is that you may otherwise need many different +configurations of Kokkos installed depending on the required compile time +features an application needs. For example there is only one default +execution space, which means you need different installations to have OpenMP +or Pthreads as the default space. Also for the CUDA backend there are certain +choices, such as allowing relocatable device code, which must be made at +installation time. Building Kokkos inline uses largely the same process +as compiling an application against an installed Kokkos library. See for +example benchmarks/bytes_and_flops/Makefile which can be used with an installed +library and for an inline build. -The CMake files contained in this repository require Tribits and are used -for integration with Trilinos. They do not currently support a standalone -CMake build. +### CMake -=========================================================================== -====Kokkos and CUDA UVM==================================================== -=========================================================================== +Kokkos supports being build as part of a CMake applications. An example can +be found in example/cmake_build. + +# Kokkos and CUDA UVM Kokkos does support UVM as a specific memory space called CudaUVMSpace. Allocations made with that space are accessible from host and device. @@ -154,25 +160,16 @@ In either case UVM comes with a number of restrictions: running. This will lead to segfaults. To avoid that you either need to call Kokkos::Cuda::fence() (or just Kokkos::fence()), after kernels, or you can set the environment variable CUDA_LAUNCH_BLOCKING=1. -Furthermore in multi socket multi GPU machines, UVM defaults to using -zero copy allocations for technical reasons related to using multiple +Furthermore in multi socket multi GPU machines without NVLINK, UVM defaults +to using zero copy allocations for technical reasons related to using multiple GPUs from the same process. If an executable doesn't do that (e.g. each MPI rank of an application uses a single GPU [can be the same GPU for multiple MPI ranks]) you can set CUDA_MANAGED_FORCE_DEVICE_ALLOC=1. This will enforce proper UVM allocations, but can lead to errors if more than a single GPU is used by a single process. -=========================================================================== -====Contributing=========================================================== -=========================================================================== - -Contributions to Kokkos are welcome. In order to do so, please open an issue -where a feature request or bug can be discussed. Then issue a pull request -with your contribution. Pull requests must be issued against the develop branch. -=========================================================================== -====Citing Kokkos========================================================== -=========================================================================== +# Citing Kokkos If you publish work which mentions Kokkos, please cite the following paper: diff --git a/lib/kokkos/algorithms/src/Kokkos_Random.hpp b/lib/kokkos/algorithms/src/Kokkos_Random.hpp index 3db9a145d7c9dc7ab1da3a1e6f034a2a0e7d929b..1c659e44a45e5cd1d972f441f956ce4e47de2d2e 100644 --- a/lib/kokkos/algorithms/src/Kokkos_Random.hpp +++ b/lib/kokkos/algorithms/src/Kokkos_Random.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -1530,7 +1530,7 @@ struct fill_random_functor_range<ViewType,RandomPool,loops,1,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) + if(idx<static_cast<IndexType>(a.extent(0))) a(idx) = Rand::draw(gen,range); } rand_pool.free_state(gen); @@ -1555,8 +1555,8 @@ struct fill_random_functor_range<ViewType,RandomPool,loops,2,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) a(idx,k) = Rand::draw(gen,range); } } @@ -1583,9 +1583,9 @@ struct fill_random_functor_range<ViewType,RandomPool,loops,3,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) a(idx,k,l) = Rand::draw(gen,range); } } @@ -1611,10 +1611,10 @@ struct fill_random_functor_range<ViewType,RandomPool,loops,4, IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) - for(IndexType m=0;m<static_cast<IndexType>(a.dimension_3());m++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) + for(IndexType m=0;m<static_cast<IndexType>(a.extent(3));m++) a(idx,k,l,m) = Rand::draw(gen,range); } } @@ -1640,11 +1640,11 @@ struct fill_random_functor_range<ViewType,RandomPool,loops,5,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) - for(IndexType m=0;m<static_cast<IndexType>(a.dimension_3());m++) - for(IndexType n=0;n<static_cast<IndexType>(a.dimension_4());n++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) + for(IndexType m=0;m<static_cast<IndexType>(a.extent(3));m++) + for(IndexType n=0;n<static_cast<IndexType>(a.extent(4));n++) a(idx,k,l,m,n) = Rand::draw(gen,range); } } @@ -1670,12 +1670,12 @@ struct fill_random_functor_range<ViewType,RandomPool,loops,6,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) - for(IndexType m=0;m<static_cast<IndexType>(a.dimension_3());m++) - for(IndexType n=0;n<static_cast<IndexType>(a.dimension_4());n++) - for(IndexType o=0;o<static_cast<IndexType>(a.dimension_5());o++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) + for(IndexType m=0;m<static_cast<IndexType>(a.extent(3));m++) + for(IndexType n=0;n<static_cast<IndexType>(a.extent(4));n++) + for(IndexType o=0;o<static_cast<IndexType>(a.extent(5));o++) a(idx,k,l,m,n,o) = Rand::draw(gen,range); } } @@ -1701,13 +1701,13 @@ struct fill_random_functor_range<ViewType,RandomPool,loops,7,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) - for(IndexType m=0;m<static_cast<IndexType>(a.dimension_3());m++) - for(IndexType n=0;n<static_cast<IndexType>(a.dimension_4());n++) - for(IndexType o=0;o<static_cast<IndexType>(a.dimension_5());o++) - for(IndexType p=0;p<static_cast<IndexType>(a.dimension_6());p++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) + for(IndexType m=0;m<static_cast<IndexType>(a.extent(3));m++) + for(IndexType n=0;n<static_cast<IndexType>(a.extent(4));n++) + for(IndexType o=0;o<static_cast<IndexType>(a.extent(5));o++) + for(IndexType p=0;p<static_cast<IndexType>(a.extent(6));p++) a(idx,k,l,m,n,o,p) = Rand::draw(gen,range); } } @@ -1733,14 +1733,14 @@ struct fill_random_functor_range<ViewType,RandomPool,loops,8,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) - for(IndexType m=0;m<static_cast<IndexType>(a.dimension_3());m++) - for(IndexType n=0;n<static_cast<IndexType>(a.dimension_4());n++) - for(IndexType o=0;o<static_cast<IndexType>(a.dimension_5());o++) - for(IndexType p=0;p<static_cast<IndexType>(a.dimension_6());p++) - for(IndexType q=0;q<static_cast<IndexType>(a.dimension_7());q++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) + for(IndexType m=0;m<static_cast<IndexType>(a.extent(3));m++) + for(IndexType n=0;n<static_cast<IndexType>(a.extent(4));n++) + for(IndexType o=0;o<static_cast<IndexType>(a.extent(5));o++) + for(IndexType p=0;p<static_cast<IndexType>(a.extent(6));p++) + for(IndexType q=0;q<static_cast<IndexType>(a.extent(7));q++) a(idx,k,l,m,n,o,p,q) = Rand::draw(gen,range); } } @@ -1765,7 +1765,7 @@ struct fill_random_functor_begin_end<ViewType,RandomPool,loops,1,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) + if(idx<static_cast<IndexType>(a.extent(0))) a(idx) = Rand::draw(gen,begin,end); } rand_pool.free_state(gen); @@ -1790,8 +1790,8 @@ struct fill_random_functor_begin_end<ViewType,RandomPool,loops,2,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) a(idx,k) = Rand::draw(gen,begin,end); } } @@ -1818,9 +1818,9 @@ struct fill_random_functor_begin_end<ViewType,RandomPool,loops,3,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) a(idx,k,l) = Rand::draw(gen,begin,end); } } @@ -1846,10 +1846,10 @@ struct fill_random_functor_begin_end<ViewType,RandomPool,loops,4,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) - for(IndexType m=0;m<static_cast<IndexType>(a.dimension_3());m++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) + for(IndexType m=0;m<static_cast<IndexType>(a.extent(3));m++) a(idx,k,l,m) = Rand::draw(gen,begin,end); } } @@ -1875,11 +1875,11 @@ struct fill_random_functor_begin_end<ViewType,RandomPool,loops,5,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())){ - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_1());l++) - for(IndexType m=0;m<static_cast<IndexType>(a.dimension_2());m++) - for(IndexType n=0;n<static_cast<IndexType>(a.dimension_3());n++) - for(IndexType o=0;o<static_cast<IndexType>(a.dimension_4());o++) + if(idx<static_cast<IndexType>(a.extent(0))){ + for(IndexType l=0;l<static_cast<IndexType>(a.extent(1));l++) + for(IndexType m=0;m<static_cast<IndexType>(a.extent(2));m++) + for(IndexType n=0;n<static_cast<IndexType>(a.extent(3));n++) + for(IndexType o=0;o<static_cast<IndexType>(a.extent(4));o++) a(idx,l,m,n,o) = Rand::draw(gen,begin,end); } } @@ -1905,12 +1905,12 @@ struct fill_random_functor_begin_end<ViewType,RandomPool,loops,6,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) - for(IndexType m=0;m<static_cast<IndexType>(a.dimension_3());m++) - for(IndexType n=0;n<static_cast<IndexType>(a.dimension_4());n++) - for(IndexType o=0;o<static_cast<IndexType>(a.dimension_5());o++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) + for(IndexType m=0;m<static_cast<IndexType>(a.extent(3));m++) + for(IndexType n=0;n<static_cast<IndexType>(a.extent(4));n++) + for(IndexType o=0;o<static_cast<IndexType>(a.extent(5));o++) a(idx,k,l,m,n,o) = Rand::draw(gen,begin,end); } } @@ -1937,13 +1937,13 @@ struct fill_random_functor_begin_end<ViewType,RandomPool,loops,7,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) - for(IndexType m=0;m<static_cast<IndexType>(a.dimension_3());m++) - for(IndexType n=0;n<static_cast<IndexType>(a.dimension_4());n++) - for(IndexType o=0;o<static_cast<IndexType>(a.dimension_5());o++) - for(IndexType p=0;p<static_cast<IndexType>(a.dimension_6());p++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) + for(IndexType m=0;m<static_cast<IndexType>(a.extent(3));m++) + for(IndexType n=0;n<static_cast<IndexType>(a.extent(4));n++) + for(IndexType o=0;o<static_cast<IndexType>(a.extent(5));o++) + for(IndexType p=0;p<static_cast<IndexType>(a.extent(6));p++) a(idx,k,l,m,n,o,p) = Rand::draw(gen,begin,end); } } @@ -1969,14 +1969,14 @@ struct fill_random_functor_begin_end<ViewType,RandomPool,loops,8,IndexType>{ typename RandomPool::generator_type gen = rand_pool.get_state(); for(IndexType j=0;j<loops;j++) { const IndexType idx = i*loops+j; - if(idx<static_cast<IndexType>(a.dimension_0())) { - for(IndexType k=0;k<static_cast<IndexType>(a.dimension_1());k++) - for(IndexType l=0;l<static_cast<IndexType>(a.dimension_2());l++) - for(IndexType m=0;m<static_cast<IndexType>(a.dimension_3());m++) - for(IndexType n=0;n<static_cast<IndexType>(a.dimension_4());n++) - for(IndexType o=0;o<static_cast<IndexType>(a.dimension_5());o++) - for(IndexType p=0;p<static_cast<IndexType>(a.dimension_6());p++) - for(IndexType q=0;q<static_cast<IndexType>(a.dimension_7());q++) + if(idx<static_cast<IndexType>(a.extent(0))) { + for(IndexType k=0;k<static_cast<IndexType>(a.extent(1));k++) + for(IndexType l=0;l<static_cast<IndexType>(a.extent(2));l++) + for(IndexType m=0;m<static_cast<IndexType>(a.extent(3));m++) + for(IndexType n=0;n<static_cast<IndexType>(a.extent(4));n++) + for(IndexType o=0;o<static_cast<IndexType>(a.extent(5));o++) + for(IndexType p=0;p<static_cast<IndexType>(a.extent(6));p++) + for(IndexType q=0;q<static_cast<IndexType>(a.extent(7));q++) a(idx,k,l,m,n,o,p,q) = Rand::draw(gen,begin,end); } } @@ -1988,14 +1988,14 @@ struct fill_random_functor_begin_end<ViewType,RandomPool,loops,8,IndexType>{ template<class ViewType, class RandomPool, class IndexType = int64_t> void fill_random(ViewType a, RandomPool g, typename ViewType::const_value_type range) { - int64_t LDA = a.dimension_0(); + int64_t LDA = a.extent(0); if(LDA>0) parallel_for((LDA+127)/128,Impl::fill_random_functor_range<ViewType,RandomPool,128,ViewType::Rank,IndexType>(a,g,range)); } template<class ViewType, class RandomPool, class IndexType = int64_t> void fill_random(ViewType a, RandomPool g, typename ViewType::const_value_type begin,typename ViewType::const_value_type end ) { - int64_t LDA = a.dimension_0(); + int64_t LDA = a.extent(0); if(LDA>0) parallel_for((LDA+127)/128,Impl::fill_random_functor_begin_end<ViewType,RandomPool,128,ViewType::Rank,IndexType>(a,g,begin,end)); } diff --git a/lib/kokkos/algorithms/src/Kokkos_Sort.hpp b/lib/kokkos/algorithms/src/Kokkos_Sort.hpp index 237de751fe4b30afa1abcf475ca8af8c52cea7ab..888476045b8ee4a424e668a5da71567c408af934 100644 --- a/lib/kokkos/algorithms/src/Kokkos_Sort.hpp +++ b/lib/kokkos/algorithms/src/Kokkos_Sort.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -120,7 +120,6 @@ public: KOKKOS_INLINE_FUNCTION void operator() (const int& i) const { - // printf("copy: dst(%i) src(%i)\n",i+dst_offset,i); copy_op::copy(dst_values,i+dst_offset,src_values,i); } }; @@ -151,20 +150,22 @@ public: DstViewType dst_values ; perm_view_type sort_order ; src_view_type src_values ; + int src_offset ; copy_permute_functor( DstViewType const & dst_values_ , PermuteViewType const & sort_order_ , SrcViewType const & src_values_ + , int const & src_offset_ ) : dst_values( dst_values_ ) , sort_order( sort_order_ ) , src_values( src_values_ ) + , src_offset( src_offset_ ) {} KOKKOS_INLINE_FUNCTION void operator() (const int& i) const { - // printf("copy_permute: dst(%i) src(%i)\n",i,sort_order(i)); - copy_op::copy(dst_values,i,src_values,sort_order(i)); + copy_op::copy(dst_values,i,src_values,src_offset+sort_order(i)); } }; @@ -259,19 +260,21 @@ public: // Create the permutation vector, the bin_offset array and the bin_count array. Can be called again if keys changed void create_permute_vector() { const size_t len = range_end - range_begin ; - Kokkos::parallel_for (Kokkos::RangePolicy<execution_space,bin_count_tag> (0,len),*this); - Kokkos::parallel_scan(Kokkos::RangePolicy<execution_space,bin_offset_tag> (0,bin_op.max_bins()) ,*this); + Kokkos::parallel_for ("Kokkos::Sort::BinCount",Kokkos::RangePolicy<execution_space,bin_count_tag> (0,len),*this); + Kokkos::parallel_scan("Kokkos::Sort::BinOffset",Kokkos::RangePolicy<execution_space,bin_offset_tag> (0,bin_op.max_bins()) ,*this); Kokkos::deep_copy(bin_count_atomic,0); - Kokkos::parallel_for (Kokkos::RangePolicy<execution_space,bin_binning_tag> (0,len),*this); + Kokkos::parallel_for ("Kokkos::Sort::BinBinning",Kokkos::RangePolicy<execution_space,bin_binning_tag> (0,len),*this); if(sort_within_bins) - Kokkos::parallel_for (Kokkos::RangePolicy<execution_space,bin_sort_bins_tag>(0,bin_op.max_bins()) ,*this); + Kokkos::parallel_for ("Kokkos::Sort::BinSort",Kokkos::RangePolicy<execution_space,bin_sort_bins_tag>(0,bin_op.max_bins()) ,*this); } - // Sort a view with respect ot the first dimension using the permutation array + // Sort a subset of a view with respect to the first dimension using the permutation array template<class ValuesViewType> - void sort( ValuesViewType const & values) + void sort( ValuesViewType const & values + , int values_range_begin + , int values_range_end) const { typedef Kokkos::View< typename ValuesViewType::data_type, @@ -280,6 +283,10 @@ public: scratch_view_type ; const size_t len = range_end - range_begin ; + const size_t values_len = values_range_end - values_range_begin ; + if (len != values_len) { + Kokkos::abort("BinSort::sort: values range length != permutation vector length"); + } scratch_view_type sorted_values("Scratch", @@ -297,19 +304,25 @@ public: , offset_type /* PermuteViewType */ , ValuesViewType /* SrcViewType */ > - functor( sorted_values , sort_order , values ); + functor( sorted_values , sort_order , values, values_range_begin - range_begin ); - parallel_for( Kokkos::RangePolicy<execution_space>(0,len),functor); + parallel_for("Kokkos::Sort::CopyPermute", Kokkos::RangePolicy<execution_space>(0,len),functor); } { copy_functor< ValuesViewType , scratch_view_type > functor( values , range_begin , sorted_values ); - parallel_for( Kokkos::RangePolicy<execution_space>(0,len),functor); + parallel_for("Kokkos::Sort::Copy", Kokkos::RangePolicy<execution_space>(0,len),functor); } } + template<class ValuesViewType> + void sort( ValuesViewType const & values ) const + { + this->sort( values, 0, /*values.extent(0)*/ range_end - range_begin ); + } + // Get the permutation vector KOKKOS_INLINE_FUNCTION offset_type get_permute_vector() const { return sort_order;} @@ -327,7 +340,7 @@ public: KOKKOS_INLINE_FUNCTION void operator() (const bin_count_tag& tag, const int& i) const { const int j = range_begin + i ; - bin_count_atomic(bin_op.bin(keys,j))++; + bin_count_atomic(bin_op.bin(keys, j))++; } KOKKOS_INLINE_FUNCTION @@ -512,7 +525,7 @@ void sort( ViewType const & view , bool const always_use_kokkos_sort = false) Kokkos::Experimental::MinMaxScalar<typename ViewType::non_const_value_type> result; Kokkos::Experimental::MinMax<typename ViewType::non_const_value_type> reducer(result); - parallel_reduce(Kokkos::RangePolicy<typename ViewType::execution_space>(0,view.extent(0)), + parallel_reduce("Kokkos::Sort::FindExtent",Kokkos::RangePolicy<typename ViewType::execution_space>(0,view.extent(0)), Impl::min_max_functor<ViewType>(view),reducer); if(result.min_val == result.max_val) return; BinSort<ViewType, CompType> bin_sort(view,CompType(view.extent(0)/2,result.min_val,result.max_val),true); @@ -532,7 +545,7 @@ void sort( ViewType view Kokkos::Experimental::MinMaxScalar<typename ViewType::non_const_value_type> result; Kokkos::Experimental::MinMax<typename ViewType::non_const_value_type> reducer(result); - parallel_reduce( range_policy( begin , end ) + parallel_reduce("Kokkos::Sort::FindExtent", range_policy( begin , end ) , Impl::min_max_functor<ViewType>(view),reducer ); if(result.min_val == result.max_val) return; @@ -541,8 +554,9 @@ void sort( ViewType view bin_sort(view,begin,end,CompType((end-begin)/2,result.min_val,result.max_val),true); bin_sort.create_permute_vector(); - bin_sort.sort(view); + bin_sort.sort(view,begin,end); } + } #endif diff --git a/lib/kokkos/algorithms/unit_tests/TestCuda.cpp b/lib/kokkos/algorithms/unit_tests/TestCuda.cpp index 710eeb8ada08065dc4f1af33c3f1ee616ceda241..86fdccd0e784e8bc56472782a87a31a050f468fe 100644 --- a/lib/kokkos/algorithms/unit_tests/TestCuda.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestCuda.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -61,14 +61,9 @@ class cuda : public ::testing::Test { protected: static void SetUpTestCase() { - std::cout << std::setprecision(5) << std::scientific; - Kokkos::HostSpace::execution_space::initialize(); - Kokkos::Cuda::initialize( Kokkos::Cuda::SelectDevice(0) ); } static void TearDownTestCase() { - Kokkos::Cuda::finalize(); - Kokkos::HostSpace::execution_space::finalize(); } }; diff --git a/lib/kokkos/algorithms/unit_tests/TestOpenMP.cpp b/lib/kokkos/algorithms/unit_tests/TestOpenMP.cpp index c2c118ce1a140e69f0c87ddd7c0fc46870b5f58c..c4ddde7b7f71995bb25655cbbb5270b671db7f3e 100644 --- a/lib/kokkos/algorithms/unit_tests/TestOpenMP.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestOpenMP.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -60,25 +60,10 @@ protected: static void SetUpTestCase() { std::cout << std::setprecision(5) << std::scientific; - - int threads_count = 0; - #pragma omp parallel - { - #pragma omp atomic - ++threads_count; - } - - if (threads_count > 3) { - threads_count /= 2; - } - - Kokkos::OpenMP::initialize( threads_count ); - Kokkos::OpenMP::print_configuration( std::cout ); } static void TearDownTestCase() { - Kokkos::OpenMP::finalize(); } }; diff --git a/lib/kokkos/algorithms/unit_tests/TestROCm.cpp b/lib/kokkos/algorithms/unit_tests/TestROCm.cpp index 720b377ed2fb29a74d241ea6c42b46e3b15b5541..15179509bbfc1fe1e193081c8387e237dfa2525c 100644 --- a/lib/kokkos/algorithms/unit_tests/TestROCm.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestROCm.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -62,13 +62,9 @@ protected: static void SetUpTestCase() { std::cout << std::setprecision(5) << std::scientific; - Kokkos::HostSpace::execution_space::initialize(); - Kokkos::Experimental::ROCm::initialize( Kokkos::Experimental::ROCm::SelectDevice(0) ); } static void TearDownTestCase() { - Kokkos::Experimental::ROCm::finalize(); - Kokkos::HostSpace::execution_space::finalize(); } }; diff --git a/lib/kokkos/algorithms/unit_tests/TestRandom.hpp b/lib/kokkos/algorithms/unit_tests/TestRandom.hpp index 2771f1793d76371afbab136b9d71641e93131a2b..73bd416f2aba49e311884096c31db295b41f1066 100644 --- a/lib/kokkos/algorithms/unit_tests/TestRandom.hpp +++ b/lib/kokkos/algorithms/unit_tests/TestRandom.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/algorithms/unit_tests/TestSerial.cpp b/lib/kokkos/algorithms/unit_tests/TestSerial.cpp index a1df93e07b51482408c861919968953674de4c2e..9cf998f7732628bf71e8bc8ea90fcf6e41a27f3d 100644 --- a/lib/kokkos/algorithms/unit_tests/TestSerial.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestSerial.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -62,13 +62,10 @@ class serial : public ::testing::Test { protected: static void SetUpTestCase() { - std::cout << std::setprecision (5) << std::scientific; - Kokkos::Serial::initialize (); } static void TearDownTestCase () { - Kokkos::Serial::finalize (); } }; diff --git a/lib/kokkos/algorithms/unit_tests/TestSort.hpp b/lib/kokkos/algorithms/unit_tests/TestSort.hpp index 2cb0b897127b1c5401504b27adc24e4abf395f3d..e0c646c199be04841fbf0354905231ec00abf322 100644 --- a/lib/kokkos/algorithms/unit_tests/TestSort.hpp +++ b/lib/kokkos/algorithms/unit_tests/TestSort.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -171,10 +171,10 @@ void test_3D_sort(unsigned int n) { double sum_after = 0.0; unsigned int sort_fails = 0; - Kokkos::parallel_reduce(keys.dimension_0(),sum3D<ExecutionSpace, KeyType>(keys),sum_before); + Kokkos::parallel_reduce(keys.extent(0),sum3D<ExecutionSpace, KeyType>(keys),sum_before); int bin_1d = 1; - while( bin_1d*bin_1d*bin_1d*4< (int) keys.dimension_0() ) bin_1d*=2; + while( bin_1d*bin_1d*bin_1d*4< (int) keys.extent(0) ) bin_1d*=2; int bin_max[3] = {bin_1d,bin_1d,bin_1d}; typename KeyViewType::value_type min[3] = {0,0,0}; typename KeyViewType::value_type max[3] = {100,100,100}; @@ -186,8 +186,8 @@ void test_3D_sort(unsigned int n) { Sorter.create_permute_vector(); Sorter.template sort< KeyViewType >(keys); - Kokkos::parallel_reduce(keys.dimension_0(),sum3D<ExecutionSpace, KeyType>(keys),sum_after); - Kokkos::parallel_reduce(keys.dimension_0()-1,bin3d_is_sorted_struct<ExecutionSpace, KeyType>(keys,bin_1d,min[0],max[0]),sort_fails); + Kokkos::parallel_reduce(keys.extent(0),sum3D<ExecutionSpace, KeyType>(keys),sum_after); + Kokkos::parallel_reduce(keys.extent(0)-1,bin3d_is_sorted_struct<ExecutionSpace, KeyType>(keys,bin_1d,min[0],max[0]),sort_fails); double ratio = sum_before/sum_after; double epsilon = 1e-10; @@ -205,24 +205,13 @@ void test_3D_sort(unsigned int n) { template<class ExecutionSpace, typename KeyType> void test_dynamic_view_sort(unsigned int n ) { - typedef typename ExecutionSpace::memory_space memory_space ; typedef Kokkos::Experimental::DynamicView<KeyType*,ExecutionSpace> KeyDynamicViewType; typedef Kokkos::View<KeyType*,ExecutionSpace> KeyViewType; const size_t upper_bound = 2 * n ; + const size_t min_chunk_size = 1024; - const size_t total_alloc_size = n * sizeof(KeyType) * 1.2 ; - const size_t superblock_size = std::min(total_alloc_size, size_t(1000000)); - - typename KeyDynamicViewType::memory_pool - pool( memory_space() - , n * sizeof(KeyType) * 1.2 - , 500 /* min block size in bytes */ - , 30000 /* max block size in bytes */ - , superblock_size - ); - - KeyDynamicViewType keys("Keys",pool,upper_bound); + KeyDynamicViewType keys("Keys", min_chunk_size, upper_bound); keys.resize_serial(n); @@ -230,13 +219,15 @@ void test_dynamic_view_sort(unsigned int n ) // Test sorting array with all numbers equal Kokkos::deep_copy(keys_view,KeyType(1)); - Kokkos::Experimental::deep_copy(keys,keys_view); + Kokkos::deep_copy(keys,keys_view); Kokkos::sort(keys, 0 /* begin */ , n /* end */ ); Kokkos::Random_XorShift64_Pool<ExecutionSpace> g(1931); Kokkos::fill_random(keys_view,g,Kokkos::Random_XorShift64_Pool<ExecutionSpace>::generator_type::MAX_URAND); - Kokkos::Experimental::deep_copy(keys,keys_view); + ExecutionSpace::fence(); + Kokkos::deep_copy(keys,keys_view); + //ExecutionSpace::fence(); double sum_before = 0.0; double sum_after = 0.0; @@ -246,7 +237,9 @@ void test_dynamic_view_sort(unsigned int n ) Kokkos::sort(keys, 0 /* begin */ , n /* end */ ); - Kokkos::Experimental::deep_copy( keys_view , keys ); + ExecutionSpace::fence(); // Need this fence to prevent BusError with Cuda + Kokkos::deep_copy( keys_view , keys ); + //ExecutionSpace::fence(); Kokkos::parallel_reduce(n,sum<ExecutionSpace, KeyType>(keys_view),sum_after); Kokkos::parallel_reduce(n-1,is_sorted_struct<ExecutionSpace, KeyType>(keys_view),sort_fails); @@ -269,6 +262,74 @@ void test_dynamic_view_sort(unsigned int n ) //---------------------------------------------------------------------------- +template<class ExecutionSpace> +void test_issue_1160() +{ + Kokkos::View<int*, ExecutionSpace> element_("element", 10); + Kokkos::View<double*, ExecutionSpace> x_("x", 10); + Kokkos::View<double*, ExecutionSpace> v_("y", 10); + + auto h_element = Kokkos::create_mirror_view(element_); + auto h_x = Kokkos::create_mirror_view(x_); + auto h_v = Kokkos::create_mirror_view(v_); + + h_element(0) = 9; + h_element(1) = 8; + h_element(2) = 7; + h_element(3) = 6; + h_element(4) = 5; + h_element(5) = 4; + h_element(6) = 3; + h_element(7) = 2; + h_element(8) = 1; + h_element(9) = 0; + + for (int i = 0; i < 10; ++i) { + h_v.access(i, 0) = h_x.access(i, 0) = double(h_element(i)); + } + Kokkos::deep_copy(element_, h_element); + Kokkos::deep_copy(x_, h_x); + Kokkos::deep_copy(v_, h_v); + + typedef decltype(element_) KeyViewType; + typedef Kokkos::BinOp1D< KeyViewType > BinOp; + + int begin = 3; + int end = 8; + auto max = h_element(begin); + auto min = h_element(end - 1); + BinOp binner(end - begin, min, max); + + Kokkos::BinSort<KeyViewType , BinOp > Sorter(element_,begin,end,binner,false); + Sorter.create_permute_vector(); + Sorter.sort(element_,begin,end); + + Sorter.sort(x_,begin,end); + Sorter.sort(v_,begin,end); + + Kokkos::deep_copy(h_element, element_); + Kokkos::deep_copy(h_x, x_); + Kokkos::deep_copy(h_v, v_); + + ASSERT_EQ(h_element(0), 9); + ASSERT_EQ(h_element(1), 8); + ASSERT_EQ(h_element(2), 7); + ASSERT_EQ(h_element(3), 2); + ASSERT_EQ(h_element(4), 3); + ASSERT_EQ(h_element(5), 4); + ASSERT_EQ(h_element(6), 5); + ASSERT_EQ(h_element(7), 6); + ASSERT_EQ(h_element(8), 1); + ASSERT_EQ(h_element(9), 0); + + for (int i = 0; i < 10; ++i) { + ASSERT_EQ(h_element(i), int(h_x.access(i, 0))); + ASSERT_EQ(h_element(i), int(h_v.access(i, 0))); + } +} + +//---------------------------------------------------------------------------- + template<class ExecutionSpace, typename KeyType> void test_sort(unsigned int N) { @@ -278,6 +339,7 @@ void test_sort(unsigned int N) test_3D_sort<ExecutionSpace,KeyType>(N); test_dynamic_view_sort<ExecutionSpace,KeyType>(N*N); #endif + test_issue_1160<ExecutionSpace>(); } } diff --git a/lib/kokkos/algorithms/unit_tests/TestThreads.cpp b/lib/kokkos/algorithms/unit_tests/TestThreads.cpp index 08749779ff56a692cebad20fcf94815c5ff7b732..99cdb7da92a253d9469b956c27ee06f212421c0d 100644 --- a/lib/kokkos/algorithms/unit_tests/TestThreads.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestThreads.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -63,25 +63,10 @@ protected: static void SetUpTestCase() { std::cout << std::setprecision(5) << std::scientific; - - unsigned num_threads = 4; - - if (Kokkos::hwloc::available()) { - num_threads = Kokkos::hwloc::get_available_numa_count() - * Kokkos::hwloc::get_available_cores_per_numa() - // * Kokkos::hwloc::get_available_threads_per_core() - ; - - } - - std::cout << "Threads: " << num_threads << std::endl; - - Kokkos::Threads::initialize( num_threads ); } static void TearDownTestCase() { - Kokkos::Threads::finalize(); } }; diff --git a/lib/kokkos/algorithms/unit_tests/UnitTestMain.cpp b/lib/kokkos/algorithms/unit_tests/UnitTestMain.cpp index 9e75b580bc0f64b53c402764197e11d1774203d8..8feb08332fa4d976395edfaf59b8e8653484c0f2 100644 --- a/lib/kokkos/algorithms/unit_tests/UnitTestMain.cpp +++ b/lib/kokkos/algorithms/unit_tests/UnitTestMain.cpp @@ -35,16 +35,20 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER */ #include <gtest/gtest.h> +#include <Kokkos_Core.hpp> int main(int argc, char *argv[]) { + Kokkos::initialize(argc,argv); ::testing::InitGoogleTest(&argc,argv); - return RUN_ALL_TESTS(); + int result = RUN_ALL_TESTS(); + Kokkos::finalize(); + return result; } diff --git a/lib/kokkos/benchmarks/atomic/Makefile b/lib/kokkos/benchmarks/atomic/Makefile index 41875ee5e49cc132ffa7879e2812ff80aefa49b4..64b43917de2eadf2f2f96419e83b74cee05265fa 100644 --- a/lib/kokkos/benchmarks/atomic/Makefile +++ b/lib/kokkos/benchmarks/atomic/Makefile @@ -10,7 +10,7 @@ default: build ifneq (,$(findstring Cuda,$(KOKKOS_DEVICES))) -CXX = ${KOKKOS_PATH}/config/nvcc_wrapper +CXX = ${KOKKOS_PATH}/bin/nvcc_wrapper EXE = ${EXE_NAME}.cuda KOKKOS_CUDA_OPTIONS = "enable_lambda" else diff --git a/lib/kokkos/benchmarks/benchmark_suite/scripts/run_tests.bash b/lib/kokkos/benchmarks/benchmark_suite/scripts/run_tests.bash index 63aaca9e402df9de8691b3deaee6c26553043de5..9dded535e8bfe20677d302d8b4f8e2cca1bf02ea 100755 --- a/lib/kokkos/benchmarks/benchmark_suite/scripts/run_tests.bash +++ b/lib/kokkos/benchmarks/benchmark_suite/scripts/run_tests.bash @@ -3,7 +3,7 @@ # BytesAndFlops cd build/bytes_and_flops -USE_CUDA=`grep "_CUDA 1" KokkosCore_config.h | wc -l` +USE_CUDA=`grep "_CUDA" KokkosCore_config.h | wc -l` if [[ ${USE_CUDA} > 0 ]]; then BAF_EXE=bytes_and_flops.cuda @@ -41,4 +41,4 @@ cd ../.. echo "MiniFE: ${FE_PERF_1} ${FE_PERF_2}" PERF_RESULT=`echo "${BAF_PERF_1} ${BAF_PERF_2} ${MD_PERF_1} ${MD_PERF_2} ${FE_PERF_1} ${FE_PERF_2}" | awk '{print ($1+$2+$3+$4+$5+$6)/6}'` -echo "Total Result: " ${PERF_RESULT} \ No newline at end of file +echo "Total Result: " ${PERF_RESULT} diff --git a/lib/kokkos/benchmarks/bytes_and_flops/bench.hpp b/lib/kokkos/benchmarks/bytes_and_flops/bench.hpp index e3fe42a652dfaa963578052664a8df71e03afce1..59b4d50c441eb5d4c58c99c53eee7f9c6b9adbd1 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/bench.hpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/bench.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/benchmarks/bytes_and_flops/bench_stride.hpp b/lib/kokkos/benchmarks/bytes_and_flops/bench_stride.hpp index b60ec849944b9415d4ad6e1cd3a627cafdc55854..6509c654e71b4fdfd5366e4699972d7d19fe7807 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/bench_stride.hpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/bench_stride.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/benchmarks/bytes_and_flops/bench_unroll_stride.hpp b/lib/kokkos/benchmarks/bytes_and_flops/bench_unroll_stride.hpp index 0992c5b54b6277f99d728710a37182695d3a6f92..c6651da1e7cf2e6d1a233dc90e9adf1211decf69 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/bench_unroll_stride.hpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/bench_unroll_stride.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/benchmarks/bytes_and_flops/main.cpp b/lib/kokkos/benchmarks/bytes_and_flops/main.cpp index 8db5ce0eb5e869c565ce8f3872baea5200e4beb4..4f46b38717df237f0d33c0ac101d105f41f3e9d8 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/main.cpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/main.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/benchmarks/gather/gather.hpp b/lib/kokkos/benchmarks/gather/gather.hpp index 406bd28983bd696e12cb82aeea388f94b6e80047..bbbd65850f75c00a928383d3c6ae2f9af27d7d95 100644 --- a/lib/kokkos/benchmarks/gather/gather.hpp +++ b/lib/kokkos/benchmarks/gather/gather.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/benchmarks/gather/gather_unroll.hpp b/lib/kokkos/benchmarks/gather/gather_unroll.hpp index 1d01b26ca77f2b7e58f5a1cbd5bbe251c3d558d3..1d9c99adf9e9909a21be2899f60000713e0208a4 100644 --- a/lib/kokkos/benchmarks/gather/gather_unroll.hpp +++ b/lib/kokkos/benchmarks/gather/gather_unroll.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/benchmarks/gather/main.cpp b/lib/kokkos/benchmarks/gather/main.cpp index 88eb0493c1861595069ae518a7fab628a37ce150..ca5238e7fdb527e56080f5b76eb6fa7c9487fcd3 100644 --- a/lib/kokkos/benchmarks/gather/main.cpp +++ b/lib/kokkos/benchmarks/gather/main.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/benchmarks/policy_performance/main.cpp b/lib/kokkos/benchmarks/policy_performance/main.cpp index b0ed9bb512f599a60eaa235bb80de1f1df33c755..2f5395734afdcfce41cc43c9b2322de4615a74b1 100644 --- a/lib/kokkos/benchmarks/policy_performance/main.cpp +++ b/lib/kokkos/benchmarks/policy_performance/main.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp b/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp index 11576413e2dc5e81f719a2dcc8786a156fcaa7b5..1ab437928de761bed614efc8a22d8c4d38fcf38f 100644 --- a/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp +++ b/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/cmake/Modules/FindHWLOC.cmake b/lib/kokkos/cmake/Modules/FindHWLOC.cmake index 273dcb5c8aac9dc7f442844ff48d0827488afe0c..60df8084d80815f79f0215c17b40f80db4c791c0 100644 --- a/lib/kokkos/cmake/Modules/FindHWLOC.cmake +++ b/lib/kokkos/cmake/Modules/FindHWLOC.cmake @@ -2,7 +2,7 @@ # FindHWLOC # ---------- # -# Try to find HWLOC. +# Try to find HWLOC, based on KOKKOS_HWLOC_DIR # # The following variables are defined: # @@ -10,8 +10,8 @@ # HWLOC_INCLUDE_DIR - HWLOC include directory # HWLOC_LIBRARIES - Libraries needed to use HWLOC -find_path(HWLOC_INCLUDE_DIR hwloc.h) -find_library(HWLOC_LIBRARIES hwloc) +find_path(HWLOC_INCLUDE_DIR hwloc.h PATHS "${KOKKOS_HWLOC_DIR}/include") +find_library(HWLOC_LIBRARIES hwloc PATHS "${KOKKOS_HWLOC_DIR}/lib") include(FindPackageHandleStandardArgs) find_package_handle_standard_args(HWLOC DEFAULT_MSG diff --git a/lib/kokkos/cmake/kokkos_build.cmake b/lib/kokkos/cmake/kokkos_build.cmake index f31680d6e28f24a33c941b5d4504d82321efe558..76d0655adb76753d09df3bbfd88ff6d98d7da013 100644 --- a/lib/kokkos/cmake/kokkos_build.cmake +++ b/lib/kokkos/cmake/kokkos_build.cmake @@ -1,7 +1,3 @@ -# kokkos_generated_settings.cmake includes the kokkos library itself in KOKKOS_LIBS -# which we do not want to use for the cmake builds so clean this up -string(REGEX REPLACE "-lkokkos" "" KOKKOS_LIBS ${KOKKOS_LIBS}) - ############################ Detect if submodule ############################### # # With thanks to StackOverflow: @@ -73,6 +69,19 @@ IF(KOKKOS_SEPARATE_LIBS) PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${KOKKOS_CXX_FLAGS}> ) + target_include_directories( + kokkoscore + PUBLIC + ${KOKKOS_TPL_INCLUDE_DIRS} + ) + + foreach(lib IN LISTS KOKKOS_TPL_LIBRARY_NAMES) + find_library(LIB_${lib} ${lib} PATHS ${KOKKOS_TPL_LIBRARY_DIRS}) + target_link_libraries(kokkoscore PUBLIC ${LIB_${lib}}) + endforeach() + + target_link_libraries(kokkoscore PUBLIC "${KOKKOS_LINK_FLAGS}") + # Install the kokkoscore library INSTALL (TARGETS kokkoscore EXPORT KokkosTargets @@ -81,12 +90,6 @@ IF(KOKKOS_SEPARATE_LIBS) RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) - TARGET_LINK_LIBRARIES( - kokkoscore - ${KOKKOS_LD_FLAGS} - ${KOKKOS_EXTRA_LIBS_LIST} - ) - # kokkoscontainers if (DEFINED KOKKOS_CONTAINERS_SRCS) ADD_LIBRARY( @@ -144,12 +147,19 @@ ELSE() PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${KOKKOS_CXX_FLAGS}> ) - TARGET_LINK_LIBRARIES( + target_include_directories( kokkos - ${KOKKOS_LD_FLAGS} - ${KOKKOS_EXTRA_LIBS_LIST} + PUBLIC + ${KOKKOS_TPL_INCLUDE_DIRS} ) + foreach(lib IN LISTS KOKKOS_TPL_LIBRARY_NAMES) + find_library(LIB_${lib} ${lib} PATHS ${KOKKOS_TPL_LIBRARY_DIRS}) + target_link_libraries(kokkos PUBLIC ${LIB_${lib}}) + endforeach() + + target_link_libraries(kokkos PUBLIC "${KOKKOS_LINK_FLAGS}") + # Install the kokkos library INSTALL (TARGETS kokkos EXPORT KokkosTargets diff --git a/lib/kokkos/cmake/kokkos_options.cmake b/lib/kokkos/cmake/kokkos_options.cmake index f17710a4ceba2b44b345dbd6a4de00d27a110fe2..25eb8e86ced2e549eefa1d1c0788ffc41654cbd8 100644 --- a/lib/kokkos/cmake/kokkos_options.cmake +++ b/lib/kokkos/cmake/kokkos_options.cmake @@ -25,11 +25,12 @@ list(APPEND KOKKOS_INTERNAL_ENABLE_OPTIONS_LIST Cuda_LDG_Intrinsic Debug Debug_DualView_Modify_Check - Debug_Bounds_Checkt + Debug_Bounds_Check Compiler_Warnings Profiling Profiling_Load_Print Aggressive_Vectorization + Deprecated_Code ) #------------------------------------------------------------------------------- @@ -263,7 +264,8 @@ set(KOKKOS_ENABLE_PROFILING ${KOKKOS_INTERNAL_ENABLE_PROFILING_DEFAULT} CACHE BO set_kokkos_default_default(PROFILING_LOAD_PRINT OFF) set(KOKKOS_ENABLE_PROFILING_LOAD_PRINT ${KOKKOS_INTERNAL_ENABLE_PROFILING_LOAD_PRINT_DEFAULT} CACHE BOOL "Enable profile load print.") - +set_kokkos_default_default(DEPRECATED_CODE ON) +set(KOKKOS_ENABLE_DEPRECATED_CODE ${KOKKOS_INTERNAL_ENABLE_DEPRECATED_CODE_DEFAULT} CACHE BOOL "Enable deprecated code.") #------------------------------------------------------------------------------- diff --git a/lib/kokkos/cmake/kokkos_settings.cmake b/lib/kokkos/cmake/kokkos_settings.cmake index 850a74a670ee8d90bc4095c205da8db4c6e9a665..579fab0c954c230d7690cda72a854d332d598be1 100644 --- a/lib/kokkos/cmake/kokkos_settings.cmake +++ b/lib/kokkos/cmake/kokkos_settings.cmake @@ -14,6 +14,13 @@ #------------------------------------------------------------------------------- # Ensure that KOKKOS_ARCH is in the ARCH_LIST +if (KOKKOS_ARCH MATCHES ",") + message("-- Detected a comma in: KOKKOS_ARCH=${KOKKOS_ARCH}") + message("-- Although we prefer KOKKOS_ARCH to be semicolon-delimited, we do allow") + message("-- comma-delimited values for compatibility with scripts (see github.com/trilinos/Trilinos/issues/2330)") + string(REPLACE "," ";" KOKKOS_ARCH "${KOKKOS_ARCH}") + message("-- Commas were changed to semicolons, now KOKKOS_ARCH=${KOKKOS_ARCH}") +endif() foreach(arch ${KOKKOS_ARCH}) list(FIND KOKKOS_ARCH_LIST ${arch} indx) if (indx EQUAL -1) @@ -23,14 +30,13 @@ foreach(arch ${KOKKOS_ARCH}) endforeach() # KOKKOS_SETTINGS uses KOKKOS_ARCH -string(REPLACE ";" "," KOKKOS_ARCH "${KOKKOS_ARCH}") -set(KOKKOS_ARCH ${KOKKOS_ARCH}) +string(REPLACE ";" "," KOKKOS_GMAKE_ARCH "${KOKKOS_ARCH}") # From Makefile.kokkos: Options: yes,no if(${KOKKOS_ENABLE_DEBUG}) - set(KOKKOS_DEBUG yes) + set(KOKKOS_GMAKE_DEBUG yes) else() - set(KOKKOS_DEBUG no) + set(KOKKOS_GMAKE_DEBUG no) endif() #------------------------------- KOKKOS_DEVICES -------------------------------- @@ -43,10 +49,10 @@ foreach(devopt ${KOKKOS_DEVICES_LIST}) endif () endforeach() # List needs to be comma-delmitted -string(REPLACE ";" "," KOKKOS_DEVICES "${KOKKOS_DEVICESl}") +string(REPLACE ";" "," KOKKOS_GMAKE_DEVICES "${KOKKOS_DEVICESl}") #------------------------------- KOKKOS_OPTIONS -------------------------------- -# From Makefile.kokkos: Options: aggressive_vectorization,disable_profiling +# From Makefile.kokkos: Options: aggressive_vectorization,disable_profiling,disable_deprecated_code #compiler_warnings, aggressive_vectorization, disable_profiling, disable_dualview_modify_check, enable_profile_load_print set(KOKKOS_OPTIONSl) @@ -57,7 +63,10 @@ if(${KOKKOS_ENABLE_AGGRESSIVE_VECTORIZATION}) list(APPEND KOKKOS_OPTIONSl aggressive_vectorization) endif() if(NOT ${KOKKOS_ENABLE_PROFILING}) - list(APPEND KOKKOS_OPTIONSl disable_vectorization) + list(APPEND KOKKOS_OPTIONSl disable_profiling) +endif() +if(NOT ${KOKKOS_ENABLE_DEPRECATED_CODE}) + list(APPEND KOKKOS_OPTIONSl disable_deprecated_code) endif() if(NOT ${KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK}) list(APPEND KOKKOS_OPTIONSl disable_dualview_modify_check) @@ -66,7 +75,7 @@ if(${KOKKOS_ENABLE_PROFILING_LOAD_PRINT}) list(APPEND KOKKOS_OPTIONSl enable_profile_load_print) endif() # List needs to be comma-delimitted -string(REPLACE ";" "," KOKKOS_OPTIONS "${KOKKOS_OPTIONSl}") +string(REPLACE ";" "," KOKKOS_GMAKE_OPTIONS "${KOKKOS_OPTIONSl}") #------------------------------- KOKKOS_USE_TPLS ------------------------------- @@ -78,19 +87,19 @@ foreach(tplopt ${KOKKOS_USE_TPLS_LIST}) endif () endforeach() # List needs to be comma-delimitted -string(REPLACE ";" "," KOKKOS_USE_TPLS "${KOKKOS_USE_TPLSl}") +string(REPLACE ";" "," KOKKOS_GMAKE_USE_TPLS "${KOKKOS_USE_TPLSl}") #------------------------------- KOKKOS_CUDA_OPTIONS --------------------------- # Construct the Makefile options -set(KOKKOS_CUDA_OPTIONS) +set(KOKKOS_CUDA_OPTIONSl) foreach(cudaopt ${KOKKOS_CUDA_OPTIONS_LIST}) if (${KOKKOS_ENABLE_CUDA_${cudaopt}}) list(APPEND KOKKOS_CUDA_OPTIONSl ${KOKKOS_INTERNAL_${cudaopt}}) endif () endforeach() # List needs to be comma-delmitted -string(REPLACE ";" "," KOKKOS_CUDA_OPTIONS "${KOKKOS_CUDA_OPTIONSl}") +string(REPLACE ";" "," KOKKOS_GMAKE_CUDA_OPTIONS "${KOKKOS_CUDA_OPTIONSl}") #------------------------------- PATH VARIABLES -------------------------------- # Want makefile to use same executables specified which means modifying @@ -100,10 +109,10 @@ string(REPLACE ";" "," KOKKOS_CUDA_OPTIONS "${KOKKOS_CUDA_OPTIONSl}") set(KOKKOS_INTERNAL_PATHS) set(addpathl) -foreach(kvar "CUDA;QTHREADS;${KOKKOS_USE_TPLS_LIST}") +foreach(kvar IN LISTS KOKKOS_USE_TPLS_LIST ITEMS CUDA QTHREADS) if(${KOKKOS_ENABLE_${kvar}}) if(DEFINED KOKKOS_${kvar}_DIR) - set(KOKKOS_INTERNAL_PATHS "${KOKKOS_INTERNAL_PATHS} ${kvar}_PATH=${KOKKOS_${kvar}_DIR}") + set(KOKKOS_INTERNAL_PATHS ${KOKKOS_INTERNAL_PATHS} "${kvar}_PATH=${KOKKOS_${kvar}_DIR}") if(IS_DIRECTORY ${KOKKOS_${kvar}_DIR}/bin) list(APPEND addpathl ${KOKKOS_${kvar}_DIR}/bin) endif() @@ -124,10 +133,9 @@ set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} KOKKOS_INSTALL_PATH=${CMAKE_INSTALL_PREFI # Form of KOKKOS_foo=$KOKKOS_foo foreach(kvar ARCH;DEVICES;DEBUG;OPTIONS;CUDA_OPTIONS;USE_TPLS) - set(KOKKOS_VAR KOKKOS_${kvar}) - if(DEFINED KOKKOS_${kvar}) - if (NOT "${${KOKKOS_VAR}}" STREQUAL "") - set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} ${KOKKOS_VAR}=${${KOKKOS_VAR}}) + if(DEFINED KOKKOS_GMAKE_${kvar}) + if (NOT "${KOKKOS_GMAKE_${kvar}}" STREQUAL "") + set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} KOKKOS_${kvar}=${KOKKOS_GMAKE_${kvar}}) endif() endif() endforeach() @@ -147,7 +155,7 @@ if (NOT "${KOKKOS_INTERNAL_PATHS}" STREQUAL "") set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} ${KOKKOS_INTERNAL_PATHS}) endif() if (NOT "${KOKKOS_INTERNAL_ADDTOPATH}" STREQUAL "") - set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} PATH=${KOKKOS_INTERNAL_ADDTOPATH}:\${PATH}) + set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} "PATH=\"${KOKKOS_INTERNAL_ADDTOPATH}:$ENV{PATH}\"") endif() # Final form that gets passed to make @@ -185,7 +193,7 @@ if(KOKKOS_CMAKE_VERBOSE) message(STATUS "") message(STATUS "Architectures:") - message(STATUS " ${KOKKOS_ARCH}") + message(STATUS " ${KOKKOS_GMAKE_ARCH}") message(STATUS "") message(STATUS "Enabled options") @@ -194,43 +202,14 @@ if(KOKKOS_CMAKE_VERBOSE) message(STATUS " KOKKOS_SEPARATE_LIBS") endif() - if(KOKKOS_ENABLE_HWLOC) - message(STATUS " KOKKOS_ENABLE_HWLOC") - endif() - - if(KOKKOS_ENABLE_MEMKIND) - message(STATUS " KOKKOS_ENABLE_MEMKIND") - endif() - - if(KOKKOS_ENABLE_DEBUG) - message(STATUS " KOKKOS_ENABLE_DEBUG") - endif() - - if(KOKKOS_ENABLE_PROFILING) - message(STATUS " KOKKOS_ENABLE_PROFILING") - endif() - - if(KOKKOS_ENABLE_AGGRESSIVE_VECTORIZATION) - message(STATUS " KOKKOS_ENABLE_AGGRESSIVE_VECTORIZATION") - endif() - - if(KOKKOS_ENABLE_CUDA) - if(KOKKOS_ENABLE_CUDA_LDG_INTRINSIC) - message(STATUS " KOKKOS_ENABLE_CUDA_LDG_INTRINSIC") - endif() - - if(KOKKOS_ENABLE_CUDA_UVM) - message(STATUS " KOKKOS_ENABLE_CUDA_UVM") - endif() - - if(KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE) - message(STATUS " KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE") - endif() - - if(KOKKOS_ENABLE_CUDA_LAMBDA) - message(STATUS " KOKKOS_ENABLE_CUDA_LAMBDA") + foreach(opt IN LISTS KOKKOS_INTERNAL_ENABLE_OPTIONS_LIST) + string(TOUPPER ${opt} OPT) + if (KOKKOS_ENABLE_${OPT}) + message(STATUS " KOKKOS_ENABLE_${OPT}") endif() + endforeach() + if(KOKKOS_ENABLE_CUDA) if(KOKKOS_CUDA_DIR) message(STATUS " KOKKOS_CUDA_DIR: ${KOKKOS_CUDA_DIR}") endif() diff --git a/lib/kokkos/cmake/tribits.cmake b/lib/kokkos/cmake/tribits.cmake index 321704a1c8db89631ddc33a641b8f3dbc2240ce6..1b5a7b2adb4572cf3b454af49ce7db13332fc7ce 100644 --- a/lib/kokkos/cmake/tribits.cmake +++ b/lib/kokkos/cmake/tribits.cmake @@ -3,7 +3,7 @@ INCLUDE(CTest) cmake_policy(SET CMP0054 NEW) -MESSAGE(WARNING "The project name is: ${PROJECT_NAME}") +MESSAGE(STATUS "The project name is: ${PROJECT_NAME}") IF(NOT DEFINED ${PROJECT_NAME}_ENABLE_OpenMP) SET(${PROJECT_NAME}_ENABLE_OpenMP OFF) @@ -84,9 +84,6 @@ ENDFUNCTION() MACRO(TRIBITS_ADD_TEST_DIRECTORIES) - message(STATUS "ProjectName: " ${PROJECT_NAME}) - message(STATUS "Tests: " ${${PROJECT_NAME}_ENABLE_TESTS}) - IF(${${PROJECT_NAME}_ENABLE_TESTS}) FOREACH(TEST_DIR ${ARGN}) ADD_SUBDIRECTORY(${TEST_DIR}) @@ -95,13 +92,11 @@ MACRO(TRIBITS_ADD_TEST_DIRECTORIES) ENDMACRO() MACRO(TRIBITS_ADD_EXAMPLE_DIRECTORIES) - IF(${PACKAGE_NAME}_ENABLE_EXAMPLES OR ${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES) FOREACH(EXAMPLE_DIR ${ARGN}) ADD_SUBDIRECTORY(${EXAMPLE_DIR}) ENDFOREACH() ENDIF() - ENDMACRO() diff --git a/lib/kokkos/config/configure_compton_cpu.sh b/lib/kokkos/config/configure_compton_cpu.sh deleted file mode 100644 index 17287fb8486977927e4ba29718c79a438378d0a4..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/configure_compton_cpu.sh +++ /dev/null @@ -1,190 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -# Additional command-line arguments given to this script will be -# passed directly to CMake. -# - -# -# Force CMake to re-evaluate build options. -# -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -#----------------------------------------------------------------------------- -# Incrementally construct cmake configure options: - -CMAKE_CONFIGURE="" - -#----------------------------------------------------------------------------- -# Location of Trilinos source tree: - -CMAKE_PROJECT_DIR="${HOME}/Trilinos" - -# Location for installation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=/home/projects/kokkos/host/`date +%F`" - -#----------------------------------------------------------------------------- -# General build options. -# Use a variable so options can be propagated to CUDA compiler. - -CMAKE_VERBOSE_MAKEFILE=OFF -CMAKE_BUILD_TYPE=RELEASE -# CMAKE_BUILD_TYPE=DEBUG - -#----------------------------------------------------------------------------- -# Build for CUDA architecture: - -CUDA_ARCH="" -# CUDA_ARCH="20" -# CUDA_ARCH="30" -# CUDA_ARCH="35" - -# Build with Intel compiler - -INTEL=ON - -# Build for MIC architecture: - -# INTEL_XEON_PHI=ON - -# Build with HWLOC at location: - -HWLOC_BASE_DIR="/home/projects/libraries/host/hwloc/1.6.2" - -# Location for MPI to use in examples: - -MPI_BASE_DIR="" - -#----------------------------------------------------------------------------- -# MPI configuation only used for examples: -# -# Must have the MPI_BASE_DIR so that the -# include path can be passed to the Cuda compiler - -if [ -n "${MPI_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -# Pthread configuation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# OpenMP configuation: - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=OFF" - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Configure packages for kokkos-only: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Hardware locality cmake configuration: - -if [ -n "${HWLOC_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib" -fi - -#----------------------------------------------------------------------------- -# Cuda cmake configuration: - -if [ -n "${CUDA_ARCH}" ] ; -then - - # Options to CUDA_NVCC_FLAGS must be semi-colon delimited, - # this is different than the standard CMAKE_CXX_FLAGS syntax. - - CUDA_NVCC_FLAGS="-gencode;arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}" - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi" - - if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ; - then - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g" - else - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3" - fi - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}" - -fi - -#----------------------------------------------------------------------------- - -if [ "${INTEL}" = "ON" -o "${INTEL_XEON_PHI}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc" -fi - -#----------------------------------------------------------------------------- - -# Cross-compile for Intel Xeon Phi: - -if [ "${INTEL_XEON_PHI}" = "ON" ] ; -then - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread" - - # Cannot cross-compile fortran compatibility checks on the MIC: - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" - - # Tell cmake the answers to compile-and-execute tests - # to prevent cmake from executing a cross-compiled program. - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0" - -fi - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" - -#----------------------------------------------------------------------------- - -echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}" - -cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/configure_compton_mic.sh b/lib/kokkos/config/configure_compton_mic.sh deleted file mode 100644 index 7f9aee13f957d503d7fa5a5b1c8ecf924a80e0d8..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/configure_compton_mic.sh +++ /dev/null @@ -1,186 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -# Additional command-line arguments given to this script will be -# passed directly to CMake. -# - -# -# Force CMake to re-evaluate build options. -# -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -#----------------------------------------------------------------------------- -# Incrementally construct cmake configure options: - -CMAKE_CONFIGURE="" - -#----------------------------------------------------------------------------- -# Location of Trilinos source tree: - -CMAKE_PROJECT_DIR="${HOME}/Trilinos" - -# Location for installation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=/home/projects/kokkos/mic/`date +%F`" - -#----------------------------------------------------------------------------- -# General build options. -# Use a variable so options can be propagated to CUDA compiler. - -CMAKE_VERBOSE_MAKEFILE=OFF -CMAKE_BUILD_TYPE=RELEASE -# CMAKE_BUILD_TYPE=DEBUG - -#----------------------------------------------------------------------------- -# Build for CUDA architecture: - -CUDA_ARCH="" -# CUDA_ARCH="20" -# CUDA_ARCH="30" -# CUDA_ARCH="35" - -# Build for MIC architecture: - -INTEL_XEON_PHI=ON - -# Build with HWLOC at location: - -HWLOC_BASE_DIR="/home/projects/libraries/mic/hwloc/1.6.2" - -# Location for MPI to use in examples: - -MPI_BASE_DIR="" - -#----------------------------------------------------------------------------- -# MPI configuation only used for examples: -# -# Must have the MPI_BASE_DIR so that the -# include path can be passed to the Cuda compiler - -if [ -n "${MPI_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -# Pthread configuation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# OpenMP configuation: - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=OFF" - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Configure packages for kokkos-only: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Hardware locality cmake configuration: - -if [ -n "${HWLOC_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib" -fi - -#----------------------------------------------------------------------------- -# Cuda cmake configuration: - -if [ -n "${CUDA_ARCH}" ] ; -then - - # Options to CUDA_NVCC_FLAGS must be semi-colon delimited, - # this is different than the standard CMAKE_CXX_FLAGS syntax. - - CUDA_NVCC_FLAGS="-gencode;arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}" - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi" - - if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ; - then - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g" - else - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3" - fi - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}" - -fi - -#----------------------------------------------------------------------------- - -if [ "${INTEL}" = "ON" -o "${INTEL_XEON_PHI}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc" -fi - -#----------------------------------------------------------------------------- - -# Cross-compile for Intel Xeon Phi: - -if [ "${INTEL_XEON_PHI}" = "ON" ] ; -then - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread" - - # Cannot cross-compile fortran compatibility checks on the MIC: - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" - - # Tell cmake the answers to compile-and-execute tests - # to prevent cmake from executing a cross-compiled program. - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0" - -fi - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" - -#----------------------------------------------------------------------------- - -echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}" - -cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/configure_kokkos.sh b/lib/kokkos/config/configure_kokkos.sh deleted file mode 100644 index 592e7f593639c617385b487183f8ea6111cbd732..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/configure_kokkos.sh +++ /dev/null @@ -1,293 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -#----------------------------------------------------------------------------- -# General build options. -# Use a variable so options can be propagated to CUDA compiler. - -CMAKE_BUILD_TYPE=RELEASE -# CMAKE_BUILD_TYPE=DEBUG - -# Source and installation directories: - -TRILINOS_SOURCE_DIR=${HOME}/Trilinos -TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F` - -#----------------------------------------------------------------------------- - -USE_CUDA_ARCH= -USE_THREAD= -USE_OPENMP= -USE_INTEL= -USE_XEON_PHI= -HWLOC_BASE_DIR= -MPI_BASE_DIR= -BLAS_LIB_DIR= -LAPACK_LIB_DIR= - -if [ 1 ] ; then - # Platform 'kokkos-dev' with Cuda, OpenMP, hwloc, mpi, gnu - USE_CUDA_ARCH="35" - USE_OPENMP=ON - HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.4.7" - MPI_BASE_DIR="/home/projects/mvapich/2.0.0b/gnu/4.4.7" - BLAS_LIB_DIR="/home/projects/blas/host/gnu/lib" - LAPACK_LIB_DIR="/home/projects/lapack/host/gnu/lib" - -elif [ ] ; then - # Platform 'kokkos-dev' with Cuda, Threads, hwloc, mpi, gnu - USE_CUDA_ARCH="35" - USE_THREAD=ON - HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.4.7" - MPI_BASE_DIR="/home/projects/mvapich/2.0.0b/gnu/4.4.7" - BLAS_LIB_DIR="/home/projects/blas/host/gnu/lib" - LAPACK_LIB_DIR="/home/projects/lapack/host/gnu/lib" - -elif [ ] ; then - # Platform 'kokkos-dev' with Xeon Phi and hwloc - USE_OPENMP=ON - USE_INTEL=ON - USE_XEON_PHI=ON - HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/mic/intel/13.SP1.1.106" - -elif [ ] ; then - # Platform 'kokkos-nvidia' with Cuda, OpenMP, hwloc, mpi, gnu - USE_CUDA_ARCH="20" - USE_OPENMP=ON - HWLOC_BASE_DIR="/home/sems/common/hwloc/current" - MPI_BASE_DIR="/home/sems/common/openmpi/current" - -elif [ ] ; then - # Platform 'kokkos-nvidia' with Cuda, Threads, hwloc, mpi, gnu - USE_CUDA_ARCH="20" - USE_THREAD=ON - HWLOC_BASE_DIR="/home/sems/common/hwloc/current" - MPI_BASE_DIR="/home/sems/common/openmpi/current" - -fi - -#----------------------------------------------------------------------------- -# Incrementally construct cmake configure command line options: - -CMAKE_CONFIGURE="" -CMAKE_CXX_FLAGS="" - -#----------------------------------------------------------------------------- -# Configure for Kokkos subpackages and tests: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- - -if [ 1 ] ; then - - # Configure for Tpetra/Kokkos: - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${BLAS_LIB_DIR}" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_DIRS:FILEPATH=${LAPACK_LIB_DIR}" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Tpetra:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Kokkos:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraClassic:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TeuchosKokkosCompat:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TeuchosKokkosComm:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Tpetra_ENABLE_Kokkos_Refactor:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D KokkosClassic_DefaultNode:STRING=Kokkos::Compat::KokkosOpenMPWrapperNode" - - CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}-DKOKKOS_FAST_COMPILE" - - if [ -n "${USE_CUDA_ARCH}" ] ; then - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Cuda:BOOL=ON" - - fi - -fi - -if [ 1 ] ; then - - # Configure for Stokhos: - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Sacado:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Stokhos:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Stokhos_ENABLE_Belos:BOOL=ON" - -fi - -if [ 1 ] ; then - - # Configure for TrilinosCouplings: - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TrilinosCouplings:BOOL=ON" - -fi - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON" - -if [ "${CMAKE_BUILD_TYPE}" == "DEBUG" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" -fi - -#----------------------------------------------------------------------------- -# Location for installation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}" - -#----------------------------------------------------------------------------- -# MPI configuation only used for examples: -# -# Must have the MPI_BASE_DIR so that the -# include path can be passed to the Cuda compiler - -if [ -n "${MPI_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -# Kokkos use pthread configuation: - -if [ "${USE_THREAD}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=ON" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -# Kokkos use OpenMP configuation: - -if [ "${USE_OPENMP}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -# Hardware locality configuration: - -if [ -n "${HWLOC_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib" -fi - -#----------------------------------------------------------------------------- -# Cuda cmake configuration: - -if [ -n "${USE_CUDA_ARCH}" ] ; -then - - # Options to CUDA_NVCC_FLAGS must be semi-colon delimited, - # this is different than the standard CMAKE_CXX_FLAGS syntax. - - CUDA_NVCC_FLAGS="-DKOKKOS_HAVE_CUDA_ARCH=${USE_CUDA_ARCH}0;-gencode;arch=compute_${USE_CUDA_ARCH},code=sm_${USE_CUDA_ARCH}" - - if [ "${USE_OPENMP}" = "ON" ] ; - then - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi,-fopenmp" - else - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi" - fi - - if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ; - then - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g" - else - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3" - fi - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}" - -fi - -#----------------------------------------------------------------------------- - -if [ "${USE_INTEL}" = "ON" -o "${USE_XEON_PHI}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc" -fi - -# Cross-compile for Intel Xeon Phi: - -if [ "${USE_XEON_PHI}" = "ON" ] ; -then - - CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -mmic" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread" - - # Cannot cross-compile fortran compatibility checks on the MIC: - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" - - # Tell cmake the answers to compile-and-execute tests - # to prevent cmake from executing a cross-compiled program. - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0" - -fi - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- - -if [ -n "${CMAKE_CXX_FLAGS}" ] ; then - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING='${CMAKE_CXX_FLAGS}'" - -fi - -#----------------------------------------------------------------------------- -# -# Remove CMake output files to force reconfigure from scratch. -# - -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -# - -echo "cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}" - -cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/configure_kokkos_bgq.sh b/lib/kokkos/config/configure_kokkos_bgq.sh deleted file mode 100755 index 73236937eaa9b311d06027a23aa070a8f62c9153..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/configure_kokkos_bgq.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -# Additional command-line arguments given to this script will be -# passed directly to CMake. -# - -# to build: -# build on bgq-b[1-12] -# module load sierra-devel -# run this configure file -# make - -# to run: -# ssh bgq-login -# cd /scratch/username/... -# export OMP_PROC_BIND and XLSMPOPTS environment variables -# run with srun - -# Note: hwloc does not work to get or set cpubindings on bgq. -# Use the openmp backend and the openmp environment variables. -# -# Only the mpi wrappers seem to be setup for cross-compile, -# so it is important that this configure enables MPI and uses mpigcc wrappers. - - - -# -# Force CMake to re-evaluate build options. -# -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -#----------------------------------------------------------------------------- -# Incrementally construct cmake configure options: - -CMAKE_CONFIGURE="" - -#----------------------------------------------------------------------------- -# Location of Trilinos source tree: - -CMAKE_PROJECT_DIR="../Trilinos" - -# Location for installation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=../TrilinosInstall/`date +%F`" - -#----------------------------------------------------------------------------- -# General build options. -# Use a variable so options can be propagated to CUDA compiler. - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=mpigcc-4.7.2" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=mpig++-4.7.2" - -CMAKE_VERBOSE_MAKEFILE=OFF -CMAKE_BUILD_TYPE=RELEASE -# CMAKE_BUILD_TYPE=DEBUG - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Configure packages for kokkos-only: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" - -#----------------------------------------------------------------------------- - -echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}" - -cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/configure_kokkos_dev.sh b/lib/kokkos/config/configure_kokkos_dev.sh deleted file mode 100755 index ac61dec602381b52d96f91a59c0eddbc2d6b5801..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/configure_kokkos_dev.sh +++ /dev/null @@ -1,216 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -# Additional command-line arguments given to this script will be -# passed directly to CMake. -# - -# -# Force CMake to re-evaluate build options. -# -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -#----------------------------------------------------------------------------- -# Incrementally construct cmake configure options: - -CMAKE_CONFIGURE="" - -#----------------------------------------------------------------------------- -# Location of Trilinos source tree: - -CMAKE_PROJECT_DIR="${HOME}/Trilinos" - -# Location for installation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${HOME}/TrilinosInstall/`date +%F`" - -#----------------------------------------------------------------------------- -# General build options. -# Use a variable so options can be propagated to CUDA compiler. - -CMAKE_VERBOSE_MAKEFILE=OFF -CMAKE_BUILD_TYPE=RELEASE -#CMAKE_BUILD_TYPE=DEBUG -#CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" - -#----------------------------------------------------------------------------- -# Build for CUDA architecture: - -#CUDA_ARCH="" -#CUDA_ARCH="20" -#CUDA_ARCH="30" -CUDA_ARCH="35" - -# Build with OpenMP - -OPENMP=ON -PTHREADS=ON - -# Build host code with Intel compiler: - -INTEL=OFF - -# Build for MIC architecture: - -INTEL_XEON_PHI=OFF - -# Build with HWLOC at location: - -#HWLOC_BASE_DIR="" -#HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.4.7" -HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.7.3" - -# Location for MPI to use in examples: - -#MPI_BASE_DIR="" -#MPI_BASE_DIR="/home/projects/mvapich/2.0.0b/gnu/4.4.7" -MPI_BASE_DIR="/home/projects/mvapich/2.0.0b/gnu/4.7.3" -#MPI_BASE_DIR="/home/projects/openmpi/1.7.3/llvm/2013-12-02/" - -#----------------------------------------------------------------------------- -# MPI configuation only used for examples: -# -# Must have the MPI_BASE_DIR so that the -# include path can be passed to the Cuda compiler - -if [ -n "${MPI_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -# Pthread configuation: - -if [ "${PTHREADS}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -# OpenMP configuation: - -if [ "${OPENMP}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Configure packages for kokkos-only: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Hardware locality cmake configuration: - -if [ -n "${HWLOC_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib" -fi - -#----------------------------------------------------------------------------- -# Cuda cmake configuration: - -if [ -n "${CUDA_ARCH}" ] ; -then - - # Options to CUDA_NVCC_FLAGS must be semi-colon delimited, - # this is different than the standard CMAKE_CXX_FLAGS syntax. - - CUDA_NVCC_FLAGS="-gencode;arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}" - - if [ "${OPENMP}" = "ON" ] ; - then - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi,-fopenmp" - else - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi" - fi - - if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ; - then - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g" - else - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3" - fi - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}" - -fi - -#----------------------------------------------------------------------------- - -if [ "${INTEL}" = "ON" -o "${INTEL_XEON_PHI}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc" -fi - -#----------------------------------------------------------------------------- - -# Cross-compile for Intel Xeon Phi: - -if [ "${INTEL_XEON_PHI}" = "ON" ] ; -then - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread" - - # Cannot cross-compile fortran compatibility checks on the MIC: - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" - - # Tell cmake the answers to compile-and-execute tests - # to prevent cmake from executing a cross-compiled program. - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0" - -fi - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" - -#----------------------------------------------------------------------------- - -echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}" - -cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/configure_kokkos_nvidia.sh b/lib/kokkos/config/configure_kokkos_nvidia.sh deleted file mode 100644 index f78b7dce7845474402d61793084d59cfff579e4a..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/configure_kokkos_nvidia.sh +++ /dev/null @@ -1,204 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -# Additional command-line arguments given to this script will be -# passed directly to CMake. -# - -# -# Force CMake to re-evaluate build options. -# -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -#----------------------------------------------------------------------------- -# Incrementally construct cmake configure options: - -CMAKE_CONFIGURE="" - -#----------------------------------------------------------------------------- -# Location of Trilinos source tree: - -CMAKE_PROJECT_DIR="${HOME}/Trilinos" - -# Location for installation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=/home/sems/common/kokkos/`date +%F`" - -#----------------------------------------------------------------------------- -# General build options. -# Use a variable so options can be propagated to CUDA compiler. - -CMAKE_VERBOSE_MAKEFILE=OFF -CMAKE_BUILD_TYPE=RELEASE -# CMAKE_BUILD_TYPE=DEBUG - -#----------------------------------------------------------------------------- -# Build for CUDA architecture: - -# CUDA_ARCH="" -CUDA_ARCH="20" -# CUDA_ARCH="30" -# CUDA_ARCH="35" - -# Build with OpenMP - -OPENMP=ON - -# Build host code with Intel compiler: - -# INTEL=ON - -# Build for MIC architecture: - -# INTEL_XEON_PHI=ON - -# Build with HWLOC at location: - -HWLOC_BASE_DIR="/home/sems/common/hwloc/current" - -# Location for MPI to use in examples: - -MPI_BASE_DIR="/home/sems/common/openmpi/current" - -#----------------------------------------------------------------------------- -# MPI configuation only used for examples: -# -# Must have the MPI_BASE_DIR so that the -# include path can be passed to the Cuda compiler - -if [ -n "${MPI_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -# Pthread configuation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# OpenMP configuation: - -if [ "${OPENMP}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Configure packages for kokkos-only: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Hardware locality cmake configuration: - -if [ -n "${HWLOC_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib" -fi - -#----------------------------------------------------------------------------- -# Cuda cmake configuration: - -if [ -n "${CUDA_ARCH}" ] ; -then - - # Options to CUDA_NVCC_FLAGS must be semi-colon delimited, - # this is different than the standard CMAKE_CXX_FLAGS syntax. - - CUDA_NVCC_FLAGS="-gencode;arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}" - - if [ "${OPENMP}" = "ON" ] ; - then - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi,-fopenmp" - else - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi" - fi - - if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ; - then - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g" - else - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3" - fi - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}" - -fi - -#----------------------------------------------------------------------------- - -if [ "${INTEL}" = "ON" -o "${INTEL_XEON_PHI}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc" -fi - -#----------------------------------------------------------------------------- - -# Cross-compile for Intel Xeon Phi: - -if [ "${INTEL_XEON_PHI}" = "ON" ] ; -then - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread" - - # Cannot cross-compile fortran compatibility checks on the MIC: - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" - - # Tell cmake the answers to compile-and-execute tests - # to prevent cmake from executing a cross-compiled program. - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0" - -fi - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" - -#----------------------------------------------------------------------------- - -echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}" - -cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/configure_shannon.sh b/lib/kokkos/config/configure_shannon.sh deleted file mode 100644 index 8bd175b0314ffc74c9c6ffb02188d599a1b5a573..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/configure_shannon.sh +++ /dev/null @@ -1,190 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -# Additional command-line arguments given to this script will be -# passed directly to CMake. -# - -# -# Force CMake to re-evaluate build options. -# -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -#----------------------------------------------------------------------------- -# Incrementally construct cmake configure options: - -CMAKE_CONFIGURE="" - -#----------------------------------------------------------------------------- -# Location of Trilinos source tree: - -CMAKE_PROJECT_DIR="${HOME}/Trilinos" - -# Location for installation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=/home/projects/kokkos/`date +%F`" - -#----------------------------------------------------------------------------- -# General build options. -# Use a variable so options can be propagated to CUDA compiler. - -CMAKE_VERBOSE_MAKEFILE=OFF -CMAKE_BUILD_TYPE=RELEASE -# CMAKE_BUILD_TYPE=DEBUG - -#----------------------------------------------------------------------------- -# Build for CUDA architecture: - -# CUDA_ARCH="" -# CUDA_ARCH="20" -# CUDA_ARCH="30" -CUDA_ARCH="35" - -# Build host code with Intel compiler: - -INTEL=ON - -# Build for MIC architecture: - -# INTEL_XEON_PHI=ON - -# Build with HWLOC at location: - -HWLOC_BASE_DIR="/home/projects/hwloc/1.6.2" - -# Location for MPI to use in examples: - -MPI_BASE_DIR="" - -#----------------------------------------------------------------------------- -# MPI configuation only used for examples: -# -# Must have the MPI_BASE_DIR so that the -# include path can be passed to the Cuda compiler - -if [ -n "${MPI_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}" -else - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF" -fi - -#----------------------------------------------------------------------------- -# Pthread configuation: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# OpenMP configuation: - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=OFF" - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Configure packages for kokkos-only: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Hardware locality cmake configuration: - -if [ -n "${HWLOC_BASE_DIR}" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib" -fi - -#----------------------------------------------------------------------------- -# Cuda cmake configuration: - -if [ -n "${CUDA_ARCH}" ] ; -then - - # Options to CUDA_NVCC_FLAGS must be semi-colon delimited, - # this is different than the standard CMAKE_CXX_FLAGS syntax. - - CUDA_NVCC_FLAGS="-gencode;arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}" - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi" - - if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ; - then - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g" - else - CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3" - fi - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}" - -fi - -#----------------------------------------------------------------------------- - -if [ "${INTEL}" = "ON" -o "${INTEL_XEON_PHI}" = "ON" ] ; -then - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc" -fi - -#----------------------------------------------------------------------------- - -# Cross-compile for Intel Xeon Phi: - -if [ "${INTEL_XEON_PHI}" = "ON" ] ; -then - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600" - - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread" - - # Cannot cross-compile fortran compatibility checks on the MIC: - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" - - # Tell cmake the answers to compile-and-execute tests - # to prevent cmake from executing a cross-compiled program. - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0" - CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0" - -fi - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" - -#----------------------------------------------------------------------------- - -echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}" - -cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/configure_tpetra_kokkos_cuda_nvcc_wrapper.sh b/lib/kokkos/config/configure_tpetra_kokkos_cuda_nvcc_wrapper.sh deleted file mode 100755 index 0baa83aefee66f6db0e131c2a0c77ce62d7545b6..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/configure_tpetra_kokkos_cuda_nvcc_wrapper.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/bash -# -# This script uses CUDA, OpenMP, and MPI. -# -# Before invoking this script, set the OMPI_CXX environment variable -# to point to nvcc_wrapper, wherever it happens to live. (If you use -# an MPI implementation other than OpenMPI, set the corresponding -# environment variable instead.) -# - -rm -f CMakeCache.txt; -rm -rf CMakeFiles -EXTRA_ARGS=$@ -MPI_PATH="/opt/mpi/openmpi/1.8.2/nvcc-gcc/4.8.3-6.5" -CUDA_PATH="/opt/nvidia/cuda/6.5.14" - -# -# As long as there are any .cu files in Trilinos, we'll need to set -# CUDA_NVCC_FLAGS. If Trilinos gets rid of all of its .cu files and -# lets nvcc_wrapper handle them as .cpp files, then we won't need to -# set CUDA_NVCC_FLAGS. As it is, given that we need to set -# CUDA_NVCC_FLAGS, we must make sure that they are the same flags as -# nvcc_wrapper passes to nvcc. -# -CUDA_NVCC_FLAGS="-gencode;arch=compute_35,code=sm_35;-I${MPI_PATH}/include" -CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi,-fopenmp" -CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3;-DKOKKOS_USE_CUDA_UVM" - -cmake \ - -D CMAKE_INSTALL_PREFIX:PATH="$PWD/../install/" \ - -D CMAKE_BUILD_TYPE:STRING=DEBUG \ - -D CMAKE_CXX_FLAGS:STRING="-g -Wall" \ - -D CMAKE_C_FLAGS:STRING="-g -Wall" \ - -D CMAKE_FORTRAN_FLAGS:STRING="" \ - -D CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS="" \ - -D Trilinos_ENABLE_Triutils=OFF \ - -D Trilinos_ENABLE_INSTALL_CMAKE_CONFIG_FILES:BOOL=OFF \ - -D Trilinos_ENABLE_DEBUG:BOOL=OFF \ - -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF \ - -D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=OFF \ - -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING="" \ - -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \ - -D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \ - -D BUILD_SHARED_LIBS:BOOL=OFF \ - -D DART_TESTING_TIMEOUT:STRING=600 \ - -D CMAKE_VERBOSE_MAKEFILE:BOOL=OFF \ - \ - \ - -D CMAKE_CXX_COMPILER:FILEPATH="${MPI_PATH}/bin/mpicxx" \ - -D CMAKE_C_COMPILER:FILEPATH="${MPI_PATH}/bin/mpicc" \ - -D MPI_CXX_COMPILER:FILEPATH="${MPI_PATH}/bin/mpicxx" \ - -D MPI_C_COMPILER:FILEPATH="${MPI_PATH}/bin/mpicc" \ - -D CMAKE_Fortran_COMPILER:FILEPATH="${MPI_PATH}/bin/mpif77" \ - -D MPI_EXEC:FILEPATH="${MPI_PATH}/bin/mpirun" \ - -D MPI_EXEC_POST_NUMPROCS_FLAGS:STRING="-bind-to;socket;--map-by;socket;env;CUDA_MANAGED_FORCE_DEVICE_ALLOC=1;CUDA_LAUNCH_BLOCKING=1;OMP_NUM_THREADS=2" \ - \ - \ - -D Trilinos_ENABLE_CXX11:BOOL=OFF \ - -D TPL_ENABLE_MPI:BOOL=ON \ - -D Trilinos_ENABLE_OpenMP:BOOL=ON \ - -D Trilinos_ENABLE_ThreadPool:BOOL=ON \ - \ - \ - -D TPL_ENABLE_CUDA:BOOL=ON \ - -D CUDA_TOOLKIT_ROOT_DIR:FILEPATH="${CUDA_PATH}" \ - -D CUDA_PROPAGATE_HOST_FLAGS:BOOL=OFF \ - -D TPL_ENABLE_Thrust:BOOL=OFF \ - -D Thrust_INCLUDE_DIRS:FILEPATH="${CUDA_PATH}/include" \ - -D TPL_ENABLE_CUSPARSE:BOOL=OFF \ - -D TPL_ENABLE_Cusp:BOOL=OFF \ - -D Cusp_INCLUDE_DIRS="/home/crtrott/Software/cusp" \ - -D CUDA_VERBOSE_BUILD:BOOL=OFF \ - -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS} \ - \ - \ - -D TPL_ENABLE_HWLOC=OFF \ - -D HWLOC_INCLUDE_DIRS="/usr/local/software/hwloc/current/include" \ - -D HWLOC_LIBRARY_DIRS="/usr/local/software/hwloc/current/lib" \ - -D TPL_ENABLE_BinUtils=OFF \ - -D TPL_ENABLE_BLAS:STRING=ON \ - -D TPL_ENABLE_LAPACK:STRING=ON \ - -D TPL_ENABLE_MKL:STRING=OFF \ - -D TPL_ENABLE_HWLOC:STRING=OFF \ - -D TPL_ENABLE_GTEST:STRING=ON \ - -D TPL_ENABLE_SuperLU=ON \ - -D TPL_ENABLE_BLAS=ON \ - -D TPL_ENABLE_LAPACK=ON \ - -D TPL_SuperLU_LIBRARIES="/home/crtrott/Software/SuperLU_4.3/lib/libsuperlu_4.3.a" \ - -D TPL_SuperLU_INCLUDE_DIRS="/home/crtrott/Software/SuperLU_4.3/SRC" \ - \ - \ - -D Trilinos_Enable_Kokkos:BOOL=ON \ - -D Trilinos_ENABLE_KokkosCore:BOOL=ON \ - -D Trilinos_ENABLE_TeuchosKokkosCompat:BOOL=ON \ - -D Trilinos_ENABLE_KokkosContainers:BOOL=ON \ - -D Trilinos_ENABLE_TpetraKernels:BOOL=ON \ - -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON \ - -D Trilinos_ENABLE_TeuchosKokkosComm:BOOL=ON \ - -D Trilinos_ENABLE_KokkosExample:BOOL=ON \ - -D Kokkos_ENABLE_EXAMPLES:BOOL=ON \ - -D Kokkos_ENABLE_TESTS:BOOL=OFF \ - -D KokkosClassic_DefaultNode:STRING="Kokkos::Compat::KokkosCudaWrapperNode" \ - -D TpetraClassic_ENABLE_OpenMPNode=OFF \ - -D TpetraClassic_ENABLE_TPINode=OFF \ - -D TpetraClassic_ENABLE_MKL=OFF \ - -D Kokkos_ENABLE_Cuda_UVM=ON \ - \ - \ - -D Trilinos_ENABLE_Teuchos:BOOL=ON \ - -D Teuchos_ENABLE_COMPLEX:BOOL=OFF \ - \ - \ - -D Trilinos_ENABLE_Tpetra:BOOL=ON \ - -D Tpetra_ENABLE_KokkosCore=ON \ - -D Tpetra_ENABLE_Kokkos_DistObject=OFF \ - -D Tpetra_ENABLE_Kokkos_Refactor=ON \ - -D Tpetra_ENABLE_TESTS=ON \ - -D Tpetra_ENABLE_EXAMPLES=ON \ - -D Tpetra_ENABLE_MPI_CUDA_RDMA:BOOL=ON \ - \ - \ - -D Trilinos_ENABLE_Belos=OFF \ - -D Trilinos_ENABLE_Amesos=OFF \ - -D Trilinos_ENABLE_Amesos2=OFF \ - -D Trilinos_ENABLE_Ifpack=OFF \ - -D Trilinos_ENABLE_Ifpack2=OFF \ - -D Trilinos_ENABLE_Epetra=OFF \ - -D Trilinos_ENABLE_EpetraExt=OFF \ - -D Trilinos_ENABLE_Zoltan=OFF \ - -D Trilinos_ENABLE_Zoltan2=OFF \ - -D Trilinos_ENABLE_MueLu=OFF \ - -D Belos_ENABLE_TESTS=ON \ - -D Belos_ENABLE_EXAMPLES=ON \ - -D MueLu_ENABLE_TESTS=ON \ - -D MueLu_ENABLE_EXAMPLES=ON \ - -D Ifpack2_ENABLE_TESTS=ON \ - -D Ifpack2_ENABLE_EXAMPLES=ON \ - $EXTRA_ARGS \ -${HOME}/Trilinos - diff --git a/lib/kokkos/config/kokkos-trilinos-integration-procedure.txt b/lib/kokkos/config/kokkos-trilinos-integration-procedure.txt deleted file mode 100644 index 0f2448781425bdf8b4099ab9c60017811bda840b..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/kokkos-trilinos-integration-procedure.txt +++ /dev/null @@ -1,148 +0,0 @@ -// -------------------------------------------------------------------------------- // - -The following steps are for workstations/servers with the SEMS environment installed. - -// -------------------------------------------------------------------------------- // -Summary: - -- Step 1: Rigorous testing of Kokkos' develop branch for each backend (Serial, OpenMP, Threads, Cuda) with all supported compilers. - -- Step 2: Snapshot Kokkos' develop branch into current Trilinos develop branch. - -- Step 3: Build and test Trilinos with combinations of compilers, types, backends. - -- Step 4: Promote Kokkos develop branch to master if the snapshot does not cause any new tests to fail; else track/fix causes of new failures. - -- Step 5: Snapshot Kokkos tagged master branch into Trilinos and push Trilinos. -// -------------------------------------------------------------------------------- // - - -// -------------------------------------------------------------------------------- // - -Step 1: - 1.1. Update kokkos develop branch (NOT a fork) - - (From kokkos directory): - git fetch --all - git checkout develop - git reset --hard origin/develop - - 1.2. Create a testing directory - here the directory is created within the kokkos directory - - mkdir testing - cd testing - - 1.3. Run the test_all_sandia script; various compiler and build-list options can be specified - - ../config/test_all_sandia - - 1.4 Clean repository of untracked files - - cd ../ - git clean -df - -// -------------------------------------------------------------------------------- // - -Step 2: - 2.1 Update Trilinos develop branch - - (From Trilinos directory): - git checkout develop - git fetch --all - git reset --hard origin/develop - git clean -df - - 2.2 Snapshot Kokkos into Trilinos - this requires python/2.7.9 and that both Trilinos and Kokkos be clean - no untracked or modified files - - module load python/2.7.9 - python KOKKOS_PATH/config/snapshot.py KOKKOS_PATH TRILINOS_PATH/packages - -// -------------------------------------------------------------------------------- // - -Step 3: - 3.1. Build and test Trilinos with 4 different configurations; Run scripts for white and shepard are provided in kokkos/config/trilinos-integration - - Usually its a good idea to run those script via nohup. - You can run all four at the same time, use separate directories for each. - - 3.2. Compare the failed test output between the pristine and the updated runs; investigate and fix problems if new tests fail after the Kokkos snapshot - -// -------------------------------------------------------------------------------- // - -Step 4: Once all Trilinos tests pass promote Kokkos develop branch to master on Github - 4.1. Generate Changelog (You need a github API token) - - Close all Open issues with "InDevelop" tag on github - - (Not from kokkos directory) - gitthub_changelog_generator kokkos/kokkos --token TOKEN --no-pull-requests --include-labels 'InDevelop' --enhancement-labels 'enhancement,Feature Request' --future-release 'NEWTAG' --between-tags 'NEWTAG,OLDTAG' - - (Copy the new section from the generated CHANGELOG.md to the kokkos/CHANGELOG.md) - (Make desired changes to CHANGELOG.md to enhance clarity) - (Commit and push the CHANGELOG to develop) - - 4.2 Merge develop into Master - - - DO NOT fast-forward the merge!!!! - - (From kokkos directory): - git checkout master - git fetch --all - # Ensure we are on the current origin/master - git reset --hard origin/master - git merge --no-ff origin/develop - - 4.3. Update the tag in kokkos/config/master_history.txt - Tag description: MajorNumber.MinorNumber.WeeksSinceMinorNumberUpdate - Tag format: #.#.## - - # Prepend master_history.txt with - - # tag: #.#.## - # date: mm/dd/yyyy - # master: sha1 - # develop: sha1 - # ----------------------- - - git commit --amend -a - - git tag -a #.#.## - tag: #.#.## - date: mm/dd/yyyy - master: sha1 - develop: sha1 - - 4.4. Do NOT push yet - -// -------------------------------------------------------------------------------- // - -Step 5: - 5.1. Make sure Trilinos is up-to-date - chances are other changes have been committed since the integration testing process began. If a substantial change has occurred that may be affected by the snapshot the testing procedure may need to be repeated - - (From Trilinos directory): - git checkout develop - git fetch --all - git reset --hard origin/develop - git clean -df - - 5.2. Snapshot Kokkos master branch into Trilinos - - (From kokkos directory): - git fetch --all - git checkout tags/#.#.## - git clean -df - - python KOKKOS_PATH/config/snapshot.py KOKKOS_PATH TRILINOS_PATH/packages - - 5.3. Run checkin-test to push to trilinos using the CI build modules (gcc/4.9.3) - - The modules are listed in kokkos/config/trilinos-integration/checkin-test - Run checkin-test, forward dependencies and optional dependencies must be enabled - If push failed because someone else clearly broke something, push manually. - If push failed for unclear reasons, investigate, fix, and potentially start over from step 2 after reseting your local kokkos/master branch - -Step 6: Push Kokkos to master - - git push --follow-tags origin master - -// -------------------------------------------------------------------------------- // diff --git a/lib/kokkos/config/kokkos_dev/config-core-all.sh b/lib/kokkos/config/kokkos_dev/config-core-all.sh deleted file mode 100755 index 1867de7204af4e1a0d0a83a881937256a4c51ee7..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/kokkos_dev/config-core-all.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -#----------------------------------------------------------------------------- -# Building on 'kokkos-dev.sandia.gov' with enabled capabilities: -# -# Cuda, OpenMP, Threads, Qthreads, hwloc -# -# module loaded on 'kokkos-dev.sandia.gov' for this build -# -# module load cmake/2.8.11.2 gcc/4.8.3 cuda/6.5.14 nvcc-wrapper/gnu -# -# The 'nvcc-wrapper' module should load a script that matches -# kokkos/bin/nvcc_wrapper -# -#----------------------------------------------------------------------------- -# Source and installation directories: - -TRILINOS_SOURCE_DIR=${HOME}/Trilinos -TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F` - -CMAKE_CONFIGURE="" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}" - -#----------------------------------------------------------------------------- -# Debug/optimized - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE" - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc" - -#----------------------------------------------------------------------------- -# Cuda using GNU, use the nvcc_wrapper to build CUDA source - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=nvcc_wrapper" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON" - -#----------------------------------------------------------------------------- -# Configure for Kokkos subpackages and tests: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -# Hardware locality configuration: - -HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.7.3" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib" - -#----------------------------------------------------------------------------- -# Pthread - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=ON" - -#----------------------------------------------------------------------------- -# OpenMP - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON" - -#----------------------------------------------------------------------------- -# Qthreads - -QTHREADS_BASE_DIR="/home/projects/qthreads/2014-07-08/host/gnu/4.7.3" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_QTHREADS:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D QTHREADS_INCLUDE_DIRS:FILEPATH=${QTHREADS_BASE_DIR}/include" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D QTHREADS_LIBRARY_DIRS:FILEPATH=${QTHREADS_BASE_DIR}/lib" - -#----------------------------------------------------------------------------- -# C++11 - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON" - -#----------------------------------------------------------------------------- -# -# Remove CMake output files to force reconfigure from scratch. -# - -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -# - -echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} diff --git a/lib/kokkos/config/kokkos_dev/config-core-cuda-omp-hwloc.sh b/lib/kokkos/config/kokkos_dev/config-core-cuda-omp-hwloc.sh deleted file mode 100755 index 5a6cc1493eb7cdbca7ac29ff2c2104249116d061..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/kokkos_dev/config-core-cuda-omp-hwloc.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -#----------------------------------------------------------------------------- -# Building on 'kokkos-dev.sandia.gov' with enabled capabilities: -# -# Cuda, OpenMP, hwloc -# -# module loaded on 'kokkos-dev.sandia.gov' for this build -# -# module load cmake/2.8.11.2 gcc/4.8.3 cuda/6.5.14 nvcc-wrapper/gnu -# -# The 'nvcc-wrapper' module should load a script that matches -# kokkos/bin/nvcc_wrapper -# -#----------------------------------------------------------------------------- -# Source and installation directories: - -TRILINOS_SOURCE_DIR=${HOME}/Trilinos -TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F` - -CMAKE_CONFIGURE="" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}" - -#----------------------------------------------------------------------------- -# Debug/optimized - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE" - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc" - -#----------------------------------------------------------------------------- -# Cuda using GNU, use the nvcc_wrapper to build CUDA source - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=nvcc_wrapper" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON" - -#----------------------------------------------------------------------------- -# Configure for Kokkos subpackages and tests: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -# Hardware locality configuration: - -HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.7.3" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib" - -#----------------------------------------------------------------------------- -# Pthread explicitly OFF so tribits doesn't automatically turn it on - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# OpenMP - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON" - -#----------------------------------------------------------------------------- -# C++11 - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON" - -#----------------------------------------------------------------------------- -# -# Remove CMake output files to force reconfigure from scratch. -# - -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -# - -echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/kokkos_dev/config-core-cuda.sh b/lib/kokkos/config/kokkos_dev/config-core-cuda.sh deleted file mode 100755 index 606755da81f0cb7afa16c136798e15155c02b7d5..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/kokkos_dev/config-core-cuda.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -#----------------------------------------------------------------------------- -# Building on 'kokkos-dev.sandia.gov' with enabled capabilities: -# -# Cuda -# -# module loaded on 'kokkos-dev.sandia.gov' for this build -# -# module load cmake/2.8.11.2 gcc/4.8.3 cuda/6.5.14 nvcc-wrapper/gnu -# -# The 'nvcc-wrapper' module should load a script that matches -# kokkos/bin/nvcc_wrapper -# -#----------------------------------------------------------------------------- -# Source and installation directories: - -TRILINOS_SOURCE_DIR=${HOME}/Trilinos -TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F` - -CMAKE_CONFIGURE="" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}" - -#----------------------------------------------------------------------------- -# Debug/optimized - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE" - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc" - -#----------------------------------------------------------------------------- -# Cuda using GNU, use the nvcc_wrapper to build CUDA source - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=nvcc_wrapper" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON" - -# Pthread explicitly OFF, otherwise tribits will automatically turn it on - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# Configure for Kokkos subpackages and tests: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -# C++11 - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON" - -#----------------------------------------------------------------------------- -# -# Remove CMake output files to force reconfigure from scratch. -# - -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -# - -echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/kokkos_dev/config-core-cxx11-omp.sh b/lib/kokkos/config/kokkos_dev/config-core-cxx11-omp.sh deleted file mode 100755 index b83a535416064febc732a4fd0d7dbf34274b1adf..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/kokkos_dev/config-core-cxx11-omp.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -#----------------------------------------------------------------------------- -# Building on 'kokkos-dev.sandia.gov' with enabled capabilities: -# -# C++11, OpenMP -# -# module loaded on 'kokkos-dev.sandia.gov' for this build -# -# module load cmake/2.8.11.2 gcc/4.8.3 -# -#----------------------------------------------------------------------------- -# Source and installation directories: - -TRILINOS_SOURCE_DIR=${HOME}/Trilinos -TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F` - -CMAKE_CONFIGURE="" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}" - -#----------------------------------------------------------------------------- -# Debug/optimized - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE" - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++" - -#----------------------------------------------------------------------------- -# Configure for Kokkos subpackages and tests: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -# Pthread explicitly OFF so tribits doesn't automatically activate - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# OpenMP - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON" - -#----------------------------------------------------------------------------- -# C++11 - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON" - -#----------------------------------------------------------------------------- -# -# Remove CMake output files to force reconfigure from scratch. -# - -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -# - -echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/kokkos_dev/config-core-dbg-none.sh b/lib/kokkos/config/kokkos_dev/config-core-dbg-none.sh deleted file mode 100755 index d2e06a4ebd92080b255754b80b2af6ba93662090..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/kokkos_dev/config-core-dbg-none.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -#----------------------------------------------------------------------------- -# Building on 'kokkos-dev.sandia.gov' with enabled capabilities: -# -# <none> -# -# module loaded on 'kokkos-dev.sandia.gov' for this build -# -# module load cmake/2.8.11.2 gcc/4.8.3 -# -#----------------------------------------------------------------------------- -# Source and installation directories: - -TRILINOS_SOURCE_DIR=${HOME}/Trilinos -TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F` - -CMAKE_CONFIGURE="" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}" - -#----------------------------------------------------------------------------- -# Debug/optimized - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE" - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++" - -#----------------------------------------------------------------------------- -# Configure for Kokkos subpackages and tests: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -# Kokkos Pthread explicitly OFF, TPL Pthread ON for gtest - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# C++11 - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON" - -#----------------------------------------------------------------------------- -# -# Remove CMake output files to force reconfigure from scratch. -# - -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -# - -echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/kokkos_dev/config-core-intel-cuda-omp.sh b/lib/kokkos/config/kokkos_dev/config-core-intel-cuda-omp.sh deleted file mode 100755 index e2ab1f1c00168ed3ea646c9f297dc040e2c5a33f..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/kokkos_dev/config-core-intel-cuda-omp.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -#----------------------------------------------------------------------------- -# Building on 'kokkos-dev.sandia.gov' with enabled capabilities: -# -# Intel, OpenMP, Cuda -# -# module loaded on 'kokkos-dev.sandia.gov' for this build -# -# module load cmake/2.8.11.2 cuda/7.0.4 intel/2015.0.090 nvcc-wrapper/intel -# -#----------------------------------------------------------------------------- -# Source and installation directories: - -TRILINOS_SOURCE_DIR=${HOME}/Trilinos -TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F` - -CMAKE_CONFIGURE="" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}" - -#----------------------------------------------------------------------------- -# Debug/optimized - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE" - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc" - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=nvcc_wrapper" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON" - -#----------------------------------------------------------------------------- -# Configure for Kokkos subpackages and tests: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -# Pthread explicitly OFF - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# OpenMP - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON" - -#----------------------------------------------------------------------------- -# C++11 - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON" - -#----------------------------------------------------------------------------- -# -# Remove CMake output files to force reconfigure from scratch. -# - -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -# - -echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/kokkos_dev/config-core-intel-omp.sh b/lib/kokkos/config/kokkos_dev/config-core-intel-omp.sh deleted file mode 100755 index fd56d41161a567bca1eb3601600cdc9fbe3b0104..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/kokkos_dev/config-core-intel-omp.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -#----------------------------------------------------------------------------- -# Building on 'kokkos-dev.sandia.gov' with enabled capabilities: -# -# Intel, OpenMP -# -# module loaded on 'kokkos-dev.sandia.gov' for this build -# -# module load cmake/2.8.11.2 intel/13.SP1.1.106 -# -#----------------------------------------------------------------------------- -# Source and installation directories: - -TRILINOS_SOURCE_DIR=${HOME}/Trilinos -TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F` - -CMAKE_CONFIGURE="" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}" - -#----------------------------------------------------------------------------- -# Debug/optimized - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE" - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc" - -#----------------------------------------------------------------------------- -# Configure for Kokkos subpackages and tests: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -# Pthread explicitly OFF - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# OpenMP - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON" - -#----------------------------------------------------------------------------- -# C++11 - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON" - -#----------------------------------------------------------------------------- -# -# Remove CMake output files to force reconfigure from scratch. -# - -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -# - -echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/kokkos_dev/config-core-omp.sh b/lib/kokkos/config/kokkos_dev/config-core-omp.sh deleted file mode 100755 index f91ecd525488c40a1d92c9143e727a4a287dfefb..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/kokkos_dev/config-core-omp.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -#----------------------------------------------------------------------------- -# Building on 'kokkos-dev.sandia.gov' with enabled capabilities: -# -# OpenMP -# -# module loaded on 'kokkos-dev.sandia.gov' for this build -# -# module load cmake/2.8.11.2 gcc/4.8.3 -# -#----------------------------------------------------------------------------- -# Source and installation directories: - -TRILINOS_SOURCE_DIR=${HOME}/Trilinos -TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F` - -CMAKE_CONFIGURE="" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}" - -#----------------------------------------------------------------------------- -# Debug/optimized - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE" - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++" - -#----------------------------------------------------------------------------- -# Configure for Kokkos subpackages and tests: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -# OpenMP - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON" - -# Pthread explicitly OFF, otherwise tribits will automatically turn it on - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF" - -#----------------------------------------------------------------------------- -# -# Remove CMake output files to force reconfigure from scratch. -# - -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -# - -echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/kokkos_dev/config-core-threads-hwloc.sh b/lib/kokkos/config/kokkos_dev/config-core-threads-hwloc.sh deleted file mode 100755 index 19ab96902340f6ad757fd84546afc2061bdad024..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/kokkos_dev/config-core-threads-hwloc.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh -# -# Copy this script, put it outside the Trilinos source directory, and -# build there. -# -#----------------------------------------------------------------------------- -# Building on 'kokkos-dev.sandia.gov' with enabled capabilities: -# -# Threads, hwloc -# -# module loaded on 'kokkos-dev.sandia.gov' for this build -# -# module load cmake/2.8.11.2 gcc/4.8.3 -# -#----------------------------------------------------------------------------- -# Source and installation directories: - -TRILINOS_SOURCE_DIR=${HOME}/Trilinos -TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F` - -CMAKE_CONFIGURE="" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}" - -#----------------------------------------------------------------------------- -# Debug/optimized - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE" - -#----------------------------------------------------------------------------- - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++" - -#----------------------------------------------------------------------------- -# Configure for Kokkos subpackages and tests: - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON" - -#----------------------------------------------------------------------------- -# Hardware locality configuration: - -HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.7.3" - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib" - -#----------------------------------------------------------------------------- -# Pthread - -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON" -CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=ON" - -#----------------------------------------------------------------------------- -# C++11 - -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON" -# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON" - -#----------------------------------------------------------------------------- -# -# Remove CMake output files to force reconfigure from scratch. -# - -rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile* - -# - -echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR} - -#----------------------------------------------------------------------------- - diff --git a/lib/kokkos/config/nvcc_wrapper b/lib/kokkos/config/nvcc_wrapper deleted file mode 100755 index d339da4fcdfa8029af85073adc068a8686253b8c..0000000000000000000000000000000000000000 --- a/lib/kokkos/config/nvcc_wrapper +++ /dev/null @@ -1,340 +0,0 @@ -#!/bin/bash -# -# This shell script (nvcc_wrapper) wraps both the host compiler and -# NVCC, if you are building legacy C or C++ code with CUDA enabled. -# The script remedies some differences between the interface of NVCC -# and that of the host compiler, in particular for linking. -# It also means that a legacy code doesn't need separate .cu files; -# it can just use .cpp files. -# -# Default settings: change those according to your machine. For -# example, you may have have two different wrappers with either icpc -# or g++ as their back-end compiler. The defaults can be overwritten -# by using the usual arguments (e.g., -arch=sm_30 -ccbin icpc). - -default_arch="sm_35" -#default_arch="sm_50" - -# -# The default C++ compiler. -# -host_compiler=${NVCC_WRAPPER_DEFAULT_COMPILER:-"g++"} -#host_compiler="icpc" -#host_compiler="/usr/local/gcc/4.8.3/bin/g++" -#host_compiler="/usr/local/gcc/4.9.1/bin/g++" - -# -# Internal variables -# - -# C++ files -cpp_files="" - -# Host compiler arguments -xcompiler_args="" - -# Cuda (NVCC) only arguments -cuda_args="" - -# Arguments for both NVCC and Host compiler -shared_args="" - -# Argument -c -compile_arg="" - -# Argument -o <obj> -output_arg="" - -# Linker arguments -xlinker_args="" - -# Object files passable to NVCC -object_files="" - -# Link objects for the host linker only -object_files_xlinker="" - -# Shared libraries with version numbers are not handled correctly by NVCC -shared_versioned_libraries_host="" -shared_versioned_libraries="" - -# Does the User set the architecture -arch_set=0 - -# Does the user overwrite the host compiler -ccbin_set=0 - -#Error code of compilation -error_code=0 - -# Do a dry run without actually compiling -dry_run=0 - -# Skip NVCC compilation and use host compiler directly -host_only=0 -host_only_args="" - -# Enable workaround for CUDA 6.5 for pragma ident -replace_pragma_ident=0 - -# Mark first host compiler argument -first_xcompiler_arg=1 - -temp_dir=${TMPDIR:-/tmp} - -# Check if we have an optimization argument already -optimization_applied=0 - -# Check if we have -std=c++X or --std=c++X already -stdcxx_applied=0 - -# Run nvcc a second time to generate dependencies if needed -depfile_separate=0 -depfile_output_arg="" -depfile_target_arg="" - -#echo "Arguments: $# $@" - -while [ $# -gt 0 ] -do - case $1 in - #show the executed command - --show|--nvcc-wrapper-show) - dry_run=1 - ;; - #run host compilation only - --host-only) - host_only=1 - ;; - #replace '#pragma ident' with '#ident' this is needed to compile OpenMPI due to a configure script bug and a non standardized behaviour of pragma with macros - --replace-pragma-ident) - replace_pragma_ident=1 - ;; - #handle source files to be compiled as cuda files - *.cpp|*.cxx|*.cc|*.C|*.c++|*.cu) - cpp_files="$cpp_files $1" - ;; - # Ensure we only have one optimization flag because NVCC doesn't allow muliple - -O*) - if [ $optimization_applied -eq 1 ]; then - echo "nvcc_wrapper - *warning* you have set multiple optimization flags (-O*), only the first is used because nvcc can only accept a single optimization setting." - else - shared_args="$shared_args $1" - optimization_applied=1 - fi - ;; - #Handle shared args (valid for both nvcc and the host compiler) - -D*|-I*|-L*|-l*|-g|--help|--version|-E|-M|-shared) - shared_args="$shared_args $1" - ;; - #Handle compilation argument - -c) - compile_arg="$1" - ;; - #Handle output argument - -o) - output_arg="$output_arg $1 $2" - shift - ;; - # Handle depfile arguments. We map them to a separate call to nvcc. - -MD|-MMD) - depfile_separate=1 - host_only_args="$host_only_args $1" - ;; - -MF) - depfile_output_arg="-o $2" - host_only_args="$host_only_args $1 $2" - shift - ;; - -MT) - depfile_target_arg="$1 $2" - host_only_args="$host_only_args $1 $2" - shift - ;; - #Handle known nvcc args - -gencode*|--dryrun|--verbose|--keep|--keep-dir*|-G|--relocatable-device-code*|-lineinfo|-expt-extended-lambda|--resource-usage|-Xptxas*) - cuda_args="$cuda_args $1" - ;; - #Handle more known nvcc args - --expt-extended-lambda|--expt-relaxed-constexpr) - cuda_args="$cuda_args $1" - ;; - #Handle known nvcc args that have an argument - -rdc|-maxrregcount|--default-stream) - cuda_args="$cuda_args $1 $2" - shift - ;; - #Handle c++11 - --std=c++11|-std=c++11|--std=c++14|-std=c++14|--std=c++1z|-std=c++1z) - if [ $stdcxx_applied -eq 1 ]; then - echo "nvcc_wrapper - *warning* you have set multiple optimization flags (-std=c++1* or --std=c++1*), only the first is used because nvcc can only accept a single std setting" - else - shared_args="$shared_args $1" - stdcxx_applied=1 - fi - ;; - - #strip of -std=c++98 due to nvcc warnings and Tribits will place both -std=c++11 and -std=c++98 - -std=c++98|--std=c++98) - ;; - #strip of pedantic because it produces endless warnings about #LINE added by the preprocessor - -pedantic|-Wpedantic|-ansi) - ;; - #strip of -Woverloaded-virtual to avoid "cc1: warning: command line option ‘-Woverloaded-virtual’ is valid for C++/ObjC++ but not for C" - -Woverloaded-virtual) - ;; - #strip -Xcompiler because we add it - -Xcompiler) - if [ $first_xcompiler_arg -eq 1 ]; then - xcompiler_args="$2" - first_xcompiler_arg=0 - else - xcompiler_args="$xcompiler_args,$2" - fi - shift - ;; - #strip of "-x cu" because we add that - -x) - if [[ $2 != "cu" ]]; then - if [ $first_xcompiler_arg -eq 1 ]; then - xcompiler_args="-x,$2" - first_xcompiler_arg=0 - else - xcompiler_args="$xcompiler_args,-x,$2" - fi - fi - shift - ;; - #Handle -ccbin (if its not set we can set it to a default value) - -ccbin) - cuda_args="$cuda_args $1 $2" - ccbin_set=1 - host_compiler=$2 - shift - ;; - #Handle -arch argument (if its not set use a default - -arch*) - cuda_args="$cuda_args $1" - arch_set=1 - ;; - #Handle -Xcudafe argument - -Xcudafe) - cuda_args="$cuda_args -Xcudafe $2" - shift - ;; - #Handle args that should be sent to the linker - -Wl*) - xlinker_args="$xlinker_args -Xlinker ${1:4:${#1}}" - host_linker_args="$host_linker_args ${1:4:${#1}}" - ;; - #Handle object files: -x cu applies to all input files, so give them to linker, except if only linking - *.a|*.so|*.o|*.obj) - object_files="$object_files $1" - object_files_xlinker="$object_files_xlinker -Xlinker $1" - ;; - #Handle object files which always need to use "-Xlinker": -x cu applies to all input files, so give them to linker, except if only linking - @*|*.dylib) - object_files="$object_files -Xlinker $1" - object_files_xlinker="$object_files_xlinker -Xlinker $1" - ;; - #Handle shared libraries with *.so.* names which nvcc can't do. - *.so.*) - shared_versioned_libraries_host="$shared_versioned_libraries_host $1" - shared_versioned_libraries="$shared_versioned_libraries -Xlinker $1" - ;; - #All other args are sent to the host compiler - *) - if [ $first_xcompiler_arg -eq 1 ]; then - xcompiler_args=$1 - first_xcompiler_arg=0 - else - xcompiler_args="$xcompiler_args,$1" - fi - ;; - esac - - shift -done - -#Add default host compiler if necessary -if [ $ccbin_set -ne 1 ]; then - cuda_args="$cuda_args -ccbin $host_compiler" -fi - -#Add architecture command -if [ $arch_set -ne 1 ]; then - cuda_args="$cuda_args -arch=$default_arch" -fi - -#Compose compilation command -nvcc_command="nvcc $cuda_args $shared_args $xlinker_args $shared_versioned_libraries" -if [ $first_xcompiler_arg -eq 0 ]; then - nvcc_command="$nvcc_command -Xcompiler $xcompiler_args" -fi - -#Compose host only command -host_command="$host_compiler $shared_args $host_only_args $compile_arg $output_arg $xcompiler_args $host_linker_args $shared_versioned_libraries_host" - -#nvcc does not accept '#pragma ident SOME_MACRO_STRING' but it does accept '#ident SOME_MACRO_STRING' -if [ $replace_pragma_ident -eq 1 ]; then - cpp_files2="" - for file in $cpp_files - do - var=`grep pragma ${file} | grep ident | grep "#"` - if [ "${#var}" -gt 0 ] - then - sed 's/#[\ \t]*pragma[\ \t]*ident/#ident/g' $file > $temp_dir/nvcc_wrapper_tmp_$file - cpp_files2="$cpp_files2 $temp_dir/nvcc_wrapper_tmp_$file" - else - cpp_files2="$cpp_files2 $file" - fi - done - cpp_files=$cpp_files2 - #echo $cpp_files -fi - -if [ "$cpp_files" ]; then - nvcc_command="$nvcc_command $object_files_xlinker -x cu $cpp_files" -else - nvcc_command="$nvcc_command $object_files" -fi - -if [ "$cpp_files" ]; then - host_command="$host_command $object_files $cpp_files" -else - host_command="$host_command $object_files" -fi - -if [ $depfile_separate -eq 1 ]; then - # run nvcc a second time to generate dependencies (without compiling) - nvcc_depfile_command="$nvcc_command -M $depfile_target_arg $depfile_output_arg" -else - nvcc_depfile_command="" -fi - -nvcc_command="$nvcc_command $compile_arg $output_arg" - -#Print command for dryrun -if [ $dry_run -eq 1 ]; then - if [ $host_only -eq 1 ]; then - echo $host_command - elif [ -n "$nvcc_depfile_command" ]; then - echo $nvcc_command "&&" $nvcc_depfile_command - else - echo $nvcc_command - fi - exit 0 -fi - -#Run compilation command -if [ $host_only -eq 1 ]; then - $host_command -elif [ -n "$nvcc_depfile_command" ]; then - $nvcc_command && $nvcc_depfile_command -else - $nvcc_command -fi -error_code=$? - -#Report error code -exit $error_code diff --git a/lib/kokkos/config/test_all_sandia b/lib/kokkos/config/test_all_sandia index 660ab91ff5ccb1bb17345b52ecc97f6d46cb9dcb..28b4a64b10819538c7f5fc672ada210671343cf4 100755 --- a/lib/kokkos/config/test_all_sandia +++ b/lib/kokkos/config/test_all_sandia @@ -14,25 +14,52 @@ PROCESSOR=`uname -p` if [[ "$HOSTNAME" =~ (white|ride).* ]]; then MACHINE=white -elif [[ "$HOSTNAME" =~ .*bowman.* ]]; then + module load git +fi + +if [[ "$HOSTNAME" =~ .*bowman.* ]]; then MACHINE=bowman -elif [[ "$HOSTNAME" =~ n.* ]]; then # Warning: very generic name + module load git +fi + +if [[ "$HOSTNAME" =~ n.* ]]; then # Warning: very generic name if [[ "$PROCESSOR" = "aarch64" ]]; then MACHINE=sullivan + module load git fi -elif [[ "$HOSTNAME" =~ node.* ]]; then # Warning: very generic name +fi + +if [[ "$HOSTNAME" =~ node.* ]]; then # Warning: very generic name + if [[ "$MACHINE" = "" ]]; then MACHINE=shepard -elif [[ "$HOSTNAME" =~ apollo ]]; then + module load git + fi +fi + +if [[ "$HOSTNAME" =~ apollo ]]; then MACHINE=apollo -elif [[ "$HOSTNAME" =~ sullivan ]]; then + module load git +fi + +if [[ "$HOSTNAME" =~ sullivan ]]; then MACHINE=sullivan -elif [ ! -z "$SEMS_MODULEFILES_ROOT" ]; then - MACHINE=sems -else + module load git +fi + +if [ ! -z "$SEMS_MODULEFILES_ROOT" ]; then + if [[ "$MACHINE" = "" ]]; then + MACHINE=sems + module load sems-git + fi +fi + +if [[ "$MACHINE" = "" ]]; then echo "Unrecognized machine" >&2 exit 1 fi +echo "Running on machine: $MACHINE" + GCC_BUILD_LIST="OpenMP,Pthread,Serial,OpenMP_Serial,Pthread_Serial" IBM_BUILD_LIST="OpenMP,Serial,OpenMP_Serial" ARM_GCC_BUILD_LIST="OpenMP,Serial,OpenMP_Serial" @@ -45,7 +72,8 @@ GCC_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits IBM_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wuninitialized" CLANG_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wuninitialized" INTEL_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wuninitialized" -CUDA_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wuninitialized" +#CUDA_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wuninitialized" +CUDA_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Wsign-compare,-Wtype-limits,-Wuninitialized" PGI_WARNING_FLAGS="" # Default. Machine specific can override. @@ -142,6 +170,18 @@ else KOKKOS_PATH=$( cd $KOKKOS_PATH && pwd ) fi +UNCOMMITTED=`cd ${KOKKOS_PATH}; git status --porcelain 2>/dev/null` +if ! [ -z "$UNCOMMITTED" ]; then + echo "WARNING!! THE FOLLOWING CHANGES ARE UNCOMMITTED!! :" + echo "$UNCOMMITTED" + echo "" +fi + +GITSTATUS=`cd ${KOKKOS_PATH}; git log -n 1 --format=oneline` +echo "Repository Status: " ${GITSTATUS} +echo "" +echo "" + # # Machine specific config. # @@ -149,7 +189,7 @@ fi if [ "$MACHINE" = "sems" ]; then source /projects/sems/modulefiles/utils/sems-modules-init.sh - BASE_MODULE_LIST="sems-env,kokkos-env,sems-<COMPILER_NAME>/<COMPILER_VERSION>,kokkos-hwloc/1.10.1/base" + BASE_MODULE_LIST="sems-env,kokkos-env,kokkos-hwloc/1.10.1/base,sems-<COMPILER_NAME>/<COMPILER_VERSION>" CUDA_MODULE_LIST="sems-env,kokkos-env,kokkos-<COMPILER_NAME>/<COMPILER_VERSION>,sems-gcc/4.8.4,kokkos-hwloc/1.10.1/base" CUDA8_MODULE_LIST="sems-env,kokkos-env,kokkos-<COMPILER_NAME>/<COMPILER_VERSION>,sems-gcc/5.3.0,kokkos-hwloc/1.10.1/base" @@ -178,9 +218,9 @@ if [ "$MACHINE" = "sems" ]; then "clang/3.7.1 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" "clang/3.8.1 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" "clang/3.9.0 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" - "cuda/7.0.28 $CUDA_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/config/nvcc_wrapper $CUDA_WARNING_FLAGS" - "cuda/7.5.18 $CUDA_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/config/nvcc_wrapper $CUDA_WARNING_FLAGS" - "cuda/8.0.44 $CUDA8_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/config/nvcc_wrapper $CUDA_WARNING_FLAGS" + "cuda/7.0.28 $CUDA_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + "cuda/7.5.18 $CUDA_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + "cuda/8.0.44 $CUDA8_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" ) fi elif [ "$MACHINE" = "white" ]; then @@ -191,14 +231,14 @@ elif [ "$MACHINE" = "white" ]; then BASE_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>" IBM_MODULE_LIST="<COMPILER_NAME>/xl/<COMPILER_VERSION>" CUDA_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>,gcc/5.4.0" - CUDA_MODULE_LIST2="<COMPILER_NAME>/<COMPILER_VERSION>,gcc/6.3.0,ibm/xl/13.1.6-BETA" + CUDA_MODULE_LIST2="<COMPILER_NAME>/<COMPILER_VERSION>,gcc/6.3.0,ibm/xl/13.1.6" # Don't do pthread on white. GCC_BUILD_LIST="OpenMP,Serial,OpenMP_Serial" # Format: (compiler module-list build-list exe-name warning-flag) COMPILERS=("gcc/5.4.0 $BASE_MODULE_LIST $IBM_BUILD_LIST g++ $GCC_WARNING_FLAGS" - "ibm/13.1.3 $IBM_MODULE_LIST $IBM_BUILD_LIST xlC $IBM_WARNING_FLAGS" + "ibm/13.1.6 $IBM_MODULE_LIST $IBM_BUILD_LIST xlC $IBM_WARNING_FLAGS" "cuda/8.0.44 $CUDA_MODULE_LIST $CUDA_IBM_BUILD_LIST ${KOKKOS_PATH}/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" "cuda/9.0.103 $CUDA_MODULE_LIST2 $CUDA_IBM_BUILD_LIST ${KOKKOS_PATH}/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" ) @@ -281,7 +321,7 @@ elif [ "$MACHINE" = "apollo" ]; then CUDA_MODULE_LIST="sems-env,kokkos-env,kokkos-<COMPILER_NAME>/<COMPILER_VERSION>,sems-gcc/4.8.4,kokkos-hwloc/1.10.1/base" CUDA8_MODULE_LIST="sems-env,kokkos-env,kokkos-<COMPILER_NAME>/<COMPILER_VERSION>,sems-gcc/5.3.0,kokkos-hwloc/1.10.1/base" - CLANG_MODULE_LIST="sems-env,kokkos-env,sems-git,sems-cmake/3.5.2,<COMPILER_NAME>/<COMPILER_VERSION>,cuda/8.0.44" + CLANG_MODULE_LIST="sems-env,kokkos-env,sems-git,sems-cmake/3.5.2,<COMPILER_NAME>/<COMPILER_VERSION>,cuda/9.0.69" NVCC_MODULE_LIST="sems-env,kokkos-env,sems-git,sems-cmake/3.5.2,<COMPILER_NAME>/<COMPILER_VERSION>,sems-gcc/5.3.0" BUILD_LIST_CUDA_NVCC="Cuda_Serial,Cuda_OpenMP" @@ -294,13 +334,13 @@ elif [ "$MACHINE" = "apollo" ]; then "gcc/5.1.0 $BASE_MODULE_LIST "Serial" g++ $GCC_WARNING_FLAGS" "intel/16.0.1 $BASE_MODULE_LIST "OpenMP" icpc $INTEL_WARNING_FLAGS" "clang/3.9.0 $BASE_MODULE_LIST "Pthread_Serial" clang++ $CLANG_WARNING_FLAGS" - "clang/4.0.0 $CLANG_MODULE_LIST "Cuda_Pthread" clang++ $CUDA_WARNING_FLAGS" - "cuda/8.0.44 $CUDA_MODULE_LIST "Cuda_OpenMP" $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + "clang/6.0 $CLANG_MODULE_LIST "Cuda_Pthread" clang++ $CUDA_WARNING_FLAGS" + "cuda/9.1 $CUDA_MODULE_LIST "Cuda_OpenMP" $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" ) else # Format: (compiler module-list build-list exe-name warning-flag) - COMPILERS=("cuda/8.0.44 $CUDA8_MODULE_LIST $BUILD_LIST_CUDA_NVCC $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" - "clang/4.0.0 $CLANG_MODULE_LIST $BUILD_LIST_CUDA_CLANG clang++ $CUDA_WARNING_FLAGS" + COMPILERS=("cuda/9.1 $CUDA8_MODULE_LIST $BUILD_LIST_CUDA_NVCC $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" + "clang/6.0 $CLANG_MODULE_LIST $BUILD_LIST_CUDA_CLANG clang++ $CUDA_WARNING_FLAGS" "clang/3.9.0 $CLANG_MODULE_LIST $BUILD_LIST_CLANG clang++ $CLANG_WARNING_FLAGS" "gcc/4.8.4 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" "gcc/4.9.3 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS" @@ -311,13 +351,11 @@ elif [ "$MACHINE" = "apollo" ]; then "intel/17.0.1 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS" "clang/3.5.2 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" "clang/3.6.1 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS" - "cuda/7.0.28 $CUDA_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" - "cuda/7.5.18 $CUDA_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/bin/nvcc_wrapper $CUDA_WARNING_FLAGS" ) fi if [ -z "$ARCH_FLAG" ]; then - ARCH_FLAG="--arch=SNB,Kepler35" + ARCH_FLAG="--arch=SNB,Volta70" fi NUM_JOBS_TO_RUN_IN_PARALLEL=2 @@ -700,17 +738,19 @@ wait_summarize_and_exit() { echo $passed_test $(cat $PASSED_DIR/$passed_test) done - echo "#######################################################" - echo "FAILED TESTS" - echo "#######################################################" - - local failed_test local -i rv=0 - for failed_test in $(\ls -1 $FAILED_DIR | sort) - do - echo $failed_test "("$(cat $FAILED_DIR/$failed_test)" failed)" - rv=$rv+1 - done + if [ "$(ls -A $FAILED_DIR)" ]; then + echo "#######################################################" + echo "FAILED TESTS" + echo "#######################################################" + + local failed_test + for failed_test in $(\ls -1 $FAILED_DIR | sort) + do + echo $failed_test "("$(cat $FAILED_DIR/$failed_test)" failed)" + rv=$rv+1 + done + fi exit $rv } diff --git a/lib/kokkos/containers/performance_tests/TestCuda.cpp b/lib/kokkos/containers/performance_tests/TestCuda.cpp index 208387425f07fe5bef5803715d8b0eda27d25cb4..682f3f52f70a6d7c37ef1006267d3bddffc9cd70 100644 --- a/lib/kokkos/containers/performance_tests/TestCuda.cpp +++ b/lib/kokkos/containers/performance_tests/TestCuda.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/performance_tests/TestDynRankView.hpp b/lib/kokkos/containers/performance_tests/TestDynRankView.hpp index ced74c6f5176040f57c0153e4e39f6d9ec8779a9..0d2fae32a38d7d0ffe11e2790d73d45216da98de 100644 --- a/lib/kokkos/containers/performance_tests/TestDynRankView.hpp +++ b/lib/kokkos/containers/performance_tests/TestDynRankView.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -64,8 +64,8 @@ struct InitViewFunctor { KOKKOS_INLINE_FUNCTION void operator()(const int i) const { - for (unsigned j = 0; j < _inview.dimension(1); ++j) { - for (unsigned k = 0; k < _inview.dimension(2); ++k) { + for (unsigned j = 0; j < _inview.extent(1); ++j) { + for (unsigned k = 0; k < _inview.extent(2); ++k) { _inview(i,j,k) = i/2 -j*j + k/3; } } @@ -84,8 +84,8 @@ struct InitViewFunctor { KOKKOS_INLINE_FUNCTION void operator()(const int i) const { - for (unsigned j = 0; j < _inview.dimension(1); ++j) { - for (unsigned k = 0; k < _inview.dimension(2); ++k) { + for (unsigned j = 0; j < _inview.extent(1); ++j) { + for (unsigned k = 0; k < _inview.extent(2); ++k) { _outview(i) += _inview(i,j,k) ; } } @@ -104,8 +104,8 @@ struct InitStrideViewFunctor { KOKKOS_INLINE_FUNCTION void operator()(const int i) const { - for (unsigned j = 0; j < _inview.dimension(1); ++j) { - for (unsigned k = 0; k < _inview.dimension(2); ++k) { + for (unsigned j = 0; j < _inview.extent(1); ++j) { + for (unsigned k = 0; k < _inview.extent(2); ++k) { _inview(i,j,k) = i/2 -j*j + k/3; } } @@ -123,8 +123,8 @@ struct InitViewRank7Functor { KOKKOS_INLINE_FUNCTION void operator()(const int i) const { - for (unsigned j = 0; j < _inview.dimension(1); ++j) { - for (unsigned k = 0; k < _inview.dimension(2); ++k) { + for (unsigned j = 0; j < _inview.extent(1); ++j) { + for (unsigned k = 0; k < _inview.extent(2); ++k) { _inview(i,j,k,0,0,0,0) = i/2 -j*j + k/3; } } @@ -143,8 +143,8 @@ struct InitDynRankViewFunctor { KOKKOS_INLINE_FUNCTION void operator()(const int i) const { - for (unsigned j = 0; j < _inview.dimension(1); ++j) { - for (unsigned k = 0; k < _inview.dimension(2); ++k) { + for (unsigned j = 0; j < _inview.extent(1); ++j) { + for (unsigned k = 0; k < _inview.extent(2); ++k) { _inview(i,j,k) = i/2 -j*j + k/3; } } @@ -163,8 +163,8 @@ struct InitDynRankViewFunctor { KOKKOS_INLINE_FUNCTION void operator()(const int i) const { - for (unsigned j = 0; j < _inview.dimension(1); ++j) { - for (unsigned k = 0; k < _inview.dimension(2); ++k) { + for (unsigned j = 0; j < _inview.extent(1); ++j) { + for (unsigned k = 0; k < _inview.extent(2); ++k) { _outview(i) += _inview(i,j,k) ; } } diff --git a/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp b/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp index 66f1fbf092dd4231e359602f4d6850fe757d7333..dcaca776be59b61b56ad82e78d6f715263e6082f 100644 --- a/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp +++ b/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -76,7 +76,7 @@ struct generate_ids generate_ids( local_id_view & ids) : local_2_global(ids) { - Kokkos::parallel_for(local_2_global.dimension_0(), *this); + Kokkos::parallel_for(local_2_global.extent(0), *this); } @@ -116,7 +116,7 @@ struct fill_map fill_map( global_id_view gIds, local_id_view lIds) : global_2_local(gIds) , local_2_global(lIds) { - Kokkos::parallel_for(local_2_global.dimension_0(), *this); + Kokkos::parallel_for(local_2_global.extent(0), *this); } KOKKOS_INLINE_FUNCTION @@ -143,7 +143,7 @@ struct find_test find_test( global_id_view gIds, local_id_view lIds, value_type & num_errors) : global_2_local(gIds) , local_2_global(lIds) { - Kokkos::parallel_reduce(local_2_global.dimension_0(), *this, num_errors); + Kokkos::parallel_reduce(local_2_global.extent(0), *this, num_errors); } KOKKOS_INLINE_FUNCTION diff --git a/lib/kokkos/containers/performance_tests/TestMain.cpp b/lib/kokkos/containers/performance_tests/TestMain.cpp index 1224af7cdb5484101dea69f155810caccf2258cb..217b01a57afccf1bc7658ce41214d77fbffffd67 100644 --- a/lib/kokkos/containers/performance_tests/TestMain.cpp +++ b/lib/kokkos/containers/performance_tests/TestMain.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/performance_tests/TestOpenMP.cpp b/lib/kokkos/containers/performance_tests/TestOpenMP.cpp index 012f45bab78b2ff24f4dd42e9eb5001568d20d14..66d497552e3de2dc09cd409bed204c35bc0ddb68 100644 --- a/lib/kokkos/containers/performance_tests/TestOpenMP.cpp +++ b/lib/kokkos/containers/performance_tests/TestOpenMP.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/performance_tests/TestROCm.cpp b/lib/kokkos/containers/performance_tests/TestROCm.cpp index 6647d23065da7c06815155448bfaae211adc6b5b..3cf9f3bd143c5848af12e7ddb717ab8e4d59ce8e 100644 --- a/lib/kokkos/containers/performance_tests/TestROCm.cpp +++ b/lib/kokkos/containers/performance_tests/TestROCm.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/performance_tests/TestScatterView.hpp b/lib/kokkos/containers/performance_tests/TestScatterView.hpp index 4fd69173c011e23233e9f26f02e2f7bd4eaf8a63..03129d2b09f17b03f34f8cb8a9b4442d9c570709 100644 --- a/lib/kokkos/containers/performance_tests/TestScatterView.hpp +++ b/lib/kokkos/containers/performance_tests/TestScatterView.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/performance_tests/TestThreads.cpp b/lib/kokkos/containers/performance_tests/TestThreads.cpp index a8910a3c72a11eb26c1e7707e160b602d0ef220b..a951a5ca56e4f30fcbe39d0ae797f6bd0d126882 100644 --- a/lib/kokkos/containers/performance_tests/TestThreads.cpp +++ b/lib/kokkos/containers/performance_tests/TestThreads.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp b/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp index 93a206c9966b05ce026ad16262e4d0248600439c..e8734b259de911489e97ccce7bcfce6e11f3b387 100644 --- a/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp +++ b/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/src/Kokkos_Bitset.hpp b/lib/kokkos/containers/src/Kokkos_Bitset.hpp index 7714506e9217b3dbebc900244398e9c319afa383..c48058d75d774feaf424cf196522dfceadf9e150 100644 --- a/lib/kokkos/containers/src/Kokkos_Bitset.hpp +++ b/lib/kokkos/containers/src/Kokkos_Bitset.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -147,7 +147,7 @@ public: if (m_last_block_mask) { //clear the unused bits in the last block typedef Kokkos::Impl::DeepCopy< typename execution_space::memory_space, Kokkos::HostSpace > raw_deep_copy; - raw_deep_copy( m_blocks.ptr_on_device() + (m_blocks.dimension_0() -1u), &m_last_block_mask, sizeof(unsigned)); + raw_deep_copy( m_blocks.data() + (m_blocks.extent(0) -1u), &m_last_block_mask, sizeof(unsigned)); } } @@ -212,7 +212,7 @@ public: KOKKOS_FORCEINLINE_FUNCTION unsigned max_hint() const { - return m_blocks.dimension_0(); + return m_blocks.extent(0); } /// find a bit set to 1 near the hint @@ -221,10 +221,10 @@ public: KOKKOS_INLINE_FUNCTION Kokkos::pair<bool, unsigned> find_any_set_near( unsigned hint , unsigned scan_direction = BIT_SCAN_FORWARD_MOVE_HINT_FORWARD ) const { - const unsigned block_idx = (hint >> block_shift) < m_blocks.dimension_0() ? (hint >> block_shift) : 0; + const unsigned block_idx = (hint >> block_shift) < m_blocks.extent(0) ? (hint >> block_shift) : 0; const unsigned offset = hint & block_mask; unsigned block = volatile_load(&m_blocks[ block_idx ]); - block = !m_last_block_mask || (block_idx < (m_blocks.dimension_0()-1)) ? block : block & m_last_block_mask ; + block = !m_last_block_mask || (block_idx < (m_blocks.extent(0)-1)) ? block : block & m_last_block_mask ; return find_any_helper(block_idx, offset, block, scan_direction); } @@ -238,7 +238,7 @@ public: const unsigned block_idx = hint >> block_shift; const unsigned offset = hint & block_mask; unsigned block = volatile_load(&m_blocks[ block_idx ]); - block = !m_last_block_mask || (block_idx < (m_blocks.dimension_0()-1) ) ? ~block : ~block & m_last_block_mask ; + block = !m_last_block_mask || (block_idx < (m_blocks.extent(0)-1) ) ? ~block : ~block & m_last_block_mask ; return find_any_helper(block_idx, offset, block, scan_direction); } @@ -281,8 +281,8 @@ private: unsigned update_hint( long long block_idx, unsigned offset, unsigned scan_direction ) const { block_idx += scan_direction & MOVE_HINT_BACKWARD ? -1 : 1; - block_idx = block_idx >= 0 ? block_idx : m_blocks.dimension_0() - 1; - block_idx = block_idx < static_cast<long long>(m_blocks.dimension_0()) ? block_idx : 0; + block_idx = block_idx >= 0 ? block_idx : m_blocks.extent(0) - 1; + block_idx = block_idx < static_cast<long long>(m_blocks.extent(0)) ? block_idx : 0; return static_cast<unsigned>(block_idx)*block_size + offset; } @@ -407,7 +407,7 @@ void deep_copy( Bitset<DstDevice> & dst, Bitset<SrcDevice> const& src) } typedef Kokkos::Impl::DeepCopy< typename DstDevice::memory_space, typename SrcDevice::memory_space > raw_deep_copy; - raw_deep_copy(dst.m_blocks.ptr_on_device(), src.m_blocks.ptr_on_device(), sizeof(unsigned)*src.m_blocks.dimension_0()); + raw_deep_copy(dst.m_blocks.data(), src.m_blocks.data(), sizeof(unsigned)*src.m_blocks.extent(0)); } template <typename DstDevice, typename SrcDevice> @@ -418,7 +418,7 @@ void deep_copy( Bitset<DstDevice> & dst, ConstBitset<SrcDevice> const& src) } typedef Kokkos::Impl::DeepCopy< typename DstDevice::memory_space, typename SrcDevice::memory_space > raw_deep_copy; - raw_deep_copy(dst.m_blocks.ptr_on_device(), src.m_blocks.ptr_on_device(), sizeof(unsigned)*src.m_blocks.dimension_0()); + raw_deep_copy(dst.m_blocks.data(), src.m_blocks.data(), sizeof(unsigned)*src.m_blocks.extent(0)); } template <typename DstDevice, typename SrcDevice> @@ -429,7 +429,7 @@ void deep_copy( ConstBitset<DstDevice> & dst, ConstBitset<SrcDevice> const& src) } typedef Kokkos::Impl::DeepCopy< typename DstDevice::memory_space, typename SrcDevice::memory_space > raw_deep_copy; - raw_deep_copy(dst.m_blocks.ptr_on_device(), src.m_blocks.ptr_on_device(), sizeof(unsigned)*src.m_blocks.dimension_0()); + raw_deep_copy(dst.m_blocks.data(), src.m_blocks.data(), sizeof(unsigned)*src.m_blocks.extent(0)); } } // namespace Kokkos diff --git a/lib/kokkos/containers/src/Kokkos_DualView.hpp b/lib/kokkos/containers/src/Kokkos_DualView.hpp index 35cc8ec7534b8ad1bdc854f338826dabc0e9132a..74fe4418f870854498cd65cfe8e346d7d183e716 100644 --- a/lib/kokkos/containers/src/Kokkos_DualView.hpp +++ b/lib/kokkos/containers/src/Kokkos_DualView.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -262,14 +262,14 @@ public: modified_host (View<unsigned int,LayoutLeft,typename t_host::execution_space> ("DualView::modified_host")) { if ( int(d_view.rank) != int(h_view.rank) || - d_view.dimension_0() != h_view.dimension_0() || - d_view.dimension_1() != h_view.dimension_1() || - d_view.dimension_2() != h_view.dimension_2() || - d_view.dimension_3() != h_view.dimension_3() || - d_view.dimension_4() != h_view.dimension_4() || - d_view.dimension_5() != h_view.dimension_5() || - d_view.dimension_6() != h_view.dimension_6() || - d_view.dimension_7() != h_view.dimension_7() || + d_view.extent(0) != h_view.extent(0) || + d_view.extent(1) != h_view.extent(1) || + d_view.extent(2) != h_view.extent(2) || + d_view.extent(3) != h_view.extent(3) || + d_view.extent(4) != h_view.extent(4) || + d_view.extent(5) != h_view.extent(5) || + d_view.extent(6) != h_view.extent(6) || + d_view.extent(7) != h_view.extent(7) || d_view.stride_0() != h_view.stride_0() || d_view.stride_1() != h_view.stride_1() || d_view.stride_2() != h_view.stride_2() || @@ -503,6 +503,18 @@ public: /* Realloc on Device */ ::Kokkos::realloc(d_view,n0,n1,n2,n3,n4,n5,n6,n7); + + const bool sizeMismatch = ( h_view.extent(0) != n0 ) || + ( h_view.extent(1) != n1 ) || + ( h_view.extent(2) != n2 ) || + ( h_view.extent(3) != n3 ) || + ( h_view.extent(4) != n4 ) || + ( h_view.extent(5) != n5 ) || + ( h_view.extent(6) != n6 ) || + ( h_view.extent(7) != n7 ); + if ( sizeMismatch ) + ::Kokkos::resize(h_view,n0,n1,n2,n3,n4,n5,n6,n7); + t_host temp_view = create_mirror_view( d_view ); /* Remap on Host */ @@ -510,6 +522,8 @@ public: h_view = temp_view; + d_view = create_mirror_view( typename t_dev::execution_space(), h_view ); + /* Mark Host copy as modified */ modified_host() = modified_host()+1; } @@ -530,22 +544,34 @@ public: d_view.stride(stride_); } + template< typename iType > + KOKKOS_INLINE_FUNCTION constexpr + typename std::enable_if< std::is_integral<iType>::value , size_t >::type + extent( const iType & r ) const + { return d_view.extent(r); } + + template< typename iType > + KOKKOS_INLINE_FUNCTION constexpr + typename std::enable_if< std::is_integral<iType>::value , int >::type + extent_int( const iType & r ) const + { return static_cast<int>(d_view.extent(r)); } + /* \brief return size of dimension 0 */ - size_t dimension_0() const {return d_view.dimension_0();} + size_t dimension_0() const {return d_view.extent(0);} /* \brief return size of dimension 1 */ - size_t dimension_1() const {return d_view.dimension_1();} + size_t dimension_1() const {return d_view.extent(1);} /* \brief return size of dimension 2 */ - size_t dimension_2() const {return d_view.dimension_2();} + size_t dimension_2() const {return d_view.extent(2);} /* \brief return size of dimension 3 */ - size_t dimension_3() const {return d_view.dimension_3();} + size_t dimension_3() const {return d_view.extent(3);} /* \brief return size of dimension 4 */ - size_t dimension_4() const {return d_view.dimension_4();} + size_t dimension_4() const {return d_view.extent(4);} /* \brief return size of dimension 5 */ - size_t dimension_5() const {return d_view.dimension_5();} + size_t dimension_5() const {return d_view.extent(5);} /* \brief return size of dimension 6 */ - size_t dimension_6() const {return d_view.dimension_6();} + size_t dimension_6() const {return d_view.extent(6);} /* \brief return size of dimension 7 */ - size_t dimension_7() const {return d_view.dimension_7();} + size_t dimension_7() const {return d_view.extent(7);} //@} }; diff --git a/lib/kokkos/containers/src/Kokkos_DynRankView.hpp b/lib/kokkos/containers/src/Kokkos_DynRankView.hpp index d22d6b865da99fa11a050e0bedfc5e088001a3ea..ccf53b3d5096574f4446d4cf9d7eee71b6e45c08 100644 --- a/lib/kokkos/containers/src/Kokkos_DynRankView.hpp +++ b/lib/kokkos/containers/src/Kokkos_DynRankView.hpp @@ -35,16 +35,16 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER */ /// \file Kokkos_DynRankView.hpp -/// \brief Declaration and definition of Kokkos::Experimental::DynRankView. +/// \brief Declaration and definition of Kokkos::DynRankView. /// -/// This header file declares and defines Kokkos::Experimental::DynRankView and its +/// This header file declares and defines Kokkos::DynRankView and its /// related nonmember functions. #ifndef KOKKOS_DYNRANKVIEW_HPP @@ -55,7 +55,6 @@ #include <type_traits> namespace Kokkos { -namespace Experimental { template< typename DataType , class ... Properties > class DynRankView; //forward declare @@ -156,7 +155,7 @@ struct DynRankDimTraits { // Extra overload to match that for specialize types template <typename Traits, typename ... P> KOKKOS_INLINE_FUNCTION - static typename std::enable_if< (std::is_same<typename Traits::array_layout , Kokkos::LayoutRight>::value || std::is_same<typename Traits::array_layout , Kokkos::LayoutLeft>::value || std::is_same<typename Traits::array_layout , Kokkos::LayoutStride>::value) , typename Traits::array_layout >::type createLayout( const ViewCtorProp<P...>& prop, const typename Traits::array_layout& layout ) + static typename std::enable_if< (std::is_same<typename Traits::array_layout , Kokkos::LayoutRight>::value || std::is_same<typename Traits::array_layout , Kokkos::LayoutLeft>::value || std::is_same<typename Traits::array_layout , Kokkos::LayoutStride>::value) , typename Traits::array_layout >::type createLayout( const Kokkos::Impl::ViewCtorProp<P...>& prop, const typename Traits::array_layout& layout ) { return createLayout( layout ); } @@ -318,7 +317,6 @@ void dyn_rank_view_verify_operator_bounds struct ViewToDynRankViewTag {}; } // namespace Impl -} // namespace Experimental namespace Impl { @@ -348,7 +346,7 @@ class ViewMapping< DstTraits , SrcTraits , ) ) ) - ) , Kokkos::Experimental::Impl::ViewToDynRankViewTag >::type > + ) , Kokkos::Impl::ViewToDynRankViewTag >::type > { private: @@ -375,7 +373,7 @@ public: template < typename DT , typename ... DP , typename ST , typename ... SP > KOKKOS_INLINE_FUNCTION - static void assign( Kokkos::Experimental::DynRankView< DT , DP...> & dst , const Kokkos::View< ST , SP... > & src ) + static void assign( Kokkos::DynRankView< DT , DP...> & dst , const Kokkos::View< ST , SP... > & src ) { static_assert( is_assignable_value_type , "View assignment must have same value type or const = non-const" ); @@ -395,8 +393,6 @@ public: } //end Impl -namespace Experimental { - /* \class DynRankView * \brief Container that creates a Kokkos view with rank determined at runtime. * Essentially this is a rank 7 view @@ -415,7 +411,7 @@ namespace Experimental { template< class > struct is_dyn_rank_view : public std::false_type {}; template< class D, class ... P > -struct is_dyn_rank_view< Kokkos::Experimental::DynRankView<D,P...> > : public std::true_type {}; +struct is_dyn_rank_view< Kokkos::DynRankView<D,P...> > : public std::true_type {}; template< typename DataType , class ... Properties > @@ -425,7 +421,7 @@ class DynRankView : public ViewTraits< DataType , Properties ... > private: template < class , class ... > friend class DynRankView ; - template < class , class ... > friend class Impl::ViewMapping ; + template < class , class ... > friend class Kokkos::Impl::ViewMapping ; public: typedef ViewTraits< DataType , Properties ... > drvtraits ; @@ -437,7 +433,7 @@ public: private: typedef Kokkos::Impl::ViewMapping< traits , void > map_type ; - typedef Kokkos::Experimental::Impl::SharedAllocationTracker track_type ; + typedef Kokkos::Impl::SharedAllocationTracker track_type ; track_type m_track ; map_type m_map ; @@ -601,7 +597,7 @@ private: // rank of the calling operator - included as first argument in ARG #define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( ARG ) \ DynRankView::template verify_space< Kokkos::Impl::ActiveExecutionMemorySpace >::check(); \ - Kokkos::Experimental::Impl::dyn_rank_view_verify_operator_bounds< typename traits::memory_space > ARG ; + Kokkos::Impl::dyn_rank_view_verify_operator_bounds< typename traits::memory_space > ARG ; #else @@ -778,6 +774,140 @@ public: return m_map.reference(i0,i1,i2,i3,i4,i5,i6); } + // Rank 0 + KOKKOS_INLINE_FUNCTION + reference_type access() const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (0 , this->rank(), m_track, m_map) ) + return implementation_map().reference(); + //return m_map.reference(0,0,0,0,0,0,0); + } + + // Rank 1 + // Rank 1 parenthesis + template< typename iType > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< (std::is_same<typename traits::specialize , void>::value && std::is_integral<iType>::value), reference_type>::type + access(const iType & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (1 , this->rank(), m_track, m_map, i0) ) + return m_map.reference(i0); + } + + template< typename iType > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< !(std::is_same<typename traits::specialize , void>::value && std::is_integral<iType>::value), reference_type>::type + access(const iType & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (1 , this->rank(), m_track, m_map, i0) ) + return m_map.reference(i0,0,0,0,0,0,0); + } + + // Rank 2 + template< typename iType0 , typename iType1 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< (std::is_same<typename traits::specialize , void>::value && std::is_integral<iType0>::value && std::is_integral<iType1>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (2 , this->rank(), m_track, m_map, i0, i1) ) + return m_map.reference(i0,i1); + } + + template< typename iType0 , typename iType1 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< !(std::is_same<typename drvtraits::specialize , void>::value && std::is_integral<iType0>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (2 , this->rank(), m_track, m_map, i0, i1) ) + return m_map.reference(i0,i1,0,0,0,0,0); + } + + // Rank 3 + template< typename iType0 , typename iType1 , typename iType2 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< (std::is_same<typename traits::specialize , void>::value && std::is_integral<iType0>::value && std::is_integral<iType1>::value && std::is_integral<iType2>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (3 , this->rank(), m_track, m_map, i0, i1, i2) ) + return m_map.reference(i0,i1,i2); + } + + template< typename iType0 , typename iType1 , typename iType2 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< !(std::is_same<typename drvtraits::specialize , void>::value && std::is_integral<iType0>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (3 , this->rank(), m_track, m_map, i0, i1, i2) ) + return m_map.reference(i0,i1,i2,0,0,0,0); + } + + // Rank 4 + template< typename iType0 , typename iType1 , typename iType2 , typename iType3 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< (std::is_same<typename traits::specialize , void>::value && std::is_integral<iType0>::value && std::is_integral<iType1>::value && std::is_integral<iType2>::value && std::is_integral<iType3>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (4 , this->rank(), m_track, m_map, i0, i1, i2, i3) ) + return m_map.reference(i0,i1,i2,i3); + } + + template< typename iType0 , typename iType1 , typename iType2 , typename iType3 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< !(std::is_same<typename drvtraits::specialize , void>::value && std::is_integral<iType0>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (4 , this->rank(), m_track, m_map, i0, i1, i2, i3) ) + return m_map.reference(i0,i1,i2,i3,0,0,0); + } + + // Rank 5 + template< typename iType0 , typename iType1 , typename iType2 , typename iType3, typename iType4 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< (std::is_same<typename traits::specialize , void>::value && std::is_integral<iType0>::value && std::is_integral<iType1>::value && std::is_integral<iType2>::value && std::is_integral<iType3>::value && std::is_integral<iType4>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (5 , this->rank(), m_track, m_map, i0, i1, i2, i3, i4) ) + return m_map.reference(i0,i1,i2,i3,i4); + } + + template< typename iType0 , typename iType1 , typename iType2 , typename iType3, typename iType4 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< !(std::is_same<typename drvtraits::specialize , void>::value && std::is_integral<iType0>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (5 , this->rank(), m_track, m_map, i0, i1, i2, i3, i4) ) + return m_map.reference(i0,i1,i2,i3,i4,0,0); + } + + // Rank 6 + template< typename iType0 , typename iType1 , typename iType2 , typename iType3, typename iType4 , typename iType5 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< (std::is_same<typename traits::specialize , void>::value && std::is_integral<iType0>::value && std::is_integral<iType1>::value && std::is_integral<iType2>::value && std::is_integral<iType3>::value && std::is_integral<iType4>::value && std::is_integral<iType5>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 , const iType5 & i5 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (6 , this->rank(), m_track, m_map, i0, i1, i2, i3, i4, i5) ) + return m_map.reference(i0,i1,i2,i3,i4,i5); + } + + template< typename iType0 , typename iType1 , typename iType2 , typename iType3, typename iType4 , typename iType5 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< !(std::is_same<typename drvtraits::specialize , void>::value && std::is_integral<iType0>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 , const iType5 & i5 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (6 , this->rank(), m_track, m_map, i0, i1, i2, i3, i4, i5) ) + return m_map.reference(i0,i1,i2,i3,i4,i5,0); + } + + // Rank 7 + template< typename iType0 , typename iType1 , typename iType2 , typename iType3, typename iType4 , typename iType5 , typename iType6 > + KOKKOS_INLINE_FUNCTION + typename std::enable_if< (std::is_integral<iType0>::value && std::is_integral<iType1>::value && std::is_integral<iType2>::value && std::is_integral<iType3>::value && std::is_integral<iType4>::value && std::is_integral<iType5>::value && std::is_integral<iType6>::value), reference_type>::type + access(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 , const iType5 & i5 , const iType6 & i6 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (7 , this->rank(), m_track, m_map, i0, i1, i2, i3, i4, i5, i6) ) + return m_map.reference(i0,i1,i2,i3,i4,i5,i6); + } + #undef KOKKOS_IMPL_VIEW_OPERATOR_VERIFY //---------------------------------------- @@ -830,7 +960,6 @@ public: return *this; } -// Experimental // Copy/Assign View to DynRankView template< class RT , class ... RP > KOKKOS_INLINE_FUNCTION @@ -840,7 +969,7 @@ public: , m_rank( rhs.Rank ) { typedef typename View<RT,RP...>::traits SrcTraits ; - typedef Kokkos::Impl::ViewMapping< traits , SrcTraits , Kokkos::Experimental::Impl::ViewToDynRankViewTag > Mapping ; + typedef Kokkos::Impl::ViewMapping< traits , SrcTraits , Kokkos::Impl::ViewToDynRankViewTag > Mapping ; static_assert( Mapping::is_assignable , "Incompatible DynRankView copy construction" ); Mapping::assign( *this , rhs ); } @@ -850,7 +979,7 @@ public: DynRankView & operator = ( const View<RT,RP...> & rhs ) { typedef typename View<RT,RP...>::traits SrcTraits ; - typedef Kokkos::Impl::ViewMapping< traits , SrcTraits , Kokkos::Experimental::Impl::ViewToDynRankViewTag > Mapping ; + typedef Kokkos::Impl::ViewMapping< traits , SrcTraits , Kokkos::Impl::ViewToDynRankViewTag > Mapping ; static_assert( Mapping::is_assignable , "Incompatible View to DynRankView copy assignment" ); Mapping::assign( *this , rhs ); return *this ; @@ -872,8 +1001,8 @@ public: // unused arg_layout dimensions must be set to ~size_t(0) so that rank deduction can properly take place template< class ... P > explicit inline - DynRankView( const Impl::ViewCtorProp< P ... > & arg_prop - , typename std::enable_if< ! Impl::ViewCtorProp< P... >::has_pointer + DynRankView( const Kokkos::Impl::ViewCtorProp< P ... > & arg_prop + , typename std::enable_if< ! Kokkos::Impl::ViewCtorProp< P... >::has_pointer , typename traits::array_layout >::type const & arg_layout ) @@ -882,11 +1011,11 @@ public: , m_rank( Impl::DynRankDimTraits<typename traits::specialize>::template computeRank< typename traits::array_layout, P...>(arg_prop, arg_layout) ) { // Append layout and spaces if not input - typedef Impl::ViewCtorProp< P ... > alloc_prop_input ; + typedef Kokkos::Impl::ViewCtorProp< P ... > alloc_prop_input ; // use 'std::integral_constant<unsigned,I>' for non-types // to avoid duplicate class error. - typedef Impl::ViewCtorProp + typedef Kokkos::Impl::ViewCtorProp < P ... , typename std::conditional < alloc_prop_input::has_label @@ -931,7 +1060,7 @@ public: #endif //------------------------------------------------------------ - Kokkos::Experimental::Impl::SharedAllocationRecord<> * + Kokkos::Impl::SharedAllocationRecord<> * record = m_map.allocate_shared( prop , Impl::DynRankDimTraits<typename traits::specialize>::template createLayout<traits, P...>(arg_prop, arg_layout) ); //------------------------------------------------------------ @@ -950,8 +1079,8 @@ public: // Wrappers template< class ... P > explicit KOKKOS_INLINE_FUNCTION - DynRankView( const Impl::ViewCtorProp< P ... > & arg_prop - , typename std::enable_if< Impl::ViewCtorProp< P... >::has_pointer + DynRankView( const Kokkos::Impl::ViewCtorProp< P ... > & arg_prop + , typename std::enable_if< Kokkos::Impl::ViewCtorProp< P... >::has_pointer , typename traits::array_layout >::type const & arg_layout ) @@ -972,8 +1101,8 @@ public: // Simple dimension-only layout template< class ... P > explicit inline - DynRankView( const Impl::ViewCtorProp< P ... > & arg_prop - , typename std::enable_if< ! Impl::ViewCtorProp< P... >::has_pointer + DynRankView( const Kokkos::Impl::ViewCtorProp< P ... > & arg_prop + , typename std::enable_if< ! Kokkos::Impl::ViewCtorProp< P... >::has_pointer , size_t >::type const arg_N0 = ~size_t(0) , const size_t arg_N1 = ~size_t(0) @@ -992,8 +1121,8 @@ public: template< class ... P > explicit KOKKOS_INLINE_FUNCTION - DynRankView( const Impl::ViewCtorProp< P ... > & arg_prop - , typename std::enable_if< Impl::ViewCtorProp< P... >::has_pointer + DynRankView( const Kokkos::Impl::ViewCtorProp< P ... > & arg_prop + , typename std::enable_if< Kokkos::Impl::ViewCtorProp< P... >::has_pointer , size_t >::type const arg_N0 = ~size_t(0) , const size_t arg_N1 = ~size_t(0) @@ -1015,10 +1144,10 @@ public: explicit inline DynRankView( const Label & arg_label , typename std::enable_if< - Kokkos::Experimental::Impl::is_view_label<Label>::value , + Kokkos::Impl::is_view_label<Label>::value , typename traits::array_layout >::type const & arg_layout ) - : DynRankView( Impl::ViewCtorProp< std::string >( arg_label ) , arg_layout ) + : DynRankView( Kokkos::Impl::ViewCtorProp< std::string >( arg_label ) , arg_layout ) {} // Allocate label and layout, must disambiguate from subview constructor @@ -1026,7 +1155,7 @@ public: explicit inline DynRankView( const Label & arg_label , typename std::enable_if< - Kokkos::Experimental::Impl::is_view_label<Label>::value , + Kokkos::Impl::is_view_label<Label>::value , const size_t >::type arg_N0 = ~size_t(0) , const size_t arg_N1 = ~size_t(0) , const size_t arg_N2 = ~size_t(0) @@ -1036,7 +1165,7 @@ public: , const size_t arg_N6 = ~size_t(0) , const size_t arg_N7 = ~size_t(0) ) - : DynRankView( Impl::ViewCtorProp< std::string >( arg_label ) + : DynRankView( Kokkos::Impl::ViewCtorProp< std::string >( arg_label ) , typename traits::array_layout ( arg_N0 , arg_N1 , arg_N2 , arg_N3 , arg_N4 , arg_N5 , arg_N6 , arg_N7 ) ) @@ -1048,7 +1177,8 @@ public: DynRankView( const ViewAllocateWithoutInitializing & arg_prop , const typename traits::array_layout & arg_layout ) - : DynRankView( Impl::ViewCtorProp< std::string , Kokkos::Experimental::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::Experimental::WithoutInitializing ) + : DynRankView( Kokkos::Impl::ViewCtorProp< std::string , Kokkos::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::WithoutInitializing ) + , Impl::DynRankDimTraits<typename traits::specialize>::createLayout(arg_layout) ) {} @@ -1064,7 +1194,7 @@ public: , const size_t arg_N6 = ~size_t(0) , const size_t arg_N7 = ~size_t(0) ) - : DynRankView(Impl::ViewCtorProp< std::string , Kokkos::Experimental::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::Experimental::WithoutInitializing ), arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7 ) + : DynRankView(Kokkos::Impl::ViewCtorProp< std::string , Kokkos::Impl::WithoutInitializing_t >( arg_prop.label , Kokkos::WithoutInitializing ), arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7 ) {} //---------------------------------------- @@ -1097,14 +1227,14 @@ public: , const size_t arg_N6 = ~size_t(0) , const size_t arg_N7 = ~size_t(0) ) - : DynRankView( Impl::ViewCtorProp<pointer_type>(arg_ptr) , arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7 ) + : DynRankView( Kokkos::Impl::ViewCtorProp<pointer_type>(arg_ptr) , arg_N0, arg_N1, arg_N2, arg_N3, arg_N4, arg_N5, arg_N6, arg_N7 ) {} explicit KOKKOS_INLINE_FUNCTION DynRankView( pointer_type arg_ptr , typename traits::array_layout & arg_layout ) - : DynRankView( Impl::ViewCtorProp<pointer_type>(arg_ptr) , arg_layout ) + : DynRankView( Kokkos::Impl::ViewCtorProp<pointer_type>(arg_ptr) , arg_layout ) {} @@ -1140,7 +1270,7 @@ public: explicit KOKKOS_INLINE_FUNCTION DynRankView( const typename traits::execution_space::scratch_memory_space & arg_space , const typename traits::array_layout & arg_layout ) - : DynRankView( Impl::ViewCtorProp<pointer_type>( + : DynRankView( Kokkos::Impl::ViewCtorProp<pointer_type>( reinterpret_cast<pointer_type>( arg_space.get_shmem( map_type::memory_span( Impl::DynRankDimTraits<typename traits::specialize>::createLayout( arg_layout ) //is this correct? @@ -1159,7 +1289,7 @@ public: , const size_t arg_N6 = ~size_t(0) , const size_t arg_N7 = ~size_t(0) ) - : DynRankView( Impl::ViewCtorProp<pointer_type>( + : DynRankView( Kokkos::Impl::ViewCtorProp<pointer_type>( reinterpret_cast<pointer_type>( arg_space.get_shmem( map_type::memory_span( @@ -1190,7 +1320,6 @@ namespace Impl { struct DynRankSubviewTag {}; } // namespace Impl -} // namespace Experimental namespace Impl { @@ -1207,7 +1336,7 @@ struct ViewMapping std::is_same< typename SrcTraits::array_layout , Kokkos::LayoutStride >::value ) - ), Kokkos::Experimental::Impl::DynRankSubviewTag >::type + ), Kokkos::Impl::DynRankSubviewTag >::type , SrcTraits , Args ... > { @@ -1279,11 +1408,11 @@ public: }; - typedef Kokkos::Experimental::DynRankView< value_type , array_layout , typename SrcTraits::device_type , typename SrcTraits::memory_traits > ret_type; + typedef Kokkos::DynRankView< value_type , array_layout , typename SrcTraits::device_type , typename SrcTraits::memory_traits > ret_type; template < typename T , class ... P > KOKKOS_INLINE_FUNCTION - static ret_type subview( const unsigned src_rank , Kokkos::Experimental::DynRankView< T , P...> const & src + static ret_type subview( const unsigned src_rank , Kokkos::DynRankView< T , P...> const & src , Args ... args ) { @@ -1351,20 +1480,19 @@ public: } // end Impl -namespace Experimental { template< class V , class ... Args > -using Subdynrankview = typename Kokkos::Impl::ViewMapping< Kokkos::Experimental::Impl::DynRankSubviewTag , V , Args... >::ret_type ; +using Subdynrankview = typename Kokkos::Impl::ViewMapping< Kokkos::Impl::DynRankSubviewTag , V , Args... >::ret_type ; template< class D , class ... P , class ...Args > KOKKOS_INLINE_FUNCTION Subdynrankview< ViewTraits<D******* , P...> , Args... > -subdynrankview( const Kokkos::Experimental::DynRankView< D , P... > &src , Args...args) +subdynrankview( const Kokkos::DynRankView< D , P... > &src , Args...args) { if ( src.rank() > sizeof...(Args) ) //allow sizeof...(Args) >= src.rank(), ignore the remaining args { Kokkos::abort("subdynrankview: num of args must be >= rank of the source DynRankView"); } - typedef Kokkos::Impl::ViewMapping< Kokkos::Experimental::Impl::DynRankSubviewTag , Kokkos::ViewTraits< D*******, P... > , Args... > metafcn ; + typedef Kokkos::Impl::ViewMapping< Kokkos::Impl::DynRankSubviewTag , Kokkos::ViewTraits< D*******, P... > , Args... > metafcn ; return metafcn::subview( src.rank() , src , args... ); } @@ -1373,16 +1501,14 @@ subdynrankview( const Kokkos::Experimental::DynRankView< D , P... > &src , Args. template< class D , class ... P , class ...Args > KOKKOS_INLINE_FUNCTION Subdynrankview< ViewTraits<D******* , P...> , Args... > -subview( const Kokkos::Experimental::DynRankView< D , P... > &src , Args...args) +subview( const Kokkos::DynRankView< D , P... > &src , Args...args) { return subdynrankview( src , args... ); } -} // namespace Experimental } // namespace Kokkos namespace Kokkos { -namespace Experimental { // overload == and != template< class LT , class ... LP , class RT , class ... RP > @@ -1422,13 +1548,11 @@ bool operator != ( const DynRankView<LT,LP...> & lhs , return ! ( operator==(lhs,rhs) ); } -} //end Experimental } //end Kokkos //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- namespace Kokkos { -namespace Experimental { namespace Impl { template< class OutputView , typename Enable = void > @@ -1455,7 +1579,7 @@ struct DynRankViewFill { for ( size_t i4 = 0 ; i4 < n4 ; ++i4 ) { for ( size_t i5 = 0 ; i5 < n5 ; ++i5 ) { for ( size_t i6 = 0 ; i6 < n6 ; ++i6 ) { - output(i0,i1,i2,i3,i4,i5,i6) = input ; + output.access(i0,i1,i2,i3,i4,i5,i6) = input ; }}}}}} } @@ -1498,14 +1622,14 @@ struct DynRankViewRemap { DynRankViewRemap( const OutputView & arg_out , const InputView & arg_in ) : output( arg_out ), input( arg_in ) - , n0( std::min( (size_t)arg_out.dimension_0() , (size_t)arg_in.dimension_0() ) ) - , n1( std::min( (size_t)arg_out.dimension_1() , (size_t)arg_in.dimension_1() ) ) - , n2( std::min( (size_t)arg_out.dimension_2() , (size_t)arg_in.dimension_2() ) ) - , n3( std::min( (size_t)arg_out.dimension_3() , (size_t)arg_in.dimension_3() ) ) - , n4( std::min( (size_t)arg_out.dimension_4() , (size_t)arg_in.dimension_4() ) ) - , n5( std::min( (size_t)arg_out.dimension_5() , (size_t)arg_in.dimension_5() ) ) - , n6( std::min( (size_t)arg_out.dimension_6() , (size_t)arg_in.dimension_6() ) ) - , n7( std::min( (size_t)arg_out.dimension_7() , (size_t)arg_in.dimension_7() ) ) + , n0( std::min( (size_t)arg_out.extent(0) , (size_t)arg_in.extent(0) ) ) + , n1( std::min( (size_t)arg_out.extent(1) , (size_t)arg_in.extent(1) ) ) + , n2( std::min( (size_t)arg_out.extent(2) , (size_t)arg_in.extent(2) ) ) + , n3( std::min( (size_t)arg_out.extent(3) , (size_t)arg_in.extent(3) ) ) + , n4( std::min( (size_t)arg_out.extent(4) , (size_t)arg_in.extent(4) ) ) + , n5( std::min( (size_t)arg_out.extent(5) , (size_t)arg_in.extent(5) ) ) + , n6( std::min( (size_t)arg_out.extent(6) , (size_t)arg_in.extent(6) ) ) + , n7( std::min( (size_t)arg_out.extent(7) , (size_t)arg_in.extent(7) ) ) { typedef Kokkos::RangePolicy< ExecSpace > Policy ; const Kokkos::Impl::ParallelFor< DynRankViewRemap , Policy > closure( *this , Policy( 0 , n0 ) ); @@ -1521,18 +1645,16 @@ struct DynRankViewRemap { for ( size_t i4 = 0 ; i4 < n4 ; ++i4 ) { for ( size_t i5 = 0 ; i5 < n5 ; ++i5 ) { for ( size_t i6 = 0 ; i6 < n6 ; ++i6 ) { - output(i0,i1,i2,i3,i4,i5,i6) = input(i0,i1,i2,i3,i4,i5,i6); + output.access(i0,i1,i2,i3,i4,i5,i6) = input.access(i0,i1,i2,i3,i4,i5,i6); }}}}}} } }; } /* namespace Impl */ -} /* namespace Experimental */ } /* namespace Kokkos */ namespace Kokkos { -namespace Experimental { /** \brief Deep copy a value from Host memory into a view. */ template< class DT , class ... DP > @@ -1549,7 +1671,7 @@ void deep_copy typename ViewTraits<DT,DP...>::value_type >::value , "deep_copy requires non-const type" ); - Kokkos::Experimental::Impl::DynRankViewFill< DynRankView<DT,DP...> >( dst , value ); + Kokkos::Impl::DynRankViewFill< DynRankView<DT,DP...> >( dst , value ); } /** \brief Deep copy into a value in Host memory from a view. */ @@ -1585,7 +1707,7 @@ void deep_copy std::is_same< typename DstType::traits::specialize , void >::value && std::is_same< typename SrcType::traits::specialize , void >::value && - ( Kokkos::Experimental::is_dyn_rank_view<DstType>::value || Kokkos::Experimental::is_dyn_rank_view<SrcType>::value) + ( Kokkos::is_dyn_rank_view<DstType>::value || Kokkos::is_dyn_rank_view<SrcType>::value) )>::type * = 0 ) { static_assert( @@ -1641,14 +1763,15 @@ void deep_copy dst.span_is_contiguous() && src.span_is_contiguous() && dst.span() == src.span() && - dst.dimension_0() == src.dimension_0() && - dst.dimension_1() == src.dimension_1() && - dst.dimension_2() == src.dimension_2() && - dst.dimension_3() == src.dimension_3() && - dst.dimension_4() == src.dimension_4() && - dst.dimension_5() == src.dimension_5() && - dst.dimension_6() == src.dimension_6() && - dst.dimension_7() == src.dimension_7() ) { + dst.extent(0) == src.extent(0) && + + dst.extent(1) == src.extent(1) && + dst.extent(2) == src.extent(2) && + dst.extent(3) == src.extent(3) && + dst.extent(4) == src.extent(4) && + dst.extent(5) == src.extent(5) && + dst.extent(6) == src.extent(6) && + dst.extent(7) == src.extent(7) ) { const size_t nbytes = sizeof(typename dst_type::value_type) * dst.span(); @@ -1673,14 +1796,14 @@ void deep_copy dst.span_is_contiguous() && src.span_is_contiguous() && dst.span() == src.span() && - dst.dimension_0() == src.dimension_0() && - dst.dimension_1() == src.dimension_1() && - dst.dimension_2() == src.dimension_2() && - dst.dimension_3() == src.dimension_3() && - dst.dimension_4() == src.dimension_4() && - dst.dimension_5() == src.dimension_5() && - dst.dimension_6() == src.dimension_6() && - dst.dimension_7() == src.dimension_7() && + dst.extent(0) == src.extent(0) && + dst.extent(1) == src.extent(1) && + dst.extent(2) == src.extent(2) && + dst.extent(3) == src.extent(3) && + dst.extent(4) == src.extent(4) && + dst.extent(5) == src.extent(5) && + dst.extent(6) == src.extent(6) && + dst.extent(7) == src.extent(7) && dst.stride_0() == src.stride_0() && dst.stride_1() == src.stride_1() && dst.stride_2() == src.stride_2() && @@ -1697,11 +1820,11 @@ void deep_copy } else if ( DstExecCanAccessSrc ) { // Copying data between views in accessible memory spaces and either non-contiguous or incompatible shape. - Kokkos::Experimental::Impl::DynRankViewRemap< dst_type , src_type >( dst , src ); + Kokkos::Impl::DynRankViewRemap< dst_type , src_type >( dst , src ); } else if ( SrcExecCanAccessDst ) { // Copying data between views in accessible memory spaces and either non-contiguous or incompatible shape. - Kokkos::Experimental::Impl::DynRankViewRemap< dst_type , src_type , src_execution_space >( dst , src ); + Kokkos::Impl::DynRankViewRemap< dst_type , src_type , src_execution_space >( dst , src ); } else { Kokkos::Impl::throw_runtime_exception("deep_copy given views that would require a temporary allocation"); @@ -1709,7 +1832,6 @@ void deep_copy } } -} //end Experimental } //end Kokkos @@ -1717,8 +1839,6 @@ void deep_copy //---------------------------------------------------------------------------- namespace Kokkos { -namespace Experimental { - namespace Impl { @@ -1726,7 +1846,7 @@ namespace Impl { template<class Space, class T, class ... P> struct MirrorDRViewType { // The incoming view_type - typedef typename Kokkos::Experimental::DynRankView<T,P...> src_view_type; + typedef typename Kokkos::DynRankView<T,P...> src_view_type; // The memory space for the mirror view typedef typename Space::memory_space memory_space; // Check whether it is the same memory space @@ -1736,7 +1856,7 @@ struct MirrorDRViewType { // The data type (we probably want it non-const since otherwise we can't even deep_copy to it. typedef typename src_view_type::non_const_data_type data_type; // The destination view type if it is not the same memory space - typedef Kokkos::Experimental::DynRankView<data_type,array_layout,Space> dest_view_type; + typedef Kokkos::DynRankView<data_type,array_layout,Space> dest_view_type; // If it is the same memory_space return the existsing view_type // This will also keep the unmanaged trait if necessary typedef typename std::conditional<is_same_memspace,src_view_type,dest_view_type>::type view_type; @@ -1745,7 +1865,7 @@ struct MirrorDRViewType { template<class Space, class T, class ... P> struct MirrorDRVType { // The incoming view_type - typedef typename Kokkos::Experimental::DynRankView<T,P...> src_view_type; + typedef typename Kokkos::DynRankView<T,P...> src_view_type; // The memory space for the mirror view typedef typename Space::memory_space memory_space; // Check whether it is the same memory space @@ -1755,12 +1875,11 @@ struct MirrorDRVType { // The data type (we probably want it non-const since otherwise we can't even deep_copy to it. typedef typename src_view_type::non_const_data_type data_type; // The destination view type if it is not the same memory space - typedef Kokkos::Experimental::DynRankView<data_type,array_layout,Space> view_type; + typedef Kokkos::DynRankView<data_type,array_layout,Space> view_type; }; } - template< class T , class ... P > inline typename DynRankView<T,P...>::HostMirror @@ -1799,7 +1918,7 @@ create_mirror( const DynRankView<T,P...> & src // Create a mirror in a new space (specialization for different space) template<class Space, class T, class ... P> -typename Impl::MirrorDRVType<Space,T,P ...>::view_type create_mirror(const Space& , const Kokkos::Experimental::DynRankView<T,P...> & src) { +typename Impl::MirrorDRVType<Space,T,P ...>::view_type create_mirror(const Space& , const Kokkos::DynRankView<T,P...> & src) { return typename Impl::MirrorDRVType<Space,T,P ...>::view_type(src.label(), Impl::reconstructLayout(src.layout(), src.rank()) ); } @@ -1836,13 +1955,13 @@ create_mirror_view( const DynRankView<T,P...> & src )>::type * = 0 ) { - return Kokkos::Experimental::create_mirror( src ); + return Kokkos::create_mirror( src ); } // Create a mirror view in a new space (specialization for same space) template<class Space, class T, class ... P> typename Impl::MirrorDRViewType<Space,T,P ...>::view_type -create_mirror_view(const Space& , const Kokkos::Experimental::DynRankView<T,P...> & src +create_mirror_view(const Space& , const Kokkos::DynRankView<T,P...> & src , typename std::enable_if<Impl::MirrorDRViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { return src; } @@ -1850,12 +1969,11 @@ create_mirror_view(const Space& , const Kokkos::Experimental::DynRankView<T,P... // Create a mirror view in a new space (specialization for different space) template<class Space, class T, class ... P> typename Impl::MirrorDRViewType<Space,T,P ...>::view_type -create_mirror_view(const Space& , const Kokkos::Experimental::DynRankView<T,P...> & src +create_mirror_view(const Space& , const Kokkos::DynRankView<T,P...> & src , typename std::enable_if<!Impl::MirrorDRViewType<Space,T,P ...>::is_same_memspace>::type* = 0 ) { return typename Impl::MirrorDRViewType<Space,T,P ...>::view_type(src.label(), Impl::reconstructLayout(src.layout(), src.rank()) ); } -} //end Experimental } //end Kokkos @@ -1863,7 +1981,6 @@ create_mirror_view(const Space& , const Kokkos::Experimental::DynRankView<T,P... //---------------------------------------------------------------------------- namespace Kokkos { -namespace Experimental { /** \brief Resize a view with copying old data to new data at the corresponding indices. */ template< class T , class ... P > inline @@ -1877,13 +1994,13 @@ void resize( DynRankView<T,P...> & v , const size_t n6 = ~size_t(0) , const size_t n7 = ~size_t(0) ) { - typedef DynRankView<T,P...> drview_type ; + typedef DynRankView<T,P...> drview_type ; static_assert( Kokkos::ViewTraits<T,P...>::is_managed , "Can only resize managed views" ); drview_type v_resized( v.label(), n0, n1, n2, n3, n4, n5, n6 ); - Kokkos::Experimental::Impl::DynRankViewRemap< drview_type , drview_type >( v_resized, v ); + Kokkos::Impl::DynRankViewRemap< drview_type , drview_type >( v_resized, v ); v = v_resized ; } @@ -1911,25 +2028,7 @@ void realloc( DynRankView<T,P...> & v , v = drview_type( label, n0, n1, n2, n3, n4, n5, n6 ); } -} //end Experimental - } //end Kokkos -using Kokkos::Experimental::is_dyn_rank_view ; - -namespace Kokkos { - -template< typename D , class ... P > -using DynRankView = Kokkos::Experimental::DynRankView< D , P... > ; - -using Kokkos::Experimental::deep_copy ; -using Kokkos::Experimental::create_mirror ; -using Kokkos::Experimental::create_mirror_view ; -using Kokkos::Experimental::subdynrankview ; -using Kokkos::Experimental::subview ; -using Kokkos::Experimental::resize ; -using Kokkos::Experimental::realloc ; - -} //end Kokkos #endif diff --git a/lib/kokkos/containers/src/Kokkos_DynamicView.hpp b/lib/kokkos/containers/src/Kokkos_DynamicView.hpp index 86275ce7c9ec6a958487dc9c11b7686d7b351754..4c1e0ef72102131b9f1d5a2192e05451c873f1c7 100644 --- a/lib/kokkos/containers/src/Kokkos_DynamicView.hpp +++ b/lib/kokkos/containers/src/Kokkos_DynamicView.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -52,7 +52,33 @@ namespace Kokkos { namespace Experimental { +// Simple metafunction for choosing memory space +// In the current implementation, if memory_space == CudaSpace, +// use CudaUVMSpace for the chunk 'array' allocation, which +// contains will contain pointers to chunks of memory allocated +// in CudaSpace +namespace Impl { +template < class MemSpace > +struct ChunkArraySpace { + using memory_space = MemSpace; +}; + +#ifdef KOKKOS_ENABLE_CUDA +template <> +struct ChunkArraySpace< Kokkos::CudaSpace > { + using memory_space = typename Kokkos::CudaUVMSpace; +}; +#endif +#ifdef KOKKOS_ENABLE_ROCM +template <> +struct ChunkArraySpace< Kokkos::Experimental::ROCmSpace > { + using memory_space = typename Kokkos::Experimental::ROCmHostPinnedSpace; +}; +#endif +} // end namespace Impl + /** \brief Dynamic views are restricted to rank-one and no layout. + * Resize only occurs on host outside of parallel_regions. * Subviews are not allowed. */ template< typename DataType , typename ... P > @@ -66,7 +92,7 @@ private: template< class , class ... > friend class DynamicView ; - typedef Kokkos::Experimental::Impl::SharedAllocationTracker track_type ; + typedef Kokkos::Impl::SharedAllocationTracker track_type ; static_assert( traits::rank == 1 && traits::rank_dynamic == 1 , "DynamicView must be rank-one" ); @@ -86,18 +112,14 @@ private: { Kokkos::abort("Kokkos::DynamicView ERROR: attempt to access inaccessible memory space"); }; }; -public: - - typedef Kokkos::MemoryPool< typename traits::device_type > memory_pool ; - private: - memory_pool m_pool ; track_type m_track ; - typename traits::value_type ** m_chunks ; - unsigned m_chunk_shift ; - unsigned m_chunk_mask ; - unsigned m_chunk_max ; + typename traits::value_type ** m_chunks ; // array of pointers to 'chunks' of memory + unsigned m_chunk_shift ; // ceil(log2(m_chunk_size)) + unsigned m_chunk_mask ; // m_chunk_size - 1 + unsigned m_chunk_max ; // number of entries in the chunk array - each pointing to a chunk of extent == m_chunk_size entries + unsigned m_chunk_size ; // 2 << (m_chunk_shift - 1) public: @@ -126,27 +148,23 @@ public: enum { Rank = 1 }; KOKKOS_INLINE_FUNCTION - size_t size() const noexcept + size_t allocation_extent() const noexcept { - uintptr_t n = 0 ; + uintptr_t n = *reinterpret_cast<const uintptr_t*>( m_chunks + m_chunk_max ); + return (n << m_chunk_shift); + } - if ( Kokkos::Impl::MemorySpaceAccess - < Kokkos::Impl::ActiveExecutionMemorySpace - , typename traits::memory_space - >::accessible ) { - n = *reinterpret_cast<const uintptr_t*>( m_chunks + m_chunk_max ); - } -#if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) - else { - Kokkos::Impl::DeepCopy< Kokkos::HostSpace - , typename traits::memory_space - , Kokkos::HostSpace::execution_space > - ( & n - , reinterpret_cast<const uintptr_t*>( m_chunks + m_chunk_max ) - , sizeof(uintptr_t) ); - } -#endif - return n << m_chunk_shift ; + KOKKOS_INLINE_FUNCTION + size_t chunk_size() const noexcept + { + return m_chunk_size; + } + + KOKKOS_INLINE_FUNCTION + size_t size() const noexcept + { + size_t extent_0 = *reinterpret_cast<const size_t*>( m_chunks + m_chunk_max +1 ); + return extent_0; } template< typename iType > @@ -159,6 +177,7 @@ public: size_t extent_int( const iType & r ) const { return r == 0 ? size() : 1 ; } +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE KOKKOS_INLINE_FUNCTION size_t dimension_0() const { return size(); } KOKKOS_INLINE_FUNCTION constexpr size_t dimension_1() const { return 1 ; } KOKKOS_INLINE_FUNCTION constexpr size_t dimension_2() const { return 1 ; } @@ -167,6 +186,7 @@ public: KOKKOS_INLINE_FUNCTION constexpr size_t dimension_5() const { return 1 ; } KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const { return 1 ; } KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const { return 1 ; } +#endif KOKKOS_INLINE_FUNCTION constexpr size_t stride_0() const { return 0 ; } KOKKOS_INLINE_FUNCTION constexpr size_t stride_1() const { return 0 ; } @@ -180,6 +200,17 @@ public: template< typename iType > KOKKOS_INLINE_FUNCTION void stride( iType * const s ) const { *s = 0 ; } + //---------------------------------------- + // Allocation tracking properties + + KOKKOS_INLINE_FUNCTION + int use_count() const + { return m_track.use_count(); } + + inline + const std::string label() const + { return m_track.template get_label< typename traits::memory_space >(); } + //---------------------------------------------------------------------- // Range span is the span which contains all members. @@ -234,65 +265,15 @@ public: } //---------------------------------------- - /** \brief Resizing in parallel only increases the array size, - * never decrease. - */ - KOKKOS_INLINE_FUNCTION - void resize_parallel( size_t n ) const - { - typedef typename traits::value_type value_type ; - - DynamicView::template verify_space< Kokkos::Impl::ActiveExecutionMemorySpace >::check(); - - const uintptr_t NC = ( n + m_chunk_mask ) >> m_chunk_shift ; - - if ( m_chunk_max < NC ) { -#if defined( KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK ) - printf("DynamicView::resize_parallel(%lu) m_chunk_max(%u) NC(%lu)\n" - , n , m_chunk_max , NC ); -#endif - Kokkos::abort("DynamicView::resize_parallel exceeded maximum size"); - } - - typename traits::value_type * volatile * const ch = m_chunks ; - - // The allocated chunk counter is m_chunks[ m_chunk_max ] - uintptr_t volatile * const pc = - reinterpret_cast<uintptr_t volatile*>( m_chunks + m_chunk_max ); - - // Potentially concurrent iteration of allocation to the required size. - - for ( uintptr_t jc = *pc ; jc < NC ; ) { - - // Claim the 'jc' chunk to-be-allocated index - - const uintptr_t jc_try = jc ; - - // Jump iteration to the chunk counter. - - jc = atomic_compare_exchange( pc , jc_try , jc_try + 1 ); - - if ( jc_try == jc ) { - - ch[jc_try] = reinterpret_cast<value_type*>( - m_pool.allocate( sizeof(value_type) << m_chunk_shift )); - - if ( 0 == ch[jc_try] ) { - Kokkos::abort("DynamicView::resize_parallel exhausted memory pool"); - } - - Kokkos::memory_fence(); - } - } - } - - /** \brief Resizing in serial can grow or shrink the array size, */ + /** \brief Resizing in serial can grow or shrink the array size + * up to the maximum number of chunks + * */ template< typename IntType > inline typename std::enable_if < std::is_integral<IntType>::value && Kokkos::Impl::MemorySpaceAccess< Kokkos::HostSpace - , typename traits::memory_space + , typename Impl::ChunkArraySpace< typename traits::memory_space >::memory_space >::accessible >::type resize_serial( IntType const & n ) @@ -300,108 +281,35 @@ public: typedef typename traits::value_type value_type ; typedef value_type * pointer_type ; - const uintptr_t NC = ( n + m_chunk_mask ) >> m_chunk_shift ; + const uintptr_t NC = ( n + m_chunk_mask ) >> m_chunk_shift ; // New total number of chunks needed for resize if ( m_chunk_max < NC ) { Kokkos::abort("DynamicView::resize_serial exceeded maximum size"); } + // *m_chunks[m_chunk_max] stores the current number of chunks being used uintptr_t * const pc = reinterpret_cast<uintptr_t*>( m_chunks + m_chunk_max ); if ( *pc < NC ) { while ( *pc < NC ) { m_chunks[*pc] = reinterpret_cast<pointer_type> - ( m_pool.allocate( sizeof(value_type) << m_chunk_shift ) ); + ( + typename traits::memory_space().allocate( sizeof(value_type) << m_chunk_shift ) + ); ++*pc ; } } else { while ( NC + 1 <= *pc ) { --*pc ; - m_pool.deallocate( m_chunks[*pc] - , sizeof(value_type) << m_chunk_shift ); + typename traits::memory_space().deallocate( m_chunks[*pc] + , sizeof(value_type) << m_chunk_shift ); m_chunks[*pc] = 0 ; } } - } - - //---------------------------------------- - - struct ResizeSerial { - memory_pool m_pool ; - typename traits::value_type ** m_chunks ; - uintptr_t * m_pc ; - uintptr_t m_nc ; - unsigned m_chunk_shift ; - - KOKKOS_INLINE_FUNCTION - void operator()( int ) const - { - typedef typename traits::value_type value_type ; - typedef value_type * pointer_type ; - - if ( *m_pc < m_nc ) { - while ( *m_pc < m_nc ) { - m_chunks[*m_pc] = reinterpret_cast<pointer_type> - ( m_pool.allocate( sizeof(value_type) << m_chunk_shift ) ); - ++*m_pc ; - } - } - else { - while ( m_nc + 1 <= *m_pc ) { - --*m_pc ; - m_pool.deallocate( m_chunks[*m_pc] - , sizeof(value_type) << m_chunk_shift ); - m_chunks[*m_pc] = 0 ; - } - } - } - - ResizeSerial( memory_pool const & arg_pool - , typename traits::value_type ** arg_chunks - , uintptr_t * arg_pc - , uintptr_t arg_nc - , unsigned arg_chunk_shift - ) - : m_pool( arg_pool ) - , m_chunks( arg_chunks ) - , m_pc( arg_pc ) - , m_nc( arg_nc ) - , m_chunk_shift( arg_chunk_shift ) - {} - }; - - template< typename IntType > - inline - typename std::enable_if - < std::is_integral<IntType>::value && - ! Kokkos::Impl::MemorySpaceAccess< Kokkos::HostSpace - , typename traits::memory_space - >::accessible - >::type - resize_serial( IntType const & n ) - { - const uintptr_t NC = ( n + m_chunk_mask ) >> m_chunk_shift ; - - if ( m_chunk_max < NC ) { - Kokkos::abort("DynamicView::resize_serial exceeded maximum size"); - } - - // Must dispatch kernel - - typedef Kokkos::RangePolicy< typename traits::execution_space > Range ; - - uintptr_t * const pc = - reinterpret_cast<uintptr_t*>( m_chunks + m_chunk_max ); - - Kokkos::Impl::ParallelFor<ResizeSerial,Range> - closure( ResizeSerial( m_pool, m_chunks, pc, NC, m_chunk_shift ) - , Range(0,1) ); - - closure.execute(); - - traits::execution_space::fence(); + // *m_chunks[m_chunk_max+1] stores the 'extent' requested by resize + *(pc+1) = n; } //---------------------------------------------------------------------- @@ -415,12 +323,12 @@ public: template< class RT , class ... RP > DynamicView( const DynamicView<RT,RP...> & rhs ) - : m_pool( rhs.m_pool ) - , m_track( rhs.m_track ) + : m_track( rhs.m_track ) , m_chunks( (typename traits::value_type **) rhs.m_chunks ) , m_chunk_shift( rhs.m_chunk_shift ) , m_chunk_mask( rhs.m_chunk_mask ) , m_chunk_max( rhs.m_chunk_max ) + , m_chunk_size( rhs.m_chunk_size ) { typedef typename DynamicView<RT,RP...>::traits SrcTraits ; typedef Kokkos::Impl::ViewMapping< traits , SrcTraits , void > Mapping ; @@ -430,35 +338,36 @@ public: //---------------------------------------------------------------------- struct Destroy { - memory_pool m_pool ; typename traits::value_type ** m_chunks ; unsigned m_chunk_max ; bool m_destroy ; + unsigned m_chunk_size ; // Initialize or destroy array of chunk pointers. // Two entries beyond the max chunks are allocation counters. - - KOKKOS_INLINE_FUNCTION + inline void operator()( unsigned i ) const { if ( m_destroy && i < m_chunk_max && 0 != m_chunks[i] ) { - m_pool.deallocate( m_chunks[i] , m_pool.min_block_size() ); + typename traits::memory_space().deallocate( m_chunks[i], m_chunk_size ); } m_chunks[i] = 0 ; } void execute( bool arg_destroy ) { - typedef Kokkos::RangePolicy< typename traits::execution_space > Range ; + typedef Kokkos::RangePolicy< typename HostSpace::execution_space > Range ; + //typedef Kokkos::RangePolicy< typename Impl::ChunkArraySpace< typename traits::memory_space >::memory_space::execution_space > Range ; m_destroy = arg_destroy ; Kokkos::Impl::ParallelFor<Destroy,Range> - closure( *this , Range(0, m_chunk_max + 1) ); + closure( *this , Range(0, m_chunk_max + 2) ); // Add 2 to 'destroy' extra slots storing num_chunks and extent; previously + 1 closure.execute(); traits::execution_space::fence(); + //Impl::ChunkArraySpace< typename traits::memory_space >::memory_space::execution_space::fence(); } void construct_shared_allocation() @@ -473,66 +382,64 @@ public: Destroy & operator = ( Destroy && ) = default ; Destroy & operator = ( const Destroy & ) = default ; - Destroy( const memory_pool & arg_pool - , typename traits::value_type ** arg_chunk - , const unsigned arg_chunk_max ) - : m_pool( arg_pool ) - , m_chunks( arg_chunk ) + Destroy( typename traits::value_type ** arg_chunk + , const unsigned arg_chunk_max + , const unsigned arg_chunk_size ) + : m_chunks( arg_chunk ) , m_chunk_max( arg_chunk_max ) , m_destroy( false ) + , m_chunk_size( arg_chunk_size ) {} }; /**\brief Allocation constructor * - * Memory is allocated in chunks from the memory pool. - * The chunk size conforms to the memory pool's chunk size. + * Memory is allocated in chunks * A maximum size is required in order to allocate a * chunk-pointer array. */ explicit inline DynamicView( const std::string & arg_label - , const memory_pool & arg_pool - , const size_t arg_size_max ) - : m_pool( arg_pool ) - , m_track() + , const unsigned min_chunk_size + , const unsigned max_extent ) + : m_track() , m_chunks(0) - // The memory pool chunk is guaranteed to be a power of two + // The chunk size is guaranteed to be a power of two , m_chunk_shift( - Kokkos::Impl::integral_power_of_two( - m_pool.min_block_size()/sizeof(typename traits::value_type)) ) - , m_chunk_mask( ( 1 << m_chunk_shift ) - 1 ) - , m_chunk_max( ( arg_size_max + m_chunk_mask ) >> m_chunk_shift ) + Kokkos::Impl::integral_power_of_two_that_contains( min_chunk_size ) ) // div ceil(log2(min_chunk_size)) + , m_chunk_mask( ( 1 << m_chunk_shift ) - 1 ) // mod + , m_chunk_max( ( max_extent + m_chunk_mask ) >> m_chunk_shift ) // max num pointers-to-chunks in array + , m_chunk_size ( 2 << (m_chunk_shift - 1) ) { + typedef typename Impl::ChunkArraySpace< typename traits::memory_space >::memory_space chunk_array_memory_space; // A functor to deallocate all of the chunks upon final destruction - - typedef typename traits::memory_space memory_space ; - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< memory_space , Destroy > record_type ; + typedef Kokkos::Impl::SharedAllocationRecord< chunk_array_memory_space , Destroy > record_type ; // Allocate chunk pointers and allocation counter record_type * const record = - record_type::allocate( memory_space() + record_type::allocate( chunk_array_memory_space() , arg_label - , ( sizeof(pointer_type) * ( m_chunk_max + 1 ) ) ); + , ( sizeof(pointer_type) * ( m_chunk_max + 2 ) ) ); + // Allocate + 2 extra slots so that *m_chunk[m_chunk_max] == num_chunks_alloc and *m_chunk[m_chunk_max+1] == extent + // This must match in Destroy's execute(...) method m_chunks = reinterpret_cast<pointer_type*>( record->data() ); - record->m_destroy = Destroy( m_pool , m_chunks , m_chunk_max ); + record->m_destroy = Destroy( m_chunks , m_chunk_max, m_chunk_size ); // Initialize to zero - record->m_destroy.construct_shared_allocation(); m_track.assign_allocated_record_to_uninitialized( record ); } + }; } // namespace Experimental } // namespace Kokkos namespace Kokkos { -namespace Experimental { template< class T , class ... P > inline @@ -545,11 +452,11 @@ create_mirror_view( const Kokkos::Experimental::DynamicView<T,P...> & src ) template< class T , class ... DP , class ... SP > inline void deep_copy( const View<T,DP...> & dst - , const DynamicView<T,SP...> & src + , const Kokkos::Experimental::DynamicView<T,SP...> & src ) { typedef View<T,DP...> dst_type ; - typedef DynamicView<T,SP...> src_type ; + typedef Kokkos::Experimental::DynamicView<T,SP...> src_type ; typedef typename ViewTraits<T,DP...>::execution_space dst_execution_space ; typedef typename ViewTraits<T,SP...>::memory_space src_memory_space ; @@ -568,11 +475,11 @@ void deep_copy( const View<T,DP...> & dst template< class T , class ... DP , class ... SP > inline -void deep_copy( const DynamicView<T,DP...> & dst +void deep_copy( const Kokkos::Experimental::DynamicView<T,DP...> & dst , const View<T,SP...> & src ) { - typedef DynamicView<T,SP...> dst_type ; + typedef Kokkos::Experimental::DynamicView<T,SP...> dst_type ; typedef View<T,DP...> src_type ; typedef typename ViewTraits<T,DP...>::execution_space dst_execution_space ; @@ -590,7 +497,81 @@ void deep_copy( const DynamicView<T,DP...> & dst } } -} // namespace Experimental +namespace Impl { +template<class Arg0, class ... DP , class ... SP> +struct CommonSubview<Kokkos::Experimental::DynamicView<DP...>,Kokkos::Experimental::DynamicView<SP...>,1,Arg0> { + typedef Kokkos::Experimental::DynamicView<DP...> DstType; + typedef Kokkos::Experimental::DynamicView<SP...> SrcType; + typedef DstType dst_subview_type; + typedef SrcType src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0): + dst_sub(dst),src_sub(src) {} +}; + +template<class ...DP, class SrcType, class Arg0> +struct CommonSubview<Kokkos::Experimental::DynamicView<DP...>,SrcType,1,Arg0> { + typedef Kokkos::Experimental::DynamicView<DP...> DstType; + typedef DstType dst_subview_type; + typedef typename Kokkos::Subview<SrcType,Arg0> src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0): + dst_sub(dst),src_sub(src,arg0) {} +}; + +template<class DstType, class ...SP, class Arg0> +struct CommonSubview<DstType,Kokkos::Experimental::DynamicView<SP...>,1,Arg0> { + typedef Kokkos::Experimental::DynamicView<SP...> SrcType; + typedef typename Kokkos::Subview<DstType,Arg0> dst_subview_type; + typedef SrcType src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0): + dst_sub(dst,arg0),src_sub(src) {} +}; + +template<class ...DP,class ViewTypeB, class Layout, class ExecSpace,typename iType> +struct ViewCopy<Kokkos::Experimental::DynamicView<DP...>,ViewTypeB,Layout,ExecSpace,1,iType> { + Kokkos::Experimental::DynamicView<DP...> a; + ViewTypeB b; + + typedef Kokkos::RangePolicy<ExecSpace,Kokkos::IndexType<iType>> policy_type; + + ViewCopy(const Kokkos::Experimental::DynamicView<DP...>& a_, const ViewTypeB& b_):a(a_),b(b_) { + Kokkos::parallel_for("Kokkos::ViewCopy-2D", + policy_type(0,b.extent(0)),*this); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0) const { + a(i0) = b(i0); + }; +}; + +template<class ...DP,class ...SP, class Layout, class ExecSpace,typename iType> +struct ViewCopy<Kokkos::Experimental::DynamicView<DP...>, + Kokkos::Experimental::DynamicView<SP...>,Layout,ExecSpace,1,iType> { + Kokkos::Experimental::DynamicView<DP...> a; + Kokkos::Experimental::DynamicView<SP...> b; + + typedef Kokkos::RangePolicy<ExecSpace,Kokkos::IndexType<iType>> policy_type; + + ViewCopy(const Kokkos::Experimental::DynamicView<DP...>& a_, + const Kokkos::Experimental::DynamicView<SP...>& b_):a(a_),b(b_) { + const iType n = std::min(a.extent(0),b.extent(0)); + Kokkos::parallel_for("Kokkos::ViewCopy-2D", + policy_type(0,n),*this); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0) const { + a(i0) = b(i0); + }; +}; + +} // namespace Impl } // namespace Kokkos #endif /* #ifndef KOKKOS_DYNAMIC_VIEW_HPP */ diff --git a/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp b/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp index 8b9e75d854234f317f953278bd8f663cab1002d4..e05ea1a9d5be4a550ed177348fe4d4c62289ace4 100644 --- a/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp +++ b/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -69,7 +69,7 @@ public: clear(); } - int getCapacity() const { return m_reports.h_view.dimension_0(); } + int getCapacity() const { return m_reports.h_view.extent(0); } int getNumReports(); @@ -90,7 +90,7 @@ public: { int idx = Kokkos::atomic_fetch_add(&m_numReportsAttempted(), 1); - if (idx >= 0 && (idx < static_cast<int>(m_reports.d_view.dimension_0()))) { + if (idx >= 0 && (idx < static_cast<int>(m_reports.d_view.extent(0)))) { m_reporters.d_view(idx) = reporter_id; m_reports.d_view(idx) = report; return true; @@ -118,8 +118,8 @@ inline int ErrorReporter<ReportType, DeviceType>::getNumReports() { int num_reports = 0; Kokkos::deep_copy(num_reports,m_numReportsAttempted); - if (num_reports > static_cast<int>(m_reports.h_view.dimension_0())) { - num_reports = m_reports.h_view.dimension_0(); + if (num_reports > static_cast<int>(m_reports.h_view.extent(0))) { + num_reports = m_reports.h_view.extent(0); } return num_reports; } diff --git a/lib/kokkos/containers/src/Kokkos_Functional.hpp b/lib/kokkos/containers/src/Kokkos_Functional.hpp index ebb5debaf144dc9f80dd5e61a89c5856c01e7f4c..4d256cce270d8edf728dfe84611230e5160c5a3c 100644 --- a/lib/kokkos/containers/src/Kokkos_Functional.hpp +++ b/lib/kokkos/containers/src/Kokkos_Functional.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/src/Kokkos_ScatterView.hpp b/lib/kokkos/containers/src/Kokkos_ScatterView.hpp index 48c470948089734ba5dc35a321dc55c0e8c45572..6c3365408ad184ac01943625b0259da18105b2ed 100644 --- a/lib/kokkos/containers/src/Kokkos_ScatterView.hpp +++ b/lib/kokkos/containers/src/Kokkos_ScatterView.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -623,14 +623,12 @@ public: typename ExecSpace::memory_space, typename dest_type::memory_space>::value, "ScatterView deep_copy destination memory space not accessible"); - size_t strides[8]; - internal_view.stride(strides); bool is_equal = (dest.data() == internal_view.data()); size_t start = is_equal ? 1 : 0; Kokkos::Impl::Experimental::ReduceDuplicates<ExecSpace, original_value_type, Op>( internal_view.data(), dest.data(), - strides[0], + internal_view.stride(0), start, internal_view.extent(0), internal_view.label()); @@ -772,9 +770,6 @@ public: typename ExecSpace::memory_space, typename dest_type::memory_space>::value, "ScatterView deep_copy destination memory space not accessible"); - size_t strides[8]; - internal_view.stride(strides); - size_t stride = strides[internal_view_type::rank - 1]; auto extent = internal_view.extent( internal_view_type::rank - 1); bool is_equal = (dest.data() == internal_view.data()); @@ -782,7 +777,7 @@ public: Kokkos::Impl::Experimental::ReduceDuplicates<ExecSpace, original_value_type, Op>( internal_view.data(), dest.data(), - stride, + internal_view.stride(internal_view_type::rank - 1), start, extent, internal_view.label()); diff --git a/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp b/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp index 996b6b5610230832a962f2bde624f874bbd540cb..500bf8f424e9fd9ef243078147e46adecc8bea46 100644 --- a/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp +++ b/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -70,7 +70,7 @@ namespace Impl { KOKKOS_INLINE_FUNCTION void operator() (const int_type& iRow) const { - const int_type num_rows = row_offsets.dimension_0()-1; + const int_type num_rows = row_offsets.extent(0)-1; const int_type num_entries = row_offsets(num_rows); const int_type total_cost = num_entries + num_rows*cost_per_row; @@ -105,7 +105,7 @@ namespace Impl { } } else { if((count >= (current_block + 1) * cost_per_workset) || - (iRow+2 == row_offsets.dimension_0())) { + (iRow+2 == row_offsets.extent(0))) { if(end_block>current_block+1) { int_type num_block = end_block-current_block; row_block_offsets(current_block+1) = iRow; @@ -330,8 +330,8 @@ public: */ KOKKOS_INLINE_FUNCTION size_type numRows() const { - return (row_map.dimension_0 () != 0) ? - row_map.dimension_0 () - static_cast<size_type> (1) : + return (row_map.extent(0) != 0) ? + row_map.extent(0) - static_cast<size_type> (1) : static_cast<size_type> (0); } @@ -458,7 +458,7 @@ DataType maximum_entry( const StaticCrsGraph< DataType , Arg1Type , Arg2Type , S typedef Impl::StaticCrsGraphMaximumEntry< GraphType > FunctorType ; DataType result = 0 ; - Kokkos::parallel_reduce( graph.entries.dimension_0(), + Kokkos::parallel_reduce( graph.entries.extent(0), FunctorType(graph), result ); return result ; } diff --git a/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp b/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp index 059587a67cfea38167037cbe594e58f7f390f4ef..64601e6b5989678f6dcf24ef704f9e0ca9a6452a 100644 --- a/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp +++ b/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -477,7 +477,7 @@ public: /// kernel. KOKKOS_INLINE_FUNCTION size_type hash_capacity() const - { return m_hash_lists.dimension_0(); } + { return m_hash_lists.extent(0); } //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- @@ -507,13 +507,13 @@ public: int volatile & failed_insert_ref = m_scalars((int)failed_insert_idx) ; const size_type hash_value = m_hasher(k); - const size_type hash_list = hash_value % m_hash_lists.dimension_0(); + const size_type hash_list = hash_value % m_hash_lists.extent(0); size_type * curr_ptr = & m_hash_lists[ hash_list ]; size_type new_index = invalid_index ; // Force integer multiply to long - size_type index_hint = static_cast<size_type>( (static_cast<double>(hash_list) * capacity()) / m_hash_lists.dimension_0()); + size_type index_hint = static_cast<size_type>( (static_cast<double>(hash_list) * capacity()) / m_hash_lists.extent(0)); size_type find_attempts = 0; @@ -645,7 +645,7 @@ public: KOKKOS_INLINE_FUNCTION size_type find( const key_type & k) const { - size_type curr = 0u < capacity() ? m_hash_lists( m_hasher(k) % m_hash_lists.dimension_0() ) : invalid_index ; + size_type curr = 0u < capacity() ? m_hash_lists( m_hasher(k) % m_hash_lists.extent(0) ) : invalid_index ; KOKKOS_NONTEMPORAL_PREFETCH_LOAD(&m_keys[curr != invalid_index ? curr : 0]); while (curr != invalid_index && !m_equal_to( m_keys[curr], k) ) { @@ -741,7 +741,7 @@ public: >::type create_copy_view( UnorderedMap<SKey, SValue, SDevice, Hasher,EqualTo> const& src) { - if (m_hash_lists.ptr_on_device() != src.m_hash_lists.ptr_on_device()) { + if (m_hash_lists.data() != src.m_hash_lists.data()) { insertable_map_type tmp; @@ -750,23 +750,23 @@ public: tmp.m_equal_to = src.m_equal_to; tmp.m_size = src.size(); tmp.m_available_indexes = bitset_type( src.capacity() ); - tmp.m_hash_lists = size_type_view( ViewAllocateWithoutInitializing("UnorderedMap hash list"), src.m_hash_lists.dimension_0() ); - tmp.m_next_index = size_type_view( ViewAllocateWithoutInitializing("UnorderedMap next index"), src.m_next_index.dimension_0() ); - tmp.m_keys = key_type_view( ViewAllocateWithoutInitializing("UnorderedMap keys"), src.m_keys.dimension_0() ); - tmp.m_values = value_type_view( ViewAllocateWithoutInitializing("UnorderedMap values"), src.m_values.dimension_0() ); + tmp.m_hash_lists = size_type_view( ViewAllocateWithoutInitializing("UnorderedMap hash list"), src.m_hash_lists.extent(0) ); + tmp.m_next_index = size_type_view( ViewAllocateWithoutInitializing("UnorderedMap next index"), src.m_next_index.extent(0) ); + tmp.m_keys = key_type_view( ViewAllocateWithoutInitializing("UnorderedMap keys"), src.m_keys.extent(0) ); + tmp.m_values = value_type_view( ViewAllocateWithoutInitializing("UnorderedMap values"), src.m_values.extent(0) ); tmp.m_scalars = scalars_view("UnorderedMap scalars"); Kokkos::deep_copy(tmp.m_available_indexes, src.m_available_indexes); typedef Kokkos::Impl::DeepCopy< typename device_type::memory_space, typename SDevice::memory_space > raw_deep_copy; - raw_deep_copy(tmp.m_hash_lists.ptr_on_device(), src.m_hash_lists.ptr_on_device(), sizeof(size_type)*src.m_hash_lists.dimension_0()); - raw_deep_copy(tmp.m_next_index.ptr_on_device(), src.m_next_index.ptr_on_device(), sizeof(size_type)*src.m_next_index.dimension_0()); - raw_deep_copy(tmp.m_keys.ptr_on_device(), src.m_keys.ptr_on_device(), sizeof(key_type)*src.m_keys.dimension_0()); + raw_deep_copy(tmp.m_hash_lists.data(), src.m_hash_lists.data(), sizeof(size_type)*src.m_hash_lists.extent(0)); + raw_deep_copy(tmp.m_next_index.data(), src.m_next_index.data(), sizeof(size_type)*src.m_next_index.extent(0)); + raw_deep_copy(tmp.m_keys.data(), src.m_keys.data(), sizeof(key_type)*src.m_keys.extent(0)); if (!is_set) { - raw_deep_copy(tmp.m_values.ptr_on_device(), src.m_values.ptr_on_device(), sizeof(impl_value_type)*src.m_values.dimension_0()); + raw_deep_copy(tmp.m_values.data(), src.m_values.data(), sizeof(impl_value_type)*src.m_values.extent(0)); } - raw_deep_copy(tmp.m_scalars.ptr_on_device(), src.m_scalars.ptr_on_device(), sizeof(int)*num_scalars ); + raw_deep_copy(tmp.m_scalars.data(), src.m_scalars.data(), sizeof(int)*num_scalars ); *this = tmp; } @@ -784,21 +784,21 @@ private: // private member functions { typedef Kokkos::Impl::DeepCopy< typename device_type::memory_space, Kokkos::HostSpace > raw_deep_copy; const int true_ = true; - raw_deep_copy(m_scalars.ptr_on_device() + flag, &true_, sizeof(int)); + raw_deep_copy(m_scalars.data() + flag, &true_, sizeof(int)); } void reset_flag(int flag) const { typedef Kokkos::Impl::DeepCopy< typename device_type::memory_space, Kokkos::HostSpace > raw_deep_copy; const int false_ = false; - raw_deep_copy(m_scalars.ptr_on_device() + flag, &false_, sizeof(int)); + raw_deep_copy(m_scalars.data() + flag, &false_, sizeof(int)); } bool get_flag(int flag) const { typedef Kokkos::Impl::DeepCopy< Kokkos::HostSpace, typename device_type::memory_space > raw_deep_copy; int result = false; - raw_deep_copy(&result, m_scalars.ptr_on_device() + flag, sizeof(int)); + raw_deep_copy(&result, m_scalars.data() + flag, sizeof(int)); return result; } diff --git a/lib/kokkos/containers/src/Kokkos_Vector.hpp b/lib/kokkos/containers/src/Kokkos_Vector.hpp index 03bbefab10d74e1e9c4b620450f8b682833ac31f..08eee5b17ada6c22b2cbe63a9a9f493f67a464b2 100644 --- a/lib/kokkos/containers/src/Kokkos_Vector.hpp +++ b/lib/kokkos/containers/src/Kokkos_Vector.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp b/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp index 3e910f5eefc1c2d6e2a7c75ad9a92c7594c551ca..7ea2e102cec501bd88a3d872c280c84380aedce0 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -80,7 +80,7 @@ struct BitsetCount size_type apply() const { size_type count = 0u; - parallel_reduce( m_bitset.m_blocks.dimension_0(), *this, count ); + parallel_reduce( m_bitset.m_blocks.extent(0), *this, count ); return count; } diff --git a/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp b/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp index 43874e97ff7b71c07f8cd365fb45e7a4d881d314..8b17dcce4b487aa371bfa1a311f562d7ad402c24 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp b/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp index 5072180876ad21f28779cbe1dbe4652505184e83..91fbaaf0113e51883b63bf569d31649f22f42ee5 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.cpp b/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.cpp index 843fd3a8089999ab80b23506c2206e7a5de325e9..88ca200daf3004fb80d08c19a304ac8e7dfef9e7 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.cpp +++ b/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp b/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp index f57ee66a1d586acdba9b3814a93811725eef3931..f97c1fc0468f7049b03770749ae678270d812e1d 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -102,7 +102,7 @@ struct UnorderedMapErase void apply() const { - parallel_for(m_map.m_hash_lists.dimension_0(), *this); + parallel_for(m_map.m_hash_lists.extent(0), *this); } KOKKOS_INLINE_FUNCTION @@ -170,7 +170,7 @@ struct UnorderedMapHistogram void calculate() { - parallel_for(m_map.m_hash_lists.dimension_0(), *this); + parallel_for(m_map.m_hash_lists.extent(0), *this); } void clear() @@ -185,7 +185,7 @@ struct UnorderedMapHistogram host_histogram_view host_copy = create_mirror_view(m_length); Kokkos::deep_copy(host_copy, m_length); - for (int i=0, size = host_copy.dimension_0(); i<size; ++i) + for (int i=0, size = host_copy.extent(0); i<size; ++i) { out << host_copy[i] << " , "; } @@ -197,7 +197,7 @@ struct UnorderedMapHistogram host_histogram_view host_copy = create_mirror_view(m_distance); Kokkos::deep_copy(host_copy, m_distance); - for (int i=0, size = host_copy.dimension_0(); i<size; ++i) + for (int i=0, size = host_copy.extent(0); i<size; ++i) { out << host_copy[i] << " , "; } @@ -209,7 +209,7 @@ struct UnorderedMapHistogram host_histogram_view host_copy = create_mirror_view(m_block_distance); Kokkos::deep_copy(host_copy, m_block_distance); - for (int i=0, size = host_copy.dimension_0(); i<size; ++i) + for (int i=0, size = host_copy.extent(0); i<size; ++i) { out << host_copy[i] << " , "; } @@ -261,7 +261,7 @@ struct UnorderedMapPrint void apply() { - parallel_for(m_map.m_hash_lists.dimension_0(), *this); + parallel_for(m_map.m_hash_lists.extent(0), *this); } KOKKOS_INLINE_FUNCTION diff --git a/lib/kokkos/containers/unit_tests/TestBitset.hpp b/lib/kokkos/containers/unit_tests/TestBitset.hpp index 76fb30edcb68aa37f7beb55352212211bcf586c3..bd83835250ad937a31e56c2ca0111bde4d0852b7 100644 --- a/lib/kokkos/containers/unit_tests/TestBitset.hpp +++ b/lib/kokkos/containers/unit_tests/TestBitset.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/unit_tests/TestCuda.cpp b/lib/kokkos/containers/unit_tests/TestCuda.cpp index ddd6bdae6db5d65a2e20006244422f46f58f1248..83498daef57724ddb433bad8f08a6c90bf4282cf 100644 --- a/lib/kokkos/containers/unit_tests/TestCuda.cpp +++ b/lib/kokkos/containers/unit_tests/TestCuda.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -83,13 +83,9 @@ protected: static void SetUpTestCase() { std::cout << std::setprecision(5) << std::scientific; - Kokkos::HostSpace::execution_space::initialize(); - Kokkos::Cuda::initialize( Kokkos::Cuda::SelectDevice(0) ); } static void TearDownTestCase() { - Kokkos::Cuda::finalize(); - Kokkos::HostSpace::execution_space::finalize(); } }; diff --git a/lib/kokkos/containers/unit_tests/TestDualView.hpp b/lib/kokkos/containers/unit_tests/TestDualView.hpp index 16891d4b1d9cf4d7bd363c3e2b930d8dff641d60..613a096b65f1853cff3bdcf6c49f90d3ae33e99d 100644 --- a/lib/kokkos/containers/unit_tests/TestDualView.hpp +++ b/lib/kokkos/containers/unit_tests/TestDualView.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -88,10 +88,10 @@ namespace Impl { a.template sync<typename ViewType::host_mirror_space>(); Scalar count = 0; - for(unsigned int i = 0; i<a.d_view.dimension_0(); i++) - for(unsigned int j = 0; j<a.d_view.dimension_1(); j++) + for(unsigned int i = 0; i<a.d_view.extent(0); i++) + for(unsigned int j = 0; j<a.d_view.extent(1); j++) count += a.h_view(i,j); - return count - a.d_view.dimension_0()*a.d_view.dimension_1()-2-4-3*2; + return count - a.d_view.extent(0)*a.d_view.extent(1)-2-4-3*2; } diff --git a/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp b/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp index 125b9b3287233e57201e9f9d4af5380170318e91..e0a89a0abd1c47d6c669b6a9645ba51b90cb5831 100644 --- a/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -56,7 +56,7 @@ namespace Test { template< class T , class ... P > -size_t allocation_count( const Kokkos::Experimental::DynRankView<T,P...> & view ) +size_t allocation_count( const Kokkos::DynRankView<T,P...> & view ) { const size_t card = view.size(); const size_t alloc = view.span(); @@ -74,7 +74,7 @@ struct TestViewOperator static const unsigned N = 100 ; static const unsigned D = 3 ; - typedef Kokkos::Experimental::DynRankView< T , execution_space > view_type ; + typedef Kokkos::DynRankView< T , execution_space > view_type ; const view_type v1 ; const view_type v2 ; @@ -129,10 +129,10 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 7 > typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; + DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; + DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; left_view left ; right_view right ; @@ -163,13 +163,13 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 7 > long offset ; offset = -1 ; - for ( unsigned i6 = 0 ; i6 < unsigned(left.dimension_6()) ; ++i6 ) - for ( unsigned i5 = 0 ; i5 < unsigned(left.dimension_5()) ; ++i5 ) - for ( unsigned i4 = 0 ; i4 < unsigned(left.dimension_4()) ; ++i4 ) - for ( unsigned i3 = 0 ; i3 < unsigned(left.dimension_3()) ; ++i3 ) - for ( unsigned i2 = 0 ; i2 < unsigned(left.dimension_2()) ; ++i2 ) - for ( unsigned i1 = 0 ; i1 < unsigned(left.dimension_1()) ; ++i1 ) - for ( unsigned i0 = 0 ; i0 < unsigned(left.dimension_0()) ; ++i0 ) + for ( unsigned i6 = 0 ; i6 < unsigned(left.extent(6)) ; ++i6 ) + for ( unsigned i5 = 0 ; i5 < unsigned(left.extent(5)) ; ++i5 ) + for ( unsigned i4 = 0 ; i4 < unsigned(left.extent(4)) ; ++i4 ) + for ( unsigned i3 = 0 ; i3 < unsigned(left.extent(3)) ; ++i3 ) + for ( unsigned i2 = 0 ; i2 < unsigned(left.extent(2)) ; ++i2 ) + for ( unsigned i1 = 0 ; i1 < unsigned(left.extent(1)) ; ++i1 ) + for ( unsigned i0 = 0 ; i0 < unsigned(left.extent(0)) ; ++i0 ) { const long j = & left( i0, i1, i2, i3, i4, i5, i6 ) - & left( 0, 0, 0, 0, 0, 0, 0 ); @@ -178,13 +178,13 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 7 > } offset = -1 ; - for ( unsigned i0 = 0 ; i0 < unsigned(right.dimension_0()) ; ++i0 ) - for ( unsigned i1 = 0 ; i1 < unsigned(right.dimension_1()) ; ++i1 ) - for ( unsigned i2 = 0 ; i2 < unsigned(right.dimension_2()) ; ++i2 ) - for ( unsigned i3 = 0 ; i3 < unsigned(right.dimension_3()) ; ++i3 ) - for ( unsigned i4 = 0 ; i4 < unsigned(right.dimension_4()) ; ++i4 ) - for ( unsigned i5 = 0 ; i5 < unsigned(right.dimension_5()) ; ++i5 ) - for ( unsigned i6 = 0 ; i6 < unsigned(right.dimension_6()) ; ++i6 ) + for ( unsigned i0 = 0 ; i0 < unsigned(right.extent(0)) ; ++i0 ) + for ( unsigned i1 = 0 ; i1 < unsigned(right.extent(1)) ; ++i1 ) + for ( unsigned i2 = 0 ; i2 < unsigned(right.extent(2)) ; ++i2 ) + for ( unsigned i3 = 0 ; i3 < unsigned(right.extent(3)) ; ++i3 ) + for ( unsigned i4 = 0 ; i4 < unsigned(right.extent(4)) ; ++i4 ) + for ( unsigned i5 = 0 ; i5 < unsigned(right.extent(5)) ; ++i5 ) + for ( unsigned i6 = 0 ; i6 < unsigned(right.extent(6)) ; ++i6 ) { const long j = & right( i0, i1, i2, i3, i4, i5, i6 ) - & right( 0, 0, 0, 0, 0, 0, 0 ); @@ -214,10 +214,10 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 6 > typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; + DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; + DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; left_view left ; right_view right ; @@ -248,12 +248,12 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 6 > long offset ; offset = -1 ; - for ( unsigned i5 = 0 ; i5 < unsigned(left.dimension_5()) ; ++i5 ) - for ( unsigned i4 = 0 ; i4 < unsigned(left.dimension_4()) ; ++i4 ) - for ( unsigned i3 = 0 ; i3 < unsigned(left.dimension_3()) ; ++i3 ) - for ( unsigned i2 = 0 ; i2 < unsigned(left.dimension_2()) ; ++i2 ) - for ( unsigned i1 = 0 ; i1 < unsigned(left.dimension_1()) ; ++i1 ) - for ( unsigned i0 = 0 ; i0 < unsigned(left.dimension_0()) ; ++i0 ) + for ( unsigned i5 = 0 ; i5 < unsigned(left.extent(5)) ; ++i5 ) + for ( unsigned i4 = 0 ; i4 < unsigned(left.extent(4)) ; ++i4 ) + for ( unsigned i3 = 0 ; i3 < unsigned(left.extent(3)) ; ++i3 ) + for ( unsigned i2 = 0 ; i2 < unsigned(left.extent(2)) ; ++i2 ) + for ( unsigned i1 = 0 ; i1 < unsigned(left.extent(1)) ; ++i1 ) + for ( unsigned i0 = 0 ; i0 < unsigned(left.extent(0)) ; ++i0 ) { const long j = & left( i0, i1, i2, i3, i4, i5 ) - & left( 0, 0, 0, 0, 0, 0 ); @@ -262,12 +262,12 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 6 > } offset = -1 ; - for ( unsigned i0 = 0 ; i0 < unsigned(right.dimension_0()) ; ++i0 ) - for ( unsigned i1 = 0 ; i1 < unsigned(right.dimension_1()) ; ++i1 ) - for ( unsigned i2 = 0 ; i2 < unsigned(right.dimension_2()) ; ++i2 ) - for ( unsigned i3 = 0 ; i3 < unsigned(right.dimension_3()) ; ++i3 ) - for ( unsigned i4 = 0 ; i4 < unsigned(right.dimension_4()) ; ++i4 ) - for ( unsigned i5 = 0 ; i5 < unsigned(right.dimension_5()) ; ++i5 ) + for ( unsigned i0 = 0 ; i0 < unsigned(right.extent(0)) ; ++i0 ) + for ( unsigned i1 = 0 ; i1 < unsigned(right.extent(1)) ; ++i1 ) + for ( unsigned i2 = 0 ; i2 < unsigned(right.extent(2)) ; ++i2 ) + for ( unsigned i3 = 0 ; i3 < unsigned(right.extent(3)) ; ++i3 ) + for ( unsigned i4 = 0 ; i4 < unsigned(right.extent(4)) ; ++i4 ) + for ( unsigned i5 = 0 ; i5 < unsigned(right.extent(5)) ; ++i5 ) { const long j = & right( i0, i1, i2, i3, i4, i5 ) - & right( 0, 0, 0, 0, 0, 0 ); @@ -297,13 +297,13 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 5 > typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; + DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; + DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutStride, execution_space > stride_view ; + DynRankView< DataType, Kokkos::LayoutStride, execution_space > stride_view ; left_view left ; right_view right ; @@ -338,11 +338,11 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 5 > long offset ; offset = -1 ; - for ( unsigned i4 = 0 ; i4 < unsigned(left.dimension_4()) ; ++i4 ) - for ( unsigned i3 = 0 ; i3 < unsigned(left.dimension_3()) ; ++i3 ) - for ( unsigned i2 = 0 ; i2 < unsigned(left.dimension_2()) ; ++i2 ) - for ( unsigned i1 = 0 ; i1 < unsigned(left.dimension_1()) ; ++i1 ) - for ( unsigned i0 = 0 ; i0 < unsigned(left.dimension_0()) ; ++i0 ) + for ( unsigned i4 = 0 ; i4 < unsigned(left.extent(4)) ; ++i4 ) + for ( unsigned i3 = 0 ; i3 < unsigned(left.extent(3)) ; ++i3 ) + for ( unsigned i2 = 0 ; i2 < unsigned(left.extent(2)) ; ++i2 ) + for ( unsigned i1 = 0 ; i1 < unsigned(left.extent(1)) ; ++i1 ) + for ( unsigned i0 = 0 ; i0 < unsigned(left.extent(0)) ; ++i0 ) { const long j = & left( i0, i1, i2, i3, i4 ) - & left( 0, 0, 0, 0, 0 ); @@ -354,11 +354,11 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 5 > } offset = -1 ; - for ( unsigned i0 = 0 ; i0 < unsigned(right.dimension_0()) ; ++i0 ) - for ( unsigned i1 = 0 ; i1 < unsigned(right.dimension_1()) ; ++i1 ) - for ( unsigned i2 = 0 ; i2 < unsigned(right.dimension_2()) ; ++i2 ) - for ( unsigned i3 = 0 ; i3 < unsigned(right.dimension_3()) ; ++i3 ) - for ( unsigned i4 = 0 ; i4 < unsigned(right.dimension_4()) ; ++i4 ) + for ( unsigned i0 = 0 ; i0 < unsigned(right.extent(0)) ; ++i0 ) + for ( unsigned i1 = 0 ; i1 < unsigned(right.extent(1)) ; ++i1 ) + for ( unsigned i2 = 0 ; i2 < unsigned(right.extent(2)) ; ++i2 ) + for ( unsigned i3 = 0 ; i3 < unsigned(right.extent(3)) ; ++i3 ) + for ( unsigned i4 = 0 ; i4 < unsigned(right.extent(4)) ; ++i4 ) { const long j = & right( i0, i1, i2, i3, i4 ) - & right( 0, 0, 0, 0, 0 ); @@ -391,10 +391,10 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 4 > typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; + DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; + DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; left_view left ; right_view right ; @@ -425,10 +425,10 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 4 > long offset ; offset = -1 ; - for ( unsigned i3 = 0 ; i3 < unsigned(left.dimension_3()) ; ++i3 ) - for ( unsigned i2 = 0 ; i2 < unsigned(left.dimension_2()) ; ++i2 ) - for ( unsigned i1 = 0 ; i1 < unsigned(left.dimension_1()) ; ++i1 ) - for ( unsigned i0 = 0 ; i0 < unsigned(left.dimension_0()) ; ++i0 ) + for ( unsigned i3 = 0 ; i3 < unsigned(left.extent(3)) ; ++i3 ) + for ( unsigned i2 = 0 ; i2 < unsigned(left.extent(2)) ; ++i2 ) + for ( unsigned i1 = 0 ; i1 < unsigned(left.extent(1)) ; ++i1 ) + for ( unsigned i0 = 0 ; i0 < unsigned(left.extent(0)) ; ++i0 ) { const long j = & left( i0, i1, i2, i3 ) - & left( 0, 0, 0, 0 ); @@ -437,10 +437,10 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 4 > } offset = -1 ; - for ( unsigned i0 = 0 ; i0 < unsigned(right.dimension_0()) ; ++i0 ) - for ( unsigned i1 = 0 ; i1 < unsigned(right.dimension_1()) ; ++i1 ) - for ( unsigned i2 = 0 ; i2 < unsigned(right.dimension_2()) ; ++i2 ) - for ( unsigned i3 = 0 ; i3 < unsigned(right.dimension_3()) ; ++i3 ) + for ( unsigned i0 = 0 ; i0 < unsigned(right.extent(0)) ; ++i0 ) + for ( unsigned i1 = 0 ; i1 < unsigned(right.extent(1)) ; ++i1 ) + for ( unsigned i2 = 0 ; i2 < unsigned(right.extent(2)) ; ++i2 ) + for ( unsigned i3 = 0 ; i3 < unsigned(right.extent(3)) ; ++i3 ) { const long j = & right( i0, i1, i2, i3 ) - & right( 0, 0, 0, 0 ); @@ -470,13 +470,13 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 3 > typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; + DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; + DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutStride, execution_space > stride_view ; + DynRankView< DataType, Kokkos::LayoutStride, execution_space > stride_view ; left_view left ; right_view right ; @@ -511,9 +511,9 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 3 > long offset ; offset = -1 ; - for ( unsigned i2 = 0 ; i2 < unsigned(left.dimension_2()) ; ++i2 ) - for ( unsigned i1 = 0 ; i1 < unsigned(left.dimension_1()) ; ++i1 ) - for ( unsigned i0 = 0 ; i0 < unsigned(left.dimension_0()) ; ++i0 ) + for ( unsigned i2 = 0 ; i2 < unsigned(left.extent(2)) ; ++i2 ) + for ( unsigned i1 = 0 ; i1 < unsigned(left.extent(1)) ; ++i1 ) + for ( unsigned i0 = 0 ; i0 < unsigned(left.extent(0)) ; ++i0 ) { const long j = & left( i0, i1, i2 ) - & left( 0, 0, 0 ); @@ -524,9 +524,9 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 3 > } offset = -1 ; - for ( unsigned i0 = 0 ; i0 < unsigned(right.dimension_0()) ; ++i0 ) - for ( unsigned i1 = 0 ; i1 < unsigned(right.dimension_1()) ; ++i1 ) - for ( unsigned i2 = 0 ; i2 < unsigned(right.dimension_2()) ; ++i2 ) + for ( unsigned i0 = 0 ; i0 < unsigned(right.extent(0)) ; ++i0 ) + for ( unsigned i1 = 0 ; i1 < unsigned(right.extent(1)) ; ++i1 ) + for ( unsigned i2 = 0 ; i2 < unsigned(right.extent(2)) ; ++i2 ) { const long j = & right( i0, i1, i2 ) - & right( 0, 0, 0 ); @@ -536,9 +536,9 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 3 > if ( & right(i0,i1,i2) != & right_stride(i0,i1,i2) ) { update |= 8 ; } } - for ( unsigned i0 = 0 ; i0 < unsigned(left.dimension_0()) ; ++i0 ) - for ( unsigned i1 = 0 ; i1 < unsigned(left.dimension_1()) ; ++i1 ) - for ( unsigned i2 = 0 ; i2 < unsigned(left.dimension_2()) ; ++i2 ) + for ( unsigned i0 = 0 ; i0 < unsigned(left.extent(0)) ; ++i0 ) + for ( unsigned i1 = 0 ; i1 < unsigned(left.extent(1)) ; ++i1 ) + for ( unsigned i2 = 0 ; i2 < unsigned(left.extent(2)) ; ++i2 ) { if ( & left(i0,i1,i2) != & left(i0,i1,i2,0,0,0,0) ) { update |= 3 ; } if ( & right(i0,i1,i2) != & right(i0,i1,i2,0,0,0,0) ) { update |= 3 ; } @@ -566,10 +566,10 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 2 > typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; + DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; + DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; left_view left ; right_view right ; @@ -600,8 +600,8 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 2 > long offset ; offset = -1 ; - for ( unsigned i1 = 0 ; i1 < unsigned(left.dimension_1()) ; ++i1 ) - for ( unsigned i0 = 0 ; i0 < unsigned(left.dimension_0()) ; ++i0 ) + for ( unsigned i1 = 0 ; i1 < unsigned(left.extent(1)) ; ++i1 ) + for ( unsigned i0 = 0 ; i0 < unsigned(left.extent(0)) ; ++i0 ) { const long j = & left( i0, i1 ) - & left( 0, 0 ); @@ -610,8 +610,8 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 2 > } offset = -1 ; - for ( unsigned i0 = 0 ; i0 < unsigned(right.dimension_0()) ; ++i0 ) - for ( unsigned i1 = 0 ; i1 < unsigned(right.dimension_1()) ; ++i1 ) + for ( unsigned i0 = 0 ; i0 < unsigned(right.extent(0)) ; ++i0 ) + for ( unsigned i1 = 0 ; i1 < unsigned(right.extent(1)) ; ++i1 ) { const long j = & right( i0, i1 ) - & right( 0, 0 ); @@ -619,8 +619,8 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 2 > offset = j ; } - for ( unsigned i0 = 0 ; i0 < unsigned(left.dimension_0()) ; ++i0 ) - for ( unsigned i1 = 0 ; i1 < unsigned(left.dimension_1()) ; ++i1 ) + for ( unsigned i0 = 0 ; i0 < unsigned(left.extent(0)) ; ++i0 ) + for ( unsigned i1 = 0 ; i1 < unsigned(left.extent(1)) ; ++i1 ) { if ( & left(i0,i1) != & left(i0,i1,0,0,0,0,0) ) { update |= 3 ; } if ( & right(i0,i1) != & right(i0,i1,0,0,0,0,0) ) { update |= 3 ; } @@ -648,13 +648,13 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 1 > typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; + DynRankView< DataType, Kokkos::LayoutLeft, execution_space > left_view ; typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; + DynRankView< DataType, Kokkos::LayoutRight, execution_space > right_view ; typedef Kokkos:: - Experimental::DynRankView< DataType, Kokkos::LayoutStride, execution_space > stride_view ; + DynRankView< DataType, Kokkos::LayoutStride, execution_space > stride_view ; left_view left ; right_view right ; @@ -686,7 +686,7 @@ struct TestViewOperator_LeftAndRight< DataType , DeviceType , 1 > KOKKOS_INLINE_FUNCTION void operator()( const size_type , value_type & update ) const { - for ( unsigned i0 = 0 ; i0 < unsigned(left.dimension_0()) ; ++i0 ) + for ( unsigned i0 = 0 ; i0 < unsigned(left.extent(0)) ; ++i0 ) { if ( & left(i0) != & left(i0,0,0,0,0,0,0) ) { update |= 3 ; } if ( & right(i0) != & right(i0,0,0,0,0,0,0) ) { update |= 3 ; } @@ -709,10 +709,10 @@ public: N2 = 5 , N3 = 7 }; - typedef Kokkos::Experimental::DynRankView< T , device > dView0 ; - typedef Kokkos::Experimental::DynRankView< const T , device > const_dView0 ; + typedef Kokkos::DynRankView< T , device > dView0 ; + typedef Kokkos::DynRankView< const T , device > const_dView0 ; - typedef Kokkos::Experimental::DynRankView< T, device, Kokkos::MemoryUnmanaged > dView0_unmanaged ; + typedef Kokkos::DynRankView< T, device, Kokkos::MemoryUnmanaged > dView0_unmanaged ; typedef typename dView0::host_mirror_space host_drv_space ; typedef Kokkos::View< T , device > View0 ; @@ -747,27 +747,27 @@ public: dView0 drv0("drv0", 10, 20, 30); ASSERT_EQ( drv0.rank(), 3); - Kokkos::Experimental::resize(drv0, 5, 10); + Kokkos::resize(drv0, 5, 10); ASSERT_EQ( drv0.rank(), 2); - ASSERT_EQ( drv0.dimension_0(), 5); - ASSERT_EQ( drv0.dimension_1(), 10); - ASSERT_EQ( drv0.dimension_2(), 1); + ASSERT_EQ( drv0.extent(0), 5); + ASSERT_EQ( drv0.extent(1), 10); + ASSERT_EQ( drv0.extent(2), 1); - Kokkos::Experimental::realloc(drv0, 10, 20); + Kokkos::realloc(drv0, 10, 20); ASSERT_EQ( drv0.rank(), 2); - ASSERT_EQ( drv0.dimension_0(), 10); - ASSERT_EQ( drv0.dimension_1(), 20); - ASSERT_EQ( drv0.dimension_2(), 1); + ASSERT_EQ( drv0.extent(0), 10); + ASSERT_EQ( drv0.extent(1), 20); + ASSERT_EQ( drv0.extent(2), 1); } static void run_test_mirror() { - typedef Kokkos::Experimental::DynRankView< int , host_drv_space > view_type ; + typedef Kokkos::DynRankView< int , host_drv_space > view_type ; typedef typename view_type::HostMirror mirror_type ; view_type a("a"); - mirror_type am = Kokkos::Experimental::create_mirror_view(a); - mirror_type ax = Kokkos::Experimental::create_mirror(a); + mirror_type am = Kokkos::create_mirror_view(a); + mirror_type ax = Kokkos::create_mirror(a); ASSERT_EQ( & a() , & am() ); ASSERT_EQ( a.rank() , am.rank() ); ASSERT_EQ( ax.rank() , am.rank() ); @@ -777,17 +777,17 @@ public: Kokkos::DynRankView<double, Kokkos::LayoutLeft, Kokkos::HostSpace> a_h("A",1000); auto a_h2 = Kokkos::create_mirror(Kokkos::HostSpace(),a_h); auto a_d = Kokkos::create_mirror(typename device::memory_space(),a_h); - + int equal_ptr_h_h2 = (a_h.data() ==a_h2.data())?1:0; int equal_ptr_h_d = (a_h.data() ==a_d. data())?1:0; int equal_ptr_h2_d = (a_h2.data()==a_d. data())?1:0; - + ASSERT_EQ(equal_ptr_h_h2,0); ASSERT_EQ(equal_ptr_h_d ,0); ASSERT_EQ(equal_ptr_h2_d,0); - ASSERT_EQ(a_h.dimension_0(),a_h2.dimension_0()); - ASSERT_EQ(a_h.dimension_0(),a_d .dimension_0()); + ASSERT_EQ(a_h.extent(0),a_h2.extent(0)); + ASSERT_EQ(a_h.extent(0),a_d .extent(0)); ASSERT_EQ(a_h.rank(),a_h2.rank()); ASSERT_EQ(a_h.rank(),a_d.rank()); @@ -797,17 +797,17 @@ public: Kokkos::DynRankView<double, Kokkos::LayoutRight, Kokkos::HostSpace> a_h("A",1000); auto a_h2 = Kokkos::create_mirror(Kokkos::HostSpace(),a_h); auto a_d = Kokkos::create_mirror(typename device::memory_space(),a_h); - + int equal_ptr_h_h2 = (a_h.data() ==a_h2.data())?1:0; int equal_ptr_h_d = (a_h.data() ==a_d. data())?1:0; int equal_ptr_h2_d = (a_h2.data()==a_d. data())?1:0; - + ASSERT_EQ(equal_ptr_h_h2,0); ASSERT_EQ(equal_ptr_h_d ,0); ASSERT_EQ(equal_ptr_h2_d,0); - ASSERT_EQ(a_h.dimension_0(),a_h2.dimension_0()); - ASSERT_EQ(a_h.dimension_0(),a_d .dimension_0()); + ASSERT_EQ(a_h.extent(0),a_h2.extent(0)); + ASSERT_EQ(a_h.extent(0),a_d .extent(0)); ASSERT_EQ(a_h.rank(),a_h2.rank()); ASSERT_EQ(a_h.rank(),a_d.rank()); @@ -818,43 +818,44 @@ public: Kokkos::DynRankView<double, Kokkos::LayoutLeft, Kokkos::HostSpace> a_h("A",1000); auto a_h2 = Kokkos::create_mirror_view(Kokkos::HostSpace(),a_h); auto a_d = Kokkos::create_mirror_view(typename device::memory_space(),a_h); - + int equal_ptr_h_h2 = a_h.data() ==a_h2.data()?1:0; int equal_ptr_h_d = a_h.data() ==a_d. data()?1:0; int equal_ptr_h2_d = a_h2.data()==a_d. data()?1:0; - - int is_same_memspace = std::is_same<Kokkos::HostSpace,typename device::memory_space>::value?1:0; + + int is_same_memspace = std::is_same<Kokkos::HostSpace,typename device::memory_space>::value?1:0; ASSERT_EQ(equal_ptr_h_h2,1); ASSERT_EQ(equal_ptr_h_d ,is_same_memspace); ASSERT_EQ(equal_ptr_h2_d ,is_same_memspace); - - ASSERT_EQ(a_h.dimension_0(),a_h2.dimension_0()); - ASSERT_EQ(a_h.dimension_0(),a_d .dimension_0()); + + ASSERT_EQ(a_h.extent(0),a_h2.extent(0)); + ASSERT_EQ(a_h.extent(0),a_d .extent(0)); ASSERT_EQ(a_h.rank(),a_h2.rank()); ASSERT_EQ(a_h.rank(),a_d.rank()); - } + } if (Kokkos::HostSpace::execution_space::is_initialized() ) { Kokkos::DynRankView<double, Kokkos::LayoutRight, Kokkos::HostSpace> a_h("A",1000); auto a_h2 = Kokkos::create_mirror_view(Kokkos::HostSpace(),a_h); auto a_d = Kokkos::create_mirror_view(typename device::memory_space(),a_h); - + int equal_ptr_h_h2 = a_h.data() ==a_h2.data()?1:0; int equal_ptr_h_d = a_h.data() ==a_d. data()?1:0; int equal_ptr_h2_d = a_h2.data()==a_d. data()?1:0; - - int is_same_memspace = std::is_same<Kokkos::HostSpace,typename device::memory_space>::value?1:0; + + int is_same_memspace = std::is_same<Kokkos::HostSpace,typename device::memory_space>::value?1:0; ASSERT_EQ(equal_ptr_h_h2,1); ASSERT_EQ(equal_ptr_h_d ,is_same_memspace); ASSERT_EQ(equal_ptr_h2_d ,is_same_memspace); + - ASSERT_EQ(a_h.dimension_0(),a_h2.dimension_0()); - ASSERT_EQ(a_h.dimension_0(),a_d .dimension_0()); + ASSERT_EQ(a_h.extent(0),a_h2.extent(0)); + ASSERT_EQ(a_h.extent(0),a_d .extent(0)); ASSERT_EQ(a_h.rank(),a_h2.rank()); ASSERT_EQ(a_h.rank(),a_d.rank()); - } + } if (Kokkos::HostSpace::execution_space::is_initialized() ) { typedef Kokkos::DynRankView< int , Kokkos::LayoutStride , Kokkos::HostSpace > view_stride_type ; @@ -862,18 +863,18 @@ public: view_stride_type a_h( "a" , Kokkos::LayoutStride::order_dimensions(7, order, dimen) ); auto a_h2 = Kokkos::create_mirror_view(Kokkos::HostSpace(),a_h); auto a_d = Kokkos::create_mirror_view(typename device::memory_space(),a_h); - + int equal_ptr_h_h2 = a_h.data() ==a_h2.data()?1:0; int equal_ptr_h_d = a_h.data() ==a_d. data()?1:0; int equal_ptr_h2_d = a_h2.data()==a_d. data()?1:0; - - int is_same_memspace = std::is_same<Kokkos::HostSpace,typename device::memory_space>::value?1:0; + + int is_same_memspace = std::is_same<Kokkos::HostSpace,typename device::memory_space>::value?1:0; ASSERT_EQ(equal_ptr_h_h2,1); ASSERT_EQ(equal_ptr_h_d ,is_same_memspace); ASSERT_EQ(equal_ptr_h2_d ,is_same_memspace); - - ASSERT_EQ(a_h.dimension_0(),a_h2.dimension_0()); - ASSERT_EQ(a_h.dimension_0(),a_d .dimension_0()); + + ASSERT_EQ(a_h.extent(0),a_h2.extent(0)); + ASSERT_EQ(a_h.extent(0),a_d .extent(0)); ASSERT_EQ(a_h.rank(),a_h2.rank()); ASSERT_EQ(a_h.rank(),a_d.rank()); @@ -890,14 +891,14 @@ public: dx = dView0( "dx" ); dy = dView0( "dy" ); - hx = Kokkos::Experimental::create_mirror( dx ); - hy = Kokkos::Experimental::create_mirror( dy ); + hx = Kokkos::create_mirror( dx ); + hy = Kokkos::create_mirror( dy ); hx() = 1 ; - Kokkos::Experimental::deep_copy( dx , hx ); - Kokkos::Experimental::deep_copy( dy , dx ); - Kokkos::Experimental::deep_copy( hy , dy ); + Kokkos::deep_copy( dx , hx ); + Kokkos::deep_copy( dy , dx ); + Kokkos::deep_copy( hy , dy ); ASSERT_EQ( hx(), hy() ); ASSERT_EQ( dx.rank() , hx.rank() ); @@ -920,18 +921,18 @@ public: View7 vcast = dx.ConstDownCast(); - ASSERT_EQ( dx.dimension_0() , vcast.dimension_0() ); - ASSERT_EQ( dx.dimension_1() , vcast.dimension_1() ); - ASSERT_EQ( dx.dimension_2() , vcast.dimension_2() ); - ASSERT_EQ( dx.dimension_3() , vcast.dimension_3() ); - ASSERT_EQ( dx.dimension_4() , vcast.dimension_4() ); + ASSERT_EQ( dx.extent(0) , vcast.extent(0) ); + ASSERT_EQ( dx.extent(1) , vcast.extent(1) ); + ASSERT_EQ( dx.extent(2) , vcast.extent(2) ); + ASSERT_EQ( dx.extent(3) , vcast.extent(3) ); + ASSERT_EQ( dx.extent(4) , vcast.extent(4) ); View7 vcast1( dy.ConstDownCast() ); - ASSERT_EQ( dy.dimension_0() , vcast1.dimension_0() ); - ASSERT_EQ( dy.dimension_1() , vcast1.dimension_1() ); - ASSERT_EQ( dy.dimension_2() , vcast1.dimension_2() ); - ASSERT_EQ( dy.dimension_3() , vcast1.dimension_3() ); - ASSERT_EQ( dy.dimension_4() , vcast1.dimension_4() ); + ASSERT_EQ( dy.extent(0) , vcast1.extent(0) ); + ASSERT_EQ( dy.extent(1) , vcast1.extent(1) ); + ASSERT_EQ( dy.extent(2) , vcast1.extent(2) ); + ASSERT_EQ( dy.extent(3) , vcast1.extent(3) ); + ASSERT_EQ( dy.extent(4) , vcast1.extent(4) ); //View - DynRankView Interoperability tests // copy View to DynRankView @@ -941,8 +942,8 @@ public: auto hvx = Kokkos::create_mirror_view(vx) ; Kokkos::deep_copy(hvx , vx); ASSERT_EQ( rank(hvx) , rank(hmx) ); - ASSERT_EQ( hvx.dimension_0() , hmx.dimension_0() ); - ASSERT_EQ( hvx.dimension_1() , hmx.dimension_1() ); + ASSERT_EQ( hvx.extent(0) , hmx.extent(0) ); + ASSERT_EQ( hvx.extent(1) , hmx.extent(1) ); // copy-assign View to DynRankView dView0 dfromvy = vy ; @@ -951,27 +952,27 @@ public: auto hvy = Kokkos::create_mirror_view(vy) ; Kokkos::deep_copy(hvy , vy); ASSERT_EQ( rank(hvy) , rank(hmy) ); - ASSERT_EQ( hvy.dimension_0() , hmy.dimension_0() ); - ASSERT_EQ( hvy.dimension_1() , hmy.dimension_1() ); + ASSERT_EQ( hvy.extent(0) , hmy.extent(0) ); + ASSERT_EQ( hvy.extent(1) , hmy.extent(1) ); View7 vtest1("vtest1",2,2,2,2,2,2,2); dView0 dfromv1( vtest1 ); ASSERT_EQ( dfromv1.rank() , vtest1.Rank ); - ASSERT_EQ( dfromv1.dimension_0() , vtest1.dimension_0() ); - ASSERT_EQ( dfromv1.dimension_1() , vtest1.dimension_1() ); + ASSERT_EQ( dfromv1.extent(0) , vtest1.extent(0) ); + ASSERT_EQ( dfromv1.extent(1) , vtest1.extent(1) ); ASSERT_EQ( dfromv1.use_count() , vtest1.use_count() ); dView0 dfromv2( vcast ); ASSERT_EQ( dfromv2.rank() , vcast.Rank ); - ASSERT_EQ( dfromv2.dimension_0() , vcast.dimension_0() ); - ASSERT_EQ( dfromv2.dimension_1() , vcast.dimension_1() ); + ASSERT_EQ( dfromv2.extent(0) , vcast.extent(0) ); + ASSERT_EQ( dfromv2.extent(1) , vcast.extent(1) ); ASSERT_EQ( dfromv2.use_count() , vcast.use_count() ); dView0 dfromv3 = vcast1; ASSERT_EQ( dfromv3.rank() , vcast1.Rank ); - ASSERT_EQ( dfromv3.dimension_0() , vcast1.dimension_0() ); - ASSERT_EQ( dfromv3.dimension_1() , vcast1.dimension_1() ); + ASSERT_EQ( dfromv3.extent(0) , vcast1.extent(0) ); + ASSERT_EQ( dfromv3.extent(1) , vcast1.extent(1) ); ASSERT_EQ( dfromv3.use_count() , vcast1.use_count() ); } @@ -993,15 +994,15 @@ public: dView0 d_uninitialized(Kokkos::ViewAllocateWithoutInitializing("uninit"),10,20); ASSERT_TRUE( d_uninitialized.data() != nullptr ); ASSERT_EQ( d_uninitialized.rank() , 2 ); - ASSERT_EQ( d_uninitialized.dimension_0() , 10 ); - ASSERT_EQ( d_uninitialized.dimension_1() , 20 ); - ASSERT_EQ( d_uninitialized.dimension_2() , 1 ); + ASSERT_EQ( d_uninitialized.extent(0) , 10 ); + ASSERT_EQ( d_uninitialized.extent(1) , 20 ); + ASSERT_EQ( d_uninitialized.extent(2) , 1 ); dView0 dx , dy , dz ; hView0 hx , hy , hz ; - ASSERT_TRUE( Kokkos::Experimental::is_dyn_rank_view<dView0>::value ); - ASSERT_FALSE( Kokkos::Experimental::is_dyn_rank_view< Kokkos::View<double> >::value ); + ASSERT_TRUE( Kokkos::is_dyn_rank_view<dView0>::value ); + ASSERT_FALSE( Kokkos::is_dyn_rank_view< Kokkos::View<double> >::value ); ASSERT_TRUE( dx.ptr_on_device() == 0 ); //Okay with UVM ASSERT_TRUE( dy.ptr_on_device() == 0 ); //Okay with UVM @@ -1009,12 +1010,12 @@ public: ASSERT_TRUE( hx.ptr_on_device() == 0 ); ASSERT_TRUE( hy.ptr_on_device() == 0 ); ASSERT_TRUE( hz.ptr_on_device() == 0 ); - ASSERT_EQ( dx.dimension_0() , 0u ); //Okay with UVM - ASSERT_EQ( dy.dimension_0() , 0u ); //Okay with UVM - ASSERT_EQ( dz.dimension_0() , 0u ); //Okay with UVM - ASSERT_EQ( hx.dimension_0() , 0u ); - ASSERT_EQ( hy.dimension_0() , 0u ); - ASSERT_EQ( hz.dimension_0() , 0u ); + ASSERT_EQ( dx.extent(0) , 0u ); //Okay with UVM + ASSERT_EQ( dy.extent(0) , 0u ); //Okay with UVM + ASSERT_EQ( dz.extent(0) , 0u ); //Okay with UVM + ASSERT_EQ( hx.extent(0) , 0u ); + ASSERT_EQ( hy.extent(0) , 0u ); + ASSERT_EQ( hz.extent(0) , 0u ); ASSERT_EQ( dx.rank() , 0u ); //Okay with UVM ASSERT_EQ( hx.rank() , 0u ); @@ -1024,10 +1025,10 @@ public: hx = hView0( "hx" , N1 , N2 , N3 ); hy = hView0( "hy" , N1 , N2 , N3 ); - ASSERT_EQ( dx.dimension_0() , unsigned(N1) ); //Okay with UVM - ASSERT_EQ( dy.dimension_0() , unsigned(N1) ); //Okay with UVM - ASSERT_EQ( hx.dimension_0() , unsigned(N1) ); - ASSERT_EQ( hy.dimension_0() , unsigned(N1) ); + ASSERT_EQ( dx.extent(0) , unsigned(N1) ); //Okay with UVM + ASSERT_EQ( dy.extent(0) , unsigned(N1) ); //Okay with UVM + ASSERT_EQ( hx.extent(0) , unsigned(N1) ); + ASSERT_EQ( hy.extent(0) , unsigned(N1) ); ASSERT_EQ( dx.rank() , 3 ); //Okay with UVM ASSERT_EQ( hx.rank() , 3 ); @@ -1036,10 +1037,10 @@ public: hx = hView0( "hx" , N0 , N1 , N2 , N3 ); hy = hView0( "hy" , N0 , N1 , N2 , N3 ); - ASSERT_EQ( dx.dimension_0() , unsigned(N0) ); - ASSERT_EQ( dy.dimension_0() , unsigned(N0) ); - ASSERT_EQ( hx.dimension_0() , unsigned(N0) ); - ASSERT_EQ( hy.dimension_0() , unsigned(N0) ); + ASSERT_EQ( dx.extent(0) , unsigned(N0) ); + ASSERT_EQ( dy.extent(0) , unsigned(N0) ); + ASSERT_EQ( hx.extent(0) , unsigned(N0) ); + ASSERT_EQ( hy.extent(0) , unsigned(N0) ); ASSERT_EQ( dx.rank() , 4 ); ASSERT_EQ( dy.rank() , 4 ); ASSERT_EQ( hx.rank() , 4 ); @@ -1052,19 +1053,19 @@ public: dView0_unmanaged unmanaged_from_ptr_dx = dView0_unmanaged(dx.ptr_on_device(), - dx.dimension_0(), - dx.dimension_1(), - dx.dimension_2(), - dx.dimension_3()); + dx.extent(0), + dx.extent(1), + dx.extent(2), + dx.extent(3)); { // Destruction of this view should be harmless const_dView0 unmanaged_from_ptr_const_dx( dx.ptr_on_device() , - dx.dimension_0() , - dx.dimension_1() , - dx.dimension_2() , - dx.dimension_3() ); + dx.extent(0) , + dx.extent(1) , + dx.extent(2) , + dx.extent(3) ); } const_dView0 const_dx = dx ; @@ -1095,33 +1096,33 @@ public: ASSERT_FALSE( dy.ptr_on_device() == 0 ); ASSERT_NE( dx , dy ); - ASSERT_EQ( dx.dimension_0() , unsigned(N0) ); - ASSERT_EQ( dx.dimension_1() , unsigned(N1) ); - ASSERT_EQ( dx.dimension_2() , unsigned(N2) ); - ASSERT_EQ( dx.dimension_3() , unsigned(N3) ); + ASSERT_EQ( dx.extent(0) , unsigned(N0) ); + ASSERT_EQ( dx.extent(1) , unsigned(N1) ); + ASSERT_EQ( dx.extent(2) , unsigned(N2) ); + ASSERT_EQ( dx.extent(3) , unsigned(N3) ); - ASSERT_EQ( dy.dimension_0() , unsigned(N0) ); - ASSERT_EQ( dy.dimension_1() , unsigned(N1) ); - ASSERT_EQ( dy.dimension_2() , unsigned(N2) ); - ASSERT_EQ( dy.dimension_3() , unsigned(N3) ); + ASSERT_EQ( dy.extent(0) , unsigned(N0) ); + ASSERT_EQ( dy.extent(1) , unsigned(N1) ); + ASSERT_EQ( dy.extent(2) , unsigned(N2) ); + ASSERT_EQ( dy.extent(3) , unsigned(N3) ); ASSERT_EQ( unmanaged_from_ptr_dx.capacity(),unsigned(N0)*unsigned(N1)*unsigned(N2)*unsigned(N3) ); - hx = Kokkos::Experimental::create_mirror( dx ); - hy = Kokkos::Experimental::create_mirror( dy ); + hx = Kokkos::create_mirror( dx ); + hy = Kokkos::create_mirror( dy ); ASSERT_EQ( hx.rank() , dx.rank() ); ASSERT_EQ( hy.rank() , dy.rank() ); - ASSERT_EQ( hx.dimension_0() , unsigned(N0) ); - ASSERT_EQ( hx.dimension_1() , unsigned(N1) ); - ASSERT_EQ( hx.dimension_2() , unsigned(N2) ); - ASSERT_EQ( hx.dimension_3() , unsigned(N3) ); + ASSERT_EQ( hx.extent(0) , unsigned(N0) ); + ASSERT_EQ( hx.extent(1) , unsigned(N1) ); + ASSERT_EQ( hx.extent(2) , unsigned(N2) ); + ASSERT_EQ( hx.extent(3) , unsigned(N3) ); - ASSERT_EQ( hy.dimension_0() , unsigned(N0) ); - ASSERT_EQ( hy.dimension_1() , unsigned(N1) ); - ASSERT_EQ( hy.dimension_2() , unsigned(N2) ); - ASSERT_EQ( hy.dimension_3() , unsigned(N3) ); + ASSERT_EQ( hy.extent(0) , unsigned(N0) ); + ASSERT_EQ( hy.extent(1) , unsigned(N1) ); + ASSERT_EQ( hy.extent(2) , unsigned(N2) ); + ASSERT_EQ( hy.extent(3) , unsigned(N3) ); // T v1 = hx() ; // Generates compile error as intended // T v2 = hx(0,0) ; // Generates compile error as intended @@ -1132,9 +1133,9 @@ public: { size_t count = 0 ; for ( size_t ip = 0 ; ip < N0 ; ++ip ) { - for ( size_t i1 = 0 ; i1 < hx.dimension_1() ; ++i1 ) { - for ( size_t i2 = 0 ; i2 < hx.dimension_2() ; ++i2 ) { - for ( size_t i3 = 0 ; i3 < hx.dimension_3() ; ++i3 ) { + for ( size_t i1 = 0 ; i1 < hx.extent(1) ; ++i1 ) { + for ( size_t i2 = 0 ; i2 < hx.extent(2) ; ++i2 ) { + for ( size_t i3 = 0 ; i3 < hx.extent(3) ; ++i3 ) { hx(ip,i1,i2,i3) = ++count ; }}}} @@ -1165,9 +1166,9 @@ public: { size_t count = 0 ; for ( size_t ip = 0 ; ip < N0 ; ++ip ) { - for ( size_t i1 = 0 ; i1 < hx.dimension_1() ; ++i1 ) { - for ( size_t i2 = 0 ; i2 < hx.dimension_2() ; ++i2 ) { - for ( size_t i3 = 0 ; i3 < hx.dimension_3() ; ++i3 ) { + for ( size_t i1 = 0 ; i1 < hx.extent(1) ; ++i1 ) { + for ( size_t i2 = 0 ; i2 < hx.extent(2) ; ++i2 ) { + for ( size_t i3 = 0 ; i3 < hx.extent(3) ; ++i3 ) { hx(ip,i1,i2,i3) = ++count ; }}}} @@ -1198,15 +1199,15 @@ public: { size_t count = 0 ; for ( size_t ip = 0 ; ip < N0 ; ++ip ) { - for ( size_t i1 = 0 ; i1 < hx.dimension_1() ; ++i1 ) { - for ( size_t i2 = 0 ; i2 < hx.dimension_2() ; ++i2 ) { - for ( size_t i3 = 0 ; i3 < hx.dimension_3() ; ++i3 ) { + for ( size_t i1 = 0 ; i1 < hx.extent(1) ; ++i1 ) { + for ( size_t i2 = 0 ; i2 < hx.extent(2) ; ++i2 ) { + for ( size_t i3 = 0 ; i3 < hx.extent(3) ; ++i3 ) { hx(ip,i1,i2,i3) = ++count ; }}}} - Kokkos::Experimental::deep_copy( dx , hx ); - Kokkos::Experimental::deep_copy( dy , dx ); - Kokkos::Experimental::deep_copy( hy , dy ); + Kokkos::deep_copy( dx , hx ); + Kokkos::deep_copy( dy , dx ); + Kokkos::deep_copy( hy , dy ); for ( size_t ip = 0 ; ip < N0 ; ++ip ) { for ( size_t i1 = 0 ; i1 < N1 ; ++i1 ) { @@ -1215,8 +1216,8 @@ public: { ASSERT_EQ( hx(ip,i1,i2,i3) , hy(ip,i1,i2,i3) ); } }}}} - Kokkos::Experimental::deep_copy( dx , T(0) ); - Kokkos::Experimental::deep_copy( hx , dx ); + Kokkos::deep_copy( dx , T(0) ); + Kokkos::deep_copy( hx , dx ); for ( size_t ip = 0 ; ip < N0 ; ++ip ) { for ( size_t i1 = 0 ; i1 < N1 ; ++i1 ) { @@ -1259,16 +1260,16 @@ public: { ASSERT_EQ( hvxx(i) , hdxx(i) ); } ASSERT_EQ( rank(hdxx) , rank(hvxx) ); - ASSERT_EQ( hdxx.dimension_0() , testdim ); - ASSERT_EQ( hdxx.dimension_0() , hvxx.dimension_0() ); + ASSERT_EQ( hdxx.extent(0) , testdim ); + ASSERT_EQ( hdxx.extent(0) , hvxx.extent(0) ); // deep_copy from dynrankview to view View1 vdxx("vdxx",testdim); auto hvdxx = Kokkos::create_mirror_view(vdxx); Kokkos::deep_copy(hvdxx , hdxx); ASSERT_EQ( rank(hdxx) , rank(hvdxx) ); - ASSERT_EQ( hvdxx.dimension_0() , testdim ); - ASSERT_EQ( hdxx.dimension_0() , hvdxx.dimension_0() ); + ASSERT_EQ( hvdxx.extent(0) , testdim ); + ASSERT_EQ( hdxx.extent(0) , hvdxx.extent(0) ); for (int i = 0; i < testdim; ++i) { ASSERT_EQ( hvxx(i) , hvdxx(i) ); } } @@ -1277,17 +1278,17 @@ public: static void check_auto_conversion_to_const( - const Kokkos::Experimental::DynRankView< const DataType , device > & arg_const , - const Kokkos::Experimental::DynRankView< DataType , device > & arg ) + const Kokkos::DynRankView< const DataType , device > & arg_const , + const Kokkos::DynRankView< DataType , device > & arg ) { ASSERT_TRUE( arg_const == arg ); } static void run_test_const() { - typedef Kokkos::Experimental::DynRankView< DataType , device > typeX ; - typedef Kokkos::Experimental::DynRankView< const DataType , device > const_typeX ; - typedef Kokkos::Experimental::DynRankView< const DataType , device , Kokkos::MemoryRandomAccess > const_typeR ; + typedef Kokkos::DynRankView< DataType , device > typeX ; + typedef Kokkos::DynRankView< const DataType , device > const_typeX ; + typedef Kokkos::DynRankView< const DataType , device , Kokkos::MemoryRandomAccess > const_typeR ; typeX x( "X", 2 ); const_typeX xc = x ; const_typeR xr = x ; @@ -1313,10 +1314,10 @@ public: static void run_test_subview() { - typedef Kokkos::Experimental::DynRankView< const T , device > cdView ; - typedef Kokkos::Experimental::DynRankView< T , device > dView ; + typedef Kokkos::DynRankView< const T , device > cdView ; + typedef Kokkos::DynRankView< T , device > dView ; // LayoutStride required for all returned DynRankView subdynrankview's - typedef Kokkos::Experimental::DynRankView< T , Kokkos::LayoutStride , device > sdView ; + typedef Kokkos::DynRankView< T , Kokkos::LayoutStride , device > sdView ; dView0 d0( "d0" ); cdView s0 = d0 ; @@ -1330,25 +1331,25 @@ public: ASSERT_EQ( ds0.rank() , 0 ); //Basic test - ALL - sdView dsALL = Kokkos::Experimental::subdynrankview( d7 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() ); + sdView dsALL = Kokkos::subdynrankview( d7 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() ); ASSERT_EQ( dsALL.rank() , 7 ); // Send a value to final rank returning rank 6 subview - sdView dsm1 = Kokkos::Experimental::subdynrankview( d7 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , 1 ); + sdView dsm1 = Kokkos::subdynrankview( d7 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , 1 ); ASSERT_EQ( dsm1.rank() , 6 ); // Send a std::pair as argument to a rank - sdView dssp = Kokkos::Experimental::subdynrankview( d7 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , std::pair<unsigned,unsigned>(1,2) ); + sdView dssp = Kokkos::subdynrankview( d7 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , std::pair<unsigned,unsigned>(1,2) ); ASSERT_EQ( dssp.rank() , 7 ); // Send a kokkos::pair as argument to a rank; take default layout as input dView0 dd0("dd0" , N0 , N1 , N2 , 2 , 2 , 2 , 2 ); //default layout ASSERT_EQ( dd0.rank() , 7 ); - sdView dtkp = Kokkos::Experimental::subdynrankview( dd0 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::pair<unsigned,unsigned>(0,1) ); + sdView dtkp = Kokkos::subdynrankview( dd0 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::pair<unsigned,unsigned>(0,1) ); ASSERT_EQ( dtkp.rank() , 7 ); // Return rank 7 subview, taking a pair as one argument, layout stride input - sdView ds7 = Kokkos::Experimental::subdynrankview( d7 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::pair<unsigned,unsigned>(0,1) ); + sdView ds7 = Kokkos::subdynrankview( d7 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::pair<unsigned,unsigned>(0,1) ); ASSERT_EQ( ds7.rank() , 7 ); // Default Layout DynRankView @@ -1356,7 +1357,7 @@ public: ASSERT_EQ( dv6.rank() , 6 ); // DynRankView with LayoutRight - typedef Kokkos::Experimental::DynRankView< T , Kokkos::LayoutRight , device > drView ; + typedef Kokkos::DynRankView< T , Kokkos::LayoutRight , device > drView ; drView dr5( "dr5" , N0 , N1 , N2 , 2 , 2 ); ASSERT_EQ( dr5.rank() , 5 ); @@ -1386,27 +1387,27 @@ public: // (i.e. rank 7 rather than 5). // Check LayoutRight dr5 and LayoutStride d5 dimensions agree (as they should) - ASSERT_EQ( d5.dimension_0() , dr5.dimension_0() ); - ASSERT_EQ( d5.dimension_1() , dr5.dimension_1() ); - ASSERT_EQ( d5.dimension_2() , dr5.dimension_2() ); - ASSERT_EQ( d5.dimension_3() , dr5.dimension_3() ); - ASSERT_EQ( d5.dimension_4() , dr5.dimension_4() ); - ASSERT_EQ( d5.dimension_5() , dr5.dimension_5() ); + ASSERT_EQ( d5.extent(0) , dr5.extent(0) ); + ASSERT_EQ( d5.extent(1) , dr5.extent(1) ); + ASSERT_EQ( d5.extent(2) , dr5.extent(2) ); + ASSERT_EQ( d5.extent(3) , dr5.extent(3) ); + ASSERT_EQ( d5.extent(4) , dr5.extent(4) ); + ASSERT_EQ( d5.extent(5) , dr5.extent(5) ); ASSERT_EQ( d5.rank() , dr5.rank() ); // Rank 5 subview of rank 5 dynamic rank view, layout stride input - sdView ds5 = Kokkos::Experimental::subdynrankview( d5 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::pair<unsigned,unsigned>(0,1) ); + sdView ds5 = Kokkos::subdynrankview( d5 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::pair<unsigned,unsigned>(0,1) ); ASSERT_EQ( ds5.rank() , 5 ); // Pass in extra ALL arguments beyond the rank of the DynRank View. // This behavior is allowed - ignore the extra ALL arguments when // the src.rank() < number of arguments, but be careful! - sdView ds5plus = Kokkos::Experimental::subdynrankview( d5 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::pair<unsigned,unsigned>(0,1) , Kokkos::ALL() ); + sdView ds5plus = Kokkos::subdynrankview( d5 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::pair<unsigned,unsigned>(0,1) , Kokkos::ALL() ); ASSERT_EQ( ds5.rank() , ds5plus.rank() ); - ASSERT_EQ( ds5.dimension_0() , ds5plus.dimension_0() ); - ASSERT_EQ( ds5.dimension_4() , ds5plus.dimension_4() ); - ASSERT_EQ( ds5.dimension_5() , ds5plus.dimension_5() ); + ASSERT_EQ( ds5.extent(0) , ds5plus.extent(0) ); + ASSERT_EQ( ds5.extent(4) , ds5plus.extent(4) ); + ASSERT_EQ( ds5.extent(5) , ds5plus.extent(5) ); #if ! defined( KOKKOS_ENABLE_CUDA ) || defined ( KOKKOS_ENABLE_CUDA_UVM ) ASSERT_EQ( & ds5(1,1,1,1,0) - & ds5plus(1,1,1,1,0) , 0 ); @@ -1415,36 +1416,36 @@ public: // Similar test to rank 5 above, but create rank 4 subview // Check that the rank contracts (ds4 and ds4plus) and that subdynrankview can accept extra args (ds4plus) - sdView ds4 = Kokkos::Experimental::subdynrankview( d5 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , 0 ); - sdView ds4plus = Kokkos::Experimental::subdynrankview( d5 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , 0 , Kokkos::ALL() ); + sdView ds4 = Kokkos::subdynrankview( d5 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , 0 ); + sdView ds4plus = Kokkos::subdynrankview( d5 , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , Kokkos::ALL() , 0 , Kokkos::ALL() ); ASSERT_EQ( ds4.rank() , ds4plus.rank() ); ASSERT_EQ( ds4.rank() , 4 ); - ASSERT_EQ( ds4.dimension_0() , ds4plus.dimension_0() ); - ASSERT_EQ( ds4.dimension_4() , ds4plus.dimension_4() ); - ASSERT_EQ( ds4.dimension_5() , ds4plus.dimension_5() ); + ASSERT_EQ( ds4.extent(0) , ds4plus.extent(0) ); + ASSERT_EQ( ds4.extent(4) , ds4plus.extent(4) ); + ASSERT_EQ( ds4.extent(5) , ds4plus.extent(5) ); } static void run_test_subview_strided() { - typedef Kokkos::Experimental::DynRankView < int , Kokkos::LayoutLeft , host_drv_space > drview_left ; - typedef Kokkos::Experimental::DynRankView < int , Kokkos::LayoutRight , host_drv_space > drview_right ; - typedef Kokkos::Experimental::DynRankView < int , Kokkos::LayoutStride , host_drv_space > drview_stride ; + typedef Kokkos::DynRankView < int , Kokkos::LayoutLeft , host_drv_space > drview_left ; + typedef Kokkos::DynRankView < int , Kokkos::LayoutRight , host_drv_space > drview_right ; + typedef Kokkos::DynRankView < int , Kokkos::LayoutStride , host_drv_space > drview_stride ; drview_left xl2( "xl2", 100 , 200 ); drview_right xr2( "xr2", 100 , 200 ); - drview_stride yl1 = Kokkos::Experimental::subdynrankview( xl2 , 0 , Kokkos::ALL() ); - drview_stride yl2 = Kokkos::Experimental::subdynrankview( xl2 , 1 , Kokkos::ALL() ); - drview_stride ys1 = Kokkos::Experimental::subdynrankview( xr2 , 0 , Kokkos::ALL() ); - drview_stride ys2 = Kokkos::Experimental::subdynrankview( xr2 , 1 , Kokkos::ALL() ); - drview_stride yr1 = Kokkos::Experimental::subdynrankview( xr2 , 0 , Kokkos::ALL() ); - drview_stride yr2 = Kokkos::Experimental::subdynrankview( xr2 , 1 , Kokkos::ALL() ); + drview_stride yl1 = Kokkos::subdynrankview( xl2 , 0 , Kokkos::ALL() ); + drview_stride yl2 = Kokkos::subdynrankview( xl2 , 1 , Kokkos::ALL() ); + drview_stride ys1 = Kokkos::subdynrankview( xr2 , 0 , Kokkos::ALL() ); + drview_stride ys2 = Kokkos::subdynrankview( xr2 , 1 , Kokkos::ALL() ); + drview_stride yr1 = Kokkos::subdynrankview( xr2 , 0 , Kokkos::ALL() ); + drview_stride yr2 = Kokkos::subdynrankview( xr2 , 1 , Kokkos::ALL() ); - ASSERT_EQ( yl1.dimension_0() , xl2.dimension_1() ); - ASSERT_EQ( yl2.dimension_0() , xl2.dimension_1() ); + ASSERT_EQ( yl1.extent(0) , xl2.extent(1) ); + ASSERT_EQ( yl2.extent(0) , xl2.extent(1) ); - ASSERT_EQ( yr1.dimension_0() , xr2.dimension_1() ); - ASSERT_EQ( yr2.dimension_0() , xr2.dimension_1() ); + ASSERT_EQ( yr1.extent(0) , xr2.extent(1) ); + ASSERT_EQ( yr2.extent(0) , xr2.extent(1) ); ASSERT_EQ( & yl1(0) - & xl2(0,0) , 0 ); ASSERT_EQ( & yl2(0) - & xl2(1,0) , 0 ); @@ -1456,13 +1457,13 @@ public: drview_right xr4( "xr4", 10 , 20 , 30 , 40 ); //Replace subdynrankview with subview - test - drview_stride yl4 = Kokkos::Experimental::subview( xl4 , 1 , Kokkos::ALL() , 2 , Kokkos::ALL() ); - drview_stride yr4 = Kokkos::Experimental::subview( xr4 , 1 , Kokkos::ALL() , 2 , Kokkos::ALL() ); + drview_stride yl4 = Kokkos::subview( xl4 , 1 , Kokkos::ALL() , 2 , Kokkos::ALL() ); + drview_stride yr4 = Kokkos::subview( xr4 , 1 , Kokkos::ALL() , 2 , Kokkos::ALL() ); - ASSERT_EQ( yl4.dimension_0() , xl4.dimension_1() ); - ASSERT_EQ( yl4.dimension_1() , xl4.dimension_3() ); - ASSERT_EQ( yr4.dimension_0() , xr4.dimension_1() ); - ASSERT_EQ( yr4.dimension_1() , xr4.dimension_3() ); + ASSERT_EQ( yl4.extent(0) , xl4.extent(1) ); + ASSERT_EQ( yl4.extent(1) , xl4.extent(3) ); + ASSERT_EQ( yr4.extent(0) , xr4.extent(1) ); + ASSERT_EQ( yr4.extent(1) , xr4.extent(3) ); ASSERT_EQ( yl4.rank() , 2); ASSERT_EQ( yr4.rank() , 2); @@ -1474,46 +1475,46 @@ public: { static const unsigned Length = 1000 , Count = 8 ; - typedef typename Kokkos::Experimental::DynRankView< T , Kokkos::LayoutLeft , host_drv_space > multivector_type ; + typedef typename Kokkos::DynRankView< T , Kokkos::LayoutLeft , host_drv_space > multivector_type ; - typedef typename Kokkos::Experimental::DynRankView< T , Kokkos::LayoutRight , host_drv_space > multivector_right_type ; + typedef typename Kokkos::DynRankView< T , Kokkos::LayoutRight , host_drv_space > multivector_right_type ; multivector_type mv = multivector_type( "mv" , Length , Count ); multivector_right_type mv_right = multivector_right_type( "mv" , Length , Count ); - typedef typename Kokkos::Experimental::DynRankView< T , Kokkos::LayoutStride , host_drv_space > svector_type ; - typedef typename Kokkos::Experimental::DynRankView< T , Kokkos::LayoutStride , host_drv_space > smultivector_type ; - typedef typename Kokkos::Experimental::DynRankView< const T , Kokkos::LayoutStride , host_drv_space > const_svector_right_type ; - typedef typename Kokkos::Experimental::DynRankView< const T , Kokkos::LayoutStride , host_drv_space > const_svector_type ; - typedef typename Kokkos::Experimental::DynRankView< const T , Kokkos::LayoutStride , host_drv_space > const_smultivector_type ; + typedef typename Kokkos::DynRankView< T , Kokkos::LayoutStride , host_drv_space > svector_type ; + typedef typename Kokkos::DynRankView< T , Kokkos::LayoutStride , host_drv_space > smultivector_type ; + typedef typename Kokkos::DynRankView< const T , Kokkos::LayoutStride , host_drv_space > const_svector_right_type ; + typedef typename Kokkos::DynRankView< const T , Kokkos::LayoutStride , host_drv_space > const_svector_type ; + typedef typename Kokkos::DynRankView< const T , Kokkos::LayoutStride , host_drv_space > const_smultivector_type ; - svector_type v1 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL() , 0 ); - svector_type v2 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL() , 1 ); - svector_type v3 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL() , 2 ); + svector_type v1 = Kokkos::subdynrankview( mv , Kokkos::ALL() , 0 ); + svector_type v2 = Kokkos::subdynrankview( mv , Kokkos::ALL() , 1 ); + svector_type v3 = Kokkos::subdynrankview( mv , Kokkos::ALL() , 2 ); - svector_type rv1 = Kokkos::Experimental::subdynrankview( mv_right , 0 , Kokkos::ALL() ); - svector_type rv2 = Kokkos::Experimental::subdynrankview( mv_right , 1 , Kokkos::ALL() ); - svector_type rv3 = Kokkos::Experimental::subdynrankview( mv_right , 2 , Kokkos::ALL() ); + svector_type rv1 = Kokkos::subdynrankview( mv_right , 0 , Kokkos::ALL() ); + svector_type rv2 = Kokkos::subdynrankview( mv_right , 1 , Kokkos::ALL() ); + svector_type rv3 = Kokkos::subdynrankview( mv_right , 2 , Kokkos::ALL() ); - smultivector_type mv1 = Kokkos::Experimental::subdynrankview( mv , std::make_pair( 1 , 998 ) , + smultivector_type mv1 = Kokkos::subdynrankview( mv , std::make_pair( 1 , 998 ) , std::make_pair( 2 , 5 ) ); smultivector_type mvr1 = - Kokkos::Experimental::subdynrankview( mv_right , + Kokkos::subdynrankview( mv_right , std::make_pair( 1 , 998 ) , std::make_pair( 2 , 5 ) ); - const_svector_type cv1 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL(), 0 ); - const_svector_type cv2 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL(), 1 ); - const_svector_type cv3 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL(), 2 ); + const_svector_type cv1 = Kokkos::subdynrankview( mv , Kokkos::ALL(), 0 ); + const_svector_type cv2 = Kokkos::subdynrankview( mv , Kokkos::ALL(), 1 ); + const_svector_type cv3 = Kokkos::subdynrankview( mv , Kokkos::ALL(), 2 ); - svector_type vr1 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL() , 0 ); - svector_type vr2 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL() , 1 ); - svector_type vr3 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL() , 2 ); + svector_type vr1 = Kokkos::subdynrankview( mv , Kokkos::ALL() , 0 ); + svector_type vr2 = Kokkos::subdynrankview( mv , Kokkos::ALL() , 1 ); + svector_type vr3 = Kokkos::subdynrankview( mv , Kokkos::ALL() , 2 ); - const_svector_right_type cvr1 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL() , 0 ); - const_svector_right_type cvr2 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL() , 1 ); - const_svector_right_type cvr3 = Kokkos::Experimental::subdynrankview( mv , Kokkos::ALL() , 2 ); + const_svector_right_type cvr1 = Kokkos::subdynrankview( mv , Kokkos::ALL() , 0 ); + const_svector_right_type cvr2 = Kokkos::subdynrankview( mv , Kokkos::ALL() , 1 ); + const_svector_right_type cvr3 = Kokkos::subdynrankview( mv , Kokkos::ALL() , 2 ); ASSERT_TRUE( & v1[0] == & v1(0) ); diff --git a/lib/kokkos/containers/unit_tests/TestDynamicView.hpp b/lib/kokkos/containers/unit_tests/TestDynamicView.hpp index 860c75b1acb28415225214a2c66fd1a76bb57fa3..852e3cc232ae193d1014e565c7b372ced50708b1 100644 --- a/lib/kokkos/containers/unit_tests/TestDynamicView.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynamicView.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -61,114 +61,181 @@ struct TestDynamicView typedef typename Space::execution_space execution_space ; typedef typename Space::memory_space memory_space ; - typedef Kokkos::MemoryPool<typename Space::device_type> memory_pool_type; - typedef Kokkos::Experimental::DynamicView<Scalar*,Space> view_type; - typedef typename view_type::const_type const_view_type ; - typedef typename Kokkos::TeamPolicy<execution_space>::member_type member_type ; typedef double value_type; - struct TEST {}; - struct VERIFY {}; - - view_type a; - const unsigned total_size ; - - TestDynamicView( const view_type & arg_a , const unsigned arg_total ) - : a(arg_a), total_size( arg_total ) {} - - KOKKOS_INLINE_FUNCTION - void operator() ( const TEST , member_type team_member, double& value) const - { - const unsigned int team_idx = team_member.league_rank() * team_member.team_size(); - - if ( team_member.team_rank() == 0 ) { - unsigned n = team_idx + team_member.team_size(); - - if ( total_size < n ) n = total_size ; - - a.resize_parallel( n ); - - if ( a.extent(0) < n ) { - Kokkos::abort("GrowTest TEST failed resize_parallel"); - } - } - - // Make sure resize is done for all team members: - team_member.team_barrier(); - - const unsigned int val = team_idx + team_member.team_rank(); - - if ( val < total_size ) { - value += val ; - - a( val ) = val ; - } - } - - KOKKOS_INLINE_FUNCTION - void operator() ( const VERIFY , member_type team_member, double& value) const - { - const unsigned int val = - team_member.team_rank() + - team_member.league_rank() * team_member.team_size(); - - if ( val < total_size ) { - - if ( val != a(val) ) { - Kokkos::abort("GrowTest VERIFY failed resize_parallel"); - } - - value += a(val); - } - } - static void run( unsigned arg_total_size ) { - typedef Kokkos::TeamPolicy<execution_space,TEST> TestPolicy ; - typedef Kokkos::TeamPolicy<execution_space,VERIFY> VerifyPolicy ; - -// printf("TestDynamicView::run(%d) construct memory pool\n",arg_total_size); - - const size_t total_alloc_size = arg_total_size * sizeof(Scalar) * 1.2 ; - const size_t superblock = std::min( total_alloc_size , size_t(1000000) ); - - memory_pool_type pool( memory_space() - , total_alloc_size - , 500 /* min block size in bytes */ - , 30000 /* max block size in bytes */ - , superblock - ); - -// printf("TestDynamicView::run(%d) construct dynamic view\n",arg_total_size); - - view_type da("A",pool,arg_total_size); - - const_view_type ca(da); - -// printf("TestDynamicView::run(%d) construct test functor\n",arg_total_size); - - TestDynamicView functor(da,arg_total_size); - - const unsigned team_size = TestPolicy::team_size_recommended(functor); - const unsigned league_size = ( arg_total_size + team_size - 1 ) / team_size ; - - double reference = 0; - double result = 0; - -// printf("TestDynamicView::run(%d) run functor test\n",arg_total_size); - - Kokkos::parallel_reduce( TestPolicy(league_size,team_size) , functor , reference); - execution_space::fence(); - - -// printf("TestDynamicView::run(%d) run functor verify\n",arg_total_size); - - Kokkos::parallel_reduce( VerifyPolicy(league_size,team_size) , functor , result ); - execution_space::fence(); - -// printf("TestDynamicView::run(%d) done\n",arg_total_size); + // Test: Create DynamicView, initialize size (via resize), run through parallel_for to set values, check values (via parallel_reduce); resize values and repeat + // Case 1: min_chunk_size is a power of 2 + { + view_type da("da", 1024, arg_total_size ); + ASSERT_EQ( da.size(), 0 ); + // Init + unsigned da_size = arg_total_size / 8; + da.resize_serial(da_size); + ASSERT_EQ( da.size(), da_size ); + +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + Kokkos::parallel_for( Kokkos::RangePolicy<execution_space>(0, da_size), KOKKOS_LAMBDA ( const int i ) + { + da(i) = Scalar(i); + } + ); + + value_type result_sum = 0.0; + Kokkos::parallel_reduce( Kokkos::RangePolicy<execution_space>(0, da_size), KOKKOS_LAMBDA ( const int i, value_type& partial_sum ) + { + partial_sum += (value_type)da(i); + } + , result_sum + ); + + ASSERT_EQ(result_sum, (value_type)( da_size * (da_size - 1) / 2 ) ); +#endif +#endif + + // add 3x more entries i.e. 4x larger than previous size + // the first 1/4 should remain the same + unsigned da_resize = arg_total_size / 2; + da.resize_serial(da_resize); + ASSERT_EQ( da.size(), da_resize ); + +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + Kokkos::parallel_for( Kokkos::RangePolicy<execution_space>(da_size, da_resize), KOKKOS_LAMBDA ( const int i ) + { + da(i) = Scalar(i); + } + ); + + value_type new_result_sum = 0.0; + Kokkos::parallel_reduce( Kokkos::RangePolicy<execution_space>(da_size, da_resize), KOKKOS_LAMBDA ( const int i, value_type& partial_sum ) + { + partial_sum += (value_type)da(i); + } + , new_result_sum + ); + + ASSERT_EQ(new_result_sum+result_sum, (value_type)( da_resize * (da_resize - 1) / 2 ) ); +#endif +#endif + } // end scope + + // Test: Create DynamicView, initialize size (via resize), run through parallel_for to set values, check values (via parallel_reduce); resize values and repeat + // Case 2: min_chunk_size is NOT a power of 2 + { + view_type da("da", 1023, arg_total_size ); + ASSERT_EQ( da.size(), 0 ); + // Init + unsigned da_size = arg_total_size / 8; + da.resize_serial(da_size); + ASSERT_EQ( da.size(), da_size ); + +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + Kokkos::parallel_for( Kokkos::RangePolicy<execution_space>(0, da_size), KOKKOS_LAMBDA ( const int i ) + { + da(i) = Scalar(i); + } + ); + + value_type result_sum = 0.0; + Kokkos::parallel_reduce( Kokkos::RangePolicy<execution_space>(0, da_size), KOKKOS_LAMBDA ( const int i, value_type& partial_sum ) + { + partial_sum += (value_type)da(i); + } + , result_sum + ); + + ASSERT_EQ(result_sum, (value_type)( da_size * (da_size - 1) / 2 ) ); +#endif +#endif + + // add 3x more entries i.e. 4x larger than previous size + // the first 1/4 should remain the same + unsigned da_resize = arg_total_size / 2; + da.resize_serial(da_resize); + ASSERT_EQ( da.size(), da_resize ); + +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + Kokkos::parallel_for( Kokkos::RangePolicy<execution_space>(da_size, da_resize), KOKKOS_LAMBDA ( const int i ) + { + da(i) = Scalar(i); + } + ); + + value_type new_result_sum = 0.0; + Kokkos::parallel_reduce( Kokkos::RangePolicy<execution_space>(da_size, da_resize), KOKKOS_LAMBDA ( const int i, value_type& partial_sum ) + { + partial_sum += (value_type)da(i); + } + , new_result_sum + ); + + ASSERT_EQ(new_result_sum+result_sum, (value_type)( da_resize * (da_resize - 1) / 2 ) ); +#endif +#endif + } // end scope + + // Test: Create DynamicView, initialize size (via resize), run through parallel_for to set values, check values (via parallel_reduce); resize values and repeat + // Case 3: resize reduces the size + { + view_type da("da", 1023, arg_total_size ); + ASSERT_EQ( da.size(), 0 ); + // Init + unsigned da_size = arg_total_size / 2; + da.resize_serial(da_size); + ASSERT_EQ( da.size(), da_size ); + +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + Kokkos::parallel_for( Kokkos::RangePolicy<execution_space>(0, da_size), KOKKOS_LAMBDA ( const int i ) + { + da(i) = Scalar(i); + } + ); + + value_type result_sum = 0.0; + Kokkos::parallel_reduce( Kokkos::RangePolicy<execution_space>(0, da_size), KOKKOS_LAMBDA ( const int i, value_type& partial_sum ) + { + partial_sum += (value_type)da(i); + } + , result_sum + ); + + ASSERT_EQ(result_sum, (value_type)( da_size * (da_size - 1) / 2 ) ); +#endif +#endif + + // remove the final 3/4 entries i.e. first 1/4 remain + unsigned da_resize = arg_total_size / 8; + da.resize_serial(da_resize); + ASSERT_EQ( da.size(), da_resize ); + +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + Kokkos::parallel_for( Kokkos::RangePolicy<execution_space>(0, da_resize), KOKKOS_LAMBDA ( const int i ) + { + da(i) = Scalar(i); + } + ); + + value_type new_result_sum = 0.0; + Kokkos::parallel_reduce( Kokkos::RangePolicy<execution_space>(0, da_resize), KOKKOS_LAMBDA ( const int i, value_type& partial_sum ) + { + partial_sum += (value_type)da(i); + } + , new_result_sum + ); + + ASSERT_EQ(new_result_sum, (value_type)( da_resize * (da_resize - 1) / 2 ) ); +#endif +#endif + } // end scope } }; diff --git a/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp b/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp index 17aa230d53e8aab952118d76b2714ecd5d8b2b7b..2b2cfdfc9a0ffff2468b233e4a7c0b6d406cbf89 100644 --- a/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp +++ b/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/unit_tests/TestOpenMP.cpp b/lib/kokkos/containers/unit_tests/TestOpenMP.cpp index 6b2223f418630541b836264cbf7722c2b8e2eca6..d25a3da44b7aff34f26082273fa79d899f19b9dd 100644 --- a/lib/kokkos/containers/unit_tests/TestOpenMP.cpp +++ b/lib/kokkos/containers/unit_tests/TestOpenMP.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -79,13 +79,10 @@ protected: static void SetUpTestCase() { std::cout << std::setprecision(5) << std::scientific; - - Kokkos::OpenMP::initialize(); } static void TearDownTestCase() { - Kokkos::OpenMP::finalize(); } }; diff --git a/lib/kokkos/containers/unit_tests/TestROCm.cpp b/lib/kokkos/containers/unit_tests/TestROCm.cpp index b910e881e8274c5af52ab4b260679f643c1805bc..aaf7a89560d2fa752762d86cf4e9abc267bdfddb 100644 --- a/lib/kokkos/containers/unit_tests/TestROCm.cpp +++ b/lib/kokkos/containers/unit_tests/TestROCm.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/unit_tests/TestScatterView.hpp b/lib/kokkos/containers/unit_tests/TestScatterView.hpp index 42e6c09307c955efe48d625ab22e9e92d1a3e736..ec7e8f4303e66742fba986cccbbd11401d68bc72 100644 --- a/lib/kokkos/containers/unit_tests/TestScatterView.hpp +++ b/lib/kokkos/containers/unit_tests/TestScatterView.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -81,7 +81,7 @@ void test_scatter_view_config(int n) } #if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) auto host_view = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), original_view); - for (typename decltype(host_view)::size_type i = 0; i < host_view.dimension_0(); ++i) { + for (typename decltype(host_view)::size_type i = 0; i < host_view.extent(0); ++i) { auto val0 = host_view(i, 0); auto val1 = host_view(i, 1); auto val2 = host_view(i, 2); diff --git a/lib/kokkos/containers/unit_tests/TestSerial.cpp b/lib/kokkos/containers/unit_tests/TestSerial.cpp index c9b7392d48a52dfa5afc005687dd3ea09253d8e6..8f9b201119cfd8b57ab74d383c5a981d1d873077 100644 --- a/lib/kokkos/containers/unit_tests/TestSerial.cpp +++ b/lib/kokkos/containers/unit_tests/TestSerial.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -76,11 +76,9 @@ class serial : public ::testing::Test { protected: static void SetUpTestCase () { std::cout << std::setprecision(5) << std::scientific; - Kokkos::Serial::initialize (); } static void TearDownTestCase () { - Kokkos::Serial::finalize (); } }; diff --git a/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp b/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp index aee6ef79b624d5c298a700c5daab1b2f2abfc12e..95a2f3a2572fd6b4cdac5b13eb85389deb987aa3 100644 --- a/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp +++ b/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -73,7 +73,7 @@ void run_test_graph() dx = Kokkos::create_staticcrsgraph<dView>( "dx" , graph ); hx = Kokkos::create_mirror( dx ); - ASSERT_EQ( hx.row_map.dimension_0() - 1 , LENGTH ); + ASSERT_EQ( hx.row_map.extent(0) - 1 , LENGTH ); for ( size_t i = 0 ; i < LENGTH ; ++i ) { const size_t begin = hx.row_map[i]; @@ -115,17 +115,17 @@ void run_test_graph2() hView hx = Kokkos::create_mirror( dx ); hView mx = Kokkos::create_mirror( dx ); - ASSERT_EQ( (size_t) dx.row_map.dimension_0() , (size_t) LENGTH + 1 ); - ASSERT_EQ( (size_t) hx.row_map.dimension_0() , (size_t) LENGTH + 1 ); - ASSERT_EQ( (size_t) mx.row_map.dimension_0() , (size_t) LENGTH + 1 ); + ASSERT_EQ( (size_t) dx.row_map.extent(0) , (size_t) LENGTH + 1 ); + ASSERT_EQ( (size_t) hx.row_map.extent(0) , (size_t) LENGTH + 1 ); + ASSERT_EQ( (size_t) mx.row_map.extent(0) , (size_t) LENGTH + 1 ); - ASSERT_EQ( (size_t) dx.entries.dimension_0() , (size_t) total_length ); - ASSERT_EQ( (size_t) hx.entries.dimension_0() , (size_t) total_length ); - ASSERT_EQ( (size_t) mx.entries.dimension_0() , (size_t) total_length ); + ASSERT_EQ( (size_t) dx.entries.extent(0) , (size_t) total_length ); + ASSERT_EQ( (size_t) hx.entries.extent(0) , (size_t) total_length ); + ASSERT_EQ( (size_t) mx.entries.extent(0) , (size_t) total_length ); - ASSERT_EQ( (size_t) dx.entries.dimension_1() , (size_t) 3 ); - ASSERT_EQ( (size_t) hx.entries.dimension_1() , (size_t) 3 ); - ASSERT_EQ( (size_t) mx.entries.dimension_1() , (size_t) 3 ); + ASSERT_EQ( (size_t) dx.entries.extent(1) , (size_t) 3 ); + ASSERT_EQ( (size_t) hx.entries.extent(1) , (size_t) 3 ); + ASSERT_EQ( (size_t) mx.entries.extent(1) , (size_t) 3 ); for ( size_t i = 0 ; i < LENGTH ; ++i ) { const size_t entry_begin = hx.row_map[i]; @@ -140,7 +140,7 @@ void run_test_graph2() Kokkos::deep_copy( dx.entries , hx.entries ); Kokkos::deep_copy( mx.entries , dx.entries ); - ASSERT_EQ( mx.row_map.dimension_0() , (size_t) LENGTH + 1 ); + ASSERT_EQ( mx.row_map.extent(0) , (size_t) LENGTH + 1 ); for ( size_t i = 0 ; i < LENGTH ; ++i ) { const size_t entry_begin = mx.row_map[i]; diff --git a/lib/kokkos/containers/unit_tests/TestThreads.cpp b/lib/kokkos/containers/unit_tests/TestThreads.cpp index aca0b57d6505cdf9562ad3b05526cfdeaed4b2a9..1086e235fb0658487ed42dd7ad4c424b3a92f6cc 100644 --- a/lib/kokkos/containers/unit_tests/TestThreads.cpp +++ b/lib/kokkos/containers/unit_tests/TestThreads.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -79,25 +79,10 @@ protected: static void SetUpTestCase() { std::cout << std::setprecision(5) << std::scientific; - - unsigned num_threads = 4; - - if (Kokkos::hwloc::available()) { - num_threads = Kokkos::hwloc::get_available_numa_count() - * Kokkos::hwloc::get_available_cores_per_numa() - // * Kokkos::hwloc::get_available_threads_per_core() - ; - - } - - std::cout << "Threads: " << num_threads << std::endl; - - Kokkos::Threads::initialize( num_threads ); } static void TearDownTestCase() { - Kokkos::Threads::finalize(); } }; diff --git a/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp b/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp index becaac198cdf679ddb596cdd529327647c3a666d..c964bbc1cf666a42104c69660b54ff311259780e 100644 --- a/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp +++ b/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/unit_tests/TestVector.hpp b/lib/kokkos/containers/unit_tests/TestVector.hpp index 2abf20f6391b87168c3306377863d920b82546c3..ddde3df18a7fa8439a80fe6257b519c54d92d890 100644 --- a/lib/kokkos/containers/unit_tests/TestVector.hpp +++ b/lib/kokkos/containers/unit_tests/TestVector.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp b/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp index 1efd1ddc517b51af09f8d78046b612e708172f70..9451e3551b85ebe1093cfe3b6c6f9f2f37aec355 100644 --- a/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp +++ b/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/containers/unit_tests/UnitTestMain.cpp b/lib/kokkos/containers/unit_tests/UnitTestMain.cpp index 2b73535c833bd5a3caa4b530a6f406fe40b710ec..508b43efd809e7041cd773b5cdaa25dc92e71450 100644 --- a/lib/kokkos/containers/unit_tests/UnitTestMain.cpp +++ b/lib/kokkos/containers/unit_tests/UnitTestMain.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -43,10 +43,13 @@ #include <gtest/gtest.h> #include <cstdlib> -#include <Kokkos_Macros.hpp> +#include <Kokkos_Core.hpp> int main(int argc, char *argv[]) { + Kokkos::initialize(argc,argv); ::testing::InitGoogleTest(&argc,argv); - return RUN_ALL_TESTS(); + int result = RUN_ALL_TESTS(); + Kokkos::finalize(); + return result; } diff --git a/lib/kokkos/core/perf_test/Makefile b/lib/kokkos/core/perf_test/Makefile index cdb8e03c1eeb93813473f8e2d3c2862f69501407..a1ec61ba797a0ef0073cc284944996b68bc8eae0 100644 --- a/lib/kokkos/core/perf_test/Makefile +++ b/lib/kokkos/core/perf_test/Makefile @@ -33,6 +33,7 @@ OBJ_PERF = PerfTestMain.o gtest-all.o OBJ_PERF += PerfTestGramSchmidt.o OBJ_PERF += PerfTestHexGrad.o OBJ_PERF += PerfTest_CustomReduction.o +OBJ_PERF += PerfTest_ViewCopy.o TARGETS += KokkosCore_PerformanceTest TEST_TARGETS += test-performance diff --git a/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp b/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp index aa4046cbf047defd47a89141d960ad330622d9b7..bb2fb5fce5fa339efeea145cffc822fefd1b2055 100644 --- a/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp +++ b/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -76,7 +76,7 @@ void axpby( const ConstScalarType & alpha , { typedef AXPBY< ConstScalarType , ConstVectorType , VectorType > functor ; - parallel_for( Y.dimension_0() , functor( alpha , X , beta , Y ) ); + parallel_for( Y.extent(0) , functor( alpha , X , beta , Y ) ); } /** \brief Y *= alpha */ @@ -86,7 +86,7 @@ void scale( const ConstScalarType & alpha , const VectorType & Y ) { typedef Scale< ConstScalarType , VectorType > functor ; - parallel_for( Y.dimension_0() , functor( alpha , Y ) ); + parallel_for( Y.extent(0) , functor( alpha , Y ) ); } template< class ConstVectorType , @@ -97,7 +97,7 @@ void dot( const ConstVectorType & X , { typedef Dot< ConstVectorType > functor ; - parallel_reduce( X.dimension_0() , functor( X , Y ) , finalize ); + parallel_reduce( X.extent(0) , functor( X , Y ) , finalize ); } template< class ConstVectorType , @@ -107,7 +107,7 @@ void dot( const ConstVectorType & X , { typedef DotSingle< ConstVectorType > functor ; - parallel_reduce( X.dimension_0() , functor( X ) , finalize ); + parallel_reduce( X.extent(0) , functor( X ) , finalize ); } } /* namespace Kokkos */ diff --git a/lib/kokkos/core/perf_test/PerfTestDriver.hpp b/lib/kokkos/core/perf_test/PerfTestDriver.hpp index 190fdb91422966cf55ec7c99e7df3a0fb6cfd94c..9cd779edf4225ef6402ebb23962a7b2f82d791ef 100644 --- a/lib/kokkos/core/perf_test/PerfTestDriver.hpp +++ b/lib/kokkos/core/perf_test/PerfTestDriver.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp b/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp index 56d90ed89089f872e4431e38540031f001fb2031..b169b02903ed4589bace5f83ee880937bba328b8 100644 --- a/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp +++ b/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -86,7 +86,7 @@ void invnorm2( const VectorView & x , const ValueView & r , const ValueView & r_inv ) { - Kokkos::parallel_reduce( x.dimension_0() , InvNorm2< VectorView , ValueView >( x , r , r_inv ) ); + Kokkos::parallel_reduce( x.extent(0) , InvNorm2< VectorView , ValueView >( x , r , r_inv ) ); } // PostProcess : tmp = - ( R(j,k) = result ); @@ -122,7 +122,7 @@ void dot_neg( const VectorView & x , const ValueView & r , const ValueView & r_neg ) { - Kokkos::parallel_reduce( x.dimension_0() , DotM< VectorView , ValueView >( x , y , r , r_neg ) ); + Kokkos::parallel_reduce( x.extent(0) , DotM< VectorView , ValueView >( x , y , r , r_neg ) ); } @@ -151,7 +151,7 @@ struct ModifiedGramSchmidt static double factorization( const multivector_type Q_ , const multivector_type R_ ) { - const size_type count = Q_.dimension_1(); + const size_type count = Q_.extent(1); value_view tmp("tmp"); value_view one("one"); diff --git a/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp b/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp index 7d5067a22c97f1351922b053a54337a594119119..b228dd2e2eb604cd7b23bb51282a248af75406dc 100644 --- a/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp +++ b/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/perf_test/PerfTestMDRange.hpp b/lib/kokkos/core/perf_test/PerfTestMDRange.hpp index d910b513c67f94eec4c1254fd4528ec4d74c62a5..d60539e279f218518f4122377db680581985f358 100644 --- a/lib/kokkos/core/perf_test/PerfTestMDRange.hpp +++ b/lib/kokkos/core/perf_test/PerfTestMDRange.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/perf_test/PerfTestMain.cpp b/lib/kokkos/core/perf_test/PerfTestMain.cpp index 832f650b9a8d7b4ae189551389dce0e1de537a6d..f1f8a50f1b35fd1f3935e4097d679aa7b653a14b 100644 --- a/lib/kokkos/core/perf_test/PerfTestMain.cpp +++ b/lib/kokkos/core/perf_test/PerfTestMain.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/perf_test/PerfTest_Category.hpp b/lib/kokkos/core/perf_test/PerfTest_Category.hpp index 02cee93ce9c0566d03bd2eb6686e61b0173d5ae7..9126457bb060bacd86f2226c3acfb1f5eb33e586 100644 --- a/lib/kokkos/core/perf_test/PerfTest_Category.hpp +++ b/lib/kokkos/core/perf_test/PerfTest_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp b/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp index dbce1ec53725ce8c1801e331a2fe726838f89583..72aea39f516f7722cb39d83e86f19be0a46191e7 100644 --- a/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e7c53b84988db8ac6c3e3b3f5d7133aa7f8d1e3e --- /dev/null +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy.cpp @@ -0,0 +1,445 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <Kokkos_Core.hpp> +#include <gtest/gtest.h> +#include <cstdio> +#include <PerfTest_Category.hpp> + +namespace Test { + +template<class ViewType> +double fill_view (ViewType& a, typename ViewType::const_value_type& val, int repeat){ + Kokkos::Timer timer; + for(int i=0; i<repeat; i++) { + Kokkos::deep_copy(a,val); + } + Kokkos::fence(); + return timer.seconds(); +} + + +template<class Layout> +void run_fillview_tests(int N, int R) { + const int N1 = N; + const int N2 = N*N; + const int N3 = N2*N; + const int N4 = N2*N2; + const int N8 = N4*N4; + + double time1,time2,time3,time4,time5,time6,time7,time8,time_raw = 100000.0; + { + Kokkos::View<double*,Layout> a("A1",N8); + time1 = fill_view(a,1.1,R)/R; + } + { + Kokkos::View<double**,Layout> a("A2",N4,N4); + time2 = fill_view(a,1.1,R)/R; + } + { + Kokkos::View<double***,Layout> a("A3",N3,N3,N2); + time3 = fill_view(a,1.1,R)/R; + } + { + Kokkos::View<double****,Layout> a("A4",N2,N2,N2,N2); + time4 = fill_view(a,1.1,R)/R; + } + { + Kokkos::View<double*****,Layout> a("A5",N2,N2,N1,N1,N2); + time5 = fill_view(a,1.1,R)/R; + } + { + Kokkos::View<double******,Layout> a("A6",N2,N1,N1,N1,N1,N2); + time6 = fill_view(a,1.1,R)/R; + } + { + Kokkos::View<double*******,Layout> a("A7",N2,N1,N1,N1,N1,N1,N1); + time7 = fill_view(a,1.1,R)/R; + } + { + Kokkos::View<double********,Layout> a("A8",N1,N1,N1,N1,N1,N1,N1,N1); + time8 = fill_view(a,1.1,R)/R; + } + #if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) + { + Kokkos::View<double*,Layout> a("A1",N8); + double* a_ptr = a.data(); + Kokkos::Timer timer; + for(int r=0;r<R;r++) { + Kokkos::parallel_for(N8, KOKKOS_LAMBDA (const int& i) { + a_ptr[i] = 1.1; + }); + } + time_raw = timer.seconds()/R; + } + #endif + double size = 1.0*N8*8/1024/1024; + printf(" Raw: %lf s %lf MB %lf GB/s\n",time_raw,size,size/1024/time_raw); + printf(" Rank1: %lf s %lf MB %lf GB/s\n",time1,size,size/1024/time1); + printf(" Rank2: %lf s %lf MB %lf GB/s\n",time2,size,size/1024/time2); + printf(" Rank3: %lf s %lf MB %lf GB/s\n",time3,size,size/1024/time3); + printf(" Rank4: %lf s %lf MB %lf GB/s\n",time4,size,size/1024/time4); + printf(" Rank5: %lf s %lf MB %lf GB/s\n",time5,size,size/1024/time5); + printf(" Rank6: %lf s %lf MB %lf GB/s\n",time6,size,size/1024/time6); + printf(" Rank7: %lf s %lf MB %lf GB/s\n",time7,size,size/1024/time7); + printf(" Rank8: %lf s %lf MB %lf GB/s\n",time8,size,size/1024/time8); +} + +TEST_F( default_exec, ViewFill ) { + printf("ViewFill Performance for LayoutLeft:\n"); + run_fillview_tests<Kokkos::LayoutLeft>(10,1); + printf("ViewFill Performance for LayoutRight:\n"); + run_fillview_tests<Kokkos::LayoutRight>(10,1); +} + +template<class Layout> +void run_allocateview_tests(int N, int R) { + const int N1 = N; + const int N2 = N*N; + const int N3 = N2*N; + const int N4 = N2*N2; + const int N8 = N4*N4; + + double time1,time2,time3,time4,time5,time6,time7,time8,time_raw = 100000.0; + { + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double*,Layout> a("A1",N8); + } + time1 = timer.seconds()/R; + } + { + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double**,Layout> a("A2",N4,N4); + } + time2 = timer.seconds()/R; + } + { + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double***,Layout> a("A3",N3,N3,N2); + } + time3 = timer.seconds()/R; + } + { + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double****,Layout> a("A4",N2,N2,N2,N2); + } + time4 = timer.seconds()/R; + } + { + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double*****,Layout> a("A5",N2,N2,N1,N1,N2); + } + time5 = timer.seconds()/R; + } + { + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double******,Layout> a("A6",N2,N1,N1,N1,N1,N2); + } + time6 = timer.seconds()/R; + } + { + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double*******,Layout> a("A7",N2,N1,N1,N1,N1,N1,N1); + } + time7 = timer.seconds()/R; + } + { + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double********,Layout> a("A8",N1,N1,N1,N1,N1,N1,N1,N1); + } + time8 = timer.seconds()/R; + } + #if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) + { + Kokkos::Timer timer; + for(int r=0;r<R;r++) { + double* a_ptr = (double*) Kokkos::kokkos_malloc("A", sizeof(double)*N8); + Kokkos::parallel_for(N8, KOKKOS_LAMBDA (const int& i) { + a_ptr[i] = 0.0; + }); + Kokkos::kokkos_free(a_ptr); + } + time_raw = timer.seconds()/R; + } + #endif + double size = 1.0*N8*8/1024/1024; + printf(" Raw: %lf s %lf MB %lf GB/s\n",time_raw,size,size/1024/time_raw); + printf(" Rank1: %lf s %lf MB %lf GB/s\n",time1,size,size/1024/time1); + printf(" Rank2: %lf s %lf MB %lf GB/s\n",time2,size,size/1024/time2); + printf(" Rank3: %lf s %lf MB %lf GB/s\n",time3,size,size/1024/time3); + printf(" Rank4: %lf s %lf MB %lf GB/s\n",time4,size,size/1024/time4); + printf(" Rank5: %lf s %lf MB %lf GB/s\n",time5,size,size/1024/time5); + printf(" Rank6: %lf s %lf MB %lf GB/s\n",time6,size,size/1024/time6); + printf(" Rank7: %lf s %lf MB %lf GB/s\n",time7,size,size/1024/time7); + printf(" Rank8: %lf s %lf MB %lf GB/s\n",time8,size,size/1024/time8); +} + +TEST_F( default_exec, ViewCreate ) { + printf("Create View Performance for LayoutLeft:\n"); + run_allocateview_tests<Kokkos::LayoutLeft>(10,1); + printf("Create View Performance for LayoutRight:\n"); + run_allocateview_tests<Kokkos::LayoutRight>(10,1); +} + +template<class ViewTypeA, class ViewTypeB> +double deepcopy_view (ViewTypeA& a, ViewTypeB& b, int repeat){ + Kokkos::Timer timer; + for(int i=0; i<repeat; i++) { + Kokkos::deep_copy(a,b); + } + Kokkos::fence(); + return timer.seconds(); +} + + +template<class LayoutA, class LayoutB> +void run_deepcopyview_tests(int N, int R) { + const int N1 = N; + const int N2 = N*N; + const int N3 = N2*N; + const int N4 = N2*N2; + const int N8 = N4*N4; + + double time1,time2,time3,time4,time5,time6,time7,time8,time_raw = 100000.0; + { + Kokkos::View<double*,LayoutA> a("A1",N8); + Kokkos::View<double*,LayoutB> b("B1",N8); + time1 = deepcopy_view(a,b,R)/R; + } + { + Kokkos::View<double**,LayoutA> a("A2",N4,N4); + Kokkos::View<double**,LayoutB> b("B2",N4,N4); + time2 = deepcopy_view(a,b,R)/R; + } + { + Kokkos::View<double***,LayoutA> a("A3",N3,N3,N2); + Kokkos::View<double***,LayoutB> b("B3",N3,N3,N2); + time3 = deepcopy_view(a,b,R)/R; + } + { + Kokkos::View<double****,LayoutA> a("A4",N2,N2,N2,N2); + Kokkos::View<double****,LayoutB> b("B4",N2,N2,N2,N2); + time4 = deepcopy_view(a,b,R)/R; + } + { + Kokkos::View<double*****,LayoutA> a("A5",N2,N2,N1,N1,N2); + Kokkos::View<double*****,LayoutB> b("B5",N2,N2,N1,N1,N2); + time5 = deepcopy_view(a,b,R)/R; + } + { + Kokkos::View<double******,LayoutA> a("A6",N2,N1,N1,N1,N1,N2); + Kokkos::View<double******,LayoutB> b("B6",N2,N1,N1,N1,N1,N2); + time6 = deepcopy_view(a,b,R)/R; + } + { + Kokkos::View<double*******,LayoutA> a("A7",N2,N1,N1,N1,N1,N1,N1); + Kokkos::View<double*******,LayoutB> b("B7",N2,N1,N1,N1,N1,N1,N1); + time7 = deepcopy_view(a,b,R)/R; + } + { + Kokkos::View<double********,LayoutA> a("A8",N1,N1,N1,N1,N1,N1,N1,N1); + Kokkos::View<double********,LayoutB> b("B8",N1,N1,N1,N1,N1,N1,N1,N1); + time8 = deepcopy_view(a,b,R)/R; + } + #if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) + { + Kokkos::View<double*,LayoutA> a("A1",N8); + Kokkos::View<double*,LayoutB> b("B1",N8); + double* const a_ptr = a.data(); + const double* const b_ptr = b.data(); + Kokkos::Timer timer; + for(int r=0;r<R;r++) { + Kokkos::parallel_for(N8, KOKKOS_LAMBDA (const int& i) { + a_ptr[i] = b_ptr[i]; + }); + } + time_raw = timer.seconds()/R; + } + #endif + double size = 1.0*N8*8/1024/1024; + printf(" Raw: %lf s %lf MB %lf GB/s\n",time_raw,size,2.0*size/1024/time_raw); + printf(" Rank1: %lf s %lf MB %lf GB/s\n",time1,size,2.0*size/1024/time1); + printf(" Rank2: %lf s %lf MB %lf GB/s\n",time2,size,2.0*size/1024/time2); + printf(" Rank3: %lf s %lf MB %lf GB/s\n",time3,size,2.0*size/1024/time3); + printf(" Rank4: %lf s %lf MB %lf GB/s\n",time4,size,2.0*size/1024/time4); + printf(" Rank5: %lf s %lf MB %lf GB/s\n",time5,size,2.0*size/1024/time5); + printf(" Rank6: %lf s %lf MB %lf GB/s\n",time6,size,2.0*size/1024/time6); + printf(" Rank7: %lf s %lf MB %lf GB/s\n",time7,size,2.0*size/1024/time7); + printf(" Rank8: %lf s %lf MB %lf GB/s\n",time8,size,2.0*size/1024/time8); +} + +TEST_F( default_exec, ViewDeepCopy ) { + printf("DeepCopy Performance for LayoutLeft to LayoutLeft:\n"); + run_deepcopyview_tests<Kokkos::LayoutLeft,Kokkos::LayoutLeft>(10,1); + printf("DeepCopy Performance for LayoutRight to LayoutRight:\n"); + run_deepcopyview_tests<Kokkos::LayoutRight,Kokkos::LayoutRight>(10,1); + printf("DeepCopy Performance for LayoutLeft to LayoutRight:\n"); + run_deepcopyview_tests<Kokkos::LayoutLeft,Kokkos::LayoutRight>(10,1); + printf("DeepCopy Performance for LayoutRight to LayoutLeft:\n"); + run_deepcopyview_tests<Kokkos::LayoutRight,Kokkos::LayoutLeft>(10,1); +} + +template<class Layout> +void run_resizeview_tests(int N, int R) { + const int N1 = N; + const int N2 = N*N; + const int N3 = N2*N; + const int N4 = N2*N2; + const int N8 = N4*N4; + + double time1,time2,time3,time4,time5,time6,time7,time8,time_raw = 100000.0; + { + Kokkos::View<double*,Layout> a("A1",N8); + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double*,Layout> a_(a); + Kokkos::resize(a_,int(N8*1.1)); + } + time1 = timer.seconds()/R; + } + { + Kokkos::View<double**,Layout> a("A2",N4,N4); + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double**,Layout> a_(a); + Kokkos::resize(a_,int(N4*1.1),N4); + } + time2 = timer.seconds()/R; + } + { + Kokkos::View<double***,Layout> a("A3",N3,N3,N2); + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double***,Layout> a_(a); + Kokkos::resize(a_,int(N3*1.1),N3,N2); + } + time3 = timer.seconds()/R; + } + { + Kokkos::View<double****,Layout> a("A4",N2,N2,N2,N2); + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double****,Layout> a_(a); + Kokkos::resize(a_,int(N2*1.1),N2,N2,N2); + } + time4 = timer.seconds()/R; + } + { + Kokkos::View<double*****,Layout> a("A5",N2,N2,N1,N1,N2); + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double*****,Layout> a_(a); + Kokkos::resize(a_,int(N2*1.1),N2,N1,N1,N2); + } + time5 = timer.seconds()/R; + } + { + Kokkos::View<double******,Layout> a("A6",N2,N1,N1,N1,N1,N2); + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double******,Layout> a_(a); + Kokkos::resize(a_,int(N2*1.1),N1,N1,N1,N1,N2); + } + time6 = timer.seconds()/R; + } + { + Kokkos::View<double*******,Layout> a("A7",N2,N1,N1,N1,N1,N1,N1); + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double*******,Layout> a_(a); + Kokkos::resize(a_,int(N2*1.1),N1,N1,N1,N1,N1,N1); + } + time7 = timer.seconds()/R; + } + { + Kokkos::View<double********,Layout> a("A8",N1,N1,N1,N1,N1,N1,N1,N1); + Kokkos::Timer timer; + for(int r=0; r<R; r++) { + Kokkos::View<double********,Layout> a_(a); + Kokkos::resize(a_,int(N1*1.1),N1,N1,N1,N1,N1,N1,N1); + } + time8 = timer.seconds()/R; + } + #if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) + { + Kokkos::View<double*,Layout> a("A1",N8); + double* a_ptr = a.data(); + Kokkos::Timer timer; + for(int r=0;r<R;r++) { + Kokkos::View<double*,Layout> a1(Kokkos::ViewAllocateWithoutInitializing("A1"),int(N8*1.1)); + double* a1_ptr = a1.data(); + Kokkos::parallel_for(N8, KOKKOS_LAMBDA (const int& i) { + a1_ptr[i] = a_ptr[i]; + }); + } + time_raw = timer.seconds()/R; + } + #endif + double size = 1.0*N8*8/1024/1024; + printf(" Raw: %lf s %lf MB %lf GB/s\n",time_raw,size,2.0*size/1024/time_raw); + printf(" Rank1: %lf s %lf MB %lf GB/s\n",time1,size,2.0*size/1024/time1); + printf(" Rank2: %lf s %lf MB %lf GB/s\n",time2,size,2.0*size/1024/time2); + printf(" Rank3: %lf s %lf MB %lf GB/s\n",time3,size,2.0*size/1024/time3); + printf(" Rank4: %lf s %lf MB %lf GB/s\n",time4,size,2.0*size/1024/time4); + printf(" Rank5: %lf s %lf MB %lf GB/s\n",time5,size,2.0*size/1024/time5); + printf(" Rank6: %lf s %lf MB %lf GB/s\n",time6,size,2.0*size/1024/time6); + printf(" Rank7: %lf s %lf MB %lf GB/s\n",time7,size,2.0*size/1024/time7); + printf(" Rank8: %lf s %lf MB %lf GB/s\n",time8,size,2.0*size/1024/time8); +} + +TEST_F( default_exec, ViewResize ) { + printf("Resize View Performance for LayoutLeft:\n"); + run_resizeview_tests<Kokkos::LayoutLeft>(10,1); + printf("Resize View Performance for LayoutRight:\n"); + run_resizeview_tests<Kokkos::LayoutRight>(10,1); +} + +} diff --git a/lib/kokkos/core/perf_test/test_atomic.cpp b/lib/kokkos/core/perf_test/test_atomic.cpp index ab73f2505e28df6bda1c8f4a43d66fc20093bf2a..6bb22e4e301aa3ef190e17fb9f292f50bd8c3d69 100644 --- a/lib/kokkos/core/perf_test/test_atomic.cpp +++ b/lib/kokkos/core/perf_test/test_atomic.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/perf_test/test_mempool.cpp b/lib/kokkos/core/perf_test/test_mempool.cpp index 7759c28275c04a48263151b2edffa2bb5c2cb371..9fd58eda9145fd327b4fbf21e951b9bc9a9ad868 100644 --- a/lib/kokkos/core/perf_test/test_mempool.cpp +++ b/lib/kokkos/core/perf_test/test_mempool.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/perf_test/test_taskdag.cpp b/lib/kokkos/core/perf_test/test_taskdag.cpp index 221182c50b548b8ae2cde702a95a0010765a2a9b..00615cd3abe7fade5b43762aad94afd7fd1f07ad 100644 --- a/lib/kokkos/core/perf_test/test_taskdag.cpp +++ b/lib/kokkos/core/perf_test/test_taskdag.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile.hpp b/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile.hpp index 1a5626b04efacd7a82f3f0011e950a9c9cc1a89d..04c5cdccbfcd2d8faee9181f9cd6d8dd0be88702 100644 --- a/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile.hpp +++ b/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile_Refactor.hpp b/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile_Refactor.hpp index d59c5c672667ab4488b3e6bb93bc1b52d42179db..636e05c8acf29ed5cc23e52c2217a0573c610d26 100644 --- a/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile_Refactor.hpp +++ b/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile_Refactor.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp b/lib/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp index f55191e98c997c7f292016c0d3b07e7aba2c1ef6..ada3f64fe129703326d2aa00d56badd14d44406c 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp b/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp index 33f77ea83512794396ac14f8b9187f5676b0edca..bf1033c0914b2aaf3b8548882ca354c6a30edd8b 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -183,6 +183,7 @@ void * CudaUVMSpace::allocate( const size_t arg_alloc_size ) const enum { max_uvm_allocations = 65536 }; + Cuda::fence(); if ( arg_alloc_size > 0 ) { Kokkos::Impl::num_uvm_allocations++; @@ -193,6 +194,7 @@ void * CudaUVMSpace::allocate( const size_t arg_alloc_size ) const CUDA_SAFE_CALL( cudaMallocManaged( &ptr, arg_alloc_size , cudaMemAttachGlobal ) ); } + Cuda::fence(); return ptr ; } @@ -215,12 +217,14 @@ void CudaSpace::deallocate( void * const arg_alloc_ptr , const size_t /* arg_all void CudaUVMSpace::deallocate( void * const arg_alloc_ptr , const size_t /* arg_alloc_size */ ) const { + Cuda::fence(); try { if ( arg_alloc_ptr != nullptr ) { Kokkos::Impl::num_uvm_allocations--; CUDA_SAFE_CALL( cudaFree( arg_alloc_ptr ) ); } } catch(...) {} + Cuda::fence(); } void CudaHostPinnedSpace::deallocate( void * const arg_alloc_ptr , const size_t /* arg_alloc_size */ ) const @@ -384,7 +388,7 @@ SharedAllocationRecord< Kokkos::CudaUVMSpace , void >:: { #if defined(KOKKOS_ENABLE_PROFILING) if(Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::fence(); //Make sure I can access the label ... + Cuda::fence(); //Make sure I can access the label ... Kokkos::Profiling::deallocateData( Kokkos::Profiling::SpaceHandle(Kokkos::CudaUVMSpace::name()),RecordBase::m_alloc_ptr->m_label, data(),size()); diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp index 391a881e2dcb320b2cb8ba25e09002e2eb9232a9..5726e02180d084fa91914ae736b9d0f9a6b44d2d 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp index bc54954418dbdb5212b7701af65c60fb66f605f9..55c7c782fe3b66f94d446e2bed6c10881f1cf5b5 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp index a63fb0cda44ceacfa70ccef7329d9d74f62636c8..052c1d2482e04447562681381b1b20f994ee524e 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -401,7 +401,6 @@ void CudaInternal::initialize( int cuda_device_id , int stream_count ) m_cudaDev = cuda_device_id ; CUDA_SAFE_CALL( cudaSetDevice( m_cudaDev ) ); - CUDA_SAFE_CALL( cudaDeviceReset() ); Kokkos::Impl::cuda_device_synchronize(); // Query what compute capability architecture a kernel executes: @@ -438,19 +437,7 @@ void CudaInternal::initialize( int cuda_device_id , int stream_count ) // Maximum number of warps, // at most one warp per thread in a warp for reduction. - // HCE 2012-February : - // Found bug in CUDA 4.1 that sometimes a kernel launch would fail - // if the thread count == 1024 and a functor is passed to the kernel. - // Copying the kernel to constant memory and then launching with - // thread count == 1024 would work fine. - // - // HCE 2012-October : - // All compute capabilities support at least 16 warps (512 threads). - // However, we have found that 8 warps typically gives better performance. - - m_maxWarpCount = 8 ; - - // m_maxWarpCount = cudaProp.maxThreadsPerBlock / Impl::CudaTraits::WarpSize ; + m_maxWarpCount = cudaProp.maxThreadsPerBlock / Impl::CudaTraits::WarpSize ; if ( Impl::CudaTraits::WarpSize < m_maxWarpCount ) { m_maxWarpCount = Impl::CudaTraits::WarpSize ; @@ -501,7 +488,7 @@ void CudaInternal::initialize( int cuda_device_id , int stream_count ) // Allocate and initialize uint32_t[ buffer_bound ] - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< Kokkos::CudaSpace , void > Record ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::CudaSpace , void > Record ; Record * const r = Record::allocate( Kokkos::CudaSpace() , "InternalScratchBitset" @@ -590,7 +577,7 @@ CudaInternal::scratch_flags( const Cuda::size_type size ) m_scratchFlagsCount = ( size + sizeScratchGrain - 1 ) / sizeScratchGrain ; - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< Kokkos::CudaSpace , void > Record ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::CudaSpace , void > Record ; Record * const r = Record::allocate( Kokkos::CudaSpace() , "InternalScratchFlags" @@ -613,7 +600,7 @@ CudaInternal::scratch_space( const Cuda::size_type size ) m_scratchSpaceCount = ( size + sizeScratchGrain - 1 ) / sizeScratchGrain ; - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< Kokkos::CudaSpace , void > Record ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::CudaSpace , void > Record ; Record * const r = Record::allocate( Kokkos::CudaSpace() , "InternalScratchSpace" @@ -635,7 +622,7 @@ CudaInternal::scratch_unified( const Cuda::size_type size ) m_scratchUnifiedCount = ( size + sizeScratchGrain - 1 ) / sizeScratchGrain ; - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< Kokkos::CudaHostPinnedSpace , void > Record ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::CudaHostPinnedSpace , void > Record ; Record * const r = Record::allocate( Kokkos::CudaHostPinnedSpace() , "InternalScratchUnified" @@ -666,8 +653,8 @@ void CudaInternal::finalize() ::free( m_stream ); } - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< CudaSpace > RecordCuda ; - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< CudaHostPinnedSpace > RecordHost ; + typedef Kokkos::Impl::SharedAllocationRecord< CudaSpace > RecordCuda ; + typedef Kokkos::Impl::SharedAllocationRecord< CudaHostPinnedSpace > RecordHost ; RecordCuda::decrement( RecordCuda::get_record( m_scratchFlags ) ); RecordCuda::decrement( RecordCuda::get_record( m_scratchSpace ) ); diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp index 148d9f44eeed8f22efe624658500c834ad066833..31f405dd840f2a49e784d1ec0653a67a593a13f9 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.cpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.cpp index 237022ad23d30aee694f53d8f35bd4f98be012b9..f1828ea2de75926a912ed2dea8a8aaa8ea515543 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp index d01f06fb4fcd41845e1a09ec4270440bf164af02..80192bf338a9cfef23729de5b2c6896cc8bb7663 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -104,8 +104,9 @@ namespace Impl { /// variable based on the Host global variable prior to running any kernels /// that will use it. /// That is the purpose of the KOKKOS_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE macro. -__device__ __constant__ +__device__ #ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE +__constant__ extern #endif Kokkos::Impl::CudaLockArrays g_device_cuda_lock_arrays ; @@ -142,15 +143,27 @@ void unlock_address_cuda_space(void* ptr) { } // namespace Impl } // namespace Kokkos +// Make lock_array_copied an explicit translation unit scope thingy +namespace Kokkos { +namespace Impl { +namespace { + static int lock_array_copied = 0; +} +} +} /* Dan Ibanez: it is critical that this code be a macro, so that it will capture the right address for Kokkos::Impl::g_device_cuda_lock_arrays! putting this in an inline function will NOT do the right thing! */ #define KOKKOS_COPY_CUDA_LOCK_ARRAYS_TO_DEVICE() \ { \ - CUDA_SAFE_CALL(cudaMemcpyToSymbol( \ + if(::Kokkos::Impl::lock_array_copied == 0) { \ + CUDA_SAFE_CALL(cudaMemcpyToSymbol( \ Kokkos::Impl::g_device_cuda_lock_arrays , \ & Kokkos::Impl::g_host_cuda_lock_arrays , \ sizeof(Kokkos::Impl::CudaLockArrays) ) ); \ + } \ + lock_array_copied = 1; \ + \ } #ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp index 5fd442ffc9911d3c9c208a852941b317e598c537..e417544fd8a599477d9828a871846e68dcf240f3 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -299,6 +299,32 @@ public: }; typedef Kokkos::Impl::CudaTeamMember member_type ; + +protected: + /** \brief set chunk_size to a discrete value*/ + inline TeamPolicyInternal internal_set_chunk_size(typename traits::index_type chunk_size_) { + m_chunk_size = chunk_size_; + return *this; + } + + /** \brief set per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team) { + m_team_scratch_size[level] = per_team.value; + return *this; + }; + + /** \brief set per thread scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerThreadValue& per_thread) { + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; + + /** \brief set per thread and per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team, const PerThreadValue& per_thread) { + m_team_scratch_size[level] = per_team.value; + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; }; } // namspace Impl @@ -364,7 +390,8 @@ public: void execute() const { const int nwork = m_policy.end() - m_policy.begin(); - const dim3 block( 1 , CudaTraits::WarpSize * cuda_internal_maximum_warp_count(), 1); + const int block_size = Kokkos::Impl::cuda_get_opt_block_size< ParallelFor >( m_functor , 1, 0 , 0 ); + const dim3 block( 1 , block_size , 1); const dim3 grid( std::min( ( nwork + block.y - 1 ) / block.y , cuda_internal_maximum_grid_count() ) , 1 , 1); CudaParallelLaunch< ParallelFor, LaunchBounds >( *this , grid , block , 0 ); @@ -544,15 +571,15 @@ public: if ( m_scratch_size[1]>0 ) { __shared__ int base_thread_id; if (threadIdx.x==0 && threadIdx.y==0 ) { - threadid = ((blockIdx.x*blockDim.z + threadIdx.z) * blockDim.x * blockDim.y) % Kokkos::Impl::g_device_cuda_lock_arrays.n; - threadid = ((threadid + blockDim.x * blockDim.y-1)/(blockDim.x * blockDim.y)) * blockDim.x * blockDim.y; - if(threadid > Kokkos::Impl::g_device_cuda_lock_arrays.n) threadid-=blockDim.x * blockDim.y; + threadid = (blockIdx.x*blockDim.z + threadIdx.z) % + (Kokkos::Impl::g_device_cuda_lock_arrays.n / (blockDim.x * blockDim.y)); + threadid *= blockDim.x * blockDim.y; int done = 0; while (!done) { done = (0 == atomicCAS(&Kokkos::Impl::g_device_cuda_lock_arrays.scratch[threadid],0,1)); if(!done) { threadid += blockDim.x * blockDim.y; - if(threadid > Kokkos::Impl::g_device_cuda_lock_arrays.n) threadid = 0; + if(threadid+blockDim.x * blockDim.y >= Kokkos::Impl::g_device_cuda_lock_arrays.n) threadid = 0; } } base_thread_id = threadid; @@ -584,7 +611,7 @@ public: inline void execute() const { - const int shmem_size_total = m_shmem_begin + m_shmem_size ; + const int64_t shmem_size_total = m_shmem_begin + m_shmem_size ; const dim3 grid( int(m_league_size) , 1 , 1 ); const dim3 block( int(m_vector_size) , int(m_team_size) , 1 ); @@ -836,7 +863,7 @@ public: : m_functor( arg_functor ) , m_policy( arg_policy ) , m_reducer( InvalidType() ) - , m_result_ptr( arg_result.ptr_on_device() ) + , m_result_ptr( arg_result.data() ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -848,7 +875,7 @@ public: : m_functor( arg_functor ) , m_policy( arg_policy ) , m_reducer( reducer ) - , m_result_ptr( reducer.view().ptr_on_device() ) + , m_result_ptr( reducer.view().data() ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -1062,7 +1089,7 @@ public: : m_functor( arg_functor ) , m_policy( arg_policy ) , m_reducer( InvalidType() ) - , m_result_ptr( arg_result.ptr_on_device() ) + , m_result_ptr( arg_result.data() ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -1074,7 +1101,7 @@ public: : m_functor( arg_functor ) , m_policy( arg_policy ) , m_reducer( reducer ) - , m_result_ptr( reducer.view().ptr_on_device() ) + , m_result_ptr( reducer.view().data() ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -1166,15 +1193,15 @@ public: if ( m_scratch_size[1]>0 ) { __shared__ int base_thread_id; if (threadIdx.x==0 && threadIdx.y==0 ) { - threadid = ((blockIdx.x*blockDim.z + threadIdx.z) * blockDim.x * blockDim.y) % Kokkos::Impl::g_device_cuda_lock_arrays.n; - threadid = ((threadid + blockDim.x * blockDim.y-1)/(blockDim.x * blockDim.y)) * blockDim.x * blockDim.y; - if(threadid > Kokkos::Impl::g_device_cuda_lock_arrays.n) threadid-=blockDim.x * blockDim.y; + threadid = (blockIdx.x*blockDim.z + threadIdx.z) % + (Kokkos::Impl::g_device_cuda_lock_arrays.n / (blockDim.x * blockDim.y)); + threadid *= blockDim.x * blockDim.y; int done = 0; while (!done) { done = (0 == atomicCAS(&Kokkos::Impl::g_device_cuda_lock_arrays.scratch[threadid],0,1)); if(!done) { threadid += blockDim.x * blockDim.y; - if(threadid > Kokkos::Impl::g_device_cuda_lock_arrays.n) threadid = 0; + if(threadid + blockDim.x * blockDim.y >= Kokkos::Impl::g_device_cuda_lock_arrays.n) threadid = 0; } } base_thread_id = threadid; @@ -1316,7 +1343,7 @@ public: ,void*>::type = NULL) : m_functor( arg_functor ) , m_reducer( InvalidType() ) - , m_result_ptr( arg_result.ptr_on_device() ) + , m_result_ptr( arg_result.data() ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -1343,7 +1370,7 @@ public: { // Return Init value if the number of worksets is zero if( arg_policy.league_size() == 0) { - ValueInit::init( ReducerConditional::select(m_functor , m_reducer) , arg_result.ptr_on_device() ); + ValueInit::init( ReducerConditional::select(m_functor , m_reducer) , arg_result.data() ); return ; } @@ -1386,7 +1413,7 @@ public: , const ReducerType & reducer) : m_functor( arg_functor ) , m_reducer( reducer ) - , m_result_ptr( reducer.view().ptr_on_device() ) + , m_result_ptr( reducer.view().data() ) , m_scratch_space( 0 ) , m_scratch_flags( 0 ) , m_unified_space( 0 ) @@ -2041,8 +2068,39 @@ namespace Impl { __device__ inline void operator() (typename ExecPolicy::work_tag, const typename ExecPolicy::member_type& i, ValueType& val) const { //Insert Static Assert with decltype on ValueType equals third argument type of FunctorType::operator() - f(typename ExecPolicy::work_tag(), i,val); + f(typename ExecPolicy::work_tag(), i, val); + } + + __device__ inline + void operator() (typename ExecPolicy::work_tag, const typename ExecPolicy::member_type& i, const typename ExecPolicy::member_type& j, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals third argument type of FunctorType::operator() + f(typename ExecPolicy::work_tag(), i, j, val); + } + + __device__ inline + void operator() (typename ExecPolicy::work_tag, const typename ExecPolicy::member_type& i, const typename ExecPolicy::member_type& j, const typename ExecPolicy::member_type& k, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals third argument type of FunctorType::operator() + f(typename ExecPolicy::work_tag(), i, j, k, val); + } + + __device__ inline + void operator() (typename ExecPolicy::work_tag, const typename ExecPolicy::member_type& i, const typename ExecPolicy::member_type& j, const typename ExecPolicy::member_type& k, const typename ExecPolicy::member_type& l, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals third argument type of FunctorType::operator() + f(typename ExecPolicy::work_tag(), i, j, k, l, val); + } + + __device__ inline + void operator() (typename ExecPolicy::work_tag, const typename ExecPolicy::member_type& i, const typename ExecPolicy::member_type& j, const typename ExecPolicy::member_type& k, const typename ExecPolicy::member_type& l, const typename ExecPolicy::member_type& m, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals third argument type of FunctorType::operator() + f(typename ExecPolicy::work_tag(), i, j, k, l, m, val); + } + + __device__ inline + void operator() (typename ExecPolicy::work_tag, const typename ExecPolicy::member_type& i, const typename ExecPolicy::member_type& j, const typename ExecPolicy::member_type& k, const typename ExecPolicy::member_type& l, const typename ExecPolicy::member_type& m, const typename ExecPolicy::member_type& n, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals third argument type of FunctorType::operator() + f(typename ExecPolicy::work_tag(), i, j, k, l, m, n, val); } + }; template< class FunctorType, class ExecPolicy, class ValueType > @@ -2056,12 +2114,74 @@ namespace Impl { //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() f(i,val); } + + __device__ inline + void operator() (const typename ExecPolicy::member_type& i, const typename ExecPolicy::member_type& j, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() + f(i,j,val); + } + + __device__ inline + void operator() (const typename ExecPolicy::member_type& i, const typename ExecPolicy::member_type& j, const typename ExecPolicy::member_type& k, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() + f(i,j,k,val); + } + + __device__ inline + void operator() (const typename ExecPolicy::member_type& i, const typename ExecPolicy::member_type& j, const typename ExecPolicy::member_type& k, const typename ExecPolicy::member_type& l, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() + f(i,j,k,l,val); + } + + __device__ inline + void operator() (const typename ExecPolicy::member_type& i, const typename ExecPolicy::member_type& j, const typename ExecPolicy::member_type& k, const typename ExecPolicy::member_type& l, const typename ExecPolicy::member_type& m, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() + f(i,j,k,l,m,val); + } + + __device__ inline + void operator() (const typename ExecPolicy::member_type& i, const typename ExecPolicy::member_type& j, const typename ExecPolicy::member_type& k, const typename ExecPolicy::member_type& l, const typename ExecPolicy::member_type& m, const typename ExecPolicy::member_type& n, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() + f(i,j,k,l,m,n,val); + } + + __device__ inline void operator() (typename ExecPolicy::member_type& i, ValueType& val) const { //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() f(i,val); } + __device__ inline + void operator() (typename ExecPolicy::member_type& i, typename ExecPolicy::member_type& j, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() + f(i,j,val); + } + + __device__ inline + void operator() (typename ExecPolicy::member_type& i, typename ExecPolicy::member_type& j, typename ExecPolicy::member_type& k, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() + f(i,j,k,val); + } + + __device__ inline + void operator() (typename ExecPolicy::member_type& i, typename ExecPolicy::member_type& j, typename ExecPolicy::member_type& k, typename ExecPolicy::member_type& l, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() + f(i,j,k,l,val); + } + + __device__ inline + void operator() (typename ExecPolicy::member_type& i, typename ExecPolicy::member_type& j, typename ExecPolicy::member_type& k, typename ExecPolicy::member_type& l, typename ExecPolicy::member_type& m, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() + f(i,j,k,l,m,val); + } + + __device__ inline + void operator() (typename ExecPolicy::member_type& i, typename ExecPolicy::member_type& j, typename ExecPolicy::member_type& k, typename ExecPolicy::member_type& l, typename ExecPolicy::member_type& m, typename ExecPolicy::member_type& n, ValueType& val) const { + //Insert Static Assert with decltype on ValueType equals second argument type of FunctorType::operator() + f(i,j,k,l,m,n,val); + } + }; template<class FunctorType, class ResultType, class Tag, bool Enable = IsNonTrivialReduceFunctor<FunctorType>::value > diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp index a478396910a381f815eead4094e97345aa2dcb15..cd4d6303f6d572d401e11d21ca42425518515476 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -66,10 +66,11 @@ namespace Impl { template< typename T > __device__ inline void cuda_shfl( T & out , T const & in , int lane , - typename std::enable_if< sizeof(int) == sizeof(T) , int >::type width ) + typename std::enable_if< sizeof(int) == sizeof(T) , int >::type width + , unsigned mask = 0xffffffff ) { *reinterpret_cast<int*>(&out) = - KOKKOS_IMPL_CUDA_SHFL( *reinterpret_cast<int const *>(&in) , lane , width ); + KOKKOS_IMPL_CUDA_SHFL_MASK( mask , *reinterpret_cast<int const *>(&in) , lane , width ); } template< typename T > @@ -77,13 +78,13 @@ __device__ inline void cuda_shfl( T & out , T const & in , int lane , typename std::enable_if < ( sizeof(int) < sizeof(T) ) && ( 0 == ( sizeof(T) % sizeof(int) ) ) - , int >::type width ) + , int >::type width, unsigned mask = 0xffffffff ) { enum : int { N = sizeof(T) / sizeof(int) }; for ( int i = 0 ; i < N ; ++i ) { reinterpret_cast<int*>(&out)[i] = - KOKKOS_IMPL_CUDA_SHFL( reinterpret_cast<int const *>(&in)[i] , lane , width ); + KOKKOS_IMPL_CUDA_SHFL_MASK( mask , reinterpret_cast<int const *>(&in)[i] , lane , width ); } } @@ -92,10 +93,10 @@ void cuda_shfl( T & out , T const & in , int lane , template< typename T > __device__ inline void cuda_shfl_down( T & out , T const & in , int delta , - typename std::enable_if< sizeof(int) == sizeof(T) , int >::type width ) + typename std::enable_if< sizeof(int) == sizeof(T) , int >::type width , unsigned mask = 0xffffffff ) { *reinterpret_cast<int*>(&out) = - KOKKOS_IMPL_CUDA_SHFL_DOWN( *reinterpret_cast<int const *>(&in) , delta , width ); + KOKKOS_IMPL_CUDA_SHFL_DOWN_MASK( mask , *reinterpret_cast<int const *>(&in) , delta , width ); } template< typename T > @@ -103,13 +104,13 @@ __device__ inline void cuda_shfl_down( T & out , T const & in , int delta , typename std::enable_if < ( sizeof(int) < sizeof(T) ) && ( 0 == ( sizeof(T) % sizeof(int) ) ) - , int >::type width ) + , int >::type width , unsigned mask = 0xffffffff ) { enum : int { N = sizeof(T) / sizeof(int) }; for ( int i = 0 ; i < N ; ++i ) { reinterpret_cast<int*>(&out)[i] = - KOKKOS_IMPL_CUDA_SHFL_DOWN( reinterpret_cast<int const *>(&in)[i] , delta , width ); + KOKKOS_IMPL_CUDA_SHFL_DOWN_MASK( mask , reinterpret_cast<int const *>(&in)[i] , delta , width ); } } @@ -118,10 +119,10 @@ void cuda_shfl_down( T & out , T const & in , int delta , template< typename T > __device__ inline void cuda_shfl_up( T & out , T const & in , int delta , - typename std::enable_if< sizeof(int) == sizeof(T) , int >::type width ) + typename std::enable_if< sizeof(int) == sizeof(T) , int >::type width , unsigned mask = 0xffffffff ) { *reinterpret_cast<int*>(&out) = - KOKKOS_IMPL_CUDA_SHFL_UP( *reinterpret_cast<int const *>(&in) , delta , width ); + KOKKOS_IMPL_CUDA_SHFL_UP_MASK( mask , *reinterpret_cast<int const *>(&in) , delta , width ); } template< typename T > @@ -129,13 +130,13 @@ __device__ inline void cuda_shfl_up( T & out , T const & in , int delta , typename std::enable_if < ( sizeof(int) < sizeof(T) ) && ( 0 == ( sizeof(T) % sizeof(int) ) ) - , int >::type width ) + , int >::type width , unsigned mask = 0xffffffff ) { enum : int { N = sizeof(T) / sizeof(int) }; for ( int i = 0 ; i < N ; ++i ) { reinterpret_cast<int*>(&out)[i] = - KOKKOS_IMPL_CUDA_SHFL_UP( reinterpret_cast<int const *>(&in)[i] , delta , width ); + KOKKOS_IMPL_CUDA_SHFL_UP_MASK( mask , reinterpret_cast<int const *>(&in)[i] , delta , width ); } } @@ -512,12 +513,18 @@ void cuda_intra_block_reduce_scan( const FunctorType & functor , const pointer_type tdata_intra = base_data + value_count * threadIdx.y ; { // Intra-warp reduction: + KOKKOS_IMPL_CUDA_SYNCWARP; BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,0) + KOKKOS_IMPL_CUDA_SYNCWARP; BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,1) + KOKKOS_IMPL_CUDA_SYNCWARP; BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,2) + KOKKOS_IMPL_CUDA_SYNCWARP; BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,3) + KOKKOS_IMPL_CUDA_SYNCWARP; BLOCK_REDUCE_STEP(rtid_intra,tdata_intra,4) - } + KOKKOS_IMPL_CUDA_SYNCWARP; + } __syncthreads(); // Wait for all warps to reduce diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp index 5f08800c40292efaeadaf74ae5b70e7a47974fb9..ee949583f1363a6f8dd03dd636c9da62cf98e3d6 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -58,32 +58,6 @@ template class TaskQueue< Kokkos::Cuda > ; //---------------------------------------------------------------------------- -#if defined( KOKKOS_DEBUG ) - -__device__ -void verify_warp_convergence( const char * const where ) -{ - const unsigned b = __ballot(1); - - if ( b != ~0u ) { - -printf(" verify_warp_convergence( %s ) (%d,%d,%d) (%d,%d,%d) failed %x\n" - , where - , blockIdx.x - , blockIdx.y - , blockIdx.z - , threadIdx.x - , threadIdx.y - , threadIdx.z - , b ); - - } -} - -#endif // #if defined( KOKKOS_DEBUG ) - -//---------------------------------------------------------------------------- - __device__ void TaskQueueSpecialization< Kokkos::Cuda >::driver ( TaskQueueSpecialization< Kokkos::Cuda >::queue_type * const queue @@ -134,13 +108,18 @@ printf("TaskQueue<Cuda>::driver(%d,%d) task(%lx)\n",threadIdx.z,blockIdx.x } - // shuffle broadcast + // Synchronize warp with memory fence before broadcasting task pointer: - ((int*) & task_ptr )[0] = __shfl( ((int*) & task_ptr )[0] , 0 ); - ((int*) & task_ptr )[1] = __shfl( ((int*) & task_ptr )[1] , 0 ); + // KOKKOS_IMPL_CUDA_SYNCWARP_OR_RETURN( "A" ); + KOKKOS_IMPL_CUDA_SYNCWARP ; + + // Broadcast task pointer: + + ((int*) & task_ptr )[0] = KOKKOS_IMPL_CUDA_SHFL( ((int*) & task_ptr )[0] , 0 , 32 ); + ((int*) & task_ptr )[1] = KOKKOS_IMPL_CUDA_SHFL( ((int*) & task_ptr )[1] , 0 , 32 ); #if defined( KOKKOS_DEBUG ) - verify_warp_convergence("task_ptr"); + KOKKOS_IMPL_CUDA_SYNCWARP_OR_RETURN( "TaskQueue CUDA task_ptr" ); #endif if ( 0 == task_ptr ) break ; // 0 == queue->m_ready_count @@ -155,17 +134,17 @@ printf("TaskQueue<Cuda>::driver(%d,%d) task(%lx)\n",threadIdx.z,blockIdx.x int32_t volatile * const task_mem = (int32_t volatile *) task_ptr ; - // copy global to shared memory: + // copy task closure from global to shared memory: for ( int32_t i = warp_lane ; i < e ; i += CudaTraits::WarpSize ) { warp_shmem[i] = task_mem[i] ; } - Kokkos::memory_fence(); + // Synchronize threads of the warp and insure memory + // writes are visible to all threads in the warp. - // Copy done - use memory fence so that memory writes are visible. - // For reliable warp convergence on Pascal and Volta an explicit - // warp level synchronization will also be required. + // KOKKOS_IMPL_CUDA_SYNCWARP_OR_RETURN( "B" ); + KOKKOS_IMPL_CUDA_SYNCWARP ; if ( task_root_type::TaskTeam == task_shmem->m_task_type ) { // Thread Team Task @@ -176,17 +155,24 @@ printf("TaskQueue<Cuda>::driver(%d,%d) task(%lx)\n",threadIdx.z,blockIdx.x (*task_shmem->m_apply)( task_shmem , & single_exec ); } - // copy shared to global memory: + // Synchronize threads of the warp and insure memory + // writes are visible to all threads in the warp. + + // KOKKOS_IMPL_CUDA_SYNCWARP_OR_RETURN( "C" ); + KOKKOS_IMPL_CUDA_SYNCWARP ; + + // copy task closure from shared to global memory: for ( int32_t i = b + warp_lane ; i < e ; i += CudaTraits::WarpSize ) { task_mem[i] = warp_shmem[i] ; } - Kokkos::memory_fence(); + // Synchronize threads of the warp and insure memory + // writes are visible to root thread of the warp for + // respawn or completion. -#if defined( KOKKOS_DEBUG ) - verify_warp_convergence("apply"); -#endif + // KOKKOS_IMPL_CUDA_SYNCWARP_OR_RETURN( "D" ); + KOKKOS_IMPL_CUDA_SYNCWARP ; // If respawn requested copy respawn data back to main memory @@ -229,13 +215,17 @@ printf("cuda_task_queue_execute before\n"); #endif // Query the stack size, in bytes: - // - // size_t stack_size = 0 ; - // CUDA_SAFE_CALL( cudaDeviceGetLimit( & stack_size , cudaLimitStackSize ) ); - // + + size_t previous_stack_size = 0 ; + CUDA_SAFE_CALL( cudaDeviceGetLimit( & previous_stack_size , cudaLimitStackSize ) ); + // If not large enough then set the stack size, in bytes: - // - // CUDA_SAFE_CALL( cudaDeviceSetLimit( cudaLimitStackSize , stack_size ) ); + + const size_t larger_stack_size = 2048 ; + + if ( previous_stack_size < larger_stack_size ) { + CUDA_SAFE_CALL( cudaDeviceSetLimit( cudaLimitStackSize , larger_stack_size ) ); + } cuda_task_queue_execute<<< grid , block , shared_total , stream >>>( queue , shared_per_warp ); @@ -243,6 +233,10 @@ printf("cuda_task_queue_execute before\n"); CUDA_SAFE_CALL( cudaDeviceSynchronize() ); + if ( previous_stack_size < larger_stack_size ) { + CUDA_SAFE_CALL( cudaDeviceSetLimit( cudaLimitStackSize , previous_stack_size ) ); + } + #if 0 printf("cuda_task_queue_execute after\n"); #endif diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp index 4a52985d29422a4490ae9271338fd04db2b1cda6..a8b96ea6fe0fe551d98d6eb2ba43fa011c3abf83 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -124,15 +124,25 @@ namespace Impl { * where * blockDim.x * blockDim.y == WarpSize * + * Current implementation requires blockDim.x == 1. + * Vector level parallelism with blockDim.y > 1 on Volta will + * require a vector-level synchronization mask for vector-level + * collective operaitons. + * * Both single thread and thread team tasks are run by a full Cuda warp. * A single thread task is called by warp lane #0 and the remaining * lanes of the warp are idle. + * + * When executing a single thread task the syncwarp or other + * warp synchronizing functions must not be called. */ template<> class TaskExec< Kokkos::Cuda > { private: + enum : int { WarpSize = Kokkos::Impl::CudaTraits::WarpSize }; + TaskExec( TaskExec && ) = delete ; TaskExec( TaskExec const & ) = delete ; TaskExec & operator = ( TaskExec && ) = delete ; @@ -144,6 +154,8 @@ private: int32_t * m_team_shmem ; const int m_team_size ; + // If constructed with arg_team_size == 1 the object + // can only be used by 0 == threadIdx.y. __device__ TaskExec( int32_t * arg_team_shmem , int arg_team_size = blockDim.y ) : m_team_shmem( arg_team_shmem ) @@ -152,13 +164,33 @@ private: public: #if defined( __CUDA_ARCH__ ) - __device__ void team_barrier() { /* __threadfence_block(); */ } __device__ int team_rank() const { return threadIdx.y ; } __device__ int team_size() const { return m_team_size ; } + + __device__ void team_barrier() const + { + if ( 1 < m_team_size ) { + KOKKOS_IMPL_CUDA_SYNCWARP ; + } + } + + template< class ValueType > + __device__ void team_broadcast( ValueType & val , const int thread_id ) const + { + if ( 1 < m_team_size ) { + // WarpSize = blockDim.X * blockDim.y + // thread_id < blockDim.y + ValueType tmp( val ); // input might not be register variable + cuda_shfl( val, tmp, blockDim.x * thread_id, WarpSize ); + } + } + #else - __host__ void team_barrier() {} __host__ int team_rank() const { return 0 ; } __host__ int team_size() const { return 0 ; } + __host__ void team_barrier() const {} + template< class ValueType > + __host__ void team_broadcast( ValueType & , const int ) const {} #endif }; @@ -285,6 +317,20 @@ ThreadVectorRange( const Impl::TaskExec< Kokkos::Cuda > & thread return Impl::ThreadVectorRangeBoundariesStruct<iType,Impl::TaskExec< Kokkos::Cuda > >(thread,count); } +KOKKOS_INLINE_FUNCTION +Impl::ThreadSingleStruct<Impl::TaskExec< Kokkos::Cuda > > +PerTeam(const Impl::TaskExec< Kokkos::Cuda >& thread) +{ + return Impl::ThreadSingleStruct<Impl::TaskExec< Kokkos::Cuda > >(thread); +} + +KOKKOS_INLINE_FUNCTION +Impl::VectorSingleStruct<Impl::TaskExec< Kokkos::Cuda > > +PerThread(const Impl::TaskExec< Kokkos::Cuda >& thread) +{ + return Impl::VectorSingleStruct<Impl::TaskExec< Kokkos::Cuda > >(thread); +} + /** \brief Inter-thread parallel_for. Executes lambda(iType i) for each i=0..N-1. * * The range i=0..N-1 is mapped to all threads of the the calling thread team. @@ -302,6 +348,16 @@ void parallel_for } } +template< typename iType, class Lambda > +KOKKOS_INLINE_FUNCTION +void parallel_for + (const Impl::ThreadVectorRangeBoundariesStruct<iType,Impl::TaskExec< Kokkos::Cuda > >& loop_boundaries, + const Lambda & lambda) { + for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { + lambda(i); + } +} + // reduce across corresponding lanes between team members within warp // assume stride*team_size == warp_size template< typename ValueType, class JoinType > @@ -338,7 +394,12 @@ ValueType shfl_warp_broadcast int src_lane, int width) { - return Kokkos::shfl(val, src_lane, width); + if ( 1 < width ) { + return Kokkos::shfl(val, src_lane, width); + } + else { + return val ; + } } /*// all-reduce across corresponding vector lanes between team members within warp @@ -390,12 +451,18 @@ void parallel_reduce } initialized_result = result; - strided_shfl_warp_reduction( - [&] (ValueType& val1, const ValueType& val2) { val1 += val2; }, - initialized_result, - loop_boundaries.thread.team_size(), - blockDim.x); - initialized_result = shfl_warp_broadcast<ValueType>( initialized_result, threadIdx.x, Impl::CudaTraits::WarpSize ); + if ( 1 < loop_boundaries.thread.team_size() ) { + + strided_shfl_warp_reduction( + [&] (ValueType& val1, const ValueType& val2) { val1 += val2; }, + initialized_result, + loop_boundaries.thread.team_size(), + blockDim.x); + + initialized_result = + shfl_warp_broadcast<ValueType>( + initialized_result, threadIdx.x, Impl::CudaTraits::WarpSize ); + } } template< typename iType, class Lambda, typename ReducerType > @@ -414,12 +481,20 @@ void parallel_reduce lambda(i,result); } - strided_shfl_warp_reduction( - [&] (ValueType& val1, const ValueType& val2) { reducer.join(val1,val2); }, - result, - loop_boundaries.thread.team_size(), - blockDim.x); - reducer.reference() = shfl_warp_broadcast<ValueType>( result, threadIdx.x, Impl::CudaTraits::WarpSize ); + if ( 1 < loop_boundaries.thread.team_size() ) { + strided_shfl_warp_reduction( + [&] (ValueType& val1, const ValueType& val2) { reducer.join(val1,val2); }, + result, + loop_boundaries.thread.team_size(), + blockDim.x); + + reducer.reference() = + shfl_warp_broadcast<ValueType>( + result, threadIdx.x, Impl::CudaTraits::WarpSize ); + } + else { + reducer.reference() = result ; + } } // all-reduce within team members within warp // assume vec_length*team_size == warp_size @@ -467,12 +542,16 @@ void parallel_reduce initialized_result = result; - //initialized_result = multi_shfl_warp_reduction( - multi_shfl_warp_reduction( - [&] (ValueType& val1, const ValueType& val2) { val1 += val2; }, - initialized_result, - blockDim.x); - initialized_result = shfl_warp_broadcast<ValueType>( initialized_result, 0, blockDim.x ); + if ( 1 < loop_boundaries.thread.team_size() ) { + //initialized_result = multi_shfl_warp_reduction( + multi_shfl_warp_reduction( + [&] (ValueType& val1, const ValueType& val2) { val1 += val2; }, + initialized_result, + blockDim.x); + + initialized_result = + shfl_warp_broadcast<ValueType>( initialized_result, 0, blockDim.x ); + } } template< typename iType, class Lambda, typename ReducerType > @@ -491,11 +570,18 @@ void parallel_reduce lambda(i,result); } - multi_shfl_warp_reduction( - [&] (ValueType& val1, const ValueType& val2) { reducer.join(val1, val2); }, - result, - blockDim.x); - reducer.reference() = shfl_warp_broadcast<ValueType>( result, 0, blockDim.x ); + if ( 1 < loop_boundaries.thread.team_size() ) { + multi_shfl_warp_reduction( + [&] (ValueType& val1, const ValueType& val2) { reducer.join(val1,val2); }, + result, + blockDim.x); + + reducer.reference() = + shfl_warp_broadcast<ValueType>( result, 0, blockDim.x ); + } + else { + reducer.reference() = result ; + } } // scan across corresponding vector lanes between team members within warp // assume vec_length*team_size == warp_size @@ -517,34 +603,48 @@ void parallel_scan , void , Closure >::value_type ; - value_type accum = 0 ; - value_type val, y, local_total; + if ( 1 < loop_boundaries.thread.team_size() ) { - for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { - val = 0; - closure(i,val,false); + // make sure all threads perform all loop iterations + const iType bound = loop_boundaries.end + loop_boundaries.start ; + const int lane = threadIdx.y * blockDim.x ; - // intra-blockDim.y exclusive scan on 'val' - // accum = accumulated, sum in total for this iteration + value_type accum = 0 ; + value_type val, y, local_total; - // INCLUSIVE scan - for( int offset = blockDim.x ; offset < Impl::CudaTraits::WarpSize ; offset <<= 1 ) { - y = Kokkos::shfl_up(val, offset, Impl::CudaTraits::WarpSize); - if(threadIdx.y*blockDim.x >= offset) { val += y; } - } + for( iType i = loop_boundaries.start; i < bound; i+=loop_boundaries.increment) { + val = 0; + if ( i < loop_boundaries.end ) closure(i,val,false); + + // intra-blockDim.y exclusive scan on 'val' + // accum = accumulated, sum in total for this iteration - // pass accum to all threads - local_total = shfl_warp_broadcast<value_type>(val, - threadIdx.x+Impl::CudaTraits::WarpSize-blockDim.x, - Impl::CudaTraits::WarpSize); + // INCLUSIVE scan + for( int offset = blockDim.x ; offset < Impl::CudaTraits::WarpSize ; offset <<= 1 ) { + y = Kokkos::shfl_up(val, offset, Impl::CudaTraits::WarpSize); + if(lane >= offset) { val += y; } + } - // make EXCLUSIVE scan by shifting values over one - val = Kokkos::shfl_up(val, blockDim.x, Impl::CudaTraits::WarpSize); - if ( threadIdx.y == 0 ) { val = 0 ; } + // pass accum to all threads + local_total = shfl_warp_broadcast<value_type>( + val, + threadIdx.x+Impl::CudaTraits::WarpSize-blockDim.x, + Impl::CudaTraits::WarpSize); - val += accum; - closure(i,val,true); - accum += local_total; + // make EXCLUSIVE scan by shifting values over one + val = Kokkos::shfl_up(val, blockDim.x, Impl::CudaTraits::WarpSize); + if ( threadIdx.y == 0 ) { val = 0 ; } + + val += accum; + if ( i < loop_boundaries.end ) closure(i,val,true); + accum += local_total; + } + } + else { + value_type accum = 0 ; + for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { + closure(i,accum,true); + } } } @@ -568,37 +668,91 @@ void parallel_scan , void , Closure >::value_type ; - value_type accum = 0 ; - value_type val, y, local_total; + if ( 1 < loop_boundaries.thread.team_size() ) { - for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { - val = 0; - closure(i,val,false); + // make sure all threads perform all loop iterations + const iType bound = loop_boundaries.end + loop_boundaries.start ; - // intra-blockDim.x exclusive scan on 'val' - // accum = accumulated, sum in total for this iteration + value_type accum = 0 ; + value_type val, y, local_total; - // INCLUSIVE scan - for( int offset = 1 ; offset < blockDim.x ; offset <<= 1 ) { - y = Kokkos::shfl_up(val, offset, blockDim.x); - if(threadIdx.x >= offset) { val += y; } - } + for( iType i = loop_boundaries.start; i < bound; i+=loop_boundaries.increment) { + val = 0; + if ( i < loop_boundaries.end ) closure(i,val,false); - // pass accum to all threads - local_total = shfl_warp_broadcast<value_type>(val, blockDim.x-1, blockDim.x); + // intra-blockDim.x exclusive scan on 'val' + // accum = accumulated, sum in total for this iteration - // make EXCLUSIVE scan by shifting values over one - val = Kokkos::shfl_up(val, 1, blockDim.x); - if ( threadIdx.x == 0 ) { val = 0 ; } + // INCLUSIVE scan + for( int offset = 1 ; offset < blockDim.x ; offset <<= 1 ) { + y = Kokkos::shfl_up(val, offset, blockDim.x); + if(threadIdx.x >= offset) { val += y; } + } - val += accum; - closure(i,val,true); - accum += local_total; + // pass accum to all threads + local_total = shfl_warp_broadcast<value_type>(val, blockDim.x-1, blockDim.x); + + // make EXCLUSIVE scan by shifting values over one + val = Kokkos::shfl_up(val, 1, blockDim.x); + if ( threadIdx.x == 0 ) { val = 0 ; } + + val += accum; + if ( i < loop_boundaries.end ) closure(i,val,true); + accum += local_total; + } + } + else { + value_type accum = 0 ; + for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { + closure(i,accum,true); + } } } } /* namespace Kokkos */ +namespace Kokkos { + + template<class FunctorType> + KOKKOS_INLINE_FUNCTION + void single(const Impl::VectorSingleStruct<Impl::TaskExec< Kokkos::Cuda > >& , const FunctorType& lambda) { +#ifdef __CUDA_ARCH__ + if(threadIdx.x == 0) lambda(); +#endif + } + + template<class FunctorType> + KOKKOS_INLINE_FUNCTION + void single(const Impl::ThreadSingleStruct<Impl::TaskExec< Kokkos::Cuda > >& , const FunctorType& lambda) { +#ifdef __CUDA_ARCH__ + if(threadIdx.x == 0 && threadIdx.y == 0) lambda(); +#endif + } + + template<class FunctorType, class ValueType> + KOKKOS_INLINE_FUNCTION + void single(const Impl::VectorSingleStruct<Impl::TaskExec< Kokkos::Cuda > >& s , const FunctorType& lambda, ValueType& val) { +#ifdef __CUDA_ARCH__ + if(threadIdx.x == 0) lambda(val); + if ( 1 < s.team_member.team_size() ) { + val = shfl(val,0,blockDim.x); + } +#endif + } + + template<class FunctorType, class ValueType> + KOKKOS_INLINE_FUNCTION + void single(const Impl::ThreadSingleStruct<Impl::TaskExec< Kokkos::Cuda > >& single_struct, const FunctorType& lambda, ValueType& val) { +#ifdef __CUDA_ARCH__ + if(threadIdx.x == 0 && threadIdx.y == 0) { + lambda(val); + } + single_struct.team_member.team_broadcast(val,0); +#endif + } + +} // namespace Kokkos + //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp index 3f3d85ecd1386329b2ab1ae7c98a773ca9a63f50..4fd5e783411f8089b636a69b1c6706d212fcb841 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -352,8 +352,10 @@ public: // Intra vector lane shuffle reduction: typename ReducerType::value_type tmp ( reducer.reference() ); + unsigned mask = blockDim.x==32?0xffffffff:((1<<blockDim.x)-1)<<(threadIdx.y%(32/blockDim.x))*blockDim.x; + for ( int i = blockDim.x ; ( i >>= 1 ) ; ) { - cuda_shfl_down( reducer.reference() , tmp , i , blockDim.x ); + cuda_shfl_down( reducer.reference() , tmp , i , blockDim.x , mask ); if ( (int)threadIdx.x < i ) { reducer.join( tmp , reducer.reference() ); } } @@ -362,7 +364,7 @@ public: // because floating point summation is not associative // and thus different threads could have different results. - cuda_shfl( reducer.reference() , tmp , 0 , blockDim.x ); + cuda_shfl( reducer.reference() , tmp , 0 , blockDim.x , mask ); #endif } @@ -901,6 +903,7 @@ void parallel_scan // 1 <= blockDim.x <= CudaTraits::WarpSize const int mask = blockDim.x - 1 ; + const unsigned active_mask = blockDim.x==32?0xffffffff:((1<<blockDim.x)-1)<<(threadIdx.y%(32/blockDim.x))*blockDim.x; const int rem = loop_boundaries.end & mask ; // == end % blockDim.x const int end = loop_boundaries.end + ( rem ? blockDim.x - rem : 0 ); @@ -923,7 +926,7 @@ void parallel_scan for ( int j = 1 ; j < (int)blockDim.x ; j <<= 1 ) { value_type tmp = 0 ; - Impl::cuda_shfl_up( tmp , sval , j , blockDim.x ); + Impl::cuda_shfl_up(tmp, sval , j , blockDim.x, active_mask ); if ( j <= (int)threadIdx.x ) { sval += tmp ; } } @@ -934,7 +937,7 @@ void parallel_scan if ( i < loop_boundaries.end ) closure( i , val , true ); // Accumulate the last value in the inclusive scan: - Impl::cuda_shfl( sval , sval , mask , blockDim.x ); + Impl::cuda_shfl( sval , sval , mask , blockDim.x, active_mask ); accum += sval ; } @@ -951,6 +954,7 @@ KOKKOS_INLINE_FUNCTION void single(const Impl::VectorSingleStruct<Impl::CudaTeamMember>& , const FunctorType& lambda) { #ifdef __CUDA_ARCH__ if(threadIdx.x == 0) lambda(); + KOKKOS_IMPL_CUDA_SYNCWARP_MASK(blockDim.x==32?0xffffffff:((1<<blockDim.x)-1)<<(threadIdx.y%(32/blockDim.x))*blockDim.x); #endif } @@ -959,6 +963,7 @@ KOKKOS_INLINE_FUNCTION void single(const Impl::ThreadSingleStruct<Impl::CudaTeamMember>& , const FunctorType& lambda) { #ifdef __CUDA_ARCH__ if(threadIdx.x == 0 && threadIdx.y == 0) lambda(); + KOKKOS_IMPL_CUDA_SYNCWARP_MASK(blockDim.x==32?0xffffffff:((1<<blockDim.x)-1)<<(threadIdx.y%(32/blockDim.x))*blockDim.x); #endif } @@ -967,7 +972,8 @@ KOKKOS_INLINE_FUNCTION void single(const Impl::VectorSingleStruct<Impl::CudaTeamMember>& , const FunctorType& lambda, ValueType& val) { #ifdef __CUDA_ARCH__ if(threadIdx.x == 0) lambda(val); - val = shfl(val,0,blockDim.x); + unsigned mask = blockDim.x==32?0xffffffff:((1<<blockDim.x)-1)<<(threadIdx.y%(32/blockDim.x))*blockDim.x; + Impl::cuda_shfl(val,val,0,blockDim.x,mask); #endif } diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp index 1ff4ff354003a8f88e055d8fb5ee776c3e5b9102..82fa4e6b89838e1648f225233842977297f15428 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp index 264f77b3bcc08ab089f24507a54bef9fac6f704d..c41cfc38d8300ec342e305f54b3728075e4d9750 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Version_9_8_Compatibility.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Version_9_8_Compatibility.hpp index b29ba9d8ba5135ae4c2ceccc8c1594e7da672ea5..2954223f98ed3e7d0d978011f5a9e7b8ba2c3339 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Version_9_8_Compatibility.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Version_9_8_Compatibility.hpp @@ -1,12 +1,70 @@ #include<Kokkos_Macros.hpp> +#if defined( __CUDA_ARCH__ ) #if ( CUDA_VERSION < 9000 ) +#define KOKKOS_IMPL_CUDA_SYNCWARP __threadfence_block() +#define KOKKOS_IMPL_CUDA_SYNCWARP_MASK(x) __threadfence_block() #define KOKKOS_IMPL_CUDA_BALLOT(x) __ballot(x) #define KOKKOS_IMPL_CUDA_SHFL(x,y,z) __shfl(x,y,z) +#define KOKKOS_IMPL_CUDA_SHFL_MASK(m,x,y,z) __shfl(x,y,z) #define KOKKOS_IMPL_CUDA_SHFL_UP(x,y,z) __shfl_up(x,y,z) +#define KOKKOS_IMPL_CUDA_SHFL_UP_MASK(m,x,y,z) __shfl_up(x,y,z) #define KOKKOS_IMPL_CUDA_SHFL_DOWN(x,y,z) __shfl_down(x,y,z) +#define KOKKOS_IMPL_CUDA_SHFL_DOWN_MASK(m,x,y,z) __shfl_down(x,y,z) #else +#define KOKKOS_IMPL_CUDA_SYNCWARP __syncwarp(0xffffffff) +#define KOKKOS_IMPL_CUDA_SYNCWARP_MASK(m) __syncwarp(m) #define KOKKOS_IMPL_CUDA_BALLOT(x) __ballot_sync(0xffffffff,x) #define KOKKOS_IMPL_CUDA_SHFL(x,y,z) __shfl_sync(0xffffffff,x,y,z) +#define KOKKOS_IMPL_CUDA_SHFL_MASK(m,x,y,z) __shfl_sync(m,x,y,z) #define KOKKOS_IMPL_CUDA_SHFL_UP(x,y,z) __shfl_up_sync(0xffffffff,x,y,z) +#define KOKKOS_IMPL_CUDA_SHFL_UP_MASK(m,x,y,z) __shfl_up_sync(m,x,y,z) #define KOKKOS_IMPL_CUDA_SHFL_DOWN(x,y,z) __shfl_down_sync(0xffffffff,x,y,z) +#define KOKKOS_IMPL_CUDA_SHFL_DOWN_MASK(m,x,y,z) __shfl_down_sync(m,x,y,z) #endif +#else +#define KOKKOS_IMPL_CUDA_SYNCWARP +#define KOKKOS_IMPL_CUDA_BALLOT(x) 0 +#define KOKKOS_IMPL_CUDA_SHFL(x,y,z) 0 +#define KOKKOS_IMPL_CUDA_SHFL_UP(x,y,z) 0 +#define KOKKOS_IMPL_CUDA_SHFL_DOWN(x,y,z) 0 +#endif + +#if defined( __CUDA_ARCH__ ) +#if ( CUDA_VERSION < 9000 ) +#define KOKKOS_IMPL_CUDA_SYNCWARP_OR_RETURN( MSG ) { \ + const unsigned b = __ballot(1); \ + if ( b != 0xffffffff ) { \ + printf(" SYNCWARP AT %s (%d,%d,%d) (%d,%d,%d) failed %x\n" \ + , MSG \ + , blockIdx.x \ + , blockIdx.y \ + , blockIdx.z \ + , threadIdx.x \ + , threadIdx.y \ + , threadIdx.z \ + , b ); \ + return ; \ + } \ +} +#else +#define KOKKOS_IMPL_CUDA_SYNCWARP_OR_RETURN( MSG ) { \ + __syncwarp(); \ + const unsigned b = __activemask(); \ + if ( b != 0xffffffff ) { \ + printf(" SYNCWARP AT %s (%d,%d,%d) (%d,%d,%d) failed %x\n" \ + , MSG \ + , blockIdx.x \ + , blockIdx.y \ + , blockIdx.z \ + , threadIdx.x \ + , threadIdx.y \ + , threadIdx.z \ + , b ); \ + return ; \ + } \ +} +#endif +#else +#define KOKKOS_IMPL_CUDA_SYNCWARP_OR_RETURN( MSG ) +#endif + diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp index 32ee7d0e594ba3c8f10e0d617e1c1ad4ee9363ad..49b11f3ae0a4a0fcc9b462412ad2b0fa9baf16cf 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -51,7 +51,6 @@ //---------------------------------------------------------------------------- namespace Kokkos { -namespace Experimental { namespace Impl { // Cuda Texture fetches can be performed for 4, 8 and 16 byte objects (int,int2,int4) @@ -214,7 +213,6 @@ struct CudaLDGFetch { #endif } // namespace Impl -} // namespace Experimental } // namespace Kokkos //---------------------------------------------------------------------------- @@ -248,7 +246,7 @@ class ViewDataHandle< Traits , { public: - using track_type = Kokkos::Experimental::Impl::SharedAllocationTracker ; + using track_type = Kokkos::Impl::SharedAllocationTracker ; using value_type = typename Traits::const_value_type ; using return_type = typename Traits::const_value_type ; // NOT a reference @@ -261,9 +259,9 @@ public: >::type ; #if defined( KOKKOS_ENABLE_CUDA_LDG_INTRINSIC ) - using handle_type = Kokkos::Experimental::Impl::CudaLDGFetch< value_type , alias_type > ; + using handle_type = Kokkos::Impl::CudaLDGFetch< value_type , alias_type > ; #else - using handle_type = Kokkos::Experimental::Impl::CudaTextureFetch< value_type , alias_type > ; + using handle_type = Kokkos::Impl::CudaTextureFetch< value_type , alias_type > ; #endif KOKKOS_INLINE_FUNCTION diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp index 9f5ab1b1f2095dbaa15bd40cf035d12e196468de..94e293d7c7b1658bf13358edab19ec536243acf8 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp index df4e3d37f62e6fb36b20334087d1c8dfbf673a7f..9f5415b5119d3091e960d13572495243a20c38ea 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp b/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp index 9486f8d26ad69de761035329c7d5842374479d43..c7f7f7981dd605883347b5d406025820c9413725 100644 --- a/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp +++ b/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -55,6 +55,11 @@ #include <Cuda/KokkosExp_Cuda_IterateTile_Refactor.hpp> #endif +#if defined( __HCC__ ) && defined( KOKKOS_ENABLE_ROCM ) +//#include<ROCm/KokkosExp_ROCm_IterateTile.hpp> +#include <ROCm/KokkosExp_ROCm_IterateTile_Refactor.hpp> +#endif + namespace Kokkos { // ------------------------------------------------------------------ // @@ -195,6 +200,9 @@ struct MDRangePolicy #if defined(KOKKOS_ENABLE_CUDA) && !std::is_same< typename traits::execution_space, Kokkos::Cuda >::value #endif + #if defined(KOKKOS_ENABLE_ROCM) + && !std::is_same< typename traits::execution_space, Kokkos::Experimental::ROCm >::value + #endif ) { index_type span; @@ -207,7 +215,7 @@ struct MDRangePolicy m_tile[i] = 2; } else { - m_tile[i] = span; + m_tile[i] = (span == 0 ? 1 : span); } } m_tile_end[i] = static_cast<index_type>((span + m_tile[i] - 1) / m_tile[i]); @@ -219,7 +227,15 @@ struct MDRangePolicy else // Cuda { index_type span; - for (int i=0; i<rank; ++i) { + int increment = 1; + int rank_start = 0; + int rank_end = rank; + if((int)inner_direction == (int)Right) { + increment = -1; + rank_start = rank-1; + rank_end = -1; + } + for (int i=rank_start; i!=rank_end; i+=increment) { span = m_upper[i] - m_lower[i]; if ( m_tile[i] <= 0 ) { // TODO: determine what is a good default tile size for cuda @@ -227,7 +243,7 @@ struct MDRangePolicy if ( ((int)inner_direction == (int)Right && (i < rank-1)) || ((int)inner_direction == (int)Left && (i > 0)) ) { - if ( m_prod_tile_dims < 512 ) { + if ( m_prod_tile_dims < 256 ) { m_tile[i] = 2; } else { m_tile[i] = 1; @@ -241,7 +257,7 @@ struct MDRangePolicy m_num_tiles *= m_tile_end[i]; m_prod_tile_dims *= m_tile[i]; } - if ( m_prod_tile_dims > 512 ) { // Match Cuda restriction for ParallelReduce; 1024,1024,64 max per dim (Kepler), but product num_threads < 1024 + if ( m_prod_tile_dims > 1024 ) { // Match Cuda restriction for ParallelReduce; 1024,1024,64 max per dim (Kepler), but product num_threads < 1024 printf(" Tile dimensions exceed Cuda limits\n"); Kokkos::abort(" Cuda ExecSpace Error: MDRange tile dims exceed maximum number of threads per block - choose smaller tile dims"); //Kokkos::Impl::throw_runtime_exception( " Cuda ExecSpace Error: MDRange tile dims exceed maximum number of threads per block - choose smaller tile dims"); @@ -275,6 +291,9 @@ struct MDRangePolicy #if defined(KOKKOS_ENABLE_CUDA) && !std::is_same< typename traits::execution_space, Kokkos::Cuda >::value #endif + #if defined(KOKKOS_ENABLE_ROCM) + && !std::is_same< typename traits::execution_space, Kokkos::Experimental::ROCm >::value + #endif ) { index_type span; @@ -287,7 +306,7 @@ struct MDRangePolicy m_tile[i] = 2; } else { - m_tile[i] = span; + m_tile[i] = (span == 0 ? 1 : span); } } m_tile_end[i] = static_cast<index_type>((span + m_tile[i] - 1) / m_tile[i]); @@ -299,7 +318,15 @@ struct MDRangePolicy else // Cuda { index_type span; - for (int i=0; i<rank; ++i) { + int increment = 1; + int rank_start = 0; + int rank_end = rank; + if((int)inner_direction == (int)Right) { + increment = -1; + rank_start = rank-1; + rank_end = -1; + } + for (int i=rank_start; i!=rank_end; i+=increment) { span = m_upper[i] - m_lower[i]; if ( m_tile[i] <= 0 ) { // TODO: determine what is a good default tile size for cuda @@ -307,7 +334,7 @@ struct MDRangePolicy if ( ((int)inner_direction == (int)Right && (i < rank-1)) || ((int)inner_direction == (int)Left && (i > 0)) ) { - if ( m_prod_tile_dims < 512 ) { + if ( m_prod_tile_dims < 256 ) { m_tile[i] = 2; } else { m_tile[i] = 1; @@ -321,13 +348,54 @@ struct MDRangePolicy m_num_tiles *= m_tile_end[i]; m_prod_tile_dims *= m_tile[i]; } - if ( m_prod_tile_dims > 512 ) { // Match Cuda restriction for ParallelReduce; 1024,1024,64 max per dim (Kepler), but product num_threads < 1024 + if ( m_prod_tile_dims > 1024 ) { // Match Cuda restriction for ParallelReduce; 1024,1024,64 max per dim (Kepler), but product num_threads < 1024 printf(" Tile dimensions exceed Cuda limits\n"); Kokkos::abort(" Cuda ExecSpace Error: MDRange tile dims exceed maximum number of threads per block - choose smaller tile dims"); //Kokkos::Impl::throw_runtime_exception( " Cuda ExecSpace Error: MDRange tile dims exceed maximum number of threads per block - choose smaller tile dims"); } } #endif + #if defined(KOKKOS_ENABLE_ROCM) + else // ROCm + { + index_type span; + int increment = 1; + int rank_start = 0; + int rank_end = rank; + if((int)inner_direction == (int)Right) { + increment = -1; + rank_start = rank-1; + rank_end = -1; + } + for (int i=rank_start; i!=rank_end; i+=increment) { + span = m_upper[i] - m_lower[i]; + if ( m_tile[i] <= 0 ) { + // TODO: determine what is a good default tile size for cuda + // may be rank dependent + if ( ((int)inner_direction == (int)Right && (i < rank-1)) + || ((int)inner_direction == (int)Left && (i > 0)) ) + { + if ( m_prod_tile_dims < 256 ) { + m_tile[i] = 2; + } else { + m_tile[i] = 1; + } + } + else { + m_tile[i] = 16; + } + } + m_tile_end[i] = static_cast<index_type>((span + m_tile[i] - 1) / m_tile[i]); + m_num_tiles *= m_tile_end[i]; + m_prod_tile_dims *= m_tile[i]; + } + if ( m_prod_tile_dims > 1024 ) { // Match ROCm restriction for ParallelReduce; 1024,1024,1024 max per dim , but product num_threads < 1024 + printf(" Tile dimensions exceed ROCm limits\n"); + Kokkos::abort(" ROCm ExecSpace Error: MDRange tile dims exceed maximum number of threads per block - choose smaller tile dims"); + //Kokkos::Impl::throw_runtime_exception( " Cuda ExecSpace Error: MDRange tile dims exceed maximum number of threads per block - choose smaller tile dims"); + } + } + #endif } }; @@ -356,6 +424,9 @@ void md_parallel_for( MDRange const& range #if defined( KOKKOS_ENABLE_CUDA) && !std::is_same< typename MDRange::range_policy::execution_space, Kokkos::Cuda>::value #endif + #if defined( KOKKOS_ENABLE_ROCM) + && !std::is_same< typename MDRange::range_policy::execution_space, Kokkos::Experimental::ROCm>::value + #endif ) >::type* = 0 ) { @@ -374,6 +445,9 @@ void md_parallel_for( const std::string& str #if defined( KOKKOS_ENABLE_CUDA) && !std::is_same< typename MDRange::range_policy::execution_space, Kokkos::Cuda>::value #endif + #if defined( KOKKOS_ENABLE_ROCM) + && !std::is_same< typename MDRange::range_policy::execution_space, Kokkos::Experimental::ROCm>::value + #endif ) >::type* = 0 ) { @@ -430,6 +504,9 @@ void md_parallel_reduce( MDRange const& range #if defined( KOKKOS_ENABLE_CUDA) && !std::is_same< typename MDRange::range_policy::execution_space, Kokkos::Cuda>::value #endif + #if defined( KOKKOS_ENABLE_ROCM) + && !std::is_same< typename MDRange::range_policy::execution_space, Kokkos::Experimental::ROCm>::value + #endif ) >::type* = 0 ) { @@ -448,6 +525,9 @@ void md_parallel_reduce( const std::string& str #if defined( KOKKOS_ENABLE_CUDA) && !std::is_same< typename MDRange::range_policy::execution_space, Kokkos::Cuda>::value #endif + #if defined( KOKKOS_ENABLE_ROCM) + && !std::is_same< typename MDRange::range_policy::execution_space, Kokkos::Experimental::ROCm>::value + #endif ) >::type* = 0 ) { diff --git a/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp b/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c34515899663a3ff009b3ca23f4ece0ed4e03441 --- /dev/null +++ b/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp @@ -0,0 +1,127 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_ANONYMOUSSPACE_HPP +#define KOKKOS_ANONYMOUSSPACE_HPP + +#include <Kokkos_Core_fwd.hpp> +#include <Kokkos_Concepts.hpp> +#include <cstddef> + +/*--------------------------------------------------------------------------*/ + +namespace Kokkos { + +class AnonymousSpace { +public: + //! Tag this class as a kokkos memory space + typedef AnonymousSpace memory_space; + typedef Kokkos::DefaultExecutionSpace execution_space; + typedef size_t size_type; + + //! This memory space preferred device_type + typedef Kokkos::Device< execution_space, memory_space > device_type; + + /**\brief Default memory space instance */ + AnonymousSpace() = default; + AnonymousSpace( AnonymousSpace && rhs ) = default; + AnonymousSpace( const AnonymousSpace & rhs ) = default; + AnonymousSpace & operator = ( AnonymousSpace && ) = default; + AnonymousSpace & operator = ( const AnonymousSpace & ) = default; + ~AnonymousSpace() = default; + + /**\brief Return Name of the MemorySpace */ + static constexpr const char* name() { return "Anonymous"; } +}; + +} // namespace Kokkos + +//---------------------------------------------------------------------------- + +namespace Kokkos { + +namespace Impl { + +template<typename OtherSpace> +struct MemorySpaceAccess< Kokkos::AnonymousSpace , OtherSpace > { + enum { assignable = true }; + enum { accessible = true }; + enum { deepcopy = true }; +}; + +template<typename OtherSpace> +struct MemorySpaceAccess< OtherSpace, Kokkos::AnonymousSpace > { + enum { assignable = true }; + enum { accessible = true }; + enum { deepcopy = true }; +}; + +template<> +struct MemorySpaceAccess< Kokkos::AnonymousSpace, Kokkos::AnonymousSpace > { + enum { assignable = true }; + enum { accessible = true }; + enum { deepcopy = true }; +}; + +template<typename OtherSpace> +struct VerifyExecutionCanAccessMemorySpace<OtherSpace, Kokkos::AnonymousSpace> +{ + enum {value = 1}; + KOKKOS_INLINE_FUNCTION static void verify(void) {} + KOKKOS_INLINE_FUNCTION static void verify(const void *) {} +}; + +template<typename OtherSpace> +struct VerifyExecutionCanAccessMemorySpace<Kokkos::AnonymousSpace, OtherSpace> +{ + enum {value = 1}; + KOKKOS_INLINE_FUNCTION static void verify(void) {} + KOKKOS_INLINE_FUNCTION static void verify(const void *) {} +}; + +} // namespace Impl + +} // namespace Kokkos + +#endif // #define KOKKOS_ANONYMOUSSPACE_HPP + diff --git a/lib/kokkos/core/src/Kokkos_Array.hpp b/lib/kokkos/core/src/Kokkos_Array.hpp index 43e6386b54fce21c1053103aa82e540e1b69e6ce..2708c4ffdb765982757d3c83eefc3528cc09f0ac 100644 --- a/lib/kokkos/core/src/Kokkos_Array.hpp +++ b/lib/kokkos/core/src/Kokkos_Array.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_Atomic.hpp b/lib/kokkos/core/src/Kokkos_Atomic.hpp index 54a97a16c1338187e18b54d176d9241f8ba8253c..b9f26ce228f01a3361f19be3698ac81440a13d39 100644 --- a/lib/kokkos/core/src/Kokkos_Atomic.hpp +++ b/lib/kokkos/core/src/Kokkos_Atomic.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -89,13 +89,18 @@ #if ! defined( KOKKOS_ENABLE_GNU_ATOMICS ) && \ ! defined( KOKKOS_ENABLE_INTEL_ATOMICS ) && \ - ! defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) + ! defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) && \ + ! defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) // Compiling for non-Cuda atomic implementation has not been pre-selected. // Choose the best implementation for the detected compiler. // Preference: GCC, INTEL, OMP31 -#if defined( KOKKOS_COMPILER_GNU ) || \ +#if defined( KOKKOS_INTERNAL_NOT_PARALLEL ) + +#define KOKKOS_ENABLE_SERIAL_ATOMICS + +#elif defined( KOKKOS_COMPILER_GNU ) || \ defined( KOKKOS_COMPILER_CLANG ) || \ ( defined ( KOKKOS_COMPILER_NVCC ) ) @@ -154,6 +159,10 @@ const char * atomic_query_version() return "KOKKOS_ENABLE_OPENMP_ATOMICS" ; #elif defined( KOKKOS_ENABLE_WINDOWS_ATOMICS ) return "KOKKOS_ENABLE_WINDOWS_ATOMICS"; +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + return "KOKKOS_ENABLE_SERIAL_ATOMICS"; +#else +#error "No valid response for atomic_query_version!" #endif } diff --git a/lib/kokkos/core/src/Kokkos_Complex.hpp b/lib/kokkos/core/src/Kokkos_Complex.hpp index f8355f0d069f6399db0fc78e59f68d10e9e183ed..7ca85a304170174ce950b58894b36e749202f4e6 100644 --- a/lib/kokkos/core/src/Kokkos_Complex.hpp +++ b/lib/kokkos/core/src/Kokkos_Complex.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -104,7 +104,7 @@ public: /// imaginary part to zero. template<class InputRealType> KOKKOS_INLINE_FUNCTION complex (const InputRealType& val) : - re_ (val), im_ (0.0) + re_ (val), im_ (static_cast<InputRealType>(0.0)) {} // BUG HCC WORKAROUND diff --git a/lib/kokkos/core/src/Kokkos_Concepts.hpp b/lib/kokkos/core/src/Kokkos_Concepts.hpp index f9366a95945d67a29f7019a1c519f1c45f78bc34..2e2507b27d557ea758c5df7b16716aa518f2bf09 100644 --- a/lib/kokkos/core/src/Kokkos_Concepts.hpp +++ b/lib/kokkos/core/src/Kokkos_Concepts.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_CopyViews.hpp b/lib/kokkos/core/src/Kokkos_CopyViews.hpp new file mode 100644 index 0000000000000000000000000000000000000000..23789eb85c5d34347761869b90f6df72d9269f9d --- /dev/null +++ b/lib/kokkos/core/src/Kokkos_CopyViews.hpp @@ -0,0 +1,1720 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_COPYVIEWS_HPP_ +#define KOKKOS_COPYVIEWS_HPP_ +#include <string> + +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + +namespace Kokkos { + +namespace Impl { + +template<class Layout> +struct ViewFillLayoutSelector { +}; + +template<> +struct ViewFillLayoutSelector<Kokkos::LayoutLeft> { + static const Kokkos::Iterate iterate = Kokkos::Iterate::Left; +}; + +template<> +struct ViewFillLayoutSelector<Kokkos::LayoutRight> { + static const Kokkos::Iterate iterate = Kokkos::Iterate::Right; +}; + +template<class ViewType,class Layout, class ExecSpace,typename iType> +struct ViewFill<ViewType,Layout,ExecSpace,0,iType> { + + typedef typename ViewType::non_const_value_type ST; + + ViewFill(const ViewType& a, const ST& val) { + Kokkos::Impl::DeepCopy< typename ViewType::memory_space, Kokkos::HostSpace >( a.data() , &val, sizeof(ST) ); + } +}; + + +template<class ViewType,class Layout, class ExecSpace,typename iType> +struct ViewFill<ViewType,Layout,ExecSpace,1,iType> { + ViewType a; + typename ViewType::const_value_type val; + typedef Kokkos::RangePolicy<ExecSpace,Kokkos::IndexType<iType>> policy_type; + + ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_):a(a_),val(val_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewFill-1D",policy_type(0,a.extent(0)),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i) const { + a(i) = val; + }; +}; + +template<class ViewType,class Layout, class ExecSpace,typename iType> +struct ViewFill<ViewType,Layout,ExecSpace,2,iType> { + ViewType a; + typename ViewType::const_value_type val; + + typedef Kokkos::Rank<2,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_):a(a_),val(val_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewFill-2D", + policy_type({0,0},{a.extent(0),a.extent(1)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1) const { + a(i0,i1) = val; + }; +}; + +template<class ViewType,class Layout, class ExecSpace,typename iType> +struct ViewFill<ViewType,Layout,ExecSpace,3,iType> { + ViewType a; + typename ViewType::const_value_type val; + + typedef Kokkos::Rank<3,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_):a(a_),val(val_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewFill-3D", + policy_type({0,0,0},{a.extent(0),a.extent(1),a.extent(2)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i2) const { + a(i0,i1,i2) = val; + }; +}; + +template<class ViewType,class Layout, class ExecSpace,typename iType> +struct ViewFill<ViewType,Layout,ExecSpace,4,iType> { + ViewType a; + typename ViewType::const_value_type val; + + typedef Kokkos::Rank<4,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_):a(a_),val(val_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewFill-4D", + policy_type({0,0,0,0},{a.extent(0),a.extent(1),a.extent(2),a.extent(3)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i2, const iType& i3) const { + a(i0,i1,i2,i3) = val; + }; +}; + +template<class ViewType,class Layout, class ExecSpace,typename iType> +struct ViewFill<ViewType,Layout,ExecSpace,5,iType> { + ViewType a; + typename ViewType::const_value_type val; + + typedef Kokkos::Rank<5,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_):a(a_),val(val_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewFill-5D", + policy_type({0,0,0,0,0},{a.extent(0),a.extent(1),a.extent(2),a.extent(3),a.extent(4)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i2, const iType& i3, const iType& i4) const { + a(i0,i1,i2,i3,i4) = val; + }; +}; + +template<class ViewType,class Layout, class ExecSpace,typename iType> +struct ViewFill<ViewType,Layout,ExecSpace,6,iType> { + ViewType a; + typename ViewType::const_value_type val; + + typedef Kokkos::Rank<6,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_):a(a_),val(val_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewFill-6D", + policy_type({0,0,0,0,0,0},{a.extent(0),a.extent(1),a.extent(2),a.extent(3),a.extent(4),a.extent(5)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i2, const iType& i3, const iType& i4, const iType& i5) const { + a(i0,i1,i2,i3,i4,i5) = val; + }; +}; + +template<class ViewType,class Layout, class ExecSpace,typename iType> +struct ViewFill<ViewType,Layout,ExecSpace,7,iType> { + ViewType a; + typename ViewType::const_value_type val; + + typedef Kokkos::Rank<6,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_):a(a_),val(val_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewFill-7D", + policy_type({0,0,0,0,0,0},{a.extent(0),a.extent(1),a.extent(2),a.extent(3), + a.extent(5),a.extent(6)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i3, + const iType& i4, const iType& i5, const iType& i6) const { + for(iType i2=0; i2<iType(a.extent(2));i2++) + a(i0,i1,i2,i3,i4,i5,i6) = val; + }; +}; + +template<class ViewType,class Layout, class ExecSpace,typename iType> +struct ViewFill<ViewType,Layout,ExecSpace,8,iType> { + ViewType a; + typename ViewType::const_value_type val; + + typedef Kokkos::Rank<6,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_):a(a_),val(val_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewFill-8D", + policy_type({0,0,0,0,0,0},{a.extent(0),a.extent(1),a.extent(3), + a.extent(5),a.extent(6),a.extent(7)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i3, + const iType& i5, const iType& i6, const iType& i7) const { + for(iType i2=0; i2<iType(a.extent(2));i2++) + for(iType i4=0; i4<iType(a.extent(4));i4++) + a(i0,i1,i2,i3,i4,i5,i6,i7) = val; + }; +}; + +template<class ViewTypeA,class ViewTypeB, class Layout, class ExecSpace,typename iType> +struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,1,iType> { + ViewTypeA a; + ViewTypeB b; + + typedef Kokkos::RangePolicy<ExecSpace,Kokkos::IndexType<iType>> policy_type; + + ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewCopy-2D", + policy_type(0,a.extent(0)),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0) const { + a(i0) = b(i0); + }; +}; + +template<class ViewTypeA,class ViewTypeB, class Layout, class ExecSpace,typename iType> +struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,2,iType> { + ViewTypeA a; + ViewTypeB b; + + typedef Kokkos::Rank<2,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewCopy-2D", + policy_type({0,0},{a.extent(0),a.extent(1)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1) const { + a(i0,i1) = b(i0,i1); + }; +}; + +template<class ViewTypeA,class ViewTypeB, class Layout, class ExecSpace,typename iType> +struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,3,iType> { + ViewTypeA a; + ViewTypeB b; + + typedef Kokkos::Rank<3,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewCopy-3D", + policy_type({0,0,0},{a.extent(0),a.extent(1),a.extent(2)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i2) const { + a(i0,i1,i2) = b(i0,i1,i2); + }; +}; + +template<class ViewTypeA,class ViewTypeB, class Layout, class ExecSpace,typename iType> +struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,4,iType> { + ViewTypeA a; + ViewTypeB b; + + typedef Kokkos::Rank<4,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewCopy-4D", + policy_type({0,0,0,0},{a.extent(0),a.extent(1),a.extent(2), + a.extent(3)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i2, + const iType& i3) const { + a(i0,i1,i2,i3) = b(i0,i1,i2,i3); + }; +}; + +template<class ViewTypeA,class ViewTypeB, class Layout, class ExecSpace,typename iType> +struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,5,iType> { + ViewTypeA a; + ViewTypeB b; + + typedef Kokkos::Rank<5,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewCopy-5D", + policy_type({0,0,0,0,0},{a.extent(0),a.extent(1),a.extent(2), + a.extent(3),a.extent(4)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i2, + const iType& i3, const iType& i4) const { + a(i0,i1,i2,i3,i4) = b(i0,i1,i2,i3,i4); + }; +}; + +template<class ViewTypeA,class ViewTypeB, class Layout, class ExecSpace,typename iType> +struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,6,iType> { + ViewTypeA a; + ViewTypeB b; + + typedef Kokkos::Rank<6,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewCopy-6D", + policy_type({0,0,0,0,0,0},{a.extent(0),a.extent(1),a.extent(2), + a.extent(3),a.extent(4),a.extent(5)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i2, + const iType& i3, const iType& i4, const iType& i5) const { + a(i0,i1,i2,i3,i4,i5) = b(i0,i1,i2,i3,i4,i5); + }; +}; + + +template<class ViewTypeA, class ViewTypeB, class Layout, class ExecSpace,typename iType> +struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,7,iType> { + ViewTypeA a; + ViewTypeB b; + + typedef Kokkos::Rank<6,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewCopy-7D", + policy_type({0,0,0,0,0,0},{a.extent(0),a.extent(1),a.extent(3), + a.extent(4),a.extent(5),a.extent(6)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i3, + const iType& i4, const iType& i5, const iType& i6) const { + for(iType i2=0; i2<iType(a.extent(2));i2++) + a(i0,i1,i2,i3,i4,i5,i6) = b(i0,i1,i2,i3,i4,i5,i6); + }; +}; + +template<class ViewTypeA,class ViewTypeB, class Layout, class ExecSpace,typename iType> +struct ViewCopy<ViewTypeA,ViewTypeB,Layout,ExecSpace,8,iType> { + ViewTypeA a; + ViewTypeB b; + + typedef Kokkos::Rank<6,ViewFillLayoutSelector<Layout>::iterate,ViewFillLayoutSelector<Layout>::iterate> iterate_type; + typedef Kokkos::MDRangePolicy<ExecSpace,iterate_type,Kokkos::IndexType<iType>> policy_type; + + ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_):a(a_),b(b_) { + ExecSpace::fence(); + Kokkos::parallel_for("Kokkos::ViewCopy-8D", + policy_type({0,0,0,0,0,0},{a.extent(0),a.extent(1),a.extent(3), + a.extent(5),a.extent(6),a.extent(7)}),*this); + ExecSpace::fence(); + } + + KOKKOS_INLINE_FUNCTION + void operator() (const iType& i0, const iType& i1, const iType& i3, + const iType& i5, const iType& i6, const iType& i7) const { + for(iType i2=0; i2<iType(a.extent(2));i2++) + for(iType i4=0; i4<iType(a.extent(4));i4++) + a(i0,i1,i2,i3,i4,i5,i6,i7) = b(i0,i1,i2,i3,i4,i5,i6,i7); + }; +}; + + +template<class DstType, class SrcType> +void view_copy(const DstType& dst, const SrcType& src) { + typedef typename DstType::execution_space dst_execution_space; + typedef typename SrcType::execution_space src_execution_space; + typedef typename DstType::memory_space dst_memory_space; + typedef typename SrcType::memory_space src_memory_space; + + enum { DstExecCanAccessSrc = + Kokkos::Impl::SpaceAccessibility< dst_execution_space , src_memory_space >::accessible }; + + enum { SrcExecCanAccessDst = + Kokkos::Impl::SpaceAccessibility< src_execution_space , dst_memory_space >::accessible }; + + if( ! DstExecCanAccessSrc && ! SrcExecCanAccessDst) { + std::string message("Error: Kokkos::deep_copy with no available copy mechanism: "); + message += src.label(); message += " to "; + message += dst.label(); + Kokkos::Impl::throw_runtime_exception(message); + } + + // Figure out iteration order in case we need it + int64_t strides[DstType::Rank+1]; + dst.stride(strides); + Kokkos::Iterate iterate; + if ( std::is_same<typename DstType::array_layout,Kokkos::LayoutRight>::value ) { + iterate = Kokkos::Iterate::Right; + } else if ( std::is_same<typename DstType::array_layout,Kokkos::LayoutLeft>::value ) { + iterate = Kokkos::Iterate::Left; + } else if ( std::is_same<typename DstType::array_layout,Kokkos::LayoutStride>::value ) { + if( strides[0] > strides[DstType::Rank-1] ) + iterate = Kokkos::Iterate::Right; + else + iterate = Kokkos::Iterate::Left; + } else { + if( std::is_same<typename DstType::execution_space::array_layout, Kokkos::LayoutRight>::value ) + iterate = Kokkos::Iterate::Right; + else + iterate = Kokkos::Iterate::Left; + } + + if( (dst.span() >= size_t(std::numeric_limits<int>::max())) || + (src.span() >= size_t(std::numeric_limits<int>::max())) ){ + if(DstExecCanAccessSrc) { + if(iterate == Kokkos::Iterate::Right) + Kokkos::Impl::ViewCopy< DstType, SrcType, Kokkos::LayoutRight, dst_execution_space, + DstType::Rank, int64_t >( dst , src ); + else + Kokkos::Impl::ViewCopy< DstType, SrcType, Kokkos::LayoutLeft, dst_execution_space, + DstType::Rank, int64_t >( dst , src ); + } else { + if(iterate == Kokkos::Iterate::Right) + Kokkos::Impl::ViewCopy< DstType, SrcType, Kokkos::LayoutRight, src_execution_space, + DstType::Rank, int64_t >( dst , src ); + else + Kokkos::Impl::ViewCopy< DstType, SrcType, Kokkos::LayoutLeft, src_execution_space, + DstType::Rank, int64_t >( dst , src ); + } + } else { + if(DstExecCanAccessSrc) { + if(iterate == Kokkos::Iterate::Right) + Kokkos::Impl::ViewCopy< DstType, SrcType, Kokkos::LayoutRight, dst_execution_space, + DstType::Rank, int >( dst , src ); + else + Kokkos::Impl::ViewCopy< DstType, SrcType, Kokkos::LayoutLeft, dst_execution_space, + DstType::Rank, int >( dst , src ); + } else { + if(iterate == Kokkos::Iterate::Right) + Kokkos::Impl::ViewCopy< DstType, SrcType, Kokkos::LayoutRight, src_execution_space, + DstType::Rank, int >( dst , src ); + else + Kokkos::Impl::ViewCopy< DstType, SrcType, Kokkos::LayoutLeft, src_execution_space, + DstType::Rank, int >( dst , src ); + } + + } +} + +template<class DstType, class SrcType, int Rank, class ... Args> +struct CommonSubview; + +template<class DstType, class SrcType, class Arg0, class ... Args> +struct CommonSubview<DstType,SrcType,1,Arg0,Args...> { + typedef typename Kokkos::Subview<DstType,Arg0> dst_subview_type; + typedef typename Kokkos::Subview<SrcType,Arg0> src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, Args... ): + dst_sub(dst,arg0),src_sub(src,arg0) {} +}; + +template<class DstType, class SrcType, class Arg0, class Arg1, class ... Args> +struct CommonSubview<DstType,SrcType,2,Arg0,Arg1,Args...> { + typedef typename Kokkos::Subview<DstType,Arg0,Arg1> dst_subview_type; + typedef typename Kokkos::Subview<SrcType,Arg0,Arg1> src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, const Arg1& arg1, Args... ): + dst_sub(dst,arg0,arg1),src_sub(src,arg0,arg1) {} +}; + +template<class DstType, class SrcType, class Arg0, class Arg1, class Arg2, class ... Args> +struct CommonSubview<DstType,SrcType,3,Arg0,Arg1,Arg2,Args...> { + typedef typename Kokkos::Subview<DstType,Arg0,Arg1,Arg2> dst_subview_type; + typedef typename Kokkos::Subview<SrcType,Arg0,Arg1,Arg2> src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, const Arg1& arg1, + const Arg2& arg2, Args... ): + dst_sub(dst,arg0,arg1,arg2),src_sub(src,arg0,arg1,arg2) {} +}; + +template<class DstType, class SrcType, class Arg0, class Arg1, class Arg2, class Arg3, + class ... Args> +struct CommonSubview<DstType,SrcType,4,Arg0,Arg1,Arg2,Arg3,Args...> { + typedef typename Kokkos::Subview<DstType,Arg0,Arg1,Arg2,Arg3> dst_subview_type; + typedef typename Kokkos::Subview<SrcType,Arg0,Arg1,Arg2,Arg3> src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3, + const Args ...): + dst_sub(dst,arg0,arg1,arg2,arg3),src_sub(src,arg0,arg1,arg2,arg3) {} +}; + +template<class DstType, class SrcType, class Arg0, class Arg1, class Arg2, class Arg3, + class Arg4, class ... Args> +struct CommonSubview<DstType,SrcType,5,Arg0,Arg1,Arg2,Arg3,Arg4,Args...> { + typedef typename Kokkos::Subview<DstType,Arg0,Arg1,Arg2,Arg3,Arg4> dst_subview_type; + typedef typename Kokkos::Subview<SrcType,Arg0,Arg1,Arg2,Arg3,Arg4> src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, + const Args ...): + dst_sub(dst,arg0,arg1,arg2,arg3,arg4),src_sub(src,arg0,arg1,arg2,arg3,arg4) {} +}; + +template<class DstType, class SrcType, class Arg0, class Arg1, class Arg2, class Arg3, + class Arg4, class Arg5, class ... Args> +struct CommonSubview<DstType,SrcType,6,Arg0,Arg1,Arg2,Arg3,Arg4,Arg5,Args...> { + typedef typename Kokkos::Subview<DstType,Arg0,Arg1,Arg2,Arg3,Arg4,Arg5> dst_subview_type; + typedef typename Kokkos::Subview<SrcType,Arg0,Arg1,Arg2,Arg3,Arg4,Arg5> src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5, + const Args ...): + dst_sub(dst,arg0,arg1,arg2,arg3,arg4,arg5),src_sub(src,arg0,arg1,arg2,arg3,arg4,arg5) {} +}; + +template<class DstType, class SrcType, class Arg0, class Arg1, class Arg2, class Arg3, + class Arg4, class Arg5, class Arg6, class ...Args> +struct CommonSubview<DstType,SrcType,7,Arg0,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Args...> { + typedef typename Kokkos::Subview<DstType,Arg0,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6> dst_subview_type; + typedef typename Kokkos::Subview<SrcType,Arg0,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6> src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5, + const Arg6& arg6, Args...): + dst_sub(dst,arg0,arg1,arg2,arg3,arg4,arg5,arg6),src_sub(src,arg0,arg1,arg2,arg3,arg4,arg5,arg6) {} +}; + +template<class DstType, class SrcType, class Arg0, class Arg1, class Arg2, class Arg3, + class Arg4, class Arg5, class Arg6, class Arg7> +struct CommonSubview<DstType,SrcType,8,Arg0,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7> { + typedef typename Kokkos::Subview<DstType,Arg0,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7> dst_subview_type; + typedef typename Kokkos::Subview<SrcType,Arg0,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7> src_subview_type; + dst_subview_type dst_sub; + src_subview_type src_sub; + CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, const Arg1& arg1, + const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5, + const Arg6& arg6, const Arg7& arg7): + dst_sub(dst,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7),src_sub(src,arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7) {} +}; + + +template<class DstType, class SrcType, class ExecSpace = typename DstType::execution_space, int Rank = DstType::Rank> +struct ViewRemap; + +template<class DstType, class SrcType, class ExecSpace> +struct ViewRemap<DstType,SrcType,ExecSpace,1> { + typedef Kokkos::pair<int64_t,int64_t> p_type; + + ViewRemap(const DstType& dst, const SrcType& src) { + if(dst.extent(0) == src.extent(0)) { + view_copy(dst,src); + } else { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + typedef CommonSubview<DstType,SrcType,1,p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } +}; + +template<class DstType, class SrcType, class ExecSpace> +struct ViewRemap<DstType,SrcType,ExecSpace,2> { + typedef Kokkos::pair<int64_t,int64_t> p_type; + + ViewRemap(const DstType& dst, const SrcType& src) { + if(dst.extent(0) == src.extent(0)) { + if(dst.extent(1) == src.extent(1)) { + view_copy(dst,src); + } else { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + typedef CommonSubview<DstType,SrcType,2,Kokkos::Impl::ALL_t,p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL,ext1); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } else { + if(dst.extent(1) == src.extent(1)) { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + typedef CommonSubview<DstType,SrcType,2,p_type,Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0,Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + typedef CommonSubview<DstType,SrcType,2,p_type,p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0,ext1); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } + } +}; + +template<class DstType, class SrcType, class ExecSpace> +struct ViewRemap<DstType,SrcType,ExecSpace,3> { + typedef Kokkos::pair<int64_t,int64_t> p_type; + + ViewRemap(const DstType& dst, const SrcType& src) { + if(dst.extent(0) == src.extent(0)) { + if(dst.extent(2) == src.extent(2)) { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + typedef CommonSubview<DstType,SrcType,3,Kokkos::Impl::ALL_t,p_type,Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL,ext1,Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + typedef CommonSubview<DstType,SrcType,3,Kokkos::Impl::ALL_t,p_type,p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL,ext1,ext2); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } else { + if(dst.extent(2) == src.extent(2)) { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + typedef CommonSubview<DstType,SrcType,3,p_type,p_type,Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0,ext1,Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + typedef CommonSubview<DstType,SrcType,3,p_type,p_type,p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0,ext1,ext2); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } + } +}; + +template<class DstType, class SrcType, class ExecSpace> +struct ViewRemap<DstType,SrcType,ExecSpace,4> { + typedef Kokkos::pair<int64_t,int64_t> p_type; + + ViewRemap(const DstType& dst, const SrcType& src) { + if(dst.extent(0) == src.extent(0)) { + if(dst.extent(3) == src.extent(3)) { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + typedef CommonSubview<DstType,SrcType,4,Kokkos::Impl::ALL_t, + p_type,p_type, + Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL, + ext1,ext2, + Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + typedef CommonSubview<DstType,SrcType,4,Kokkos::Impl::ALL_t, + p_type,p_type, + p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL, + ext1,ext2, + ext3); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } else { + if(dst.extent(7) == src.extent(7)) { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + typedef CommonSubview<DstType,SrcType,4,p_type, + p_type,p_type, + Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0, + ext1,ext2, + Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + typedef CommonSubview<DstType,SrcType,4,p_type, + p_type,p_type, + p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0, + ext1,ext2, + ext3); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } + } +}; + +template<class DstType, class SrcType, class ExecSpace> +struct ViewRemap<DstType,SrcType,ExecSpace,5> { + typedef Kokkos::pair<int64_t,int64_t> p_type; + + ViewRemap(const DstType& dst, const SrcType& src) { + if(dst.extent(0) == src.extent(0)) { + if(dst.extent(4) == src.extent(4)) { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + typedef CommonSubview<DstType,SrcType,5,Kokkos::Impl::ALL_t, + p_type,p_type,p_type, + Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL, + ext1,ext2,ext3, + Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + typedef CommonSubview<DstType,SrcType,5,Kokkos::Impl::ALL_t, + p_type,p_type,p_type, + p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL, + ext1,ext2,ext3, + ext4); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } else { + if(dst.extent(4) == src.extent(4)) { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + typedef CommonSubview<DstType,SrcType,5,p_type, + p_type,p_type,p_type, + Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0, + ext1,ext2,ext3, + Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + typedef CommonSubview<DstType,SrcType,5,p_type, + p_type,p_type,p_type, + p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0, + ext1,ext2,ext3, + ext4); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } + } +}; +template<class DstType, class SrcType, class ExecSpace> +struct ViewRemap<DstType,SrcType,ExecSpace,6> { + typedef Kokkos::pair<int64_t,int64_t> p_type; + + ViewRemap(const DstType& dst, const SrcType& src) { + if(dst.extent(0) == src.extent(0)) { + if(dst.extent(5) == src.extent(5)) { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + typedef CommonSubview<DstType,SrcType,6,Kokkos::Impl::ALL_t, + p_type,p_type,p_type,p_type, + Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL, + ext1,ext2,ext3,ext4, + Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + p_type ext5(0,std::min(dst.extent(5),src.extent(5))); + typedef CommonSubview<DstType,SrcType,6,Kokkos::Impl::ALL_t, + p_type,p_type,p_type,p_type, + p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL, + ext1,ext2,ext3,ext4, + ext5); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } else { + if(dst.extent(5) == src.extent(5)) { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + + typedef CommonSubview<DstType,SrcType,6,p_type, + p_type,p_type,p_type,p_type, + Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0, + ext1,ext2,ext3,ext4, + Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + p_type ext5(0,std::min(dst.extent(5),src.extent(5))); + + typedef CommonSubview<DstType,SrcType,6,p_type, + p_type,p_type,p_type,p_type, + p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0, + ext1,ext2,ext3,ext4, + ext5); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } + } +}; + +template<class DstType, class SrcType, class ExecSpace> +struct ViewRemap<DstType,SrcType,ExecSpace,7> { + typedef Kokkos::pair<int64_t,int64_t> p_type; + + ViewRemap(const DstType& dst, const SrcType& src) { + if(dst.extent(0) == src.extent(0)) { + if(dst.extent(6) == src.extent(6)) { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + p_type ext5(0,std::min(dst.extent(5),src.extent(5))); + typedef CommonSubview<DstType,SrcType,7,Kokkos::Impl::ALL_t, + p_type,p_type,p_type,p_type,p_type, + Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL, + ext1,ext2,ext3,ext4,ext5, + Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + p_type ext5(0,std::min(dst.extent(5),src.extent(5))); + p_type ext6(0,std::min(dst.extent(6),src.extent(6))); + typedef CommonSubview<DstType,SrcType,7,Kokkos::Impl::ALL_t, + p_type,p_type,p_type,p_type,p_type, + p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL, + ext1,ext2,ext3,ext4,ext5, + ext6); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } else { + if(dst.extent(6) == src.extent(6)) { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + p_type ext5(0,std::min(dst.extent(5),src.extent(5))); + typedef CommonSubview<DstType,SrcType,7,p_type, + p_type,p_type,p_type,p_type,p_type, + Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0, + ext1,ext2,ext3,ext4,ext5, + Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + p_type ext5(0,std::min(dst.extent(5),src.extent(5))); + p_type ext6(0,std::min(dst.extent(6),src.extent(6))); + typedef CommonSubview<DstType,SrcType,7,p_type, + p_type,p_type,p_type,p_type,p_type, + p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0, + ext1,ext2,ext3,ext4,ext5, + ext6); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } + } +}; + +template<class DstType, class SrcType, class ExecSpace> +struct ViewRemap<DstType,SrcType,ExecSpace,8> { + typedef Kokkos::pair<int64_t,int64_t> p_type; + + ViewRemap(const DstType& dst, const SrcType& src) { + if(dst.extent(0) == src.extent(0)) { + if(dst.extent(7) == src.extent(7)) { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + p_type ext5(0,std::min(dst.extent(5),src.extent(5))); + p_type ext6(0,std::min(dst.extent(6),src.extent(6))); + typedef CommonSubview<DstType,SrcType,8,Kokkos::Impl::ALL_t, + p_type,p_type,p_type,p_type,p_type,p_type, + Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL, + ext1,ext2,ext3,ext4,ext5,ext6, + Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + p_type ext5(0,std::min(dst.extent(5),src.extent(5))); + p_type ext6(0,std::min(dst.extent(6),src.extent(6))); + p_type ext7(0,std::min(dst.extent(7),src.extent(7))); + typedef CommonSubview<DstType,SrcType,8,Kokkos::Impl::ALL_t, + p_type,p_type,p_type,p_type,p_type,p_type, + p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,Kokkos::ALL, + ext1,ext2,ext3,ext4,ext5,ext6, + ext7); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } else { + if(dst.extent(7) == src.extent(7)) { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + p_type ext5(0,std::min(dst.extent(5),src.extent(5))); + p_type ext6(0,std::min(dst.extent(6),src.extent(6))); + typedef CommonSubview<DstType,SrcType,8,p_type, + p_type,p_type,p_type,p_type,p_type,p_type, + Kokkos::Impl::ALL_t> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0, + ext1,ext2,ext3,ext4,ext5,ext6, + Kokkos::ALL); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } else { + p_type ext0(0,std::min(dst.extent(0),src.extent(0))); + p_type ext1(0,std::min(dst.extent(1),src.extent(1))); + p_type ext2(0,std::min(dst.extent(2),src.extent(2))); + p_type ext3(0,std::min(dst.extent(3),src.extent(3))); + p_type ext4(0,std::min(dst.extent(4),src.extent(4))); + p_type ext5(0,std::min(dst.extent(5),src.extent(5))); + p_type ext6(0,std::min(dst.extent(6),src.extent(6))); + p_type ext7(0,std::min(dst.extent(7),src.extent(7))); + typedef CommonSubview<DstType,SrcType,8,p_type, + p_type,p_type,p_type,p_type,p_type,p_type, + p_type> sv_adapter_type; + sv_adapter_type common_subview(dst,src,ext0, + ext1,ext2,ext3,ext4,ext5,ext6, + ext7); + view_copy(common_subview.dst_sub,common_subview.src_sub); + } + } + } +}; + +} + +/** \brief Deep copy a value from Host memory into a view. */ +template< class DT , class ... DP > +inline +void deep_copy + ( const View<DT,DP...> & dst + , typename ViewTraits<DT,DP...>::const_value_type & value + , typename std::enable_if< + std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value + >::type * = 0 ) +{ + typedef View<DT,DP...> ViewType; + if(dst.data() == NULL ) { + Kokkos::fence(); + return; + } + + Kokkos::fence(); + static_assert( + std::is_same< typename ViewType::non_const_value_type , + typename ViewType::value_type >::value + , "deep_copy requires non-const type" ); + + // If contigous we can simply do a 1D flat loop + if(dst.span_is_contiguous()) { + typedef Kokkos::View<typename ViewType::value_type*,Kokkos::LayoutRight, + typename ViewType::device_type,Kokkos::MemoryTraits<Kokkos::Unmanaged> > + ViewTypeFlat; + + ViewTypeFlat dst_flat(dst.data(),dst.size()); + Kokkos::Impl::ViewFill< ViewTypeFlat , Kokkos::LayoutLeft, typename ViewType::execution_space, ViewTypeFlat::Rank, int >( dst_flat , value ); + Kokkos::fence(); + return; + } + + // Figure out iteration order to do the ViewFill + int64_t strides[ViewType::Rank+1]; + dst.stride(strides); + Kokkos::Iterate iterate; + if ( std::is_same<typename ViewType::array_layout,Kokkos::LayoutRight>::value ) { + iterate = Kokkos::Iterate::Right; + } else if ( std::is_same<typename ViewType::array_layout,Kokkos::LayoutLeft>::value ) { + iterate = Kokkos::Iterate::Left; + } else if ( std::is_same<typename ViewType::array_layout,Kokkos::LayoutStride>::value ) { + if( strides[0] > strides[ViewType::Rank>0?ViewType::Rank-1:0] ) + iterate = Kokkos::Iterate::Right; + else + iterate = Kokkos::Iterate::Left; + } else { + if( std::is_same<typename ViewType::execution_space::array_layout, Kokkos::LayoutRight>::value ) + iterate = Kokkos::Iterate::Right; + else + iterate = Kokkos::Iterate::Left; + } + + // Lets call the right ViewFill functor based on integer space needed and iteration type + if(dst.span() > std::numeric_limits<int>::max()) { + if(iterate == Kokkos::Iterate::Right) + Kokkos::Impl::ViewFill< ViewType, Kokkos::LayoutRight, typename ViewType::execution_space, ViewType::Rank, int64_t >( dst , value ); + else + Kokkos::Impl::ViewFill< ViewType, Kokkos::LayoutLeft, typename ViewType::execution_space, ViewType::Rank, int64_t >( dst , value ); + } else { + if(iterate == Kokkos::Iterate::Right) + Kokkos::Impl::ViewFill< ViewType, Kokkos::LayoutRight, typename ViewType::execution_space, ViewType::Rank, int >( dst , value ); + else + Kokkos::Impl::ViewFill< ViewType, Kokkos::LayoutLeft, typename ViewType::execution_space, ViewType::Rank, int >( dst , value ); + } + Kokkos::fence(); +} + +/** \brief Deep copy into a value in Host memory from a view. */ +template< class ST , class ... SP > +inline +void deep_copy + ( typename ViewTraits<ST,SP...>::non_const_value_type & dst + , const View<ST,SP...> & src + , typename std::enable_if< + std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value + >::type * = 0 ) +{ + static_assert( ViewTraits<ST,SP...>::rank == 0 + , "ERROR: Non-rank-zero view in deep_copy( value , View )" ); + + if(src.data() == NULL) { + Kokkos::fence(); + return; + } + + typedef ViewTraits<ST,SP...> src_traits ; + typedef typename src_traits::memory_space src_memory_space ; + Kokkos::Impl::DeepCopy< HostSpace , src_memory_space >( & dst , src.data() , sizeof(ST) ); +} + +//---------------------------------------------------------------------------- +/** \brief A deep copy between views of compatible type, and rank zero. */ +template< class DT , class ... DP , class ST , class ... SP > +inline +void deep_copy + ( const View<DT,DP...> & dst + , const View<ST,SP...> & src + , typename std::enable_if<( + std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value && + std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value && + ( unsigned(ViewTraits<DT,DP...>::rank) == unsigned(0) && + unsigned(ViewTraits<ST,SP...>::rank) == unsigned(0) ) + )>::type * = 0 ) +{ + static_assert( + std::is_same< typename ViewTraits<DT,DP...>::value_type , + typename ViewTraits<ST,SP...>::non_const_value_type >::value + , "deep_copy requires matching non-const destination type" ); + + if(dst.data() == NULL && src.data() == NULL) { + Kokkos::fence(); + return; + } + + typedef View<DT,DP...> dst_type ; + typedef View<ST,SP...> src_type ; + + typedef typename dst_type::value_type value_type ; + typedef typename dst_type::memory_space dst_memory_space ; + typedef typename src_type::memory_space src_memory_space ; + + Kokkos::fence(); + if ( dst.data() != src.data() ) { + Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space >( dst.data() , src.data() , sizeof(value_type) ); + Kokkos::fence(); + } +} + +//---------------------------------------------------------------------------- +/** \brief A deep copy between views of the default specialization, compatible type, + * same non-zero rank, same contiguous layout. + */ +template< class DT , class ... DP , class ST , class ... SP > +inline +void deep_copy + ( const View<DT,DP...> & dst + , const View<ST,SP...> & src + , typename std::enable_if<( + std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value && + std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value && + ( unsigned(ViewTraits<DT,DP...>::rank) != 0 || + unsigned(ViewTraits<ST,SP...>::rank) != 0 ) + )>::type * = 0 ) +{ + static_assert( + std::is_same< typename ViewTraits<DT,DP...>::value_type , + typename ViewTraits<DT,DP...>::non_const_value_type >::value + , "deep_copy requires non-const destination type" ); + + static_assert( + ( unsigned(ViewTraits<DT,DP...>::rank) == + unsigned(ViewTraits<ST,SP...>::rank) ) + , "deep_copy requires Views of equal rank" ); + + typedef View<DT,DP...> dst_type ; + typedef View<ST,SP...> src_type ; + + typedef typename dst_type::execution_space dst_execution_space ; + typedef typename src_type::execution_space src_execution_space ; + typedef typename dst_type::memory_space dst_memory_space ; + typedef typename src_type::memory_space src_memory_space ; + typedef typename dst_type::value_type dst_value_type ; + typedef typename src_type::value_type src_value_type ; + if(dst.data() == NULL && src.data() == NULL) { + Kokkos::fence(); + return; + } + + enum { DstExecCanAccessSrc = + Kokkos::Impl::SpaceAccessibility< dst_execution_space , src_memory_space >::accessible }; + + enum { SrcExecCanAccessDst = + Kokkos::Impl::SpaceAccessibility< src_execution_space , dst_memory_space >::accessible }; + + + // Checking for Overlapping Views. + dst_value_type* dst_start = dst.data(); + dst_value_type* dst_end = dst.data() + dst.span(); + src_value_type* src_start = src.data(); + src_value_type* src_end = src.data() + src.span(); + if( ((std::ptrdiff_t)dst_start == (std::ptrdiff_t)src_start) && + ((std::ptrdiff_t)dst_end == (std::ptrdiff_t)src_end) && + (dst.span_is_contiguous() && src.span_is_contiguous()) ) { + Kokkos::fence(); + return; + } + + if( ( ( (std::ptrdiff_t)dst_start < (std::ptrdiff_t)src_end ) && ( (std::ptrdiff_t)dst_end > (std::ptrdiff_t)src_start ) ) && + ( ( dst.span_is_contiguous() && src.span_is_contiguous() ))) { + std::string message("Error: Kokkos::deep_copy of overlapping views: "); + message += dst.label(); message += "("; + message += std::to_string((std::ptrdiff_t)dst_start); message += ","; + message += std::to_string((std::ptrdiff_t)dst_end); message += ") "; + message += src.label(); message += "("; + message += std::to_string((std::ptrdiff_t)src_start); message += ","; + message += std::to_string((std::ptrdiff_t)src_end); message += ") "; + Kokkos::Impl::throw_runtime_exception(message); + } + + // Check for same extents + if ( (src.extent(0) != dst.extent(0)) || + (src.extent(1) != dst.extent(1)) || + (src.extent(2) != dst.extent(2)) || + (src.extent(3) != dst.extent(3)) || + (src.extent(4) != dst.extent(4)) || + (src.extent(5) != dst.extent(5)) || + (src.extent(6) != dst.extent(6)) || + (src.extent(7) != dst.extent(7)) + ) { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + Kokkos::fence(); + if ( DstExecCanAccessSrc ) { + // Copying data between views in accessible memory spaces and either non-contiguous or incompatible shape. + Kokkos::Impl::ViewRemap< dst_type , src_type >( dst , src ); + } + else if ( SrcExecCanAccessDst ) { + // Copying data between views in accessible memory spaces and either non-contiguous or incompatible shape. + Kokkos::Impl::ViewRemap< dst_type , src_type , src_execution_space >( dst , src ); + } + else { + Kokkos::Impl::throw_runtime_exception("deep_copy given views that would require a temporary allocation"); + } + Kokkos::fence(); + return; +#else + std::string message("Deprecation Error: Kokkos::deep_copy extents of views don't match: "); + message += dst.label(); message += "("; + for(int r = 0; r<dst_type::Rank-1; r++) + { message+= std::to_string(dst.extent(r)); message += ","; } + message+= std::to_string(dst.extent(dst_type::Rank-1)); message += ") "; + message += src.label(); message += "("; + for(int r = 0; r<src_type::Rank-1; r++) + { message+= std::to_string(src.extent(r)); message += ","; } + message+= std::to_string(src.extent(src_type::Rank-1)); message += ") "; + + Kokkos::Impl::throw_runtime_exception(message); +#endif + } + + // If same type, equal layout, equal dimensions, equal span, and contiguous memory then can byte-wise copy + + if ( std::is_same< typename ViewTraits<DT,DP...>::value_type , + typename ViewTraits<ST,SP...>::non_const_value_type >::value && + ( + std::is_same< typename ViewTraits<DT,DP...>::array_layout , + typename ViewTraits<ST,SP...>::array_layout >::value + || + ( ViewTraits<DT,DP...>::rank == 1 && + ViewTraits<ST,SP...>::rank == 1 ) + ) && + dst.span_is_contiguous() && + src.span_is_contiguous() && + ((ViewTraits<DT,DP...>::rank < 1) || (dst.stride_0() == src.stride_0())) && + ((ViewTraits<DT,DP...>::rank < 2) || (dst.stride_1() == src.stride_1())) && + ((ViewTraits<DT,DP...>::rank < 3) || (dst.stride_2() == src.stride_2())) && + ((ViewTraits<DT,DP...>::rank < 4) || (dst.stride_3() == src.stride_3())) && + ((ViewTraits<DT,DP...>::rank < 5) || (dst.stride_4() == src.stride_4())) && + ((ViewTraits<DT,DP...>::rank < 6) || (dst.stride_5() == src.stride_5())) && + ((ViewTraits<DT,DP...>::rank < 7) || (dst.stride_6() == src.stride_6())) && + ((ViewTraits<DT,DP...>::rank < 8) || (dst.stride_7() == src.stride_7())) + ) { + const size_t nbytes = sizeof(typename dst_type::value_type) * dst.span(); + Kokkos::fence(); + if((void*)dst.data()!=(void*)src.data()) { + Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space > + ( dst.data() , src.data() , nbytes ); + } + Kokkos::fence(); + } else { + Kokkos::fence(); + Impl::view_copy(dst,src); + Kokkos::fence(); + } +} + +} /* namespace Kokkos */ + +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + +namespace Kokkos { + +/** \brief Deep copy a value from Host memory into a view. */ +template< class ExecSpace ,class DT , class ... DP > +inline +void deep_copy + ( const ExecSpace & + , const View<DT,DP...> & dst + , typename ViewTraits<DT,DP...>::const_value_type & value + , typename std::enable_if< + Kokkos::Impl::is_execution_space< ExecSpace >::value && + std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value + >::type * = 0 ) +{ + static_assert( + std::is_same< typename ViewTraits<DT,DP...>::non_const_value_type , + typename ViewTraits<DT,DP...>::value_type >::value + , "deep_copy requires non-const type" ); + + ExecSpace::fence(); + Kokkos::Impl::ViewFill< View<DT,DP...> >( dst , value ); + ExecSpace::fence(); +} + +/** \brief Deep copy into a value in Host memory from a view. */ +template< class ExecSpace , class ST , class ... SP > +inline +void deep_copy + ( const ExecSpace & exec_space + , typename ViewTraits<ST,SP...>::non_const_value_type & dst + , const View<ST,SP...> & src + , typename std::enable_if< + Kokkos::Impl::is_execution_space< ExecSpace >::value && + std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value + >::type * = 0 ) +{ + static_assert( ViewTraits<ST,SP...>::rank == 0 + , "ERROR: Non-rank-zero view in deep_copy( value , View )" ); + + if(src.data() == NULL) { + exec_space.fence(); + return; + } + + typedef ViewTraits<ST,SP...> src_traits ; + typedef typename src_traits::memory_space src_memory_space ; + Kokkos::Impl::DeepCopy< HostSpace , src_memory_space , ExecSpace > + ( exec_space , & dst , src.data() , sizeof(ST) ); +} + +//---------------------------------------------------------------------------- +/** \brief A deep copy between views of compatible type, and rank zero. */ +template< class ExecSpace , class DT , class ... DP , class ST , class ... SP > +inline +void deep_copy + ( const ExecSpace & exec_space + , const View<DT,DP...> & dst + , const View<ST,SP...> & src + , typename std::enable_if<( + Kokkos::Impl::is_execution_space< ExecSpace >::value && + std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value && + std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value && + ( unsigned(ViewTraits<DT,DP...>::rank) == unsigned(0) && + unsigned(ViewTraits<ST,SP...>::rank) == unsigned(0) ) + )>::type * = 0 ) +{ + static_assert( + std::is_same< typename ViewTraits<DT,DP...>::value_type , + typename ViewTraits<ST,SP...>::non_const_value_type >::value + , "deep_copy requires matching non-const destination type" ); + + typedef View<DT,DP...> dst_type ; + typedef View<ST,SP...> src_type ; + + typedef typename dst_type::value_type value_type ; + typedef typename dst_type::memory_space dst_memory_space ; + typedef typename src_type::memory_space src_memory_space ; + if(dst.data() == NULL && src.data() == NULL) { + exec_space.fence(); + return; + } + + exec_space.fence(); + if ( dst.data() != src.data() ) { + Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space , ExecSpace > + ( exec_space , dst.data() , src.data() , sizeof(value_type) ); + } + exec_space.fence(); +} + +//---------------------------------------------------------------------------- +/** \brief A deep copy between views of the default specialization, compatible type, + * same non-zero rank + */ +template< class ExecSpace , class DT, class ... DP, class ST, class ... SP > +inline +void deep_copy + ( const ExecSpace & exec_space + , const View<DT,DP...> & dst + , const View<ST,SP...> & src + , typename std::enable_if<( + Kokkos::Impl::is_execution_space< ExecSpace >::value && + std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value && + std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value && + ( unsigned(ViewTraits<DT,DP...>::rank) != 0 || + unsigned(ViewTraits<ST,SP...>::rank) != 0 ) + )>::type * = 0 ) +{ + static_assert( + std::is_same< typename ViewTraits<DT,DP...>::value_type , + typename ViewTraits<DT,DP...>::non_const_value_type >::value + , "deep_copy requires non-const destination type" ); + + static_assert( + ( unsigned(ViewTraits<DT,DP...>::rank) == + unsigned(ViewTraits<ST,SP...>::rank) ) + , "deep_copy requires Views of equal rank" ); + + typedef View<DT,DP...> dst_type ; + typedef View<ST,SP...> src_type ; + + typedef typename dst_type::execution_space dst_execution_space ; + typedef typename src_type::execution_space src_execution_space ; + typedef typename dst_type::memory_space dst_memory_space ; + typedef typename src_type::memory_space src_memory_space ; + typedef typename dst_type::value_type dst_value_type ; + typedef typename src_type::value_type src_value_type ; + + if(dst.data() == NULL && src.data() == NULL) { + exec_space.fence(); + return; + } + + enum { ExecCanAccessSrcDst = + Kokkos::Impl::SpaceAccessibility< ExecSpace , dst_memory_space >::accessible && + Kokkos::Impl::SpaceAccessibility< ExecSpace , src_memory_space >::accessible + }; + enum { DstExecCanAccessSrc = + Kokkos::Impl::SpaceAccessibility< dst_execution_space , src_memory_space >::accessible }; + + enum { SrcExecCanAccessDst = + Kokkos::Impl::SpaceAccessibility< src_execution_space , dst_memory_space >::accessible }; + + // Checking for Overlapping Views. + dst_value_type* dst_start = dst.data(); + dst_value_type* dst_end = dst.data() + dst.span(); + src_value_type* src_start = src.data(); + src_value_type* src_end = src.data() + src.span(); + if( ( ( (std::ptrdiff_t)dst_start < (std::ptrdiff_t)src_end ) && ( (std::ptrdiff_t)dst_end > (std::ptrdiff_t)src_start ) ) && + ( ( dst.span_is_contiguous() && src.span_is_contiguous() ))) { + std::string message("Error: Kokkos::deep_copy of overlapping views: "); + message += dst.label(); message += "("; + message += std::to_string((std::ptrdiff_t)dst_start); message += ","; + message += std::to_string((std::ptrdiff_t)dst_end); message += ") "; + message += src.label(); message += "("; + message += std::to_string((std::ptrdiff_t)src_start); message += ","; + message += std::to_string((std::ptrdiff_t)src_end); message += ") "; + Kokkos::Impl::throw_runtime_exception(message); + } + + // Check for same extents + if ( (src.extent(0) != dst.extent(0)) || + (src.extent(1) != dst.extent(1)) || + (src.extent(2) != dst.extent(2)) || + (src.extent(3) != dst.extent(3)) || + (src.extent(4) != dst.extent(4)) || + (src.extent(5) != dst.extent(5)) || + (src.extent(6) != dst.extent(6)) || + (src.extent(7) != dst.extent(7)) + ) { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + exec_space.fence(); + if ( ExecCanAccessSrcDst ) { + Kokkos::Impl::ViewRemap< dst_type , src_type , ExecSpace >( dst , src ); + } + else if ( DstExecCanAccessSrc ) { + // Copying data between views in accessible memory spaces and either non-contiguous or incompatible shape. + Kokkos::Impl::ViewRemap< dst_type , src_type >( dst , src ); + } + else if ( SrcExecCanAccessDst ) { + // Copying data between views in accessible memory spaces and either non-contiguous or incompatible shape. + Kokkos::Impl::ViewRemap< dst_type , src_type , src_execution_space >( dst , src ); + } + else { + Kokkos::Impl::throw_runtime_exception("deep_copy given views that would require a temporary allocation"); + } + exec_space.fence(); + return; +#else + std::string message("Deprecation Error: Kokkos::deep_copy extents of views don't match: "); + message += dst.label(); message += "("; + for(int r = 0; r<dst_type::Rank-1; r++) + { message+= std::to_string(dst.extent(r)); message += ","; } + message+= std::to_string(dst.extent(dst_type::Rank-1)); message += ") "; + message += src.label(); message += "("; + for(int r = 0; r<src_type::Rank-1; r++) + { message+= std::to_string(src.extent(r)); message += ","; } + message+= std::to_string(src.extent(src_type::Rank-1)); message += ") "; + + Kokkos::Impl::throw_runtime_exception(message); +#endif + } + + // If same type, equal layout, equal dimensions, equal span, and contiguous memory then can byte-wise copy + + if ( std::is_same< typename ViewTraits<DT,DP...>::value_type , + typename ViewTraits<ST,SP...>::non_const_value_type >::value && + ( + std::is_same< typename ViewTraits<DT,DP...>::array_layout , + typename ViewTraits<ST,SP...>::array_layout >::value + || + ( ViewTraits<DT,DP...>::rank == 1 && + ViewTraits<ST,SP...>::rank == 1 ) + ) && + dst.span_is_contiguous() && + src.span_is_contiguous() && + ((ViewTraits<DT,DP...>::rank < 1) || (dst.stride_0() == src.stride_0())) && + ((ViewTraits<DT,DP...>::rank < 2) || (dst.stride_1() == src.stride_1())) && + ((ViewTraits<DT,DP...>::rank < 3) || (dst.stride_2() == src.stride_2())) && + ((ViewTraits<DT,DP...>::rank < 4) || (dst.stride_3() == src.stride_3())) && + ((ViewTraits<DT,DP...>::rank < 5) || (dst.stride_4() == src.stride_4())) && + ((ViewTraits<DT,DP...>::rank < 6) || (dst.stride_5() == src.stride_5())) && + ((ViewTraits<DT,DP...>::rank < 7) || (dst.stride_6() == src.stride_6())) && + ((ViewTraits<DT,DP...>::rank < 8) || (dst.stride_7() == src.stride_7())) + ) { + + const size_t nbytes = sizeof(typename dst_type::value_type) * dst.span(); + exec_space.fence(); + if((void*)dst.data() != (void*)src.data()) { + Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space , ExecSpace > + ( exec_space , dst.data() , src.data() , nbytes ); + } + exec_space.fence(); + } else { + exec_space.fence(); + Impl::view_copy(dst,src); + exec_space.fence(); + } +} + +} /* namespace Kokkos */ + +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + +namespace Kokkos { + +/** \brief Resize a view with copying old data to new data at the corresponding indices. */ +template< class T , class ... P > +inline +typename std::enable_if< + std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutLeft>::value || + std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutRight>::value +>::type +resize( Kokkos::View<T,P...> & v , + const size_t n0 = 0 , + const size_t n1 = 0 , + const size_t n2 = 0 , + const size_t n3 = 0 , + const size_t n4 = 0 , + const size_t n5 = 0 , + const size_t n6 = 0 , + const size_t n7 = 0 ) +{ + typedef Kokkos::View<T,P...> view_type ; + + static_assert( Kokkos::ViewTraits<T,P...>::is_managed , "Can only resize managed views" ); + + // Fix #904 by checking dimensions before actually resizing. + // + // Rank is known at compile time, so hopefully the compiler will + // remove branches that are compile-time false. The upcoming "if + // constexpr" language feature would make this certain. + if (view_type::Rank == 1 && + n0 == static_cast<size_t> (v.extent(0))) { + return; + } + if (view_type::Rank == 2 && + n0 == static_cast<size_t> (v.extent(0)) && + n1 == static_cast<size_t> (v.extent(1))) { + return; + } + if (view_type::Rank == 3 && + n0 == static_cast<size_t> (v.extent(0)) && + n1 == static_cast<size_t> (v.extent(1)) && + n2 == static_cast<size_t> (v.extent(2))) { + return; + } + if (view_type::Rank == 4 && + n0 == static_cast<size_t> (v.extent(0)) && + n1 == static_cast<size_t> (v.extent(1)) && + n2 == static_cast<size_t> (v.extent(2)) && + n3 == static_cast<size_t> (v.extent(3))) { + return; + } + if (view_type::Rank == 5 && + n0 == static_cast<size_t> (v.extent(0)) && + n1 == static_cast<size_t> (v.extent(1)) && + n2 == static_cast<size_t> (v.extent(2)) && + n3 == static_cast<size_t> (v.extent(3)) && + n4 == static_cast<size_t> (v.extent(4))) { + return; + } + if (view_type::Rank == 6 && + n0 == static_cast<size_t> (v.extent(0)) && + n1 == static_cast<size_t> (v.extent(1)) && + n2 == static_cast<size_t> (v.extent(2)) && + n3 == static_cast<size_t> (v.extent(3)) && + n4 == static_cast<size_t> (v.extent(4)) && + n5 == static_cast<size_t> (v.extent(5))) { + return; + } + if (view_type::Rank == 7 && + n0 == static_cast<size_t> (v.extent(0)) && + n1 == static_cast<size_t> (v.extent(1)) && + n2 == static_cast<size_t> (v.extent(2)) && + n3 == static_cast<size_t> (v.extent(3)) && + n4 == static_cast<size_t> (v.extent(4)) && + n5 == static_cast<size_t> (v.extent(5)) && + n6 == static_cast<size_t> (v.extent(6))) { + return; + } + if (view_type::Rank == 8 && + n0 == static_cast<size_t> (v.extent(0)) && + n1 == static_cast<size_t> (v.extent(1)) && + n2 == static_cast<size_t> (v.extent(2)) && + n3 == static_cast<size_t> (v.extent(3)) && + n4 == static_cast<size_t> (v.extent(4)) && + n5 == static_cast<size_t> (v.extent(5)) && + n6 == static_cast<size_t> (v.extent(6)) && + n7 == static_cast<size_t> (v.extent(7))) { + return; + } + // If Kokkos ever supports Views of rank > 8, the above code won't + // be incorrect, because avoiding reallocation in resize() is just + // an optimization. + + // TODO (mfh 27 Jun 2017) If the old View has enough space but just + // different dimensions (e.g., if the product of the dimensions, + // including extra space for alignment, will not change), then + // consider just reusing storage. For now, Kokkos always + // reallocates if any of the dimensions change, even if the old View + // has enough space. + + view_type v_resized( v.label(), n0, n1, n2, n3, n4, n5, n6, n7 ); + + Kokkos::Impl::ViewRemap< view_type , view_type >( v_resized , v ); + + v = v_resized ; +} + +/** \brief Resize a view with copying old data to new data at the corresponding indices. */ +template< class T , class ... P > +inline +void resize( Kokkos::View<T,P...> & v , + const typename Kokkos::View<T,P...>::array_layout & layout) +{ + typedef Kokkos::View<T,P...> view_type ; + + static_assert( Kokkos::ViewTraits<T,P...>::is_managed , "Can only resize managed views" ); + + view_type v_resized( v.label(), layout ); + + Kokkos::Impl::ViewRemap< view_type , view_type >( v_resized , v ); + + v = v_resized ; +} + +/** \brief Resize a view with discarding old data. */ +template< class T , class ... P > +inline +typename std::enable_if< + std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutLeft>::value || + std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutRight>::value +>::type +realloc( Kokkos::View<T,P...> & v , + const size_t n0 = 0 , + const size_t n1 = 0 , + const size_t n2 = 0 , + const size_t n3 = 0 , + const size_t n4 = 0 , + const size_t n5 = 0 , + const size_t n6 = 0 , + const size_t n7 = 0 ) +{ + typedef Kokkos::View<T,P...> view_type ; + + static_assert( Kokkos::ViewTraits<T,P...>::is_managed , "Can only realloc managed views" ); + + const std::string label = v.label(); + + v = view_type(); // Deallocate first, if the only view to allocation + v = view_type( label, n0, n1, n2, n3, n4, n5, n6, n7 ); +} + +/** \brief Resize a view with discarding old data. */ +template< class T , class ... P > +inline +void realloc( Kokkos::View<T,P...> & v , + const typename Kokkos::View<T,P...>::array_layout & layout) +{ + typedef Kokkos::View<T,P...> view_type ; + + static_assert( Kokkos::ViewTraits<T,P...>::is_managed , "Can only realloc managed views" ); + + const std::string label = v.label(); + + v = view_type(); // Deallocate first, if the only view to allocation + v = view_type( label, layout ); +} +} /* namespace Kokkos */ + +#endif diff --git a/lib/kokkos/core/src/Kokkos_Core.hpp b/lib/kokkos/core/src/Kokkos_Core.hpp index b1531a0a1b1cb72e5dfd126f5848d2299912e76d..b4d664c8eaf1e41e8b792ed3e4e351c01c6e3009 100644 --- a/lib/kokkos/core/src/Kokkos_Core.hpp +++ b/lib/kokkos/core/src/Kokkos_Core.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -78,6 +78,7 @@ #include <Kokkos_ROCm.hpp> #endif +#include <Kokkos_AnonymousSpace.hpp> #include <Kokkos_Pair.hpp> #include <Kokkos_MemoryPool.hpp> #include <Kokkos_Array.hpp> @@ -89,6 +90,8 @@ #include <Kokkos_Complex.hpp> +#include <Kokkos_CopyViews.hpp> +#include <functional> #include <iosfwd> //---------------------------------------------------------------------------- @@ -124,6 +127,28 @@ bool show_warnings() noexcept; /** \brief Finalize the spaces that were initialized via Kokkos::initialize */ void finalize(); +/** + * \brief Push a user-defined function to be called in + * Kokkos::finalize, before any Kokkos state is finalized. + * + * \warning Only call this after Kokkos::initialize, but before + * Kokkos::finalize. + * + * This function is the Kokkos analog to std::atexit. If you call + * this with a function f, then your function will get called when + * Kokkos::finalize is called. Specifically, it will be called BEFORE + * Kokkos does any finalization. This means that all execution + * spaces, memory spaces, etc. that were initialized will still be + * initialized when your function is called. + * + * Just like std::atexit, if you call push_finalize_hook in sequence + * with multiple functions (f, g, h), Kokkos::finalize will call them + * in reverse order (h, g, f), as if popping a stack. Furthermore, + * just like std::atexit, if any of your functions throws but does not + * catch an exception, Kokkos::finalize will call std::terminate. + */ +void push_finalize_hook(std::function<void()> f); + /** \brief Finalize all known execution spaces */ void finalize_all(); diff --git a/lib/kokkos/core/src/Kokkos_Core_fwd.hpp b/lib/kokkos/core/src/Kokkos_Core_fwd.hpp index 29001e19eddb4fb48bfad15043684b4884c8a29e..b0d4d8a49a8b8adecdb6468a855a2da611f8c66a 100644 --- a/lib/kokkos/core/src/Kokkos_Core_fwd.hpp +++ b/lib/kokkos/core/src/Kokkos_Core_fwd.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -239,6 +239,13 @@ namespace Kokkos { namespace Impl { +template<class ViewType, class Layout = typename ViewType::array_layout, + class ExecSpace = typename ViewType::execution_space, int Rank = ViewType::Rank, typename iType = int64_t> +struct ViewFill; + +template<class ViewTypeA,class ViewTypeB, class Layout, class ExecSpace, int Rank, typename iType> +struct ViewCopy; + template< class Functor , class Policy , class EnableFunctor = void diff --git a/lib/kokkos/core/src/Kokkos_Crs.hpp b/lib/kokkos/core/src/Kokkos_Crs.hpp index 7bbc938010035bbd1f9614d20e47738f1f346daa..09b0d666a1f8c10c0bd3f616fc333515ac688b1d 100644 --- a/lib/kokkos/core/src/Kokkos_Crs.hpp +++ b/lib/kokkos/core/src/Kokkos_Crs.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -130,8 +130,8 @@ public: */ KOKKOS_INLINE_FUNCTION size_type numRows() const { - return (row_map.dimension_0 () != 0) ? - row_map.dimension_0 () - static_cast<size_type> (1) : + return (row_map.extent(0) != 0) ? + row_map.extent(0) - static_cast<size_type> (1) : static_cast<size_type> (0); } }; @@ -359,7 +359,7 @@ struct CountAndFillBase { we could compare to row_map(i + 1), but that is a read from global memory, whereas dimension_0() should be part of the View in registers (or constant memory) */ data_type* fill = - (j == static_cast<decltype(j)>(m_crs.entries.dimension_0())) ? + (j == static_cast<decltype(j)>(m_crs.entries.extent(0))) ? nullptr : (&(m_crs.entries(j))); m_functor(i, fill); } @@ -393,7 +393,7 @@ struct CountAndFillBase<CrsType, Functor, Kokkos::Cuda> { we could compare to row_map(i + 1), but that is a read from global memory, whereas dimension_0() should be part of the View in registers (or constant memory) */ data_type* fill = - (j == static_cast<decltype(j)>(m_crs.entries.dimension_0())) ? + (j == static_cast<decltype(j)>(m_crs.entries.extent(0))) ? nullptr : (&(m_crs.entries(j))); m_functor(i, fill); } diff --git a/lib/kokkos/core/src/Kokkos_Cuda.hpp b/lib/kokkos/core/src/Kokkos_Cuda.hpp index 197831dee5b79f53116f2f7524a43e1e98c85f45..c2db88fdc2aade42999d92ab2e09e15670b12e5c 100644 --- a/lib/kokkos/core/src/Kokkos_Cuda.hpp +++ b/lib/kokkos/core/src/Kokkos_Cuda.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_CudaSpace.hpp b/lib/kokkos/core/src/Kokkos_CudaSpace.hpp index fb5985e164e0c61a34e2f32192cc7e5d2ecbde05..f537dad2c4a28e3c878e34c604c07d3dca6de74b 100644 --- a/lib/kokkos/core/src/Kokkos_CudaSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_CudaSpace.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_ExecPolicy.hpp b/lib/kokkos/core/src/Kokkos_ExecPolicy.hpp index 6f6343713c4e7807d34d6951b8862d5e0e32ed9b..6c9cc4b510cee035f8cd6a387ab7a8b93c1726eb 100644 --- a/lib/kokkos/core/src/Kokkos_ExecPolicy.hpp +++ b/lib/kokkos/core/src/Kokkos_ExecPolicy.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -57,6 +57,11 @@ namespace Kokkos { +struct ChunkSize { + int value; + ChunkSize(int value_):value(value_) {} +}; + /** \brief Execution policy for work over a range of an integral type. * * Valid template argument options: @@ -132,7 +137,56 @@ public: ) : RangePolicy( typename traits::execution_space() , work_begin , work_end ) - {} + { + set_auto_chunk_size(); + } + + /** \brief Total range */ + template<class ... Args> + inline + RangePolicy( const typename traits::execution_space & work_space + , const member_type work_begin + , const member_type work_end + , Args ... args + ) + : m_space( work_space ) + , m_begin( work_begin < work_end ? work_begin : 0 ) + , m_end( work_begin < work_end ? work_end : 0 ) + , m_granularity(0) + , m_granularity_mask(0) + { + set_auto_chunk_size(); + set(args...); + } + + /** \brief Total range */ + template<class ... Args> + inline + RangePolicy( const member_type work_begin + , const member_type work_end + , Args ... args + ) + : RangePolicy( typename traits::execution_space() + , work_begin , work_end ) + { + set_auto_chunk_size(); + set(args...); + } + +private: + inline void set() {} + +public: + template<class ... Args> + inline void set(Args ...) { + static_assert( 0 == sizeof...(Args), "Kokkos::RangePolicy: unhandled constructor arguments encountered."); + } + + template<class ... Args> + inline void set(const ChunkSize& chunksize, Args ... args) { + m_granularity = chunksize.value; + m_granularity_mask = m_granularity - 1; + } public: /** \brief return chunk_size */ @@ -348,6 +402,7 @@ public: }; }; + struct PerTeamValue { int value; PerTeamValue(int arg); @@ -358,11 +413,68 @@ public: PerThreadValue(int arg); }; + template<class iType, class ... Args> + struct ExtractVectorLength { + static inline iType value(typename std::enable_if<std::is_integral<iType>::value,iType>::type val, Args...) { + return val; + } + static inline typename std::enable_if<!std::is_integral<iType>::value,int>::type value(typename std::enable_if<!std::is_integral<iType>::value,iType>::type, Args...) { + return 1; + } + }; + + template<class iType, class ... Args> + inline typename std::enable_if<std::is_integral<iType>::value,iType>::type extract_vector_length(iType val, Args...) { + return val; + } + + template<class iType, class ... Args> + inline typename std::enable_if<!std::is_integral<iType>::value,int>::type extract_vector_length(iType, Args...) { + return 1; + } + } Impl::PerTeamValue PerTeam(const int& arg); Impl::PerThreadValue PerThread(const int& arg); +struct ScratchRequest { + int level; + + int per_team; + int per_thread; + + inline + ScratchRequest(const int& level_, const Impl::PerTeamValue& team_value) { + level = level_; + per_team = team_value.value; + per_thread = 0; + } + + inline + ScratchRequest(const int& level_, const Impl::PerThreadValue& thread_value) { + level = level_; + per_team = 0; + per_thread = thread_value.value;; + } + + inline + ScratchRequest(const int& level_, const Impl::PerTeamValue& team_value, const Impl::PerThreadValue& thread_value) { + level = level_; + per_team = team_value.value; + per_thread = thread_value.value;; + } + + inline + ScratchRequest(const int& level_, const Impl::PerThreadValue& thread_value, const Impl::PerTeamValue& team_value) { + level = level_; + per_team = team_value.value; + per_thread = thread_value.value;; + } + +}; + + /** \brief Execution policy for parallel work over a league of teams of threads. * * The work functor is called for each thread of each team such that @@ -405,27 +517,127 @@ public: /** \brief Construct policy with the given instance of the execution space */ TeamPolicy( const typename traits::execution_space & , int league_size_request , int team_size_request , int vector_length_request = 1 ) - : internal_policy(typename traits::execution_space(),league_size_request,team_size_request, vector_length_request) {} + : internal_policy(typename traits::execution_space(),league_size_request,team_size_request, vector_length_request) {first_arg = false;} TeamPolicy( const typename traits::execution_space & , int league_size_request , const Kokkos::AUTO_t & , int vector_length_request = 1 ) - : internal_policy(typename traits::execution_space(),league_size_request,Kokkos::AUTO(), vector_length_request) {} + : internal_policy(typename traits::execution_space(),league_size_request,Kokkos::AUTO(), vector_length_request) {first_arg = false;} /** \brief Construct policy with the default instance of the execution space */ TeamPolicy( int league_size_request , int team_size_request , int vector_length_request = 1 ) - : internal_policy(league_size_request,team_size_request, vector_length_request) {} + : internal_policy(league_size_request,team_size_request, vector_length_request) {first_arg = false;} TeamPolicy( int league_size_request , const Kokkos::AUTO_t & , int vector_length_request = 1 ) - : internal_policy(league_size_request,Kokkos::AUTO(), vector_length_request) {} + : internal_policy(league_size_request,Kokkos::AUTO(), vector_length_request) {first_arg = false;} + + /** \brief Construct policy with the given instance of the execution space */ + template<class ... Args> + TeamPolicy( const typename traits::execution_space & , int league_size_request , int team_size_request , int vector_length_request, + Args ... args) + : internal_policy(typename traits::execution_space(),league_size_request,team_size_request, vector_length_request) { + first_arg = false; + set(args...); + } + + template<class ... Args> + TeamPolicy( const typename traits::execution_space & , int league_size_request , const Kokkos::AUTO_t & , int vector_length_request , + Args ... args) + : internal_policy(typename traits::execution_space(),league_size_request,Kokkos::AUTO(), vector_length_request) { + first_arg = false; + set(args...); + } -/* TeamPolicy( int league_size_request , int team_size_request ) - : internal_policy(league_size_request,team_size_request) {} + /** \brief Construct policy with the default instance of the execution space */ + template<class ... Args> + TeamPolicy( int league_size_request , int team_size_request , int vector_length_request , + Args ... args) + : internal_policy(league_size_request,team_size_request, vector_length_request) { + first_arg = false; + set(args...); + } + + template<class ... Args> + TeamPolicy( int league_size_request , const Kokkos::AUTO_t & , int vector_length_request , + Args ... args) + : internal_policy(league_size_request,Kokkos::AUTO(), vector_length_request) { + first_arg = false; + set(args...); + } + + /** \brief Construct policy with the given instance of the execution space */ + template<class ... Args> + TeamPolicy( const typename traits::execution_space & , int league_size_request , int team_size_request , + Args ... args) + : internal_policy(typename traits::execution_space(),league_size_request,team_size_request, + Kokkos::Impl::extract_vector_length<Args...>(args...)) { + first_arg = true; + set(args...); + } + + template<class ... Args> + TeamPolicy( const typename traits::execution_space & , int league_size_request , const Kokkos::AUTO_t & , + Args ... args) + : internal_policy(typename traits::execution_space(),league_size_request,Kokkos::AUTO(), + Kokkos::Impl::extract_vector_length<Args...>(args...)) { + first_arg = true; + set(args...); + } - TeamPolicy( int league_size_request , const Kokkos::AUTO_t & ) - : internal_policy(league_size_request,Kokkos::AUTO()) {}*/ + /** \brief Construct policy with the default instance of the execution space */ + template<class ... Args> + TeamPolicy( int league_size_request , int team_size_request , + Args ... args) + : internal_policy(league_size_request,team_size_request, + Kokkos::Impl::extract_vector_length<Args...>(args...)) { + first_arg = true; + set(args...); + } + + template<class ... Args> + TeamPolicy( int league_size_request , const Kokkos::AUTO_t & , + Args ... args) + : internal_policy(league_size_request,Kokkos::AUTO(), + Kokkos::Impl::extract_vector_length<Args...>(args...)) { + first_arg = true; + set(args...); + } private: - TeamPolicy(const internal_policy& p):internal_policy(p) {} + bool first_arg; + TeamPolicy(const internal_policy& p):internal_policy(p) {first_arg = false;} + + inline void set() {} + public: + template<class ... Args> + inline void set(Args ...) { + static_assert( 0 == sizeof...(Args), "Kokkos::TeamPolicy: unhandled constructor arguments encountered."); + } + + template<class iType, class ... Args> + inline typename std::enable_if<std::is_integral<iType>::value>::type set(iType, Args ... args) { + if(first_arg) { + first_arg = false; + set(args...); + } else { + first_arg = false; + Kokkos::Impl::throw_runtime_exception("Kokkos::TeamPolicy: integer argument to constructor in illegal place."); + } + } + + template<class ... Args> + inline void set(const ChunkSize& chunksize, Args ... args) { + first_arg = false; + internal_policy::internal_set_chunk_size(chunksize.value); + set(args...); + } + + template<class ... Args> + inline void set(const ScratchRequest& scr_request, Args ... args) { + first_arg = false; + internal_policy::internal_set_scratch_size(scr_request.level,Impl::PerTeamValue(scr_request.per_team), + Impl::PerThreadValue(scr_request.per_thread)); + set(args...); + } inline TeamPolicy set_chunk_size(int chunk) const { return TeamPolicy(internal_policy::set_chunk_size(chunk)); diff --git a/lib/kokkos/core/src/Kokkos_HBWSpace.hpp b/lib/kokkos/core/src/Kokkos_HBWSpace.hpp index b811751a2c09c91bb75252a223cd3efa02dfbe31..b7c65f36a304f700c4d74cfe52f1d841d01e438d 100644 --- a/lib/kokkos/core/src/Kokkos_HBWSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_HBWSpace.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_HostSpace.hpp b/lib/kokkos/core/src/Kokkos_HostSpace.hpp index 431635047a9ea0d65f01290684a59bcf01906159..c84146ecf5e127936ef3fcd21499562eef26476f 100644 --- a/lib/kokkos/core/src/Kokkos_HostSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_HostSpace.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_Layout.hpp b/lib/kokkos/core/src/Kokkos_Layout.hpp index 87c705153ea35419513978ecb938b9f6f9073043..b0f92d8cf10cec45ff5d9e7130af8d0d682aa26f 100644 --- a/lib/kokkos/core/src/Kokkos_Layout.hpp +++ b/lib/kokkos/core/src/Kokkos_Layout.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_Macros.hpp b/lib/kokkos/core/src/Kokkos_Macros.hpp index b51f38efb2cf3a06beaa2093cb6258840d6fee5b..696bdcd520f5119e27876c4833b8a407ed040ce4 100644 --- a/lib/kokkos/core/src/Kokkos_Macros.hpp +++ b/lib/kokkos/core/src/Kokkos_Macros.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -102,6 +102,12 @@ #define KOKKOS_INTERNAL_ENABLE_NON_CUDA_BACKEND #endif +#if !defined(KOKKOS_ENABLE_THREADS) && !defined(KOKKOS_ENABLE_CUDA) && \ + !defined(KOKKOS_ENABLE_OPENMP) && !defined(KOKKOS_ENABLE_QTHREADS) && \ + !defined(KOKKOS_ENABLE_ROCM) && !defined(KOKKOS_ENABLE_OPENMPTARGET) + #define KOKKOS_INTERNAL_NOT_PARALLEL +#endif + #define KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA #if defined( KOKKOS_ENABLE_CUDA ) && defined( __CUDACC__ ) @@ -170,6 +176,7 @@ #define KOKKOS_INLINE_FUNCTION __device__ __host__ inline #define KOKKOS_FUNCTION __device__ __host__ #ifdef KOKKOS_COMPILER_CLANG + #define KOKKOS_INLINE_FUNCTION_DEFAULTED KOKKOS_INLINE_FUNCTION #define KOKKOS_FUNCTION_DEFAULTED KOKKOS_FUNCTION #endif #endif // #if defined( __CUDA_ARCH__ ) @@ -180,6 +187,7 @@ #define KOKKOS_INLINE_FUNCTION __attribute__((amp,cpu)) inline #define KOKKOS_FUNCTION __attribute__((amp,cpu)) #define KOKKOS_LAMBDA [=] __attribute__((amp,cpu)) + #define KOKKOS_INLINE_FUNCTION_DEFAULTED KOKKOS_INLINE_FUNCTION #define KOKKOS_FUNCTION_DEFAULTED KOKKOS_FUNCTION #endif @@ -416,6 +424,7 @@ #endif #if !defined( KOKKOS_FUNCTION_DEFAULTED ) + #define KOKKOS_INLINE_FUNCTION_DEFAULTED inline #define KOKKOS_FUNCTION_DEFAULTED /**/ #endif @@ -430,11 +439,11 @@ // Define Macro for alignment: #if ! defined( KOKKOS_MEMORY_ALIGNMENT ) - #define KOKKOS_MEMORY_ALIGNMENT 16 + #define KOKKOS_MEMORY_ALIGNMENT 64 #endif #if ! defined( KOKKOS_MEMORY_ALIGNMENT_THRESHOLD ) - #define KOKKOS_MEMORY_ALIGNMENT_THRESHOLD 4 + #define KOKKOS_MEMORY_ALIGNMENT_THRESHOLD 1 #endif #if !defined( KOKKOS_IMPL_ALIGN_PTR ) diff --git a/lib/kokkos/core/src/Kokkos_MasterLock.hpp b/lib/kokkos/core/src/Kokkos_MasterLock.hpp index 81564b8eac5c7326c0f1bf5786531102c5d8edc5..2db22d2fdd6ce4131ca7c536b872130e8be7d0e3 100644 --- a/lib/kokkos/core/src/Kokkos_MasterLock.hpp +++ b/lib/kokkos/core/src/Kokkos_MasterLock.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_MemoryPool.hpp b/lib/kokkos/core/src/Kokkos_MemoryPool.hpp index 91997257671a79c83c1221b3b97277e48ec74ea5..cf80004c22bde62af420e33c6e3dbb7b051a8763 100644 --- a/lib/kokkos/core/src/Kokkos_MemoryPool.hpp +++ b/lib/kokkos/core/src/Kokkos_MemoryPool.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -258,12 +258,12 @@ public: //-------------------------------------------------------------------------- - MemoryPool( MemoryPool && ) = default ; - MemoryPool( const MemoryPool & ) = default ; - MemoryPool & operator = ( MemoryPool && ) = default ; - MemoryPool & operator = ( const MemoryPool & ) = default ; + KOKKOS_INLINE_FUNCTION_DEFAULTED MemoryPool( MemoryPool && ) = default ; + KOKKOS_INLINE_FUNCTION_DEFAULTED MemoryPool( const MemoryPool & ) = default ; + KOKKOS_INLINE_FUNCTION_DEFAULTED MemoryPool & operator = ( MemoryPool && ) = default ; + KOKKOS_INLINE_FUNCTION_DEFAULTED MemoryPool & operator = ( const MemoryPool & ) = default ; - MemoryPool() + KOKKOS_INLINE_FUNCTION MemoryPool() : m_tracker() , m_sb_state_array(0) , m_sb_state_size(0) diff --git a/lib/kokkos/core/src/Kokkos_MemoryTraits.hpp b/lib/kokkos/core/src/Kokkos_MemoryTraits.hpp index 36170e4a8e8ad106146b0470348122c9cf86b5cd..eebc83cf3ddc12a745f7aa273321add249716d2a 100644 --- a/lib/kokkos/core/src/Kokkos_MemoryTraits.hpp +++ b/lib/kokkos/core/src/Kokkos_MemoryTraits.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_NumericTraits.hpp b/lib/kokkos/core/src/Kokkos_NumericTraits.hpp index 7264ba7f3899e8733b9e62b358a877dabc6ec9be..baac78254526d9fc375c05be3ae468c6d2171006 100644 --- a/lib/kokkos/core/src/Kokkos_NumericTraits.hpp +++ b/lib/kokkos/core/src/Kokkos_NumericTraits.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_OpenMP.hpp b/lib/kokkos/core/src/Kokkos_OpenMP.hpp index d5de01cf2f83e65497c0a692cf96aae26b2aacc6..769252e8b98c6bad942413a6d9837e15ce6572c7 100644 --- a/lib/kokkos/core/src/Kokkos_OpenMP.hpp +++ b/lib/kokkos/core/src/Kokkos_OpenMP.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -176,7 +176,7 @@ public: KOKKOS_INLINE_FUNCTION static int thread_pool_rank() noexcept; -#if !defined( KOKKOS_DISABLE_DEPRECATED ) +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE /// \brief Initialize the default execution space static void initialize( int thread_count, int use_numa_count, diff --git a/lib/kokkos/core/src/Kokkos_OpenMPTarget.hpp b/lib/kokkos/core/src/Kokkos_OpenMPTarget.hpp index 4f50de032532c2e80c759927756e0cea70c7fb30..e2dd249ff7897cf1dea0c58ca1e10307845dfa64 100644 --- a/lib/kokkos/core/src/Kokkos_OpenMPTarget.hpp +++ b/lib/kokkos/core/src/Kokkos_OpenMPTarget.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_OpenMPTargetSpace.hpp b/lib/kokkos/core/src/Kokkos_OpenMPTargetSpace.hpp index 710a86e2d834d16e773253348b2bb6e480cf3325..f2491900ff6c5448b34f27986542669a36474e6c 100644 --- a/lib/kokkos/core/src/Kokkos_OpenMPTargetSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_OpenMPTargetSpace.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_Pair.hpp b/lib/kokkos/core/src/Kokkos_Pair.hpp index b6b1596883aaa56a9d7d850f8b0e9fdfb140a028..eaa85122f701bb95dac056a452a7fb08551aa08f 100644 --- a/lib/kokkos/core/src/Kokkos_Pair.hpp +++ b/lib/kokkos/core/src/Kokkos_Pair.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_Parallel.hpp b/lib/kokkos/core/src/Kokkos_Parallel.hpp index 0ceae866c48168b3a2410cf2e6e3cdd63263f63b..783cc7fde4a64e5800e055eb493fc246d5a4e26f 100644 --- a/lib/kokkos/core/src/Kokkos_Parallel.hpp +++ b/lib/kokkos/core/src/Kokkos_Parallel.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp b/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp index c392fc5b9ab76f19769b5d68b8b65cbd8340db54..d122d5bdca2b154f0a3711f344ad421da2abf696 100644 --- a/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp +++ b/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -906,241 +906,6 @@ namespace Impl { //---------------------------------------------------------------------------- -#if 0 - -//---------------------------------------------------------------------------- - -namespace Impl { - -template< class OutType , class InType > -inline -typename std::enable_if - < std::is_same< OutType , InType >::value , InType const & >::type -forward_execution_policy( InType const & p ) { return p ; } - -template< class OutType , class InType > -inline -typename std::enable_if - < ! std::is_same< OutType , InType >::value , OutType >::type -forward_execution_policy( InType const & p ) { return OutType(p); } - - -template< class OutType , class InType > -inline -typename std::enable_if - < std::is_same< OutType , InType >::value , InType const & >::type -forward_reducer( InType const & r ) { return r ; } - -template< class OutType , class InType > -inline -typename std::enable_if< Kokkos::is_view< InType >::value , OutType >::type -forward_reducer( InType const & v ) -{ return OutType( v.data() ); } - -template< class OutType > -inline -OutType -forward_reducer( typename OutType::reference ref ) -{ return OutType( ref ); } - -} /* namespace Impl */ - -//---------------------------------------------------------------------------- -// parallel_reduce with 4 args: label, policy, closure, and reducer - -/**\brief Parallel reduce with an explicit Reducer */ -template< class PolicyType , class ClosureType , class ReduceType > -inline -typename std::enable_if< Kokkos::is_reducer< ReduceType >::value >::type -parallel_reduce( std::string const & arg_label - , PolicyType && arg_policy - , ClosureType && arg_closure - , ReduceType && arg_reduce - ) -{ - //------------------------------ - - using input_policy_type = - typename std::remove_const< - typename std::remove_reference< PolicyType >::type >::type ; - - using input_reduce_type = - typename std::remove_const< - typename std::remove_reference< ReduceType >::type >::type ; - - using Analysis = Kokkos::Impl::FunctorAnalysis - < Kokkos::Impl::FunctorPatternInterface::REDUCE - , input_policy_type - , ClosureType - > ; - - //------------------------------ - // Policy is either given or an integer value - // If an integer value then is a RangePolicy with queried execution space - - enum { is_policy = Kokkos::is_execution_policy< input_policy_type >::value }; - enum { is_intval = std::is_integral< input_policy_type >::value }; - - static_assert( is_policy || is_intval , - "Kokkos::parallel_reduce 2nd argument must be execution policy or integral value" ); - - using policy_type = typename std::conditional - < is_policy , input_policy_type - , Kokkos::RangePolicy< typename Analysis::execution_space > - >::type ; - - //------------------------------ - // ReduceType is either a reducer, view, or value reference - - enum { is_reducer = Kokkos::is_reducer< input_reduce_type >::value }; - enum { is_view = Kokkos::is_view< input_reduce_type >::value }; - enum { is_ref = std::is_same< ReduceType - , typename Analysis::reference_type - >::value }; - - static_assert( is_reducer || is_view || is_ref , - "Kokkos::parallel_reduce 4th argument must be reducer, output View, or output variable" ); - - // If input_reducer_type is_view or is_ref then need its memory_space. - // A View has a memory_space, a reference is in the HostSpace. - - using has_space = typename std::conditional - < is_view , input_reduce_type , Kokkos::HostSpace >::type ; - - using memory_space = typename has_space::memory_space ; - - using reduce_type = typename std::conditional - < is_reducer , input_reduce_type - , typename Analysis::Reducer< memory_space > - >::type ; - - //------------------------------ - - #if defined(KOKKOS_ENABLE_PROFILING) - uint64_t kpID = 0; - if(Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::beginParallelReduce(arg_label, 0, &kpID); - } - #endif - - //------------------------------ - // Disable tracking while creating the closure: - - Kokkos::Impl::shared_allocation_tracking_claim_and_disable(); - - Kokkos::Impl::ParallelReduce< ClosureType , policy_type, reduce_type - , typename Analysis::execution_space > - closure( arg_closure - , forward_execution_policy< policy_type >( arg_policy ) - , forward_reducer< reduce_type >( arg_reduce ) ); - - Kokkos::Impl::shared_allocation_tracking_release_and_enable(); - - // Enable tracking after creating the closure - - closure.execute(); - - //------------------------------ - - #if defined(KOKKOS_ENABLE_PROFILING) - if(Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::endParallelReduce(kpID); - } - #endif -} - -//---------------------------------------------------------------------------- -// parallel_reduce with 3 args: policy, closure, and reducer - -template< class PolicyType , class ClosureType , class ReduceType > -inline -typename std::enable_if - < Kokkos::is_execution_policy< - typename std::remove_const< - typename std::remove_reference< PolicyType >::type >::type - >::value - || - std::is_integral< - typename std::remove_const< - typename std::remove_reference< PolicyType >::type >::type - >::value - >::type ; -parallel_reduce( PolicyType && arg_policy - , ClosureType && arg_closure - , ReduceType && arg_reduce - ) -{ - parallel_reduce( typeid(ClosureType).name() - , std::forward< PolicyType >( arg_policy ) - , std::forward< ClosureType >( arg_closure ) - , std::forward< ReduceType >( arg_reduce ) ); -} - -// parallel_reduce with 3 args: label, policy, and closure - -template< class PolicyType , class ClosureType > -inline -void -parallel_reduce( std::string const & arg_label - , PolicyType && arg_policy - , ClosureType && arg_closure - ) -{ - // Deduce a Reducer from the Closure - - using input_policy_type = - typename std::remove_const< - typename std::remove_reference< PolicyType >::type >::type ; - - using Analysis = Kokkos::Impl::FunctorAnalysis - < Kokkos::Impl::FunctorPatternInterface::REDUCE - , input_policy_type - , ClosureType - > ; - - static_assert( Analysis::has_final_member_function , - "Kokkos::parallel_reduce functor does not have a final member function" ); - - parallel_reduce( arg_label - , std::forward< PolicyType >( arg_policy ) - , std::forward< ClosureType >( arg_closure ) - , typename Analysis::Reducer<>() ); -} - -//---------------------------------------------------------------------------- -// parallel_reduce with 2 arguments: policy and closure: - -/**\brief Parallel reduce processed by ClosureType::final */ -template< class PolicyType , class ClosureType > -inline -parallel_reduce( PolicyType && arg_policy - , ClosureType && arg_closure ) -{ - // Deduce a Reducer from the Closure - - using input_policy_type = - typename std::remove_const< - typename std::remove_reference< PolicyType >::type >::type ; - - using Analysis = Kokkos::Impl::FunctorAnalysis - < Kokkos::Impl::FunctorPatternInterface::REDUCE - , input_policy_type - , ClosureType - > ; - - static_assert( Analysis::has_final_member_function , - "Kokkos::parallel_reduce functor does not have a final member function" ); - - parallel_reduce( typeid(ClosureType).name() - , std::forward< PolicyType >( arg_policy ) - , std::forward< ClosureType >( arg_closure ) - , typename Analysis::Reducer<>() ); -} - -#endif - -//---------------------------------------------------------------------------- - /*! \fn void parallel_reduce(label,policy,functor,return_argument) \brief Perform a parallel reduction. \param label An optional Label giving the call name. Must be able to construct a std::string from the argument. diff --git a/lib/kokkos/core/src/Kokkos_Profiling_ProfileSection.hpp b/lib/kokkos/core/src/Kokkos_Profiling_ProfileSection.hpp index b5e58507d6ef7ef42fe1bb7a11830de156e9fa07..b3fd3af70b25e6971aa0e1ea7d375c4822571cb7 100644 --- a/lib/kokkos/core/src/Kokkos_Profiling_ProfileSection.hpp +++ b/lib/kokkos/core/src/Kokkos_Profiling_ProfileSection.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // - // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) + // Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_Qthreads.hpp b/lib/kokkos/core/src/Kokkos_Qthreads.hpp index 0323d32d872b872ad9f8068b67c38ad2c7d03e41..16702f864736a17bd9c77980d06de949d50d688b 100644 --- a/lib/kokkos/core/src/Kokkos_Qthreads.hpp +++ b/lib/kokkos/core/src/Kokkos_Qthreads.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_ROCm.hpp b/lib/kokkos/core/src/Kokkos_ROCm.hpp index 6effbb60909142fde57e67ef460b06a83871dceb..469d6b27878cc5603313f11c835f765dfcda0b3b 100644 --- a/lib/kokkos/core/src/Kokkos_ROCm.hpp +++ b/lib/kokkos/core/src/Kokkos_ROCm.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -47,6 +47,13 @@ #include <Kokkos_Core_fwd.hpp> #if defined( KOKKOS_ENABLE_ROCM ) + +class dim3 { +public: +int x,y,z; +dim3(int _x, int _y, int _z):x(_x),y(_y),z(_z) {}; +}; + #include <ROCm/hc_math_std.hpp> //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -207,11 +214,14 @@ struct VerifyExecutionCanAccessMemorySpace inline static void verify( void ) { Kokkos::Experimental::ROCmSpace::access_error(); } inline static void verify( const void * p ) { Kokkos::Experimental::ROCmSpace::access_error(p); } }; + } // namespace Experimental } // namespace Kokkos + + #define threadIdx_x (hc_get_workitem_id(0)) #define threadIdx_y (hc_get_workitem_id(1)) #define threadIdx_z (hc_get_workitem_id(2)) diff --git a/lib/kokkos/core/src/Kokkos_ROCmSpace.hpp b/lib/kokkos/core/src/Kokkos_ROCmSpace.hpp index dce6a3cb3f838c56aba2de6f73a775b0586ea353..0b98ab1b74b29c1eb7644bce38c9a49742552303 100644 --- a/lib/kokkos/core/src/Kokkos_ROCmSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_ROCmSpace.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp b/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp index c65822c72e76029a2da69fd187419dacb232106c..4527dd4c14586e2c451d0658a5c774bf0da286a4 100644 --- a/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_Serial.hpp b/lib/kokkos/core/src/Kokkos_Serial.hpp index e713461f8dfe2327407727d0a7d75eb6a90b25d6..065b5a0c5efa7112f064fa6092e5c9362051d173 100644 --- a/lib/kokkos/core/src/Kokkos_Serial.hpp +++ b/lib/kokkos/core/src/Kokkos_Serial.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -350,6 +350,32 @@ public: }; typedef Impl::HostThreadTeamMember< Kokkos::Serial > member_type ; + +protected: + /** \brief set chunk_size to a discrete value*/ + inline TeamPolicyInternal internal_set_chunk_size(typename traits::index_type chunk_size_) { + m_chunk_size = chunk_size_; + return *this; + } + + /** \brief set per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team) { + m_team_scratch_size[level] = per_team.value; + return *this; + }; + + /** \brief set per thread scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerThreadValue& per_thread) { + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; + + /** \brief set per thread and per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team, const PerThreadValue& per_thread) { + m_team_scratch_size[level] = per_team.value; + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; }; } /* namespace Impl */ } /* namespace Kokkos */ @@ -679,21 +705,20 @@ private: typedef typename ReducerConditional::type ReducerTypeFwd; typedef typename Kokkos::Impl::if_c< std::is_same<InvalidType,ReducerType>::value, WorkTag, void>::type WorkTagFwd; - typedef typename ReducerTypeFwd::value_type ValueType; - - typedef FunctorAnalysis< FunctorPatternInterface::REDUCE , Policy , FunctorType > Analysis ; + typedef FunctorAnalysis< FunctorPatternInterface::REDUCE , MDRangePolicy , FunctorType > Analysis ; typedef Kokkos::Impl::FunctorValueInit< ReducerTypeFwd , WorkTagFwd > ValueInit ; typedef typename Analysis::pointer_type pointer_type ; + typedef typename Analysis::value_type value_type ; typedef typename Analysis::reference_type reference_type ; using iterate_type = typename Kokkos::Impl::HostIterateTile< MDRangePolicy - , FunctorType - , WorkTag - , ValueType - >; + , FunctorType + , WorkTag + , reference_type + >; const FunctorType m_functor ; diff --git a/lib/kokkos/core/src/Kokkos_TaskPolicy.hpp b/lib/kokkos/core/src/Kokkos_TaskPolicy.hpp index 05ed5103b874d3f8912f1e8ca6e0559967dbd86a..00bceec2b5dba1f5d664831d3f7c86b625b6f4c3 100644 --- a/lib/kokkos/core/src/Kokkos_TaskPolicy.hpp +++ b/lib/kokkos/core/src/Kokkos_TaskPolicy.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp b/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp index 079f80f5561f7efa5a5d1adf2f1fe6914acb82ff..c3185853dc693a7263e1b9e649aad859f78e1121 100644 --- a/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp +++ b/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -419,16 +419,20 @@ public: TaskScheduler() : m_track(), m_queue(0) {} KOKKOS_INLINE_FUNCTION - TaskScheduler( TaskScheduler && rhs ) = default ; + TaskScheduler( TaskScheduler && rhs ) + : m_track( rhs.m_track ), m_queue( rhs.m_queue ) {} KOKKOS_INLINE_FUNCTION - TaskScheduler( TaskScheduler const & rhs ) = default ; + TaskScheduler( TaskScheduler const & rhs ) + : m_track( rhs.m_track ), m_queue( rhs.m_queue ) {} KOKKOS_INLINE_FUNCTION - TaskScheduler & operator = ( TaskScheduler && rhs ) = default ; + TaskScheduler & operator = ( TaskScheduler && rhs ) + { m_track = rhs.m_track ; m_queue = rhs.m_queue ; return *this ; } KOKKOS_INLINE_FUNCTION - TaskScheduler & operator = ( TaskScheduler const & rhs ) = default ; + TaskScheduler & operator = ( TaskScheduler const & rhs ) + { m_track = rhs.m_track ; m_queue = rhs.m_queue ; return *this ; } TaskScheduler( memory_pool const & arg_memory_pool ) : m_track() diff --git a/lib/kokkos/core/src/Kokkos_Threads.hpp b/lib/kokkos/core/src/Kokkos_Threads.hpp index d4069a1f597105af11679d3bcffec3992b57ebad..b135022deb71783e378540129ebf894e27880a5a 100644 --- a/lib/kokkos/core/src/Kokkos_Threads.hpp +++ b/lib/kokkos/core/src/Kokkos_Threads.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_Timer.hpp b/lib/kokkos/core/src/Kokkos_Timer.hpp index ec71386cbbfa24e0906210bc7c62dad94210e804..f6ec4a079a6433a1bbf06daea5c457e3b70dd9b3 100644 --- a/lib/kokkos/core/src/Kokkos_Timer.hpp +++ b/lib/kokkos/core/src/Kokkos_Timer.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_UniqueToken.hpp b/lib/kokkos/core/src/Kokkos_UniqueToken.hpp index 1ffb07a6dbd7d277ab6790d4ae625f56bd14e6bc..d89542631d658af1ede69cab5956af9b7ac6e448 100644 --- a/lib/kokkos/core/src/Kokkos_UniqueToken.hpp +++ b/lib/kokkos/core/src/Kokkos_UniqueToken.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_Vectorization.hpp b/lib/kokkos/core/src/Kokkos_Vectorization.hpp index 00526cb398b7e4fdfe603392a5da43ba0d447e46..f5b6cad4b7f4285d6cddac640e4e8f68eecf65f9 100644 --- a/lib/kokkos/core/src/Kokkos_Vectorization.hpp +++ b/lib/kokkos/core/src/Kokkos_Vectorization.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Kokkos_View.hpp b/lib/kokkos/core/src/Kokkos_View.hpp index d4940b34127c5d43673d7896c15c0ea5912404c9..d8e6321f34ac6011479f792ac365acf1be272bbb 100644 --- a/lib/kokkos/core/src/Kokkos_View.hpp +++ b/lib/kokkos/core/src/Kokkos_View.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -524,6 +524,8 @@ public: * ISO/C++ vocabulary 'extent'. */ +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + template< typename iType > KOKKOS_INLINE_FUNCTION constexpr typename std::enable_if< std::is_integral<iType>::value , size_t >::type @@ -538,6 +540,8 @@ public: KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const { return m_map.dimension_6(); } KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const { return m_map.dimension_7(); } +#endif + //---------------------------------------- KOKKOS_INLINE_FUNCTION constexpr size_t size() const { return m_map.dimension_0() * @@ -558,6 +562,20 @@ public: KOKKOS_INLINE_FUNCTION constexpr size_t stride_6() const { return m_map.stride_6(); } KOKKOS_INLINE_FUNCTION constexpr size_t stride_7() const { return m_map.stride_7(); } + template< typename iType > + KOKKOS_INLINE_FUNCTION constexpr + typename std::enable_if< std::is_integral<iType>::value , size_t >::type + stride(iType r) const { + return (r == 0 ? m_map.stride_0() : + (r == 1 ? m_map.stride_1() : + (r == 2 ? m_map.stride_2() : + (r == 3 ? m_map.stride_3() : + (r == 4 ? m_map.stride_4() : + (r == 5 ? m_map.stride_5() : + (r == 6 ? m_map.stride_6() : + m_map.stride_7()))))))); + } + template< typename iType > KOKKOS_INLINE_FUNCTION void stride( iType * const s ) const { m_map.stride(s); } @@ -570,15 +588,19 @@ public: enum { reference_type_is_lvalue_reference = std::is_lvalue_reference< reference_type >::value }; KOKKOS_INLINE_FUNCTION constexpr size_t span() const { return m_map.span(); } +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE // Deprecated, use 'span()' instead KOKKOS_INLINE_FUNCTION constexpr size_t capacity() const { return m_map.span(); } - KOKKOS_INLINE_FUNCTION constexpr bool span_is_contiguous() const { return m_map.span_is_contiguous(); } +#endif + KOKKOS_INLINE_FUNCTION bool span_is_contiguous() const { return m_map.span_is_contiguous(); } KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const { return m_map.data(); } +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE // Deprecated, use 'span_is_contigous()' instead KOKKOS_INLINE_FUNCTION constexpr bool is_contiguous() const { return m_map.span_is_contiguous(); } // Deprecated, use 'data()' instead KOKKOS_INLINE_FUNCTION constexpr pointer_type ptr_on_device() const { return m_map.data(); } +#endif //---------------------------------------- // Allow specializations to query their specialized map @@ -629,9 +651,7 @@ private: public: - //------------------------------ - // Rank 0 operator() - +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE template< class ... Args > KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<( Kokkos::Impl::are_integral<Args...>::value @@ -643,19 +663,16 @@ public: return m_map.reference(); } - //------------------------------ - // Rank 1 operator() - template< typename I0 - , class ... Args > + , class ... Args> KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< ( Kokkos::Impl::are_integral<I0,Args...>::value && ( 1 == Rank ) && ! is_default_map ), reference_type >::type - operator()( const I0 & i0 - , Args ... args ) const + operator()( const I0 & i0, + Args ... args) const { KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) return m_map.reference(i0); @@ -694,51 +711,49 @@ public: } //------------------------------ - // Rank 1 operator[] - - template< typename I0 > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0>::value - && ( 1 == Rank ) - && ! is_default_map - ), reference_type >::type - operator[]( const I0 & i0 ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) - return m_map.reference(i0); - } + // Rank 1 operator[] + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && ! is_default_map + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.reference(i0); + } - template< typename I0 > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0>::value - && ( 1 == Rank ) - && is_default_map - && ! is_layout_stride - ), reference_type >::type - operator[]( const I0 & i0 ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) - return m_map.m_handle[ i0 ]; - } + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && ! is_layout_stride + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.m_handle[ i0 ]; + } - template< typename I0 > - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if< - ( Kokkos::Impl::are_integral<I0>::value - && ( 1 == Rank ) - && is_default_map - && is_layout_stride - ), reference_type >::type - operator[]( const I0 & i0 ) const - { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) - return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; - } + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; + } - //------------------------------ - // Rank 2 template< typename I0 , typename I1 , class ... Args > @@ -906,36 +921,425 @@ public: // Rank 5 template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 - , class ... Args > + , typename I4 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,Args...>::value + && ( 5 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,Args...>::value + && ( 5 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) + return m_map.reference(i0,i1,i2,i3,i4); + } + + //------------------------------ + // Rank 6 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,Args...>::value + && ( 6 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,Args...>::value + && ( 6 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) + return m_map.reference(i0,i1,i2,i3,i4,i5); + } + + //------------------------------ + // Rank 7 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,Args...>::value + && ( 7 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,Args...>::value + && ( 7 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + return m_map.reference(i0,i1,i2,i3,i4,i5,i6); + } + + //------------------------------ + // Rank 8 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 , typename I7 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7,Args...>::value + && ( 8 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 , typename I7 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7,Args...>::value + && ( 8 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + return m_map.reference(i0,i1,i2,i3,i4,i5,i6,i7); + } + + + #else + //------------------------------ + // Rank 0 operator() + + KOKKOS_FORCEINLINE_FUNCTION + reference_type + operator()() const + { + return m_map.reference(); + } + //------------------------------ + // Rank 1 operator() + + + template< typename I0> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.reference(i0); + } + + template< typename I0> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && ! is_layout_stride + ), reference_type >::type + operator()( const I0 & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.m_handle[ i0 ]; + } + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + operator()( const I0 & i0) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; + } + //------------------------------ + // Rank 1 operator[] + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && ! is_default_map + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.reference(i0); + } + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && ! is_layout_stride + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.m_handle[ i0 ]; + } + + template< typename I0 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0>::value + && ( 1 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + operator[]( const I0 & i0 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0) ) + return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; + } + + + //------------------------------ + // Rank 2 + + template< typename I0 , typename I1 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) + return m_map.reference(i0,i1); + } + + template< typename I0 , typename I1 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_left && ( traits::rank_dynamic == 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) + return m_map.m_handle[ i0 + m_map.m_offset.m_dim.N0 * i1 ]; + } + + template< typename I0 , typename I1> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_left && ( traits::rank_dynamic != 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) + return m_map.m_handle[ i0 + m_map.m_offset.m_stride * i1 ]; + } + + template< typename I0 , typename I1 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_right && ( traits::rank_dynamic == 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) + return m_map.m_handle[ i1 + m_map.m_offset.m_dim.N1 * i0 ]; + } + + template< typename I0 , typename I1 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_right && ( traits::rank_dynamic != 0 ) + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) + return m_map.m_handle[ i1 + m_map.m_offset.m_stride * i0 ]; + } + + template< typename I0 , typename I1> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1) ) + return m_map.m_handle[ i0 * m_map.m_offset.m_stride.S0 + + i1 * m_map.m_offset.m_stride.S1 ]; + } + + //------------------------------ + // Rank 3 + + template< typename I0 , typename I1 , typename I2 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2>::value + && ( 3 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2) ]; + } + + template< typename I0 , typename I1 , typename I2> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2>::value + && ( 3 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2) ) + return m_map.reference(i0,i1,i2); + } + + //------------------------------ + // Rank 4 + + template< typename I0 , typename I1 , typename I2 , typename I3> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3>::value + && ( 4 == Rank ) + && is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3>::value + && ( 4 == Rank ) + && ! is_default_map + ), reference_type >::type + operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3) ) + return m_map.reference(i0,i1,i2,i3); + } + + //------------------------------ + // Rank 5 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4> KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,Args...>::value + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4>::value && ( 5 == Rank ) && is_default_map ), reference_type >::type operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 - , Args ... args ) const + , const I4 & i4 ) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4) ) return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 - , class ... Args > + , typename I4> KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,Args...>::value + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4>::value && ( 5 == Rank ) && ! is_default_map ), reference_type >::type operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 - , Args ... args ) const + , const I4 & i4) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4) ) return m_map.reference(i0,i1,i2,i3,i4); } @@ -943,36 +1347,32 @@ public: // Rank 6 template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 - , class ... Args > + , typename I4 , typename I5 > KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,Args...>::value + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5>::value && ( 6 == Rank ) && is_default_map ), reference_type >::type operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 - , Args ... args ) const + , const I4 & i4 , const I5 & i5 ) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5) ) return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 - , class ... Args > + , typename I4 , typename I5> KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,Args...>::value + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5>::value && ( 6 == Rank ) && ! is_default_map ), reference_type >::type operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 - , Args ... args ) const + , const I4 & i4 , const I5 & i5) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5) ) return m_map.reference(i0,i1,i2,i3,i4,i5); } @@ -980,36 +1380,32 @@ public: // Rank 7 template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 , typename I6 - , class ... Args > + , typename I4 , typename I5 , typename I6> KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,Args...>::value + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6>::value && ( 7 == Rank ) && is_default_map ), reference_type >::type operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 , const I6 & i6 - , Args ... args ) const + , const I4 & i4 , const I5 & i5 , const I6 & i6) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6) ) return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 , typename I6 - , class ... Args > + , typename I4 , typename I5 , typename I6 > KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,Args...>::value + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6>::value && ( 7 == Rank ) && ! is_default_map ), reference_type >::type operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 , const I6 & i6 - , Args ... args ) const + , const I4 & i4 , const I5 & i5 , const I6 & i6) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6) ) return m_map.reference(i0,i1,i2,i3,i4,i5,i6); } @@ -1017,39 +1413,406 @@ public: // Rank 8 template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 , typename I6 , typename I7 - , class ... Args > + , typename I4 , typename I5 , typename I6 , typename I7 > KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7,Args...>::value + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7>::value && ( 8 == Rank ) && is_default_map ), reference_type >::type operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 - , Args ... args ) const + , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7) ) return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; } template< typename I0 , typename I1 , typename I2 , typename I3 - , typename I4 , typename I5 , typename I6 , typename I7 - , class ... Args > + , typename I4 , typename I5 , typename I6 , typename I7> KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7,Args...>::value + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7>::value && ( 8 == Rank ) && ! is_default_map ), reference_type >::type operator()( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 - , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 - , Args ... args ) const + , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 ) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7) ) return m_map.reference(i0,i1,i2,i3,i4,i5,i6,i7); } +#endif + + template< class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if<( Kokkos::Impl::are_integral<Args...>::value + && ( 0 == Rank ) + ), reference_type >::type + access( Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,args...) ) + return m_map.reference(); + } + + template< typename I0 + , class ... Args> + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,Args...>::value + && ( 1 == Rank ) + && ! is_default_map + ), reference_type >::type + access( const I0 & i0, + Args ... args) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) + return m_map.reference(i0); + } + + template< typename I0 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,Args...>::value + && ( 1 == Rank ) + && is_default_map + && ! is_layout_stride + ), reference_type >::type + access( const I0 & i0 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) + return m_map.m_handle[ i0 ]; + } + + template< typename I0 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,Args...>::value + && ( 1 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + access( const I0 & i0 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,args...) ) + return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; + } + + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && ! is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.reference(i0,i1); + } + + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_left && ( traits::rank_dynamic == 0 ) + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.m_handle[ i0 + m_map.m_offset.m_dim.N0 * i1 ]; + } + + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_left && ( traits::rank_dynamic != 0 ) + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.m_handle[ i0 + m_map.m_offset.m_stride * i1 ]; + } + + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_right && ( traits::rank_dynamic == 0 ) + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.m_handle[ i1 + m_map.m_offset.m_dim.N1 * i0 ]; + } + + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_right && ( traits::rank_dynamic != 0 ) + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.m_handle[ i1 + m_map.m_offset.m_stride * i0 ]; + } + + template< typename I0 , typename I1 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,Args...>::value + && ( 2 == Rank ) + && is_default_map + && is_layout_stride + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,args...) ) + return m_map.m_handle[ i0 * m_map.m_offset.m_stride.S0 + + i1 * m_map.m_offset.m_stride.S1 ]; + } + + //------------------------------ + // Rank 3 + + template< typename I0 , typename I1 , typename I2 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,Args...>::value + && ( 3 == Rank ) + && is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,args...) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2) ]; + } + + template< typename I0 , typename I1 , typename I2 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,Args...>::value + && ( 3 == Rank ) + && ! is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,args...) ) + return m_map.reference(i0,i1,i2); + } + + //------------------------------ + // Rank 4 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,Args...>::value + && ( 4 == Rank ) + && is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,args...) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,Args...>::value + && ( 4 == Rank ) + && ! is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,args...) ) + return m_map.reference(i0,i1,i2,i3); + } + + //------------------------------ + // Rank 5 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,Args...>::value + && ( 5 == Rank ) + && is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,Args...>::value + && ( 5 == Rank ) + && ! is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,args...) ) + return m_map.reference(i0,i1,i2,i3,i4); + } + + //------------------------------ + // Rank 6 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,Args...>::value + && ( 6 == Rank ) + && is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,Args...>::value + && ( 6 == Rank ) + && ! is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,args...) ) + return m_map.reference(i0,i1,i2,i3,i4,i5); + } + + //------------------------------ + // Rank 7 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,Args...>::value + && ( 7 == Rank ) + && is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,Args...>::value + && ( 7 == Rank ) + && ! is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + return m_map.reference(i0,i1,i2,i3,i4,i5,i6); + } + + //------------------------------ + // Rank 8 + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 , typename I7 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7,Args...>::value + && ( 8 == Rank ) + && is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; + } + + template< typename I0 , typename I1 , typename I2 , typename I3 + , typename I4 , typename I5 , typename I6 , typename I7 + , class ... Args > + KOKKOS_FORCEINLINE_FUNCTION + typename std::enable_if< + ( Kokkos::Impl::are_integral<I0,I1,I2,I3,I4,I5,I6,I7,Args...>::value + && ( 8 == Rank ) + && ! is_default_map + ), reference_type >::type + access( const I0 & i0 , const I1 & i1 , const I2 & i2 , const I3 & i3 + , const I4 & i4 , const I5 & i5 , const I6 & i6 , const I7 & i7 + , Args ... args ) const + { + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + return m_map.reference(i0,i1,i2,i3,i4,i5,i6,i7); + } + + #undef KOKKOS_IMPL_VIEW_OPERATOR_VERIFY //---------------------------------------- @@ -1062,16 +1825,16 @@ public: View() : m_track(), m_map() {} KOKKOS_INLINE_FUNCTION - View( const View & rhs ) : m_track( rhs.m_track ), m_map( rhs.m_map ) {} + View( const View & rhs ) : m_track( rhs.m_track, traits::is_managed ), m_map( rhs.m_map ) {} KOKKOS_INLINE_FUNCTION - View( View && rhs ) : m_track( rhs.m_track ), m_map( rhs.m_map ) {} + View( View && rhs ) : m_track( std::move(rhs.m_track) ), m_map( std::move(rhs.m_map) ) {} KOKKOS_INLINE_FUNCTION View & operator = ( const View & rhs ) { m_track = rhs.m_track ; m_map = rhs.m_map ; return *this ; } KOKKOS_INLINE_FUNCTION - View & operator = ( View && rhs ) { m_track = rhs.m_track ; m_map = rhs.m_map ; return *this ; } + View & operator = ( View && rhs ) { m_track = std::move(rhs.m_track) ; m_map = std::move(rhs.m_map) ; return *this ; } //---------------------------------------- // Compatible view copy constructor and assignment @@ -1393,15 +2156,19 @@ public: // Shared scratch memory constructor static inline - size_t shmem_size( const size_t arg_N0 = ~size_t(0) , - const size_t arg_N1 = ~size_t(0) , - const size_t arg_N2 = ~size_t(0) , - const size_t arg_N3 = ~size_t(0) , - const size_t arg_N4 = ~size_t(0) , - const size_t arg_N5 = ~size_t(0) , - const size_t arg_N6 = ~size_t(0) , - const size_t arg_N7 = ~size_t(0) ) + size_t + shmem_size( const size_t arg_N0 = ~size_t(0) , + const size_t arg_N1 = ~size_t(0) , + const size_t arg_N2 = ~size_t(0) , + const size_t arg_N3 = ~size_t(0) , + const size_t arg_N4 = ~size_t(0) , + const size_t arg_N5 = ~size_t(0) , + const size_t arg_N6 = ~size_t(0) , + const size_t arg_N7 = ~size_t(0) ) { + if ( is_layout_stride ) { + Kokkos::abort( "Kokkos::View::shmem_size(extents...) doesn't work with LayoutStride. Pass a LayoutStride object instead" ); + } const size_t num_passed_args = ( arg_N0 != ~size_t(0) ) + ( arg_N1 != ~size_t(0) ) + ( arg_N2 != ~size_t(0) ) + ( arg_N3 != ~size_t(0) ) + ( arg_N4 != ~size_t(0) ) + ( arg_N5 != ~size_t(0) ) + @@ -1411,12 +2178,18 @@ public: Kokkos::abort( "Kokkos::View::shmem_size() rank_dynamic != number of arguments.\n" ); } - return map_type::memory_span( + return View::shmem_size( typename traits::array_layout ( arg_N0 , arg_N1 , arg_N2 , arg_N3 , arg_N4 , arg_N5 , arg_N6 , arg_N7 ) ); } + static inline + size_t shmem_size( typename traits::array_layout const& arg_layout ) + { + return map_type::memory_span( arg_layout ); + } + explicit KOKKOS_INLINE_FUNCTION View( const typename traits::execution_space::scratch_memory_space & arg_space , const typename traits::array_layout & arg_layout ) @@ -1536,14 +2309,14 @@ bool operator == ( const View<LT,LP...> & lhs , unsigned(lhs_traits::rank) == unsigned(rhs_traits::rank) && lhs.data() == rhs.data() && lhs.span() == rhs.span() && - lhs.dimension_0() == rhs.dimension_0() && - lhs.dimension_1() == rhs.dimension_1() && - lhs.dimension_2() == rhs.dimension_2() && - lhs.dimension_3() == rhs.dimension_3() && - lhs.dimension_4() == rhs.dimension_4() && - lhs.dimension_5() == rhs.dimension_5() && - lhs.dimension_6() == rhs.dimension_6() && - lhs.dimension_7() == rhs.dimension_7(); + lhs.extent(0) == rhs.extent(0) && + lhs.extent(1) == rhs.extent(1) && + lhs.extent(2) == rhs.extent(2) && + lhs.extent(3) == rhs.extent(3) && + lhs.extent(4) == rhs.extent(4) && + lhs.extent(5) == rhs.extent(5) && + lhs.extent(6) == rhs.extent(6) && + lhs.extent(7) == rhs.extent(7); } template< class LT , class ... LP , class RT , class ... RP > @@ -1576,509 +2349,6 @@ void shared_allocation_tracking_enable() //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -namespace Kokkos { -namespace Impl { - -template< class OutputView , typename Enable = void > -struct ViewFill { - - typedef typename OutputView::const_value_type const_value_type ; - - const OutputView output ; - const_value_type input ; - - KOKKOS_INLINE_FUNCTION - void operator()( const size_t i0 ) const - { - const size_t n1 = output.dimension_1(); - const size_t n2 = output.dimension_2(); - const size_t n3 = output.dimension_3(); - const size_t n4 = output.dimension_4(); - const size_t n5 = output.dimension_5(); - const size_t n6 = output.dimension_6(); - const size_t n7 = output.dimension_7(); - - for ( size_t i1 = 0 ; i1 < n1 ; ++i1 ) { - for ( size_t i2 = 0 ; i2 < n2 ; ++i2 ) { - for ( size_t i3 = 0 ; i3 < n3 ; ++i3 ) { - for ( size_t i4 = 0 ; i4 < n4 ; ++i4 ) { - for ( size_t i5 = 0 ; i5 < n5 ; ++i5 ) { - for ( size_t i6 = 0 ; i6 < n6 ; ++i6 ) { - for ( size_t i7 = 0 ; i7 < n7 ; ++i7 ) { - output(i0,i1,i2,i3,i4,i5,i6,i7) = input ; - }}}}}}} - } - - ViewFill( const OutputView & arg_out , const_value_type & arg_in ) - : output( arg_out ), input( arg_in ) - { - typedef typename OutputView::execution_space execution_space ; - typedef Kokkos::RangePolicy< execution_space > Policy ; - - const Kokkos::Impl::ParallelFor< ViewFill , Policy > closure( *this , Policy( 0 , output.dimension_0() ) ); - - closure.execute(); - - execution_space::fence(); - } -}; - -template< class OutputView > -struct ViewFill< OutputView , typename std::enable_if< OutputView::Rank == 0 >::type > { - ViewFill( const OutputView & dst , const typename OutputView::const_value_type & src ) - { - Kokkos::Impl::DeepCopy< typename OutputView::memory_space , Kokkos::HostSpace > - ( dst.data() , & src , sizeof(typename OutputView::const_value_type) ); - } -}; - -template< class OutputView , class InputView , class ExecSpace = typename OutputView::execution_space > -struct ViewRemap { - - const OutputView output ; - const InputView input ; - const size_t n0 ; - const size_t n1 ; - const size_t n2 ; - const size_t n3 ; - const size_t n4 ; - const size_t n5 ; - const size_t n6 ; - const size_t n7 ; - - ViewRemap( const OutputView & arg_out , const InputView & arg_in ) - : output( arg_out ), input( arg_in ) - , n0( std::min( (size_t)arg_out.dimension_0() , (size_t)arg_in.dimension_0() ) ) - , n1( std::min( (size_t)arg_out.dimension_1() , (size_t)arg_in.dimension_1() ) ) - , n2( std::min( (size_t)arg_out.dimension_2() , (size_t)arg_in.dimension_2() ) ) - , n3( std::min( (size_t)arg_out.dimension_3() , (size_t)arg_in.dimension_3() ) ) - , n4( std::min( (size_t)arg_out.dimension_4() , (size_t)arg_in.dimension_4() ) ) - , n5( std::min( (size_t)arg_out.dimension_5() , (size_t)arg_in.dimension_5() ) ) - , n6( std::min( (size_t)arg_out.dimension_6() , (size_t)arg_in.dimension_6() ) ) - , n7( std::min( (size_t)arg_out.dimension_7() , (size_t)arg_in.dimension_7() ) ) - { - typedef Kokkos::RangePolicy< ExecSpace > Policy ; - const Kokkos::Impl::ParallelFor< ViewRemap , Policy > closure( *this , Policy( 0 , n0 ) ); - closure.execute(); - } - - KOKKOS_INLINE_FUNCTION - void operator()( const size_t i0 ) const - { - for ( size_t i1 = 0 ; i1 < n1 ; ++i1 ) { - for ( size_t i2 = 0 ; i2 < n2 ; ++i2 ) { - for ( size_t i3 = 0 ; i3 < n3 ; ++i3 ) { - for ( size_t i4 = 0 ; i4 < n4 ; ++i4 ) { - for ( size_t i5 = 0 ; i5 < n5 ; ++i5 ) { - for ( size_t i6 = 0 ; i6 < n6 ; ++i6 ) { - for ( size_t i7 = 0 ; i7 < n7 ; ++i7 ) { - output(i0,i1,i2,i3,i4,i5,i6,i7) = input(i0,i1,i2,i3,i4,i5,i6,i7); - }}}}}}} - } -}; - -} /* namespace Impl */ -} /* namespace Kokkos */ - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -namespace Kokkos { - -/** \brief Deep copy a value from Host memory into a view. */ -template< class DT , class ... DP > -inline -void deep_copy - ( const View<DT,DP...> & dst - , typename ViewTraits<DT,DP...>::const_value_type & value - , typename std::enable_if< - std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value - >::type * = 0 ) -{ - static_assert( - std::is_same< typename ViewTraits<DT,DP...>::non_const_value_type , - typename ViewTraits<DT,DP...>::value_type >::value - , "deep_copy requires non-const type" ); - - Kokkos::Impl::ViewFill< View<DT,DP...> >( dst , value ); -} - -/** \brief Deep copy into a value in Host memory from a view. */ -template< class ST , class ... SP > -inline -void deep_copy - ( typename ViewTraits<ST,SP...>::non_const_value_type & dst - , const View<ST,SP...> & src - , typename std::enable_if< - std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value - >::type * = 0 ) -{ - static_assert( ViewTraits<ST,SP...>::rank == 0 - , "ERROR: Non-rank-zero view in deep_copy( value , View )" ); - - typedef ViewTraits<ST,SP...> src_traits ; - typedef typename src_traits::memory_space src_memory_space ; - Kokkos::Impl::DeepCopy< HostSpace , src_memory_space >( & dst , src.data() , sizeof(ST) ); -} - -//---------------------------------------------------------------------------- -/** \brief A deep copy between views of compatible type, and rank zero. */ -template< class DT , class ... DP , class ST , class ... SP > -inline -void deep_copy - ( const View<DT,DP...> & dst - , const View<ST,SP...> & src - , typename std::enable_if<( - std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value && - std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value && - ( unsigned(ViewTraits<DT,DP...>::rank) == unsigned(0) && - unsigned(ViewTraits<ST,SP...>::rank) == unsigned(0) ) - )>::type * = 0 ) -{ - static_assert( - std::is_same< typename ViewTraits<DT,DP...>::value_type , - typename ViewTraits<ST,SP...>::non_const_value_type >::value - , "deep_copy requires matching non-const destination type" ); - - typedef View<DT,DP...> dst_type ; - typedef View<ST,SP...> src_type ; - - typedef typename dst_type::value_type value_type ; - typedef typename dst_type::memory_space dst_memory_space ; - typedef typename src_type::memory_space src_memory_space ; - - if ( dst.data() != src.data() ) { - Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space >( dst.data() , src.data() , sizeof(value_type) ); - } -} - -//---------------------------------------------------------------------------- -/** \brief A deep copy between views of the default specialization, compatible type, - * same non-zero rank, same contiguous layout. - */ -template< class DT , class ... DP , class ST , class ... SP > -inline -void deep_copy - ( const View<DT,DP...> & dst - , const View<ST,SP...> & src - , typename std::enable_if<( - std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value && - std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value && - ( unsigned(ViewTraits<DT,DP...>::rank) != 0 || - unsigned(ViewTraits<ST,SP...>::rank) != 0 ) - )>::type * = 0 ) -{ - static_assert( - std::is_same< typename ViewTraits<DT,DP...>::value_type , - typename ViewTraits<DT,DP...>::non_const_value_type >::value - , "deep_copy requires non-const destination type" ); - - static_assert( - ( unsigned(ViewTraits<DT,DP...>::rank) == - unsigned(ViewTraits<ST,SP...>::rank) ) - , "deep_copy requires Views of equal rank" ); - - typedef View<DT,DP...> dst_type ; - typedef View<ST,SP...> src_type ; - - typedef typename dst_type::execution_space dst_execution_space ; - typedef typename src_type::execution_space src_execution_space ; - typedef typename dst_type::memory_space dst_memory_space ; - typedef typename src_type::memory_space src_memory_space ; - - enum { DstExecCanAccessSrc = - Kokkos::Impl::SpaceAccessibility< dst_execution_space , src_memory_space >::accessible }; - - enum { SrcExecCanAccessDst = - Kokkos::Impl::SpaceAccessibility< src_execution_space , dst_memory_space >::accessible }; - - - if ( (void *) dst.data() != (void*) src.data() ) { - -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - const size_t nbytes = sizeof(typename dst_type::value_type) * dst.span(); - Kokkos::Profiling::beginDeepCopy( - Kokkos::Profiling::SpaceHandle(dst_memory_space::name()), - dst.label(), - dst.data(), - Kokkos::Profiling::SpaceHandle(src_memory_space::name()), - src.label(), - src.data(), - nbytes); - } -#endif - - // Concern: If overlapping views then a parallel copy will be erroneous. - // ... - - // If same type, equal layout, equal dimensions, equal span, and contiguous memory then can byte-wise copy - - if ( std::is_same< typename ViewTraits<DT,DP...>::value_type , - typename ViewTraits<ST,SP...>::non_const_value_type >::value && - ( - ( std::is_same< typename ViewTraits<DT,DP...>::array_layout , - typename ViewTraits<ST,SP...>::array_layout >::value - && - ( std::is_same< typename ViewTraits<DT,DP...>::array_layout , - typename Kokkos::LayoutLeft>::value - || - std::is_same< typename ViewTraits<DT,DP...>::array_layout , - typename Kokkos::LayoutRight>::value - ) - ) - || - ( ViewTraits<DT,DP...>::rank == 1 && - ViewTraits<ST,SP...>::rank == 1 ) - ) && - dst.span_is_contiguous() && - src.span_is_contiguous() && - dst.span() == src.span() && - dst.dimension_0() == src.dimension_0() && - dst.dimension_1() == src.dimension_1() && - dst.dimension_2() == src.dimension_2() && - dst.dimension_3() == src.dimension_3() && - dst.dimension_4() == src.dimension_4() && - dst.dimension_5() == src.dimension_5() && - dst.dimension_6() == src.dimension_6() && - dst.dimension_7() == src.dimension_7() ) { - - const size_t nbytes = sizeof(typename dst_type::value_type) * dst.span(); - - Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space >( dst.data() , src.data() , nbytes ); - } - else if ( std::is_same< typename ViewTraits<DT,DP...>::value_type , - typename ViewTraits<ST,SP...>::non_const_value_type >::value && - ( - ( std::is_same< typename ViewTraits<DT,DP...>::array_layout , - typename ViewTraits<ST,SP...>::array_layout >::value - && - std::is_same< typename ViewTraits<DT,DP...>::array_layout , - typename Kokkos::LayoutStride>::value - ) - || - ( ViewTraits<DT,DP...>::rank == 1 && - ViewTraits<ST,SP...>::rank == 1 ) - ) && - dst.span_is_contiguous() && - src.span_is_contiguous() && - dst.span() == src.span() && - dst.dimension_0() == src.dimension_0() && - dst.dimension_1() == src.dimension_1() && - dst.dimension_2() == src.dimension_2() && - dst.dimension_3() == src.dimension_3() && - dst.dimension_4() == src.dimension_4() && - dst.dimension_5() == src.dimension_5() && - dst.dimension_6() == src.dimension_6() && - dst.dimension_7() == src.dimension_7() && - dst.stride_0() == src.stride_0() && - dst.stride_1() == src.stride_1() && - dst.stride_2() == src.stride_2() && - dst.stride_3() == src.stride_3() && - dst.stride_4() == src.stride_4() && - dst.stride_5() == src.stride_5() && - dst.stride_6() == src.stride_6() && - dst.stride_7() == src.stride_7() - ) { - - const size_t nbytes = sizeof(typename dst_type::value_type) * dst.span(); - - Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space >( dst.data() , src.data() , nbytes ); - } - else if ( DstExecCanAccessSrc ) { - // Copying data between views in accessible memory spaces and either non-contiguous or incompatible shape. - Kokkos::Impl::ViewRemap< dst_type , src_type >( dst , src ); - } - else if ( SrcExecCanAccessDst ) { - // Copying data between views in accessible memory spaces and either non-contiguous or incompatible shape. - Kokkos::Impl::ViewRemap< dst_type , src_type , src_execution_space >( dst , src ); - } - else { - Kokkos::Impl::throw_runtime_exception("deep_copy given views that would require a temporary allocation"); - } - -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::endDeepCopy(); - } -#endif - - } // ( (void *) dst.data() != (void*) src.data() ) -} - -} /* namespace Kokkos */ - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -namespace Kokkos { - -/** \brief Deep copy a value from Host memory into a view. */ -template< class ExecSpace ,class DT , class ... DP > -inline -void deep_copy - ( const ExecSpace & - , const View<DT,DP...> & dst - , typename ViewTraits<DT,DP...>::const_value_type & value - , typename std::enable_if< - Kokkos::Impl::is_execution_space< ExecSpace >::value && - std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value - >::type * = 0 ) -{ - static_assert( - std::is_same< typename ViewTraits<DT,DP...>::non_const_value_type , - typename ViewTraits<DT,DP...>::value_type >::value - , "deep_copy requires non-const type" ); - - Kokkos::Impl::ViewFill< View<DT,DP...> >( dst , value ); -} - -/** \brief Deep copy into a value in Host memory from a view. */ -template< class ExecSpace , class ST , class ... SP > -inline -void deep_copy - ( const ExecSpace & exec_space - , typename ViewTraits<ST,SP...>::non_const_value_type & dst - , const View<ST,SP...> & src - , typename std::enable_if< - Kokkos::Impl::is_execution_space< ExecSpace >::value && - std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value - >::type * = 0 ) -{ - static_assert( ViewTraits<ST,SP...>::rank == 0 - , "ERROR: Non-rank-zero view in deep_copy( value , View )" ); - - typedef ViewTraits<ST,SP...> src_traits ; - typedef typename src_traits::memory_space src_memory_space ; - Kokkos::Impl::DeepCopy< HostSpace , src_memory_space , ExecSpace > - ( exec_space , & dst , src.data() , sizeof(ST) ); -} - -//---------------------------------------------------------------------------- -/** \brief A deep copy between views of compatible type, and rank zero. */ -template< class ExecSpace , class DT , class ... DP , class ST , class ... SP > -inline -void deep_copy - ( const ExecSpace & exec_space - , const View<DT,DP...> & dst - , const View<ST,SP...> & src - , typename std::enable_if<( - Kokkos::Impl::is_execution_space< ExecSpace >::value && - std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value && - std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value && - ( unsigned(ViewTraits<DT,DP...>::rank) == unsigned(0) && - unsigned(ViewTraits<ST,SP...>::rank) == unsigned(0) ) - )>::type * = 0 ) -{ - static_assert( - std::is_same< typename ViewTraits<DT,DP...>::value_type , - typename ViewTraits<ST,SP...>::non_const_value_type >::value - , "deep_copy requires matching non-const destination type" ); - - typedef View<DT,DP...> dst_type ; - typedef View<ST,SP...> src_type ; - - typedef typename dst_type::value_type value_type ; - typedef typename dst_type::memory_space dst_memory_space ; - typedef typename src_type::memory_space src_memory_space ; - - if ( dst.data() != src.data() ) { - Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space , ExecSpace > - ( exec_space , dst.data() , src.data() , sizeof(value_type) ); - } -} - -//---------------------------------------------------------------------------- -/** \brief A deep copy between views of the default specialization, compatible type, - * same non-zero rank, same contiguous layout. - */ -template< class ExecSpace , class DT, class ... DP, class ST, class ... SP > -inline -void deep_copy - ( const ExecSpace & exec_space - , const View<DT,DP...> & dst - , const View<ST,SP...> & src - , typename std::enable_if<( - Kokkos::Impl::is_execution_space< ExecSpace >::value && - std::is_same< typename ViewTraits<DT,DP...>::specialize , void >::value && - std::is_same< typename ViewTraits<ST,SP...>::specialize , void >::value && - ( unsigned(ViewTraits<DT,DP...>::rank) != 0 || - unsigned(ViewTraits<ST,SP...>::rank) != 0 ) - )>::type * = 0 ) -{ - static_assert( - std::is_same< typename ViewTraits<DT,DP...>::value_type , - typename ViewTraits<DT,DP...>::non_const_value_type >::value - , "deep_copy requires non-const destination type" ); - - static_assert( - ( unsigned(ViewTraits<DT,DP...>::rank) == - unsigned(ViewTraits<ST,SP...>::rank) ) - , "deep_copy requires Views of equal rank" ); - - typedef View<DT,DP...> dst_type ; - typedef View<ST,SP...> src_type ; - - typedef typename dst_type::execution_space dst_execution_space ; - typedef typename src_type::execution_space src_execution_space ; - typedef typename dst_type::memory_space dst_memory_space ; - typedef typename src_type::memory_space src_memory_space ; - - enum { DstExecCanAccessSrc = - Kokkos::Impl::SpaceAccessibility< dst_execution_space , src_memory_space >::accessible }; - - enum { SrcExecCanAccessDst = - Kokkos::Impl::SpaceAccessibility< src_execution_space , dst_memory_space >::accessible }; - - if ( (void *) dst.data() != (void*) src.data() ) { - - // Concern: If overlapping views then a parallel copy will be erroneous. - // ... - - // If same type, equal layout, equal dimensions, equal span, and contiguous memory then can byte-wise copy - - if ( std::is_same< typename ViewTraits<DT,DP...>::value_type , - typename ViewTraits<ST,SP...>::non_const_value_type >::value && - ( - std::is_same< typename ViewTraits<DT,DP...>::array_layout , - typename ViewTraits<ST,SP...>::array_layout >::value - || - ( ViewTraits<DT,DP...>::rank == 1 && - ViewTraits<ST,SP...>::rank == 1 ) - ) && - dst.span_is_contiguous() && - src.span_is_contiguous() && - dst.span() == src.span() && - dst.dimension_0() == src.dimension_0() && - dst.dimension_1() == src.dimension_1() && - dst.dimension_2() == src.dimension_2() && - dst.dimension_3() == src.dimension_3() && - dst.dimension_4() == src.dimension_4() && - dst.dimension_5() == src.dimension_5() && - dst.dimension_6() == src.dimension_6() && - dst.dimension_7() == src.dimension_7() ) { - - const size_t nbytes = sizeof(typename dst_type::value_type) * dst.span(); - - Kokkos::Impl::DeepCopy< dst_memory_space , src_memory_space , ExecSpace > - ( exec_space , dst.data() , src.data() , nbytes ); - } - else if ( DstExecCanAccessSrc ) { - // Copying data between views in accessible memory spaces and either non-contiguous or incompatible shape. - Kokkos::Impl::ViewRemap< dst_type , src_type >( dst , src ); - } - else if ( SrcExecCanAccessDst ) { - // Copying data between views in accessible memory spaces and either non-contiguous or incompatible shape. - Kokkos::Impl::ViewRemap< dst_type , src_type , src_execution_space >( dst , src ); - } - else { - Kokkos::Impl::throw_runtime_exception("deep_copy given views that would require a temporary allocation"); - } - } -} - -} /* namespace Kokkos */ - //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -2137,14 +2407,14 @@ create_mirror( const Kokkos::View<T,P...> & src typedef typename src_type::HostMirror dst_type ; return dst_type( std::string( src.label() ).append("_mirror") - , src.dimension_0() - , src.dimension_1() - , src.dimension_2() - , src.dimension_3() - , src.dimension_4() - , src.dimension_5() - , src.dimension_6() - , src.dimension_7() ); + , src.extent(0) + , src.extent(1) + , src.extent(2) + , src.extent(3) + , src.extent(4) + , src.extent(5) + , src.extent(6) + , src.extent(7) ); } template< class T , class ... P > @@ -2162,14 +2432,14 @@ create_mirror( const Kokkos::View<T,P...> & src Kokkos::LayoutStride layout ; - layout.dimension[0] = src.dimension_0(); - layout.dimension[1] = src.dimension_1(); - layout.dimension[2] = src.dimension_2(); - layout.dimension[3] = src.dimension_3(); - layout.dimension[4] = src.dimension_4(); - layout.dimension[5] = src.dimension_5(); - layout.dimension[6] = src.dimension_6(); - layout.dimension[7] = src.dimension_7(); + layout.dimension[0] = src.extent(0); + layout.dimension[1] = src.extent(1); + layout.dimension[2] = src.extent(2); + layout.dimension[3] = src.extent(3); + layout.dimension[4] = src.extent(4); + layout.dimension[5] = src.extent(5); + layout.dimension[6] = src.extent(6); + layout.dimension[7] = src.extent(7); layout.stride[0] = src.stride_0(); layout.stride[1] = src.stride_1(); @@ -2267,175 +2537,6 @@ create_mirror_view_and_copy(const Space& , const Kokkos::View<T,P...> & src } /* namespace Kokkos */ -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -namespace Kokkos { - -/** \brief Resize a view with copying old data to new data at the corresponding indices. */ -template< class T , class ... P > -inline -typename std::enable_if< - std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutLeft>::value || - std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutRight>::value ->::type -resize( Kokkos::View<T,P...> & v , - const size_t n0 = 0 , - const size_t n1 = 0 , - const size_t n2 = 0 , - const size_t n3 = 0 , - const size_t n4 = 0 , - const size_t n5 = 0 , - const size_t n6 = 0 , - const size_t n7 = 0 ) -{ - typedef Kokkos::View<T,P...> view_type ; - - static_assert( Kokkos::ViewTraits<T,P...>::is_managed , "Can only resize managed views" ); - - // Fix #904 by checking dimensions before actually resizing. - // - // Rank is known at compile time, so hopefully the compiler will - // remove branches that are compile-time false. The upcoming "if - // constexpr" language feature would make this certain. - if (view_type::Rank == 1 && - n0 == static_cast<size_t> (v.extent(0))) { - return; - } - if (view_type::Rank == 2 && - n0 == static_cast<size_t> (v.extent(0)) && - n1 == static_cast<size_t> (v.extent(1))) { - return; - } - if (view_type::Rank == 3 && - n0 == static_cast<size_t> (v.extent(0)) && - n1 == static_cast<size_t> (v.extent(1)) && - n2 == static_cast<size_t> (v.extent(2))) { - return; - } - if (view_type::Rank == 4 && - n0 == static_cast<size_t> (v.extent(0)) && - n1 == static_cast<size_t> (v.extent(1)) && - n2 == static_cast<size_t> (v.extent(2)) && - n3 == static_cast<size_t> (v.extent(3))) { - return; - } - if (view_type::Rank == 5 && - n0 == static_cast<size_t> (v.extent(0)) && - n1 == static_cast<size_t> (v.extent(1)) && - n2 == static_cast<size_t> (v.extent(2)) && - n3 == static_cast<size_t> (v.extent(3)) && - n4 == static_cast<size_t> (v.extent(4))) { - return; - } - if (view_type::Rank == 6 && - n0 == static_cast<size_t> (v.extent(0)) && - n1 == static_cast<size_t> (v.extent(1)) && - n2 == static_cast<size_t> (v.extent(2)) && - n3 == static_cast<size_t> (v.extent(3)) && - n4 == static_cast<size_t> (v.extent(4)) && - n5 == static_cast<size_t> (v.extent(5))) { - return; - } - if (view_type::Rank == 7 && - n0 == static_cast<size_t> (v.extent(0)) && - n1 == static_cast<size_t> (v.extent(1)) && - n2 == static_cast<size_t> (v.extent(2)) && - n3 == static_cast<size_t> (v.extent(3)) && - n4 == static_cast<size_t> (v.extent(4)) && - n5 == static_cast<size_t> (v.extent(5)) && - n6 == static_cast<size_t> (v.extent(6))) { - return; - } - if (view_type::Rank == 8 && - n0 == static_cast<size_t> (v.extent(0)) && - n1 == static_cast<size_t> (v.extent(1)) && - n2 == static_cast<size_t> (v.extent(2)) && - n3 == static_cast<size_t> (v.extent(3)) && - n4 == static_cast<size_t> (v.extent(4)) && - n5 == static_cast<size_t> (v.extent(5)) && - n6 == static_cast<size_t> (v.extent(6)) && - n7 == static_cast<size_t> (v.extent(7))) { - return; - } - // If Kokkos ever supports Views of rank > 8, the above code won't - // be incorrect, because avoiding reallocation in resize() is just - // an optimization. - - // TODO (mfh 27 Jun 2017) If the old View has enough space but just - // different dimensions (e.g., if the product of the dimensions, - // including extra space for alignment, will not change), then - // consider just reusing storage. For now, Kokkos always - // reallocates if any of the dimensions change, even if the old View - // has enough space. - - view_type v_resized( v.label(), n0, n1, n2, n3, n4, n5, n6, n7 ); - - Kokkos::Impl::ViewRemap< view_type , view_type >( v_resized , v ); - - v = v_resized ; -} - -/** \brief Resize a view with copying old data to new data at the corresponding indices. */ -template< class T , class ... P > -inline -void resize( Kokkos::View<T,P...> & v , - const typename Kokkos::View<T,P...>::array_layout & layout) -{ - typedef Kokkos::View<T,P...> view_type ; - - static_assert( Kokkos::ViewTraits<T,P...>::is_managed , "Can only resize managed views" ); - - view_type v_resized( v.label(), layout ); - - Kokkos::Impl::ViewRemap< view_type , view_type >( v_resized , v ); - - v = v_resized ; -} - -/** \brief Resize a view with discarding old data. */ -template< class T , class ... P > -inline -typename std::enable_if< - std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutLeft>::value || - std::is_same<typename Kokkos::View<T,P...>::array_layout,Kokkos::LayoutRight>::value ->::type -realloc( Kokkos::View<T,P...> & v , - const size_t n0 = 0 , - const size_t n1 = 0 , - const size_t n2 = 0 , - const size_t n3 = 0 , - const size_t n4 = 0 , - const size_t n5 = 0 , - const size_t n6 = 0 , - const size_t n7 = 0 ) -{ - typedef Kokkos::View<T,P...> view_type ; - - static_assert( Kokkos::ViewTraits<T,P...>::is_managed , "Can only realloc managed views" ); - - const std::string label = v.label(); - - v = view_type(); // Deallocate first, if the only view to allocation - v = view_type( label, n0, n1, n2, n3, n4, n5, n6, n7 ); -} - -/** \brief Resize a view with discarding old data. */ -template< class T , class ... P > -inline -void realloc( Kokkos::View<T,P...> & v , - const typename Kokkos::View<T,P...>::array_layout & layout) -{ - typedef Kokkos::View<T,P...> view_type ; - - static_assert( Kokkos::ViewTraits<T,P...>::is_managed , "Can only realloc managed views" ); - - const std::string label = v.label(); - - v = view_type(); // Deallocate first, if the only view to allocation - v = view_type( label, layout ); -} -} /* namespace Kokkos */ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -2540,64 +2641,11 @@ common_view_alloc_prop( Views const & ... views ) } // namespace Kokkos -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -// For backward compatibility: - -namespace Kokkos { -namespace Experimental { - -using Kokkos::ViewTraits ; -using Kokkos::View ; -using Kokkos::Subview ; -using Kokkos::is_view ; -using Kokkos::subview ; -using Kokkos::ALL ; -using Kokkos::WithoutInitializing ; -using Kokkos::AllowPadding ; -using Kokkos::view_alloc ; -using Kokkos::view_wrap ; -using Kokkos::deep_copy ; -using Kokkos::create_mirror ; -using Kokkos::create_mirror_view ; -using Kokkos::resize ; -using Kokkos::realloc ; - -namespace Impl { - -using Kokkos::Impl::ViewFill ; -using Kokkos::Impl::ViewRemap ; -using Kokkos::Impl::ViewCtorProp ; -using Kokkos::Impl::is_view_label ; -using Kokkos::Impl::WithoutInitializing_t ; -using Kokkos::Impl::AllowPadding_t ; -using Kokkos::Impl::SharedAllocationRecord ; -using Kokkos::Impl::SharedAllocationTracker ; -using Kokkos::Impl::ViewMapping ; -using Kokkos::Impl::ViewDataAnalysis ; - - -} /* namespace Impl */ -} /* namespace Experimental */ -} /* namespace Kokkos */ - namespace Kokkos { namespace Impl { using Kokkos::is_view ; -template< class SrcViewType - , class Arg0Type - , class Arg1Type - , class Arg2Type - , class Arg3Type - , class Arg4Type - , class Arg5Type - , class Arg6Type - , class Arg7Type - > -struct ViewSubview /* { typedef ... type ; } */ ; - } /* namespace Impl */ } /* namespace Kokkos */ diff --git a/lib/kokkos/core/src/Kokkos_WorkGraphPolicy.hpp b/lib/kokkos/core/src/Kokkos_WorkGraphPolicy.hpp index f9521a7e38e1064828b94c579466b81728350182..352d6316b4a6e062a17f1ed09503dfab3b21b015 100644 --- a/lib/kokkos/core/src/Kokkos_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/Kokkos_WorkGraphPolicy.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -139,7 +139,7 @@ public: if ( w == END_TOKEN ) { return END_TOKEN ; } if ( ( w != BEGIN_TOKEN ) && - ( w == atomic_compare_exchange(ready_queue+i,w,BEGIN_TOKEN) ) ) { + ( w == atomic_compare_exchange(ready_queue+i,w,(std::int32_t)BEGIN_TOKEN) ) ) { // Attempt to claim ready work index succeeded, // update the hint and return work index atomic_increment( begin_hint ); diff --git a/lib/kokkos/core/src/Kokkos_hwloc.hpp b/lib/kokkos/core/src/Kokkos_hwloc.hpp index ff713c95239197e57b51fafe51d9a6b69bb1472e..064e5816a5c5e4fbdad6c0f8cdd42033f0f11dbf 100644 --- a/lib/kokkos/core/src/Kokkos_hwloc.hpp +++ b/lib/kokkos/core/src/Kokkos_hwloc.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Makefile.generate_build_files b/lib/kokkos/core/src/Makefile.generate_build_files index d55967f84f3aabb5055dbf5e03ca11107bd85e3c..56d9596b04ba82bbe60fe771577bb3d8d7613927 100644 --- a/lib/kokkos/core/src/Makefile.generate_build_files +++ b/lib/kokkos/core/src/Makefile.generate_build_files @@ -26,25 +26,33 @@ kokkos_appendvar2_makefile = echo $1 ?= $($(1)) >> $(KOKKOS_MAKEFILE) kokkos_appendvar_cmakefile = echo set\($1 $($(1)) CACHE $2 FORCE\) >> $(KOKKOS_CMAKEFILE) kokkos_appendval_makefile = echo $1 = $2 >> $(KOKKOS_MAKEFILE) kokkos_appendval_cmakefile = echo set\($1 $2 CACHE $3 FORCE\) >> $(KOKKOS_CMAKEFILE) +kokkos_append_gmakevar_cmakefile = echo set\(KOKKOS_GMAKE_$(1:KOKKOS_%=%) \"$($(1))\" CACHE $2 FORCE\) >> $(KOKKOS_CMAKEFILE) kokkos_append_string = $(call kokkos_append_makefile,$1); $(call kokkos_append_cmakefile,$1) kokkos_append_var = $(call kokkos_appendvar_makefile,$1); $(call kokkos_appendvar_cmakefile,$1,$2) kokkos_append_var2 = $(call kokkos_appendvar2_makefile,$1); $(call kokkos_appendvar_cmakefile,$1,$2) kokkos_append_varval = $(call kokkos_appendval_makefile,$1,$2); $(call kokkos_appendval_cmakefile,$1,$2,$3) +#This function should be used for variables whose values are different in GNU Make versus CMake, +#especially lists which are delimited by commas in one case and semicolons in another +kokkos_append_gmakevar = $(call kokkos_appendvar_makefile,$1); $(call kokkos_append_gmakevar_cmakefile,$1,$2) + generate_build_settings: $(KOKKOS_CONFIG_HEADER) @rm -f $(KOKKOS_MAKEFILE) @rm -f $(KOKKOS_CMAKEFILE) @$(call kokkos_append_string, "#Global Settings used to generate this library") @$(call kokkos_append_varval,KOKKOS_PATH,$(KOKKOS_INSTALL_PATH),'FILEPATH "Kokkos installation path"') - @$(call kokkos_append_var,KOKKOS_DEVICES,'STRING "Kokkos devices list"') - @$(call kokkos_append_var,KOKKOS_ARCH,'STRING "Kokkos architecture flags"') + @$(call kokkos_append_gmakevar,KOKKOS_DEVICES,'STRING "Kokkos devices list"') + @$(call kokkos_append_gmakevar,KOKKOS_ARCH,'STRING "Kokkos architecture flags"') @$(call kokkos_appendvar_makefile,KOKKOS_DEBUG) @$(call kokkos_appendvar_cmakefile,KOKKOS_DEBUG_CMAKE,'BOOL "Kokkos debug enabled ?"') - @$(call kokkos_append_var,KOKKOS_USE_TPLS,'STRING "Kokkos templates list"') + @$(call kokkos_append_gmakevar,KOKKOS_USE_TPLS,'STRING "Kokkos templates list"') @$(call kokkos_append_var,KOKKOS_CXX_STANDARD,'STRING "Kokkos C++ standard"') - @$(call kokkos_append_var,KOKKOS_OPTIONS,'STRING "Kokkos options"') - @$(call kokkos_append_var,KOKKOS_CUDA_OPTIONS,'STRING "Kokkos Cuda options"') + @$(call kokkos_append_gmakevar,KOKKOS_OPTIONS,'STRING "Kokkos options"') + @$(call kokkos_append_gmakevar,KOKKOS_CUDA_OPTIONS,'STRING "Kokkos Cuda options"') + @$(call kokkos_append_gmakevar,KOKKOS_TPL_INCLUDE_DIRS,'STRING "Kokkos TPL include directories"') + @$(call kokkos_append_gmakevar,KOKKOS_TPL_LIBRARY_DIRS,'STRING "Kokkos TPL library directories"') + @$(call kokkos_append_gmakevar,KOKKOS_TPL_LIBRARY_NAMES,'STRING "Kokkos TPL library names"') @$(call kokkos_appendvar2,CXX,'KOKKOS C++ Compiler') @$(call kokkos_append_cmakefile,"if(NOT DEFINED ENV{NVCC_WRAPPER})") @$(call kokkos_append_var2,NVCC_WRAPPER,'FILEPATH "Path to command nvcc_wrapper"') @@ -71,14 +79,16 @@ generate_build_settings: $(KOKKOS_CONFIG_HEADER) @$(call kokkos_append_var,KOKKOS_LDFLAGS,'STRING ""') @$(call kokkos_append_var,KOKKOS_LIBS,'STRING ""') @$(call kokkos_append_var,KOKKOS_EXTRA_LIBS,'STRING ""') + @$(call kokkos_append_var,KOKKOS_LINK_FLAGS,'STRING "extra flags to the link step (e.g. OpenMP)"') @$(call kokkos_append_string,"") @$(call kokkos_append_string,"#Internal settings which need to propagated for Kokkos examples") @$(call kokkos_append_var,KOKKOS_INTERNAL_USE_CUDA,'STRING ""') @$(call kokkos_append_var,KOKKOS_INTERNAL_USE_OPENMP,'STRING ""') @$(call kokkos_append_var,KOKKOS_INTERNAL_USE_PTHREADS,'STRING ""') + @$(call kokkos_append_var,KOKKOS_INTERNAL_USE_SERIAL,'STRING ""') @$(call kokkos_append_var,KOKKOS_INTERNAL_USE_ROCM,'STRING ""') @$(call kokkos_append_var,KOKKOS_INTERNAL_USE_QTHREADS,'STRING ""') # Not in original cmake gen - @$(call kokkos_append_cmakefile "mark_as_advanced(KOKKOS_HEADERS KOKKOS_SRC KOKKOS_INTERNAL_USE_CUDA KOKKOS_INTERNAL_USE_OPENMP KOKKOS_INTERNAL_USE_PTHREADS)") + @$(call kokkos_append_cmakefile "mark_as_advanced(KOKKOS_HEADERS KOKKOS_SRC KOKKOS_INTERNAL_USE_CUDA KOKKOS_INTERNAL_USE_OPENMP KOKKOS_INTERNAL_USE_PTHREADS KOKKOS_INTERNAL_USE_SERIAL)") @$(call kokkos_append_makefile,"") @$(call kokkos_append_makefile,"#Fake kokkos-clean target") @$(call kokkos_append_makefile,"kokkos-clean:") @@ -97,4 +107,5 @@ generate_build_settings: $(KOKKOS_CONFIG_HEADER) @$(call kokkos_setvar_cmakefile,KOKKOS_LD_FLAGS,$(KOKKOS_LDFLAGS)) @$(call kokkos_setlist_cmakefile,KOKKOS_LIBS_LIST,$(KOKKOS_LIBS)) @$(call kokkos_setlist_cmakefile,KOKKOS_EXTRA_LIBS_LIST,$(KOKKOS_EXTRA_LIBS)) + @$(call kokkos_setvar_cmakefile,KOKKOS_LINK_FLAGS,$(KOKKOS_LINK_FLAGS)) diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.cpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.cpp index ed19a248a64995be6f895ae5db24de85b300a0ee..8b04afe4184dbc57fc3e4bbf5143f4d838452b01 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.cpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -391,10 +391,11 @@ void OpenMP::finalize() } if ( Impl::t_openmp_instance ) { - + // Silence Cuda Warning const int nthreads = Impl::t_openmp_instance->m_pool_size <= Impl::g_openmp_hardware_max_threads ? Impl::g_openmp_hardware_max_threads : Impl::t_openmp_instance->m_pool_size; + (void) nthreads; using Exec = Impl::OpenMPExec; Exec * instance = Impl::t_openmp_instance; @@ -453,7 +454,7 @@ std::vector<OpenMP> OpenMP::partition(...) OpenMP OpenMP::create_instance(...) { return OpenMP(); } -#if !defined( KOKKOS_DISABLE_DEPRECATED ) +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE int OpenMP::concurrency() { return Impl::g_openmp_hardware_max_threads; diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.hpp index de84f6e59fed9f300b2d2bde514308d7a272187d..870c84d56cc9ed883855b76bfe7ff35f37b55991 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -47,7 +47,7 @@ #include <Kokkos_Macros.hpp> #if defined( KOKKOS_ENABLE_OPENMP ) -#if !defined(_OPENMP) +#if !defined(_OPENMP) && !defined(__CUDA_ARCH__) #error "You enabled Kokkos OpenMP support without enabling OpenMP in the compiler!" #endif @@ -332,7 +332,7 @@ public: } // namespace Experimental -#if !defined( KOKKOS_DISABLE_DEPRECATED ) +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE inline int OpenMP::thread_pool_size( int depth ) @@ -358,7 +358,7 @@ int OpenMP::max_hardware_threads() noexcept return Impl::g_openmp_hardware_max_threads; } -#endif // KOKKOS_DISABLE_DEPRECATED +#endif } // namespace Kokkos diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp index 70115b4728d6205062225a5474bf58287d6d1598..21416108a3f0543f910859aa747304b4cf508a76 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -460,25 +460,24 @@ private: typedef typename Policy::WorkRange WorkRange ; typedef typename Policy::member_type Member ; - typedef FunctorAnalysis< FunctorPatternInterface::REDUCE , Policy , FunctorType > Analysis ; + typedef FunctorAnalysis< FunctorPatternInterface::REDUCE , MDRangePolicy , FunctorType > Analysis ; typedef Kokkos::Impl::if_c< std::is_same<InvalidType,ReducerType>::value, FunctorType, ReducerType> ReducerConditional; typedef typename ReducerConditional::type ReducerTypeFwd; typedef typename Kokkos::Impl::if_c< std::is_same<InvalidType,ReducerType>::value, WorkTag, void>::type WorkTagFwd; - typedef typename ReducerTypeFwd::value_type ValueType; - typedef Kokkos::Impl::FunctorValueInit< ReducerTypeFwd, WorkTagFwd > ValueInit ; typedef Kokkos::Impl::FunctorValueJoin< ReducerTypeFwd, WorkTagFwd > ValueJoin ; typedef typename Analysis::pointer_type pointer_type ; + typedef typename Analysis::value_type value_type ; typedef typename Analysis::reference_type reference_type ; using iterate_type = typename Kokkos::Impl::HostIterateTile< MDRangePolicy - , FunctorType - , WorkTag - , ValueType - >; + , FunctorType + , WorkTag + , reference_type + >; OpenMPExec * m_instance ; const FunctorType m_functor ; diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp index 77363876b00dbb4f8979b83c366b94dc91d4b93f..4ebeec44a5ec04ed291d757951dbc9ed81473ec8 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.hpp index dfa1635e08cff2a638267f15bf09082e3112be89..b99c149b06d7acf9d37c3dbc42ad12aafd62e893 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp index 743e6b6e62031aebf4ea670c4cd4a971a5e149a7..775043b23efc1bdfdb2f04c7d3f697dc0027929a 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -210,6 +210,32 @@ public: return p; }; +protected: + /** \brief set chunk_size to a discrete value*/ + inline TeamPolicyInternal internal_set_chunk_size(typename traits::index_type chunk_size_) { + m_chunk_size = chunk_size_; + return *this; + } + + /** \brief set per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team) { + m_team_scratch_size[level] = per_team.value; + return *this; + }; + + /** \brief set per thread scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerThreadValue& per_thread) { + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; + + /** \brief set per thread and per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team, const PerThreadValue& per_thread) { + m_team_scratch_size[level] = per_team.value; + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; + private: /** \brief finalize chunk_size if it was set to AUTO*/ inline void set_auto_chunk_size() { diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_WorkGraphPolicy.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_WorkGraphPolicy.hpp index 540b91a52a6fa363db4f8b03d5d5c82637862ff2..cd95a54b364eb2040d597964d95151772c500196 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_WorkGraphPolicy.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp index 57d39c3160749c82bd19e033aacfb96e2155dd4c..79f2e185475c2991634693248effde14f5d0790d 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp index 447245ea9a4c7dff78c466146bc1c184563e0f10..8991c6394701d9a5219cb168c909bbaa8a178126 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp index 258a9d2ff703907913cff7928e05b38785245b64..147916395e4c4282924ced14d4d15e79a02412a2 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -463,6 +463,32 @@ public: return p; }; +protected: + /** \brief set chunk_size to a discrete value*/ + inline TeamPolicyInternal internal_set_chunk_size(typename traits::index_type chunk_size_) { + m_chunk_size = chunk_size_; + return *this; + } + + /** \brief set per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team) { + m_team_scratch_size[level] = per_team.value; + return *this; + }; + + /** \brief set per thread scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerThreadValue& per_thread) { + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; + + /** \brief set per thread and per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team, const PerThreadValue& per_thread) { + m_team_scratch_size[level] = per_team.value; + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; + private: /** \brief finalize chunk_size if it was set to AUTO*/ inline void set_auto_chunk_size() { diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp index 035ee2e7a6201d2ba26c236f4bc0605a32e24802..33b0749e3f0c5a29feef65d161117c292cc08dff 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Task.cpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Task.cpp index 9c8b90637755a7d96c6f1182f35fc73e248b57ef..dfd45486ef268c170fbb29a49dc6ac226424c832 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Task.cpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Task.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Task.hpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Task.hpp index 91c9d67767a137bca80641b1a358d376d153ab20..fe9ac4abb4a8521b2d02e6a943aaf2fa05353cc5 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Task.hpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Task.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Qthreads/Kokkos_QthreadsExec.cpp b/lib/kokkos/core/src/Qthreads/Kokkos_QthreadsExec.cpp index b91b6171477fec4168870ceb5738299b4accb545..b37a4c63b93b7bf2ee45679c609ae0637f898e1d 100644 --- a/lib/kokkos/core/src/Qthreads/Kokkos_QthreadsExec.cpp +++ b/lib/kokkos/core/src/Qthreads/Kokkos_QthreadsExec.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Qthreads/Kokkos_QthreadsExec.hpp b/lib/kokkos/core/src/Qthreads/Kokkos_QthreadsExec.hpp index abf390b176e6fd87e9f1fafe254f09a9972c5c1f..b2a3ebe4149909301ce5c5759d5c0676f333b413 100644 --- a/lib/kokkos/core/src/Qthreads/Kokkos_QthreadsExec.hpp +++ b/lib/kokkos/core/src/Qthreads/Kokkos_QthreadsExec.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Parallel.hpp b/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Parallel.hpp index 6c94319004934bbdb4df6917330bc2eda71df9b3..00580a4933897148db0e41af033ca422df311d08 100644 --- a/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Parallel.hpp +++ b/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Parallel.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Task.cpp b/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Task.cpp index 3a1493a848c96dc5bfce9e87672dc14773928683..52f57f5e45a205f80fd1effb21c5033b15bc08f0 100644 --- a/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Task.cpp +++ b/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Task.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Task.hpp b/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Task.hpp index 4d393a6ed3bf921ec7d81abb8a84d61c2381befd..35fc6599779b134e5a8844ac8295f7dd8f7d2a25 100644 --- a/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Task.hpp +++ b/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_Task.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_TaskQueue.hpp b/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_TaskQueue.hpp index f832e708794e64815b3eff2928d8a340e0991d45..96d88af79f3f9404ca16d50f53feeb980cf1e978 100644 --- a/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_TaskQueue.hpp +++ b/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_TaskQueue.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_TaskQueue_impl.hpp b/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_TaskQueue_impl.hpp index 33411775443682a41df3e93e2b64836d95801609..152546fadcf3d97863d1f508a72df1ee8212662f 100644 --- a/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_TaskQueue_impl.hpp +++ b/lib/kokkos/core/src/Qthreads/Kokkos_Qthreads_TaskQueue_impl.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/KokkosExp_ROCm_IterateTile_Refactor.hpp b/lib/kokkos/core/src/ROCm/KokkosExp_ROCm_IterateTile_Refactor.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0d66d016cb62eacba74cc409b91201ba32b82783 --- /dev/null +++ b/lib/kokkos/core/src/ROCm/KokkosExp_ROCm_IterateTile_Refactor.hpp @@ -0,0 +1,2750 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_ROCM_EXP_ITERATE_TILE_REFACTOR_HPP +#define KOKKOS_ROCM_EXP_ITERATE_TILE_REFACTOR_HPP + +#include <Kokkos_Macros.hpp> +#if defined( __HCC__ ) && defined( KOKKOS_ENABLE_ROCM ) + +#include <iostream> +#include <algorithm> +#include <cstdio> + +#include <utility> + +// #include<ROCm/Kokkos_ROCmExec.hpp> +// Including the file above leads to following type of errors: +// /home/ndellin/kokkos/core/src/ROCm/Kokkos_ROCmExec.hpp(84): error: incomplete type is not allowed +// use existing Kokkos functionality, e.g. max blocks, once resolved + +#if defined(KOKKOS_ENABLE_PROFILING) +#include <impl/Kokkos_Profiling_Interface.hpp> +#include <typeinfo> +#endif + + +#define threadIdx_x (hc_get_workitem_id(0)) +#define threadIdx_y (hc_get_workitem_id(1)) +#define threadIdx_z (hc_get_workitem_id(2)) + +#define blockIdx_x (hc_get_group_id(0)) +#define blockIdx_y (hc_get_group_id(1)) +#define blockIdx_z (hc_get_group_id(2)) + +#define blockDim_x (hc_get_group_size(0)) +#define blockDim_y (hc_get_group_size(1)) +#define blockDim_z (hc_get_group_size(2)) + +#define gridDim_x (hc_get_num_groups(0)) +#define gridDim_y (hc_get_num_groups(1)) +#define gridDim_z (hc_get_num_groups(2)) + + +namespace Kokkos { namespace Impl { + +namespace Refactor { + +// ------------------------------------------------------------------ // +// ParallelFor iteration pattern +template< int N , typename RP , typename Functor , typename Tag > +struct DeviceIterateTile; + +//Rank 2 +// Specializations for void tag type +template< typename RP , typename Functor > +struct DeviceIterateTile<2,RP,Functor,void > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ ) + : m_rp(rp_) + , m_func(f_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + // LL + if (RP::inner_direction == RP::Left) { + for ( index_type tile_id1 = (index_type)blockIdx_y; tile_id1 < m_rp.m_tile_end[1]; tile_id1 += gridDim_y ) { + const index_type offset_1 = tile_id1*m_rp.m_tile[1] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && (index_type)threadIdx_y < m_rp.m_tile[1] ) { + + for ( index_type tile_id0 = (index_type)blockIdx_x; tile_id0 < m_rp.m_tile_end[0]; tile_id0 += gridDim_x ) { + const index_type offset_0 = tile_id0*m_rp.m_tile[0] + (index_type)threadIdx_x + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && (index_type)threadIdx_x < m_rp.m_tile[0] ) { + m_func(offset_0 , offset_1); + } + } + } + } + } + // LR + else { + for ( index_type tile_id0 = (index_type)blockIdx_x; tile_id0 < m_rp.m_tile_end[0]; tile_id0 += gridDim_x ) { + const index_type offset_0 = tile_id0*m_rp.m_tile[0] + (index_type)threadIdx_x + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && (index_type)threadIdx_x < m_rp.m_tile[0] ) { + + for ( index_type tile_id1 = (index_type)blockIdx_y; tile_id1 < m_rp.m_tile_end[1]; tile_id1 += gridDim_y ) { + const index_type offset_1 = tile_id1*m_rp.m_tile[1] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && (index_type)threadIdx_y < m_rp.m_tile[1] ) { + m_func(offset_0 , offset_1); + } + } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; +}; + +// Specializations for tag type +template< typename RP , typename Functor , typename Tag > +struct DeviceIterateTile<2,RP,Functor,Tag> +{ + using index_type = typename RP::index_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ ) + : m_rp(rp_) + , m_func(f_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + if (RP::inner_direction == RP::Left) { + // Loop over size maxnumblocks until full range covered + for ( index_type tile_id1 = (index_type)blockIdx_y; tile_id1 < m_rp.m_tile_end[1]; tile_id1 += gridDim_y ) { + const index_type offset_1 = tile_id1*m_rp.m_tile[1] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && (index_type)threadIdx_y < m_rp.m_tile[1] ) { + + for ( index_type tile_id0 = (index_type)blockIdx_x; tile_id0 < m_rp.m_tile_end[0]; tile_id0 += gridDim_x ) { + const index_type offset_0 = tile_id0*m_rp.m_tile[0] + (index_type)threadIdx_x + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && (index_type)threadIdx_x < m_rp.m_tile[0] ) { + m_func(Tag(), offset_0 , offset_1); + } + } + } + } + } + else { + for ( index_type tile_id0 = (index_type)blockIdx_x; tile_id0 < m_rp.m_tile_end[0]; tile_id0 += gridDim_x ) { + const index_type offset_0 = tile_id0*m_rp.m_tile[0] + (index_type)threadIdx_x + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && (index_type)threadIdx_x < m_rp.m_tile[0] ) { + + for ( index_type tile_id1 = (index_type)blockIdx_y; tile_id1 < m_rp.m_tile_end[1]; tile_id1 += gridDim_y ) { + const index_type offset_1 = tile_id1*m_rp.m_tile[1] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && (index_type)threadIdx_y < m_rp.m_tile[1] ) { + m_func(Tag(), offset_0 , offset_1); + } + } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; +}; + + +//Rank 3 +// Specializations for void tag type +template< typename RP , typename Functor > +struct DeviceIterateTile<3,RP,Functor,void > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ ) + : m_rp(rp_) + , m_func(f_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + // LL + if (RP::inner_direction == RP::Left) { + for ( index_type tile_id2 = (index_type)blockIdx_z; tile_id2 < m_rp.m_tile_end[2]; tile_id2 += gridDim_z ) { + const index_type offset_2 = tile_id2*m_rp.m_tile[2] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && (index_type)threadIdx_z < m_rp.m_tile[2] ) { + + for ( index_type tile_id1 = (index_type)blockIdx_y; tile_id1 < m_rp.m_tile_end[1]; tile_id1 += gridDim_y ) { + const index_type offset_1 = tile_id1*m_rp.m_tile[1] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && (index_type)threadIdx_y < m_rp.m_tile[1] ) { + + for ( index_type tile_id0 = (index_type)blockIdx_x; tile_id0 < m_rp.m_tile_end[0]; tile_id0 += gridDim_x ) { + const index_type offset_0 = tile_id0*m_rp.m_tile[0] + (index_type)threadIdx_x + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && (index_type)threadIdx_x < m_rp.m_tile[0] ) { + m_func(offset_0 , offset_1 , offset_2); + } + } + } + } + } + } + } + // LR + else { + for ( index_type tile_id0 = (index_type)blockIdx_x; tile_id0 < m_rp.m_tile_end[0]; tile_id0 += gridDim_x ) { + const index_type offset_0 = tile_id0*m_rp.m_tile[0] + (index_type)threadIdx_x + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && (index_type)threadIdx_x < m_rp.m_tile[0] ) { + + for ( index_type tile_id1 = (index_type)blockIdx_y; tile_id1 < m_rp.m_tile_end[1]; tile_id1 += gridDim_y ) { + const index_type offset_1 = tile_id1*m_rp.m_tile[1] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && (index_type)threadIdx_y < m_rp.m_tile[1] ) { + + for ( index_type tile_id2 = (index_type)blockIdx_z; tile_id2 < m_rp.m_tile_end[2]; tile_id2 += gridDim_z ) { + const index_type offset_2 = tile_id2*m_rp.m_tile[2] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && (index_type)threadIdx_z < m_rp.m_tile[2] ) { + m_func(offset_0 , offset_1 , offset_2); + } + } + } + } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; +}; + +// Specializations for void tag type +template< typename RP , typename Functor , typename Tag > +struct DeviceIterateTile<3,RP,Functor,Tag> +{ + using index_type = typename RP::index_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ ) + : m_rp(rp_) + , m_func(f_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + if (RP::inner_direction == RP::Left) { + for ( index_type tile_id2 = (index_type)blockIdx_z; tile_id2 < m_rp.m_tile_end[2]; tile_id2 += gridDim_z ) { + const index_type offset_2 = tile_id2*m_rp.m_tile[2] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && (index_type)threadIdx_z < m_rp.m_tile[2] ) { + + for ( index_type tile_id1 = (index_type)blockIdx_y; tile_id1 < m_rp.m_tile_end[1]; tile_id1 += gridDim_y ) { + const index_type offset_1 = tile_id1*m_rp.m_tile[1] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && (index_type)threadIdx_y < m_rp.m_tile[1] ) { + + for ( index_type tile_id0 = (index_type)blockIdx_x; tile_id0 < m_rp.m_tile_end[0]; tile_id0 += gridDim_x ) { + const index_type offset_0 = tile_id0*m_rp.m_tile[0] + (index_type)threadIdx_x + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && (index_type)threadIdx_x < m_rp.m_tile[0] ) { + m_func(Tag(), offset_0 , offset_1 , offset_2); + } + } + } + } + } + } + } + else { + for ( index_type tile_id0 = (index_type)blockIdx_x; tile_id0 < m_rp.m_tile_end[0]; tile_id0 += gridDim_x ) { + const index_type offset_0 = tile_id0*m_rp.m_tile[0] + (index_type)threadIdx_x + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && (index_type)threadIdx_x < m_rp.m_tile[0] ) { + + for ( index_type tile_id1 = (index_type)blockIdx_y; tile_id1 < m_rp.m_tile_end[1]; tile_id1 += gridDim_y ) { + const index_type offset_1 = tile_id1*m_rp.m_tile[1] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && (index_type)threadIdx_y < m_rp.m_tile[1] ) { + + for ( index_type tile_id2 = (index_type)blockIdx_z; tile_id2 < m_rp.m_tile_end[2]; tile_id2 += gridDim_z ) { + const index_type offset_2 = tile_id2*m_rp.m_tile[2] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && (index_type)threadIdx_z < m_rp.m_tile[2] ) { + m_func(Tag(), offset_0 , offset_1 , offset_2); + } + } + } + } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; +}; + + +//Rank 4 +// Specializations for void tag type +template< typename RP , typename Functor > +struct DeviceIterateTile<4,RP,Functor,void > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ ) + : m_rp(rp_) + , m_func(f_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + // LL + if (RP::inner_direction == RP::Left) { + const index_type temp0 = m_rp.m_tile_end[0]; + const index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl0 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl1 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl0 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x % numbl0; + const index_type tile_id1 = (index_type)blockIdx_x / numbl0; + const index_type thr_id0 = (index_type)threadIdx_x % m_rp.m_tile[0]; + const index_type thr_id1 = (index_type)threadIdx_x / m_rp.m_tile[0]; + + for ( index_type tile_id3 = (index_type)blockIdx_z; tile_id3 < m_rp.m_tile_end[3]; tile_id3 += gridDim_z ) { + const index_type offset_3 = tile_id3*m_rp.m_tile[3] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && (index_type)threadIdx_z < m_rp.m_tile[3] ) { + + for ( index_type tile_id2 = (index_type)blockIdx_y; tile_id2 < m_rp.m_tile_end[2]; tile_id2 += gridDim_y ) { + const index_type offset_2 = tile_id2*m_rp.m_tile[2] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && (index_type)threadIdx_y < m_rp.m_tile[2] ) { + + for ( index_type j = tile_id1 ; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type i = tile_id0 ; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + m_func(offset_0 , offset_1 , offset_2 , offset_3); + } + } + } + } + } + } + } + } + } + // LR + else { + const index_type temp0 = m_rp.m_tile_end[0]; + const index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl1 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl0 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl1 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x / numbl1; + const index_type tile_id1 = (index_type)blockIdx_x % numbl1; + const index_type thr_id0 = (index_type)threadIdx_x / m_rp.m_tile[1]; + const index_type thr_id1 = (index_type)threadIdx_x % m_rp.m_tile[1]; + + for ( index_type i = tile_id0; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + + for ( index_type j = tile_id1; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type tile_id2 = (index_type)blockIdx_y; tile_id2 < m_rp.m_tile_end[2]; tile_id2 += gridDim_y ) { + const index_type offset_2 = tile_id2*m_rp.m_tile[2] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && (index_type)threadIdx_y < m_rp.m_tile[2] ) { + + for ( index_type tile_id3 = (index_type)blockIdx_z; tile_id3 < m_rp.m_tile_end[3]; tile_id3 += gridDim_z ) { + const index_type offset_3 = tile_id3*m_rp.m_tile[3] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && (index_type)threadIdx_z < m_rp.m_tile[3] ) { + m_func(offset_0 , offset_1 , offset_2 , offset_3); + } + } + } + } + } + } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; +}; + +// Specializations for void tag type +template< typename RP , typename Functor , typename Tag > +struct DeviceIterateTile<4,RP,Functor,Tag> +{ + using index_type = typename RP::index_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ ) + : m_rp(rp_) + , m_func(f_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if (RP::inner_direction == RP::Left) { + const index_type temp0 = m_rp.m_tile_end[0]; + const index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl0 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl1 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl0 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x % numbl0; + const index_type tile_id1 = (index_type)blockIdx_x / numbl0; + const index_type thr_id0 = (index_type)threadIdx_x % m_rp.m_tile[0]; + const index_type thr_id1 = (index_type)threadIdx_x / m_rp.m_tile[0]; + + for ( index_type tile_id3 = (index_type)blockIdx_z; tile_id3 < m_rp.m_tile_end[3]; tile_id3 += gridDim_z ) { + const index_type offset_3 = tile_id3*m_rp.m_tile[3] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && (index_type)threadIdx_z < m_rp.m_tile[3] ) { + + for ( index_type tile_id2 = (index_type)blockIdx_y; tile_id2 < m_rp.m_tile_end[2]; tile_id2 += gridDim_y ) { + const index_type offset_2 = tile_id2*m_rp.m_tile[2] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && (index_type)threadIdx_y < m_rp.m_tile[2] ) { + + for ( index_type j = tile_id1; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type i = tile_id0; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + m_func(Tag(), offset_0 , offset_1 , offset_2 , offset_3); + } + } + } + } + } + } + } + } + } + else { + const index_type temp0 = m_rp.m_tile_end[0]; + const index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl1 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl0 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl1 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x / numbl1; + const index_type tile_id1 = (index_type)blockIdx_x % numbl1; + const index_type thr_id0 = (index_type)threadIdx_x / m_rp.m_tile[1]; + const index_type thr_id1 = (index_type)threadIdx_x % m_rp.m_tile[1]; + + for ( index_type i = tile_id0; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + + for ( index_type j = tile_id1; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = tile_id1*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type tile_id2 = (index_type)blockIdx_y; tile_id2 < m_rp.m_tile_end[2]; tile_id2 += gridDim_y ) { + const index_type offset_2 = tile_id2*m_rp.m_tile[2] + (index_type)threadIdx_y + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && (index_type)threadIdx_y < m_rp.m_tile[2] ) { + + for ( index_type tile_id3 = (index_type)blockIdx_z; tile_id3 < m_rp.m_tile_end[3]; tile_id3 += gridDim_z ) { + const index_type offset_3 = tile_id3*m_rp.m_tile[3] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && (index_type)threadIdx_z < m_rp.m_tile[3] ) { + m_func(Tag() , offset_0 , offset_1 , offset_2 , offset_3); + } + } + } + } + } + } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; +}; + + +//Rank 5 +// Specializations for void tag type +template< typename RP , typename Functor > +struct DeviceIterateTile<5,RP,Functor,void > +{ + using index_type = typename RP::index_type; + + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ ) + : m_rp(rp_) + , m_func(f_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + // LL + if (RP::inner_direction == RP::Left) { + + index_type temp0 = m_rp.m_tile_end[0]; + index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl0 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl1 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl0 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x % numbl0; + const index_type tile_id1 = (index_type)blockIdx_x / numbl0; + const index_type thr_id0 = (index_type)threadIdx_x % m_rp.m_tile[0]; + const index_type thr_id1 = (index_type)threadIdx_x / m_rp.m_tile[0]; + + temp0 = m_rp.m_tile_end[2]; + temp1 = m_rp.m_tile_end[3]; + const index_type numbl2 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl3 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl2 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id2 = (index_type)blockIdx_y % numbl2; + const index_type tile_id3 = (index_type)blockIdx_y / numbl2; + const index_type thr_id2 = (index_type)threadIdx_y % m_rp.m_tile[2]; + const index_type thr_id3 = (index_type)threadIdx_y / m_rp.m_tile[2]; + + for ( index_type tile_id4 = (index_type)blockIdx_z; tile_id4 < m_rp.m_tile_end[4]; tile_id4 += gridDim_z ) { + const index_type offset_4 = tile_id4*m_rp.m_tile[4] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[4]; + if ( offset_4 < m_rp.m_upper[4] && (index_type)threadIdx_z < m_rp.m_tile[4] ) { + + for ( index_type l = tile_id3; l < m_rp.m_tile_end[3]; l += numbl3 ) { + const index_type offset_3 = l*m_rp.m_tile[3] + thr_id3 + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && thr_id3 < m_rp.m_tile[3] ) { + + for ( index_type k = tile_id2; k < m_rp.m_tile_end[2]; k += numbl2 ) { + const index_type offset_2 = k*m_rp.m_tile[2] + thr_id2 + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && thr_id2 < m_rp.m_tile[2] ) { + + for ( index_type j = tile_id1 ; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type i = tile_id0 ; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + m_func(offset_0 , offset_1 , offset_2 , offset_3, offset_4); + } + } + } + } + } + } + } + } + } + } + } + // LR + else { + index_type temp0 = m_rp.m_tile_end[0]; + index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl1 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl0 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl1 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x / numbl1; + const index_type tile_id1 = (index_type)blockIdx_x % numbl1; + const index_type thr_id0 = (index_type)threadIdx_x / m_rp.m_tile[1]; + const index_type thr_id1 = (index_type)threadIdx_x % m_rp.m_tile[1]; + + temp0 = m_rp.m_tile_end[2]; + temp1 = m_rp.m_tile_end[3]; + const index_type numbl3 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl2 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl3 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id2 = (index_type)blockIdx_y / numbl3; + const index_type tile_id3 = (index_type)blockIdx_y % numbl3; + const index_type thr_id2 = (index_type)threadIdx_y / m_rp.m_tile[3]; + const index_type thr_id3 = (index_type)threadIdx_y % m_rp.m_tile[3]; + + for ( index_type i = tile_id0; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + + for ( index_type j = tile_id1; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type k = tile_id2; k < m_rp.m_tile_end[2]; k += numbl2 ) { + const index_type offset_2 = k*m_rp.m_tile[2] + thr_id2 + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && thr_id2 < m_rp.m_tile[2] ) { + + for ( index_type l = tile_id3; l < m_rp.m_tile_end[3]; l += numbl3 ) { + const index_type offset_3 = l*m_rp.m_tile[3] + thr_id3 + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && thr_id3 < m_rp.m_tile[3] ) { + + for ( index_type tile_id4 = (index_type)blockIdx_z; tile_id4 < m_rp.m_tile_end[4]; tile_id4 += gridDim_z ) { + const index_type offset_4 = tile_id4*m_rp.m_tile[4] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[4]; + if ( offset_4 < m_rp.m_upper[4] && (index_type)threadIdx_z < m_rp.m_tile[4] ) { + m_func(offset_0 , offset_1 , offset_2 , offset_3 , offset_4); + } + } + } + } + } + } + } + } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; +}; + +// Specializations for tag type +template< typename RP , typename Functor , typename Tag > +struct DeviceIterateTile<5,RP,Functor,Tag> +{ + using index_type = typename RP::index_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ ) + : m_rp(rp_) + , m_func(f_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + // LL + if (RP::inner_direction == RP::Left) { + index_type temp0 = m_rp.m_tile_end[0]; + index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl0 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl1 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl0 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x % numbl0; + const index_type tile_id1 = (index_type)blockIdx_x / numbl0; + const index_type thr_id0 = (index_type)threadIdx_x % m_rp.m_tile[0]; + const index_type thr_id1 = (index_type)threadIdx_x / m_rp.m_tile[0]; + + temp0 = m_rp.m_tile_end[2]; + temp1 = m_rp.m_tile_end[3]; + const index_type numbl2 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl3 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl2 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id2 = (index_type)blockIdx_y % numbl2; + const index_type tile_id3 = (index_type)blockIdx_y / numbl2; + const index_type thr_id2 = (index_type)threadIdx_y % m_rp.m_tile[2]; + const index_type thr_id3 = (index_type)threadIdx_y / m_rp.m_tile[2]; + + for ( index_type tile_id4 = (index_type)blockIdx_z; tile_id4 < m_rp.m_tile_end[4]; tile_id4 += gridDim_z ) { + const index_type offset_4 = tile_id4*m_rp.m_tile[4] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[4]; + if ( offset_4 < m_rp.m_upper[4] && (index_type)threadIdx_z < m_rp.m_tile[4] ) { + + for ( index_type l = tile_id3; l < m_rp.m_tile_end[3]; l += numbl3 ) { + const index_type offset_3 = l*m_rp.m_tile[3] + thr_id3 + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && thr_id3 < m_rp.m_tile[3] ) { + + for ( index_type k = tile_id2; k < m_rp.m_tile_end[2]; k += numbl2 ) { + const index_type offset_2 = k*m_rp.m_tile[2] + thr_id2 + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && thr_id2 < m_rp.m_tile[2] ) { + + for ( index_type j = tile_id1 ; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type i = tile_id0 ; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + m_func(Tag() , offset_0 , offset_1 , offset_2 , offset_3, offset_4); + } + } + } + } + } + } + } + } + } + } + } + // LR + else { + index_type temp0 = m_rp.m_tile_end[0]; + index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl1 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl0 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl1 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x / numbl1; + const index_type tile_id1 = (index_type)blockIdx_x % numbl1; + const index_type thr_id0 = (index_type)threadIdx_x / m_rp.m_tile[1]; + const index_type thr_id1 = (index_type)threadIdx_x % m_rp.m_tile[1]; + + temp0 = m_rp.m_tile_end[2]; + temp1 = m_rp.m_tile_end[3]; + const index_type numbl3 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl2 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl3 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id2 = (index_type)blockIdx_y / numbl3; + const index_type tile_id3 = (index_type)blockIdx_y % numbl3; + const index_type thr_id2 = (index_type)threadIdx_y / m_rp.m_tile[3]; + const index_type thr_id3 = (index_type)threadIdx_y % m_rp.m_tile[3]; + + for ( index_type i = tile_id0; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + + for ( index_type j = tile_id1; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type k = tile_id2; k < m_rp.m_tile_end[2]; k += numbl2 ) { + const index_type offset_2 = k*m_rp.m_tile[2] + thr_id2 + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && thr_id2 < m_rp.m_tile[2] ) { + + for ( index_type l = tile_id3; l < m_rp.m_tile_end[3]; l += numbl3 ) { + const index_type offset_3 = l*m_rp.m_tile[3] + thr_id3 + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && thr_id3 < m_rp.m_tile[3] ) { + + for ( index_type tile_id4 = (index_type)blockIdx_z; tile_id4 < m_rp.m_tile_end[4]; tile_id4 += gridDim_z ) { + const index_type offset_4 = tile_id4*m_rp.m_tile[4] + (index_type)threadIdx_z + (index_type)m_rp.m_lower[4]; + if ( offset_4 < m_rp.m_upper[4] && (index_type)threadIdx_z < m_rp.m_tile[4] ) { + m_func(Tag() , offset_0 , offset_1 , offset_2 , offset_3 , offset_4); + } + } + } + } + } + } + } + } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; +}; + + +//Rank 6 +// Specializations for void tag type +template< typename RP , typename Functor > +struct DeviceIterateTile<6,RP,Functor,void > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ ) + : m_rp(rp_) + , m_func(f_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + // LL + if (RP::inner_direction == RP::Left) { + index_type temp0 = m_rp.m_tile_end[0]; + index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl0 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl1 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl0 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x % numbl0; + const index_type tile_id1 = (index_type)blockIdx_x / numbl0; + const index_type thr_id0 = (index_type)threadIdx_x % m_rp.m_tile[0]; + const index_type thr_id1 = (index_type)threadIdx_x / m_rp.m_tile[0]; + + temp0 = m_rp.m_tile_end[2]; + temp1 = m_rp.m_tile_end[3]; + const index_type numbl2 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl3 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl2 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id2 = (index_type)blockIdx_y % numbl2; + const index_type tile_id3 = (index_type)blockIdx_y / numbl2; + const index_type thr_id2 = (index_type)threadIdx_y % m_rp.m_tile[2]; + const index_type thr_id3 = (index_type)threadIdx_y / m_rp.m_tile[2]; + + temp0 = m_rp.m_tile_end[4]; + temp1 = m_rp.m_tile_end[5]; + const index_type numbl4 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl5 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl4 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id4 = (index_type)blockIdx_z % numbl4; + const index_type tile_id5 = (index_type)blockIdx_z / numbl4; + const index_type thr_id4 = (index_type)threadIdx_z % m_rp.m_tile[4]; + const index_type thr_id5 = (index_type)threadIdx_z / m_rp.m_tile[4]; + + for ( index_type n = tile_id5; n < m_rp.m_tile_end[5]; n += numbl5 ) { + const index_type offset_5 = n*m_rp.m_tile[5] + thr_id5 + (index_type)m_rp.m_lower[5]; + if ( offset_5 < m_rp.m_upper[5] && thr_id5 < m_rp.m_tile[5] ) { + + for ( index_type m = tile_id4; m < m_rp.m_tile_end[4]; m += numbl4 ) { + const index_type offset_4 = m*m_rp.m_tile[4] + thr_id4 + (index_type)m_rp.m_lower[4]; + if ( offset_4 < m_rp.m_upper[4] && thr_id4 < m_rp.m_tile[4] ) { + + for ( index_type l = tile_id3; l < m_rp.m_tile_end[3]; l += numbl3 ) { + const index_type offset_3 = l*m_rp.m_tile[3] + thr_id3 + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && thr_id3 < m_rp.m_tile[3] ) { + + for ( index_type k = tile_id2; k < m_rp.m_tile_end[2]; k += numbl2 ) { + const index_type offset_2 = k*m_rp.m_tile[2] + thr_id2 + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && thr_id2 < m_rp.m_tile[2] ) { + + for ( index_type j = tile_id1 ; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type i = tile_id0 ; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + m_func(offset_0 , offset_1 , offset_2 , offset_3, offset_4, offset_5); + } + } + } + } + } + } + } + } + } + } + } + } + } + // LR + else { + index_type temp0 = m_rp.m_tile_end[0]; + index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl1 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl0 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl1 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x / numbl1; + const index_type tile_id1 = (index_type)blockIdx_x % numbl1; + const index_type thr_id0 = (index_type)threadIdx_x / m_rp.m_tile[1]; + const index_type thr_id1 = (index_type)threadIdx_x % m_rp.m_tile[1]; + + temp0 = m_rp.m_tile_end[2]; + temp1 = m_rp.m_tile_end[3]; + const index_type numbl3 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl2 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl3 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id2 = (index_type)blockIdx_y / numbl3; + const index_type tile_id3 = (index_type)blockIdx_y % numbl3; + const index_type thr_id2 = (index_type)threadIdx_y / m_rp.m_tile[3]; + const index_type thr_id3 = (index_type)threadIdx_y % m_rp.m_tile[3]; + + temp0 = m_rp.m_tile_end[4]; + temp1 = m_rp.m_tile_end[5]; + const index_type numbl5 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl4 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl5 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id4 = (index_type)blockIdx_z / numbl5; + const index_type tile_id5 = (index_type)blockIdx_z % numbl5; + const index_type thr_id4 = (index_type)threadIdx_z / m_rp.m_tile[5]; + const index_type thr_id5 = (index_type)threadIdx_z % m_rp.m_tile[5]; + + for ( index_type i = tile_id0; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + + for ( index_type j = tile_id1; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type k = tile_id2; k < m_rp.m_tile_end[2]; k += numbl2 ) { + const index_type offset_2 = k*m_rp.m_tile[2] + thr_id2 + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && thr_id2 < m_rp.m_tile[2] ) { + + for ( index_type l = tile_id3; l < m_rp.m_tile_end[3]; l += numbl3 ) { + const index_type offset_3 = l*m_rp.m_tile[3] + thr_id3 + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && thr_id3 < m_rp.m_tile[3] ) { + + for ( index_type m = tile_id4; m < m_rp.m_tile_end[4]; m += numbl4 ) { + const index_type offset_4 = m*m_rp.m_tile[4] + thr_id4 + (index_type)m_rp.m_lower[4]; + if ( offset_4 < m_rp.m_upper[4] && thr_id4 < m_rp.m_tile[4] ) { + + for ( index_type n = tile_id5; n < m_rp.m_tile_end[5]; n += numbl5 ) { + const index_type offset_5 = n*m_rp.m_tile[5] + thr_id5 + (index_type)m_rp.m_lower[5]; + if ( offset_5 < m_rp.m_upper[5] && thr_id5 < m_rp.m_tile[5] ) { + m_func(offset_0 , offset_1 , offset_2 , offset_3 , offset_4 , offset_5); + } + } + } + } + } + } + } + } + } + } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; +}; + +// Specializations for tag type +template< typename RP , typename Functor , typename Tag > +struct DeviceIterateTile<6,RP,Functor,Tag> +{ + using index_type = typename RP::index_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ ) + : m_rp(rp_) + , m_func(f_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + // LL + if (RP::inner_direction == RP::Left) { + index_type temp0 = m_rp.m_tile_end[0]; + index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl0 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl1 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl0 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x % numbl0; + const index_type tile_id1 = (index_type)blockIdx_x / numbl0; + const index_type thr_id0 = (index_type)threadIdx_x % m_rp.m_tile[0]; + const index_type thr_id1 = (index_type)threadIdx_x / m_rp.m_tile[0]; + + temp0 = m_rp.m_tile_end[2]; + temp1 = m_rp.m_tile_end[3]; + const index_type numbl2 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl3 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl2 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id2 = (index_type)blockIdx_y % numbl2; + const index_type tile_id3 = (index_type)blockIdx_y / numbl2; + const index_type thr_id2 = (index_type)threadIdx_y % m_rp.m_tile[2]; + const index_type thr_id3 = (index_type)threadIdx_y / m_rp.m_tile[2]; + + temp0 = m_rp.m_tile_end[4]; + temp1 = m_rp.m_tile_end[5]; + const index_type numbl4 = ( temp0 <= max_blocks ? temp0 : max_blocks ) ; + const index_type numbl5 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl4 ) : + ( temp1 <= max_blocks ? temp1 : max_blocks ) ); + + const index_type tile_id4 = (index_type)blockIdx_z % numbl4; + const index_type tile_id5 = (index_type)blockIdx_z / numbl4; + const index_type thr_id4 = (index_type)threadIdx_z % m_rp.m_tile[4]; + const index_type thr_id5 = (index_type)threadIdx_z / m_rp.m_tile[4]; + + for ( index_type n = tile_id5; n < m_rp.m_tile_end[5]; n += numbl5 ) { + const index_type offset_5 = n*m_rp.m_tile[5] + thr_id5 + (index_type)m_rp.m_lower[5]; + if ( offset_5 < m_rp.m_upper[5] && thr_id5 < m_rp.m_tile[5] ) { + + for ( index_type m = tile_id4; m < m_rp.m_tile_end[4]; m += numbl4 ) { + const index_type offset_4 = m*m_rp.m_tile[4] + thr_id4 + (index_type)m_rp.m_lower[4]; + if ( offset_4 < m_rp.m_upper[4] && thr_id4 < m_rp.m_tile[4] ) { + + for ( index_type l = tile_id3; l < m_rp.m_tile_end[3]; l += numbl3 ) { + const index_type offset_3 = l*m_rp.m_tile[3] + thr_id3 + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && thr_id3 < m_rp.m_tile[3] ) { + + for ( index_type k = tile_id2; k < m_rp.m_tile_end[2]; k += numbl2 ) { + const index_type offset_2 = k*m_rp.m_tile[2] + thr_id2 + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && thr_id2 < m_rp.m_tile[2] ) { + + for ( index_type j = tile_id1 ; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type i = tile_id0 ; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + m_func(Tag() , offset_0 , offset_1 , offset_2 , offset_3, offset_4, offset_5); + } + } + } + } + } + } + } + } + } + } + } + } + } + // LR + else { + index_type temp0 = m_rp.m_tile_end[0]; + index_type temp1 = m_rp.m_tile_end[1]; + const index_type numbl1 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl0 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl1 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id0 = (index_type)blockIdx_x / numbl1; + const index_type tile_id1 = (index_type)blockIdx_x % numbl1; + const index_type thr_id0 = (index_type)threadIdx_x / m_rp.m_tile[1]; + const index_type thr_id1 = (index_type)threadIdx_x % m_rp.m_tile[1]; + + temp0 = m_rp.m_tile_end[2]; + temp1 = m_rp.m_tile_end[3]; + const index_type numbl3 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl2 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl3 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id2 = (index_type)blockIdx_y / numbl3; + const index_type tile_id3 = (index_type)blockIdx_y % numbl3; + const index_type thr_id2 = (index_type)threadIdx_y / m_rp.m_tile[3]; + const index_type thr_id3 = (index_type)threadIdx_y % m_rp.m_tile[3]; + + temp0 = m_rp.m_tile_end[4]; + temp1 = m_rp.m_tile_end[5]; + const index_type numbl5 = ( temp1 <= max_blocks ? temp1 : max_blocks ) ; + const index_type numbl4 = ( temp0*temp1 > max_blocks ? index_type( max_blocks / numbl5 ) : + ( temp0 <= max_blocks ? temp0 : max_blocks ) ); + + const index_type tile_id4 = (index_type)blockIdx_z / numbl5; + const index_type tile_id5 = (index_type)blockIdx_z % numbl5; + const index_type thr_id4 = (index_type)threadIdx_z / m_rp.m_tile[5]; + const index_type thr_id5 = (index_type)threadIdx_z % m_rp.m_tile[5]; + + for ( index_type i = tile_id0; i < m_rp.m_tile_end[0]; i += numbl0 ) { + const index_type offset_0 = i*m_rp.m_tile[0] + thr_id0 + (index_type)m_rp.m_lower[0]; + if ( offset_0 < m_rp.m_upper[0] && thr_id0 < m_rp.m_tile[0] ) { + + for ( index_type j = tile_id1; j < m_rp.m_tile_end[1]; j += numbl1 ) { + const index_type offset_1 = j*m_rp.m_tile[1] + thr_id1 + (index_type)m_rp.m_lower[1]; + if ( offset_1 < m_rp.m_upper[1] && thr_id1 < m_rp.m_tile[1] ) { + + for ( index_type k = tile_id2; k < m_rp.m_tile_end[2]; k += numbl2 ) { + const index_type offset_2 = k*m_rp.m_tile[2] + thr_id2 + (index_type)m_rp.m_lower[2]; + if ( offset_2 < m_rp.m_upper[2] && thr_id2 < m_rp.m_tile[2] ) { + + for ( index_type l = tile_id3; l < m_rp.m_tile_end[3]; l += numbl3 ) { + const index_type offset_3 = l*m_rp.m_tile[3] + thr_id3 + (index_type)m_rp.m_lower[3]; + if ( offset_3 < m_rp.m_upper[3] && thr_id3 < m_rp.m_tile[3] ) { + + for ( index_type m = tile_id4; m < m_rp.m_tile_end[4]; m += numbl4 ) { + const index_type offset_4 = m*m_rp.m_tile[4] + thr_id4 + (index_type)m_rp.m_lower[4]; + if ( offset_4 < m_rp.m_upper[4] && thr_id4 < m_rp.m_tile[4] ) { + + for ( index_type n = tile_id5; n < m_rp.m_tile_end[5]; n += numbl5 ) { + const index_type offset_5 = n*m_rp.m_tile[5] + thr_id5 + (index_type)m_rp.m_lower[5]; + if ( offset_5 < m_rp.m_upper[5] && thr_id5 < m_rp.m_tile[5] ) { + m_func(Tag() , offset_0 , offset_1 , offset_2 , offset_3 , offset_4 , offset_5); + } + } + } + } + } + } + } + } + } + } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; +}; + +} // Refactor + +// ---------------------------------------------------------------------------------- + +namespace Reduce { + +template < typename T > +using is_void = std::is_same< T, void >; + +template < typename T > +struct is_array_type : std::false_type +{ + using value_type = T; +}; + +template < typename T > +struct is_array_type< T* > : std::true_type +{ + using value_type = T; +}; + +template < typename T > +struct is_array_type< T[] > : std::true_type +{ + using value_type = T; +}; + +// ------------------------------------------------------------------ // +template< int N , typename RP , typename Functor , typename Tag , typename ValueType , typename Enable = void > +struct DeviceIterateTile; + +// ParallelReduce iteration pattern +// Scalar reductions + +// num_blocks = min( num_tiles, max_num_blocks ); //i.e. determined by number of tiles and reduction algorithm constraints +// extract n-dim tile offsets (i.e. tile's global starting mulit-index) from the tileid = blockid using tile dimensions +// local indices within a tile extracted from (index_type)threadIdx_x using tile dims, constrained by blocksize +// combine tile and local id info for multi-dim global ids + +// Pattern: +// Each block+thread is responsible for a tile+local_id combo (additional when striding by num_blocks) +// 1. create offset arrays +// 2. loop over number of tiles, striding by griddim (equal to num tiles, or max num blocks) +// 3. temps set for tile_idx and thrd_idx, which will be modified +// 4. if LL vs LR: +// determine tile starting point offsets (multidim) +// determine local index offsets (multidim) +// concatentate tile offset + local offset for global multi-dim index +// if offset withinin range bounds AND local offset within tile bounds, call functor + +// ValueType = T +//Rank 2 +// Specializations for void tag type +template< typename RP , typename Functor , typename ValueType > +struct DeviceIterateTile<2,RP,Functor,void,ValueType, typename std::enable_if< !is_array_type<ValueType>::value >::type > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ , ValueType & v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + // Deduce this blocks tile_id + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { + m_func( m_offset[0], m_offset[1], m_v ); + } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_v ); } + } + } + } + + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + ValueType & m_v; +}; + + +// Specializations for tag type +template< typename RP , typename Functor , typename Tag, typename ValueType > +struct DeviceIterateTile<2,RP,Functor,Tag, ValueType, typename std::enable_if< !is_array_type<ValueType>::value && !is_void< Tag >::value >::type > +{ + using index_type = typename RP::index_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , ValueType & v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); // Move this to first computation, add to m_offset right away + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + ValueType & m_v; +}; + + +//Rank 3 +// Specializations for void tag type +template< typename RP , typename Functor , typename ValueType > +struct DeviceIterateTile<3,RP,Functor,void,ValueType , typename std::enable_if< !is_array_type<ValueType>::value >::type > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ , ValueType & v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); // Move this to first computation, add to m_offset right away + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + ValueType & m_v; +}; + + +// Specializations for void tag type +template< typename RP , typename Functor , typename Tag, typename ValueType > +struct DeviceIterateTile<3,RP,Functor,Tag, ValueType, typename std::enable_if< !is_array_type<ValueType>::value && !is_void< Tag >::value >::type > +{ + using index_type = typename RP::index_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , ValueType & v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); // Move this to first computation, add to m_offset right away + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + ValueType & m_v; +}; + + +//Rank 4 +// Specializations for void tag type +template< typename RP , typename Functor , typename ValueType > +struct DeviceIterateTile<4,RP,Functor,void,ValueType , typename std::enable_if< !is_array_type<ValueType>::value >::type > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ , ValueType & v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + ValueType & m_v; +}; + + +// Specializations for void tag type +template< typename RP , typename Functor , typename Tag, typename ValueType > +struct DeviceIterateTile<4,RP,Functor,Tag,ValueType, typename std::enable_if< !is_array_type<ValueType>::value && !is_void< Tag >::value >::type > +{ + using index_type = typename RP::index_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , ValueType & v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + ValueType & m_v; +}; + + +//Rank 5 +// Specializations for void tag type +template< typename RP , typename Functor , typename ValueType > +struct DeviceIterateTile<5,RP,Functor,void,ValueType , typename std::enable_if< !is_array_type<ValueType>::value >::type > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ , ValueType & v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + ValueType & m_v; +}; + + +// Specializations for tag type +template< typename RP , typename Functor , typename Tag, typename ValueType > +struct DeviceIterateTile<5,RP,Functor,Tag,ValueType, typename std::enable_if< !is_array_type<ValueType>::value && !is_void< Tag >::value >::type > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ , ValueType & v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + ValueType & m_v; +}; + + +//Rank 6 +// Specializations for void tag type +template< typename RP , typename Functor , typename ValueType > +struct DeviceIterateTile<6,RP,Functor,void,ValueType , typename std::enable_if< !is_array_type<ValueType>::value >::type > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ , ValueType & v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_offset[5], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_offset[5], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + ValueType & m_v; +}; + + +// Specializations for tag type +template< typename RP , typename Functor , typename Tag, typename ValueType > +struct DeviceIterateTile<6,RP,Functor,Tag,ValueType, typename std::enable_if< !is_array_type<ValueType>::value && !is_void< Tag >::value >::type > +{ + using index_type = typename RP::index_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ , ValueType & v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_offset[5], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_offset[5], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + ValueType & m_v; +}; + + +// ValueType = T[], T* +//Rank 2 +// Specializations for void tag type +template< typename RP , typename Functor , typename ValueType > +struct DeviceIterateTile<2,RP,Functor,void,ValueType, typename std::enable_if< is_array_type<ValueType>::value >::type > +{ + using index_type = typename RP::index_type; + using value_type = typename is_array_type< ValueType >::value_type; + + [[hc]] + DeviceIterateTile( const RP & rp_ , const Functor & f_ , value_type* v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { + m_func( m_offset[0], m_offset[1], m_v ); + } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); // Move this to first computation, add to m_offset right away + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + value_type* m_v; +}; + + +// Specializations for tag type +template< typename RP , typename Functor , typename Tag, typename ValueType > +struct DeviceIterateTile<2,RP,Functor,Tag, ValueType, typename std::enable_if< is_array_type<ValueType>::value && !is_void< Tag >::value >::type > +{ + using index_type = typename RP::index_type; + using value_type = typename is_array_type< ValueType >::value_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , value_type* v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_v ); } + } + } //end for loop over num_tiles - product of tiles in each direction + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + value_type* m_v; +}; + + +//Rank 3 +// Specializations for void tag type +template< typename RP , typename Functor , typename ValueType > +struct DeviceIterateTile<3,RP,Functor,void,ValueType , typename std::enable_if< is_array_type<ValueType>::value >::type > +{ + using index_type = typename RP::index_type; + using value_type = typename is_array_type< ValueType >::value_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , value_type* v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); // Move this to first computation, add to m_offset right away + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); // Move this to first computation, add to m_offset right away + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + value_type* m_v; +}; + + +// Specializations for void tag type +template< typename RP , typename Functor , typename Tag, typename ValueType > +struct DeviceIterateTile<3,RP,Functor,Tag, ValueType, typename std::enable_if< is_array_type<ValueType>::value && !is_void< Tag >::value >::type > +{ + using index_type = typename RP::index_type; + using value_type = typename is_array_type< ValueType >::value_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , value_type* v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + value_type* m_v; +}; + + +//Rank 4 +// Specializations for void tag type +template< typename RP , typename Functor , typename ValueType > +struct DeviceIterateTile<4,RP,Functor,void,ValueType , typename std::enable_if< is_array_type<ValueType>::value >::type > +{ + using index_type = typename RP::index_type; + using value_type = typename is_array_type< ValueType >::value_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , value_type* v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + value_type* m_v; +}; + + +// Specializations for void tag type +template< typename RP , typename Functor , typename Tag, typename ValueType > +struct DeviceIterateTile<4,RP,Functor,Tag,ValueType, typename std::enable_if< is_array_type<ValueType>::value && !is_void< Tag >::value >::type > +{ + using index_type = typename RP::index_type; + using value_type = typename is_array_type< ValueType >::value_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , value_type* v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + value_type* m_v; +}; + + +//Rank 5 +// Specializations for void tag type +template< typename RP , typename Functor , typename ValueType > +struct DeviceIterateTile<5,RP,Functor,void,ValueType , typename std::enable_if< is_array_type<ValueType>::value >::type > +{ + using index_type = typename RP::index_type; + using value_type = typename is_array_type< ValueType >::value_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , value_type* v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + value_type* m_v; +}; + + +// Specializations for tag type +template< typename RP , typename Functor , typename Tag, typename ValueType > +struct DeviceIterateTile<5,RP,Functor,Tag,ValueType, typename std::enable_if< is_array_type<ValueType>::value && !is_void< Tag >::value >::type > +{ + using index_type = typename RP::index_type; + using value_type = typename is_array_type< ValueType >::value_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , value_type* v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + value_type* m_v; +}; + + +//Rank 6 +// Specializations for void tag type +template< typename RP , typename Functor , typename ValueType > +struct DeviceIterateTile<6,RP,Functor,void,ValueType , typename std::enable_if< is_array_type<ValueType>::value >::type > +{ + using index_type = typename RP::index_type; + using value_type = typename is_array_type< ValueType >::value_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , value_type* v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_offset[5], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_offset[5], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + value_type* m_v; +}; + + +// Specializations for tag type +template< typename RP , typename Functor , typename Tag, typename ValueType > +struct DeviceIterateTile<6,RP,Functor,Tag,ValueType, typename std::enable_if< is_array_type<ValueType>::value && !is_void< Tag >::value >::type > +{ + using index_type = typename RP::index_type; + using value_type = typename is_array_type< ValueType >::value_type; + + KOKKOS_INLINE_FUNCTION + DeviceIterateTile( const RP & rp_ , const Functor & f_ , value_type* v_) + : m_rp(rp_) + , m_func(f_) + , m_v(v_) + {} + + static constexpr index_type max_blocks = 65535; + //static constexpr index_type max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount); + + KOKKOS_INLINE_FUNCTION + void exec_range() const + { + //enum { max_blocks = static_cast<index_type>(Kokkos::Impl::ROCmTraits::UpperBoundGridCount) }; + //const index_type max_blocks = static_cast<index_type>( Kokkos::Impl::rocm_internal_maximum_grid_count() ); + if ( (index_type)blockIdx_x < m_rp.m_num_tiles && (index_type)threadIdx_y < m_rp.m_prod_tile_dims ) { + index_type m_offset[RP::rank]; // tile starting global id offset + index_type m_local_offset[RP::rank]; // tile starting global id offset + + for ( index_type tileidx = (index_type)blockIdx_x; tileidx < m_rp.m_num_tiles; tileidx += gridDim_x ) { + index_type tile_idx = tileidx; // temp because tile_idx will be modified while determining tile starting point offsets + index_type thrd_idx = (index_type)threadIdx_y; + bool in_bounds = true; + + // LL + if (RP::inner_direction == RP::Left) { + for (int i=0; i<RP::rank; ++i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_offset[5], m_v ); } + } + // LR + else { + for (int i=RP::rank-1; i>=0; --i) { + m_offset[i] = (tile_idx % m_rp.m_tile_end[i]) * m_rp.m_tile[i] + m_rp.m_lower[i] ; + tile_idx /= m_rp.m_tile_end[i]; + + // tile-local indices identified with (index_type)threadIdx_y + m_local_offset[i] = (thrd_idx % m_rp.m_tile[i]); + thrd_idx /= m_rp.m_tile[i]; + + m_offset[i] += m_local_offset[i]; + if ( !(m_offset[i] < m_rp.m_upper[i] && m_local_offset[i] < m_rp.m_tile[i]) ) { + in_bounds &= false; + } + } + if ( in_bounds ) + { m_func( Tag(), m_offset[0], m_offset[1], m_offset[2], m_offset[3], m_offset[4], m_offset[5], m_v ); } + } + } + } + } //end exec_range + +private: + const RP & m_rp; + const Functor & m_func; + value_type* m_v; +}; + +} // Reduce + +// ---------------------------------------------------------------------------------- + +} } //end namespace Kokkos::Impl +#undef threadIdx_x +#undef threadIdx_y +#undef threadIdx_z + +#undef blockIdx_x +#undef blockIdx_y +#undef blockIdx_z + +#undef blockDim_x +#undef blockDim_y +#undef blockDim_z + +#undef gridDim_x +#undef gridDim_y +#undef gridDim_z + + +#endif +#endif diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Atomic.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Atomic.hpp index 3c7586e2644d99e1d68513191e887164ba1c9968..9d220cfd419df1938b2a9d805e479b573eef1efc 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Atomic.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Atomic.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -398,7 +398,7 @@ namespace Kokkos { template<class T> KOKKOS_INLINE_FUNCTION - T atomic_fetch_sub(volatile T* dest, typename std::enable_if<sizeof(T) == sizeof(int),T>::type & val) { + T atomic_fetch_sub(volatile T* dest, typename std::enable_if<sizeof(T) == sizeof(int),T>::type val) { union U { int i ; T t ; @@ -435,5 +435,43 @@ namespace Kokkos { return oldval.t ; } +// KOKKOS_INLINE_FUNCTION +// char atomic_fetch_sub(volatile char * dest, const char& val) { + template<class T> + KOKKOS_INLINE_FUNCTION + T atomic_fetch_sub(volatile T* dest, typename std::enable_if<sizeof(T) == sizeof(char),T>::type val) { + + unsigned int oldval,newval,assume; + oldval = *(int *)dest ; + + do { + assume = oldval ; + newval = assume&0x7fffff00 + ((assume&0xff)-val)&0xff ; + oldval = hc::atomic_compare_exchange_unsigned((unsigned int*)dest, assume,newval); + } while ( assume != oldval ); + + return (T) oldval&0xff ; + } + +// KOKKOS_INLINE_FUNCTION +// short atomic_fetch_sub(volatile short * dest, const short& val) { + template<class T> + KOKKOS_INLINE_FUNCTION + T atomic_fetch_sub(volatile T* dest, typename std::enable_if<sizeof(T) == sizeof(short),T>::type val) { + + unsigned int oldval,newval,assume; + oldval = *(int *)dest ; + + do { + assume = oldval ; + newval = assume&0x7fff0000 + ((assume&0xffff)-val)&0xffff; + oldval = hc::atomic_compare_exchange_unsigned((unsigned int*)dest, assume,newval); + } while ( assume != oldval ); + + return (T) oldval&0xffff ; + } + + + } #endif diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Config.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Config.hpp index 83b5792a6495a70607c9832a653cfdfa7e6f968d..71643458b471d45e0cc3743fea1233f3b8c39f54 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Config.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Config.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.cpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.cpp index e919d35903d2da15522738aa9870862dd6c0c065..b4be18d03be763bea6aa0c54148bbd07b572e675 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.cpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.hpp index 48a27eb11d1f02632f9f1f74772eac9bbb874f2d..c0d5b9004ca532cface778738bef87934afcf692 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -52,6 +52,7 @@ namespace Kokkos { namespace Impl { + struct ROCmTraits { // TODO: determine if needed enum { WavefrontSize = 64 /* 64 */ }; @@ -63,7 +64,7 @@ struct ROCmTraits { enum { SharedMemoryCapacity = 0x0C000 /* 48k shared / 16k L1 Cache */ }; enum { SharedMemoryUsage = 0x04000 /* 16k shared / 48k L1 Cache */ }; - enum { UpperBoundExtentCount = 65535 /* Hard upper bound */ }; + enum { UpperBoundExtentCount = 4294967295 /* Hard upper bound */ }; #if 0 KOKKOS_INLINE_FUNCTION static ROCmSpace::size_type wavefront_count( ROCmSpace::size_type i ) @@ -133,5 +134,125 @@ namespace Impl { } } // namespace Kokkos +//#if defined(__HCC_ACCELERATOR__) +namespace Kokkos { +namespace Impl { +/* +template< class DriverType> +__global__ +static void rocm_parallel_launch_constant_memory() +{ + const DriverType & driver = + *((const DriverType *) kokkos_impl_rocm_constant_memory_buffer ); + + driver(); +} + +template< class DriverType, unsigned int maxTperB, unsigned int minBperSM > +__global__ +__launch_bounds__(maxTperB, minBperSM) +static void rocm_parallel_launch_constant_memory() +{ + const DriverType & driver = + *((const DriverType *) kokkos_impl_rocm_constant_memory_buffer ); + + driver(); +} + +template< class DriverType> +__global__ +static void rocm_parallel_launch_local_memory( const DriverType driver ) +{ + driver(); +} + +template< class DriverType, unsigned int maxTperB, unsigned int minBperSM > +__global__ +__launch_bounds__(maxTperB, minBperSM) +static void rocm_parallel_launch_local_memory( const DriverType driver ) +{ + driver(); +} +*/ +template < class DriverType + , class LaunchBounds = Kokkos::LaunchBounds<> > +struct ROCmParallelLaunch ; + +template < class DriverType + , unsigned int MaxThreadsPerBlock + , unsigned int MinBlocksPerSM > +struct ROCmParallelLaunch< DriverType + , Kokkos::LaunchBounds< MaxThreadsPerBlock + , MinBlocksPerSM >> +{ + inline + ROCmParallelLaunch( const DriverType & driver + , const dim3 & grid + , const dim3 & block + , const int shmem ) + { + if ( grid.x && ( block.x * block.y * block.z ) ) { + if ( ROCmTraits::SharedMemoryCapacity < shmem ) { + Kokkos::Impl::throw_runtime_exception( std::string("ROCmParallelLaunch FAILED: shared memory request is too large") ); + } + DriverType * rocm_memory_buffer = (DriverType *) + rocm_device_allocate(sizeof(DriverType)); + // Copy functor to constant memory on the device + Kokkos::Impl::DeepCopy<HostSpace,Kokkos::Experimental::ROCmSpace> + ( rocm_memory_buffer , (void *)&driver , sizeof(DriverType) ); + +// KOKKOS_ENSURE_ROCM_LOCK_ARRAYS_ON_DEVICE(); + + // Invoke the driver function on the device + auto ext = hc::extent<3>(grid.x,grid.y,grid.z); + + hc::parallel_for_each(ext.tile_with_dynamic(block.x,block.y,block.z,shmem), [=](const hc::index<3> & idx) [[hc]] + { rocm_memory_buffer->operator()(); + }).wait(); + rocm_device_free(rocm_memory_buffer); + +//#if defined( KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK ) +// ROCM_SAFE_CALL( rocmGetLastError() ); +// Kokkos::ROCm::fence(); +//#endif + } + } +}; +template < class DriverType > +struct ROCmParallelLaunch< DriverType + , Kokkos::LaunchBounds<>> +{ + inline + ROCmParallelLaunch( const DriverType & driver + , const dim3 & grid + , const dim3 & block + , const int shmem ) + { + if ( grid.x && ( block.x * block.y * block.z ) ) { + if ( ROCmTraits::SharedMemoryCapacity < shmem ) { + Kokkos::Impl::throw_runtime_exception( std::string("ROCmParallelLaunch FAILED: shared memory request is too large") ); + } + + DriverType * rocm_memory_buffer = (DriverType *) + rocm_device_allocate(sizeof(DriverType)); + // Copy functor to constant memory on the device + Kokkos::Impl::DeepCopy<HostSpace,Kokkos::Experimental::ROCmSpace> + ( rocm_memory_buffer , (void *)&driver , sizeof(DriverType) ); + +// KOKKOS_ENSURE_ROCM_LOCK_ARRAYS_ON_DEVICE(); + // Invoke the driver function on the device + auto ext = hc::extent<3>(grid.x,grid.y,grid.z); + + hc::parallel_for_each(ext.tile_with_dynamic(block.x,block.y,block.z,shmem), [=](const hc::index<3> & idx) [[hc]] + + { rocm_memory_buffer->operator()(); + }).wait(); + rocm_device_free(rocm_memory_buffer); + } + } +}; +} // namespace Impl +} // namespace Kokkos + #endif /* #ifndef KOKKOS_ROCMEXEC_HPP */ diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp index ffb129cb86f237de1e6263c681576f4099954ed9..3ae312647e6d038cf561860ac7c81bf3fbce7bf8 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -567,7 +567,7 @@ ROCmInternal::scratch_flags( const Kokkos::Experimental::ROCm::size_type size ) m_scratchFlagsCount = ( size + sizeScratchGrain - 1 ) / sizeScratchGrain ; - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< Kokkos::HostSpace , void > Record ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::HostSpace , void > Record ; Record * const r = Record::allocate( Kokkos::HostSpace() , "InternalScratchFlags" @@ -590,7 +590,7 @@ ROCmInternal::scratch_space( const Kokkos::Experimental::ROCm::size_type size ) m_scratchSpaceCount = ( size + sizeScratchGrain - 1 ) / sizeScratchGrain ; - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< Kokkos::HostSpace , void > Record ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::HostSpace , void > Record ; Record * const r = Record::allocate( Kokkos::HostSpace() , "InternalScratchSpace" @@ -616,8 +616,8 @@ void ROCmInternal::finalize() // scratch_lock_array_rocm_space_ptr(false); // threadid_lock_array_rocm_space_ptr(false); - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< HostSpace > RecordROCm ; - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< Kokkos::Experimental::ROCmHostPinnedSpace > RecordHost ; + typedef Kokkos::Impl::SharedAllocationRecord< HostSpace > RecordROCm ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::Experimental::ROCmHostPinnedSpace > RecordHost ; RecordROCm::decrement( RecordROCm::get_record( m_scratchFlags ) ); RecordROCm::decrement( RecordROCm::get_record( m_scratchSpace ) ); diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Invoke.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Invoke.hpp index 481e7df3a431d8f68cbff760abdf8475ae1df2df..b18e5f61f17f8cc62610b6eff11e35e8a460960d 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Invoke.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Invoke.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Join.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Join.hpp index d3d150703ed3bc4352f56f3294bffe1134cf0dad..eccba5119a2aec0917d12d8d94234993b480f19c 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Join.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Join.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp index 04f4754db2b2eef76d53ad25cd1d2019115d04b9..7ca9b149a61da248163f8b420c53f64a6840e80f 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -45,7 +45,11 @@ #include <typeinfo> #include <ROCm/Kokkos_ROCm_Reduce.hpp> #include <ROCm/Kokkos_ROCm_Scan.hpp> +#include <ROCm/Kokkos_ROCm_Exec.hpp> #include <ROCm/Kokkos_ROCm_Vectorization.hpp> +#include <ROCm/KokkosExp_ROCm_IterateTile_Refactor.hpp> + +#include <KokkosExp_MDRangePolicy.hpp> namespace Kokkos { @@ -161,6 +165,33 @@ public: return p; }; +protected: + /** \brief set chunk_size to a discrete value*/ + inline TeamPolicyInternal internal_set_chunk_size(typename traits::index_type chunk_size_) { + m_chunk_size = chunk_size_; + return *this; + } + + /** \brief set per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team) { + m_team_scratch_size[level] = per_team.value; + return *this; + }; + + /** \brief set per thread scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerThreadValue& per_thread) { + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; + + /** \brief set per thread and per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team, const PerThreadValue& per_thread) { + m_team_scratch_size[level] = per_team.value; + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; + +public: // TODO: evaluate proper team_size_max requirements template< class Functor_Type> KOKKOS_INLINE_FUNCTION static @@ -652,6 +683,102 @@ auto foo = [=](size_t i){rocm_invoke<typename Policy::work_tag>(f, i);}; }; +// MDRangePolicy impl +template< class FunctorType , class ... Traits > +class ParallelFor< FunctorType + , Kokkos::MDRangePolicy< Traits ... > + , Kokkos::Experimental::ROCm + > +{ +private: + typedef Kokkos::MDRangePolicy< Traits ... > Policy ; + using RP = Policy; + typedef typename Policy::array_index_type array_index_type; + typedef typename Policy::index_type index_type; + typedef typename Policy::launch_bounds LaunchBounds; + + + const FunctorType m_functor ; + const Policy m_rp ; + +public: + + KOKKOS_INLINE_FUNCTION + void operator()(void) const + { + Kokkos::Impl::Refactor::DeviceIterateTile<Policy::rank,Policy,FunctorType,typename Policy::work_tag>(m_rp,m_functor).exec_range(); + } + + + inline + void execute() const + { + const array_index_type maxblocks = static_cast<array_index_type>(Kokkos::Impl::ROCmTraits::UpperBoundExtentCount); + if ( RP::rank == 2 ) + { + const dim3 block( m_rp.m_tile[0] , m_rp.m_tile[1] , 1); + const dim3 grid( + std::min( ( m_rp.m_upper[0] - m_rp.m_lower[0] + block.x - 1 ) / block.x , maxblocks ) + , std::min( ( m_rp.m_upper[1] - m_rp.m_lower[1] + block.y - 1 ) / block.y , maxblocks ) + , 1 ); + ROCmParallelLaunch< ParallelFor, LaunchBounds >( *this, grid, block, 0); + } + else if ( RP::rank == 3 ) + { + const dim3 block( m_rp.m_tile[0] , m_rp.m_tile[1] , m_rp.m_tile[2] ); + const dim3 grid( + std::min( ( m_rp.m_upper[0] - m_rp.m_lower[0] + block.x - 1 ) / block.x , maxblocks ) + , std::min( ( m_rp.m_upper[1] - m_rp.m_lower[1] + block.y - 1 ) / block.y , maxblocks ) + , std::min( ( m_rp.m_upper[2] - m_rp.m_lower[2] + block.z - 1 ) / block.z , maxblocks )); + ROCmParallelLaunch< ParallelFor, LaunchBounds >( *this, grid, block, 0); + } + else if ( RP::rank == 4 ) + { + // id0,id1 encoded within threadIdx.x; id2 to threadIdx.y; id3 to threadIdx.z + const dim3 block( m_rp.m_tile[0]*m_rp.m_tile[1] , m_rp.m_tile[2] , m_rp.m_tile[3] ); + const dim3 grid( + std::min( m_rp.m_tile_end[0] * m_rp.m_tile_end[1] , maxblocks ) + , std::min( ( m_rp.m_upper[2] - m_rp.m_lower[2] + block.y - 1 ) / block.y , maxblocks ) + , std::min( ( m_rp.m_upper[3] - m_rp.m_lower[3] + block.z - 1 ) / block.z , maxblocks )); + ROCmParallelLaunch< ParallelFor, LaunchBounds >( *this, grid, block, 0); + } + else if ( RP::rank == 5 ) + { + // id0,id1 encoded within threadIdx.x; id2,id3 to threadIdx.y; id4 to threadIdx.z + const dim3 block( m_rp.m_tile[0]*m_rp.m_tile[1] , m_rp.m_tile[2]*m_rp.m_tile[3] , m_rp.m_tile[4] ); + const dim3 grid( + std::min( m_rp.m_tile_end[0] * m_rp.m_tile_end[1] , maxblocks ) + , std::min( m_rp.m_tile_end[2] * m_rp.m_tile_end[3] , maxblocks ) + , std::min( ( m_rp.m_upper[4] - m_rp.m_lower[4] + block.z - 1 ) / block.z , maxblocks )); + ROCmParallelLaunch< ParallelFor, LaunchBounds >( *this, grid, block, 0); + } + else if ( RP::rank == 6 ) + { + // id0,id1 encoded within threadIdx.x; id2,id3 to threadIdx.y; id4,id5 to threadIdx.z + const dim3 block( m_rp.m_tile[0]*m_rp.m_tile[1] , m_rp.m_tile[2]*m_rp.m_tile[3] , m_rp.m_tile[4]*m_rp.m_tile[5] ); + const dim3 grid( + std::min( m_rp.m_tile_end[0] * m_rp.m_tile_end[1] , maxblocks ) + , std::min( m_rp.m_tile_end[2] * m_rp.m_tile_end[3] , maxblocks ) + , std::min( m_rp.m_tile_end[4] * m_rp.m_tile_end[5] , maxblocks )); + ROCmParallelLaunch< ParallelFor, LaunchBounds >( *this, grid, block, 0); + } + else + { + printf("Kokkos::MDRange Error: Exceeded rank bounds with ROCm\n"); + Kokkos::abort("Aborting"); + } + + } //end execute + +// inline + ParallelFor( const FunctorType & arg_functor + , Policy arg_policy ) + : m_functor( arg_functor ) + , m_rp( arg_policy ) + { +} +}; + //---------------------------------------------------------------------------- template< class F , class... Traits > diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp index 4e96aa6eaf31298722ed028d93dcf3023c8d85df..293fca2ad76809f0453ddbde7e326f9b418477d8 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp index 309b38d69ffcd221f18707ccd42e8a897f61c5f9..3f67089b9204a3396e6d829a1c82e17dc2a04cc6 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp index c2e85ad11279dc329ec85e0e7e08e972abf52f22..9890598bc980fcda3e2f1446d46689cc2d1332d2 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp index e2b673807641b718b30aaa2fdd76e26a064de3de..ed6c517e9b6d4e3d5766234c19a4922a06c9735d 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.cpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.cpp index 317995c4f476357aa27c7e63d15791c79e0390dd..894d3248341aa69e0dcaebab1e7711044fb8e6c7 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.cpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.hpp index 16badcc1d4d50e3f4bbd0ff387b327b30dc945dc..379279441ea08f3dbe110611c07b66f793942d67 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp index e1a89e379462d0580ae0ac3b53937d454d155ea8..12fe72116602a2bdb485f9b36fd7b18bda4de03a 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Vectorization.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Vectorization.hpp index ac166f9ad8d7ed4a214b5d710ba4b632455e5968..36f886109c495564ce2e7b57f73df896a2adc598 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Vectorization.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Vectorization.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp index 977ada214edaecbeb6d927dd4bbbbbf547454c62..4d0514f471b1524c55b2cc8d49f3674410333b94 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -197,7 +197,7 @@ ThreadsExec::~ThreadsExec() { const unsigned entry = m_pool_size - ( m_pool_rank + 1 ); - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< Kokkos::HostSpace , void > Record ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::HostSpace , void > Record ; if ( m_scratch ) { Record * const r = Record::get_record( m_scratch ); @@ -430,7 +430,7 @@ void * ThreadsExec::root_reduce_scratch() void ThreadsExec::execute_resize_scratch( ThreadsExec & exec , const void * ) { - typedef Kokkos::Experimental::Impl::SharedAllocationRecord< Kokkos::HostSpace , void > Record ; + typedef Kokkos::Impl::SharedAllocationRecord< Kokkos::HostSpace , void > Record ; if ( exec.m_scratch ) { Record * const r = Record::get_record( exec.m_scratch ); diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp index 71189cf7cc9c6a4f6440ef190613513c94841b3e..6f5c461f3e6b3ac26a813786bf834104bacdde8d 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec_base.cpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec_base.cpp index 288dab2bacace135bf87579082cfe7aa66640d17..bac6022cd487eaa02134732a24d21268b1c31205 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec_base.cpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec_base.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp index 7a51b41bfb7b92e2eee15f634a6ee704a4e8fe64..a496d911d21668ace8555e8abab079168658bd48 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -725,6 +725,32 @@ public: return p; }; +protected: + /** \brief set chunk_size to a discrete value*/ + inline TeamPolicyInternal internal_set_chunk_size(typename traits::index_type chunk_size_) { + m_chunk_size = chunk_size_; + return *this; + } + + /** \brief set per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team) { + m_team_scratch_size[level] = per_team.value; + return *this; + }; + + /** \brief set per thread scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerThreadValue& per_thread) { + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; + + /** \brief set per thread and per team scratch size for a specific level of the scratch hierarchy */ + inline TeamPolicyInternal internal_set_scratch_size(const int& level, const PerTeamValue& per_team, const PerThreadValue& per_thread) { + m_team_scratch_size[level] = per_team.value; + m_thread_scratch_size[level] = per_thread.value; + return *this; + }; + private: /** \brief finalize chunk_size if it was set to AUTO*/ inline void set_auto_chunk_size() { diff --git a/lib/kokkos/core/src/Threads/Kokkos_Threads_Parallel.hpp b/lib/kokkos/core/src/Threads/Kokkos_Threads_Parallel.hpp index be9f5a6f876f1e7eca7c84f999ed300e37372abf..731c692968dcd29b329cef26fc83e1e834c4fb54 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_Threads_Parallel.hpp +++ b/lib/kokkos/core/src/Threads/Kokkos_Threads_Parallel.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -567,18 +567,17 @@ private: typedef typename ReducerConditional::type ReducerTypeFwd; typedef typename Kokkos::Impl::if_c< std::is_same<InvalidType,ReducerType>::value, WorkTag, void>::type WorkTagFwd; - typedef typename ReducerTypeFwd::value_type ValueType; - typedef Kokkos::Impl::FunctorValueTraits< ReducerTypeFwd , WorkTagFwd > ValueTraits ; typedef Kokkos::Impl::FunctorValueInit< ReducerTypeFwd , WorkTagFwd > ValueInit ; typedef typename ValueTraits::pointer_type pointer_type ; + typedef typename ValueTraits::value_type value_type ; typedef typename ValueTraits::reference_type reference_type ; using iterate_type = typename Kokkos::Impl::HostIterateTile< MDRangePolicy , FunctorType , WorkTag - , ValueType + , reference_type >; const FunctorType m_functor ; diff --git a/lib/kokkos/core/src/Threads/Kokkos_Threads_WorkGraphPolicy.hpp b/lib/kokkos/core/src/Threads/Kokkos_Threads_WorkGraphPolicy.hpp index 203e5b2b99aab13cfcd7833c384a2da4742e2931..934d2db2ca83ccbd2dc1062ab71c48c14f1f8542 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_Threads_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/Threads/Kokkos_Threads_WorkGraphPolicy.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/KokkosExp_Host_IterateTile.hpp b/lib/kokkos/core/src/impl/KokkosExp_Host_IterateTile.hpp index e851a1e217dab00622ddc7e03d9ac01af2e82b37..258fd0787288e7cf7f5a73e95f2fc3fe217f3950 100644 --- a/lib/kokkos/core/src/impl/KokkosExp_Host_IterateTile.hpp +++ b/lib/kokkos/core/src/impl/KokkosExp_Host_IterateTile.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/KokkosExp_ViewMapping.hpp b/lib/kokkos/core/src/impl/KokkosExp_ViewMapping.hpp index d5d27cc8365c48ddd83077cc96511374f4658e89..0bfc5841dfb0487419c20c9849cb00f68db3cef9 100644 --- a/lib/kokkos/core/src/impl/KokkosExp_ViewMapping.hpp +++ b/lib/kokkos/core/src/impl/KokkosExp_ViewMapping.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_AnalyzePolicy.hpp b/lib/kokkos/core/src/impl/Kokkos_AnalyzePolicy.hpp index 3fb15c8d1efa639ec2483cb2208d8cf5835f6552..d27c2e13061fc33d3bec1f1b9d3955448db70a1a 100644 --- a/lib/kokkos/core/src/impl/Kokkos_AnalyzePolicy.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_AnalyzePolicy.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Assembly.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Assembly.hpp index ea2c90a9e3fc3cb33976ab217ca461d3beca1a69..c94309162219adf1250e84f00aa38d3e600d8866 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Assembly.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Assembly.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp index bc0d9696998073fcd97c53406f4ddef76c3ed6d1..ad115dd8ffc96efc25a9ac2fd316d13a0b58dfc3 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -283,6 +283,18 @@ T atomic_compare_exchange( volatile T * const dest, const T compare, const T val return retval; } +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + +template< typename T > +KOKKOS_INLINE_FUNCTION +T atomic_compare_exchange( volatile T * const dest_v, const T compare, const T val ) +{ + T* dest = const_cast<T*>(dest_v); + T retval = *dest; + if (retval == compare) *dest = val; + return retval; +} + #endif #endif #endif // !defined ROCM_ATOMICS diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Decrement.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Decrement.hpp index 2a13a4865c7eaec2c24877e9511d79e823b261b7..0f3dc52fcec33ab994c301b21f5906bc2a832b15 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Decrement.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Decrement.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -61,15 +61,17 @@ void atomic_decrement<char>(volatile char* a) { #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) _mm_prefetch( (const char*) a, _MM_HINT_ET0 ); #endif - __asm__ __volatile__( "lock decb %0" : /* no output registers */ : "m" (a[0]) : "memory" ); +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + char* a_nv = const_cast<char*>(a); + --(*a_nv); #else - Kokkos::atomic_fetch_sub(a, 1); + Kokkos::atomic_fetch_sub(a, char(1)); #endif } @@ -80,15 +82,17 @@ void atomic_decrement<short>(volatile short* a) { #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) _mm_prefetch( (const char*) a, _MM_HINT_ET0 ); #endif - __asm__ __volatile__( "lock decw %0" : /* no output registers */ : "m" (a[0]) : "memory" ); +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + short* a_nv = const_cast<short*>(a); + --(*a_nv); #else - Kokkos::atomic_fetch_sub(a, 1); + Kokkos::atomic_fetch_sub(a, short(1)); #endif } @@ -99,15 +103,17 @@ void atomic_decrement<int>(volatile int* a) { #if defined( KOKKOS_ENABLE_RFO_PREFETCH ) _mm_prefetch( (const char*) a, _MM_HINT_ET0 ); #endif - __asm__ __volatile__( "lock decl %0" : /* no output registers */ : "m" (a[0]) : "memory" ); +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + int* a_nv = const_cast<int*>(a); + --(*a_nv); #else - Kokkos::atomic_fetch_sub(a, 1); + Kokkos::atomic_fetch_sub(a, int(1)); #endif } @@ -124,15 +130,24 @@ void atomic_decrement<long long int>(volatile long long int* a) { : "m" (a[0]) : "memory" ); +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + long long int* a_nv = const_cast<long long int*>(a); + --(*a_nv); #else - Kokkos::atomic_fetch_sub(a, 1); + using T = long long int; + Kokkos::atomic_fetch_sub(a, T(1)); #endif } template<typename T> KOKKOS_INLINE_FUNCTION void atomic_decrement(volatile T* a) { - Kokkos::atomic_fetch_sub(a, 1); +#if defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + T* a_nv = const_cast<T*>(a); + --(*a_nv); +#else + Kokkos::atomic_fetch_sub(a, T(1)); +#endif } } // End of namespace Kokkos diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp index 2f5bfd44e8f1f450fefd7f2d13e2d86b622e6a49..801a8091ddcba27ca09be73951cca8ae00e7d2ca 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -387,6 +387,26 @@ void atomic_assign( volatile T * const dest , const T val ) } } +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + +template < typename T > +inline +T atomic_exchange( volatile T * const dest_v , const T val ) +{ + T* dest = const_cast<T*>(dest_v); + T retval = *dest; + *dest = val; + return retval; +} + +template < typename T > +inline +void atomic_assign( volatile T * const dest_v , const T val ) +{ + T* dest = const_cast<T*>(dest_v); + *dest = val; +} + #endif #endif } // namespace Kokkos diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp index dfdd133a3cee139c979b38eec5c3b506265de54d..55521e0c53c762715725519292c57dc91f50f9f3 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -358,6 +358,17 @@ T atomic_fetch_add( volatile T * const dest , const T val ) return retval; } +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + +template< typename T > +T atomic_fetch_add( volatile T * const dest_v , const T val ) +{ + T* dest = const_cast<T*>(dest_v); + T retval = *dest; + *dest += val; + return retval; +} + #endif #endif #endif // !defined ROCM_ATOMICS diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_And.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_And.hpp index 6ecb65336c737214d364e8981bed85e4b6993191..044cbdf79ae74fe304de8fea159c7a18188289f0 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_And.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_And.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -134,6 +134,17 @@ T atomic_fetch_and( volatile T * const dest , const T val ) return retval; } +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + +template< typename T > +T atomic_fetch_and( volatile T * const dest_v , const T val ) +{ + T* dest = const_cast<T*>(dest_v); + T retval = *dest; + *dest &= val; + return retval; +} + #endif #endif //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Or.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Or.hpp index ed3b438f8957fd54d21aa7e91410696f061b049e..0b8cbb1d8ce0777cd029fc70b93675e29e65e63a 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Or.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Or.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -134,6 +134,17 @@ T atomic_fetch_or( volatile T * const dest , const T val ) return retval; } +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + +template< typename T > +T atomic_fetch_or( volatile T * const dest_v , const T val ) +{ + T* dest = const_cast<T*>(dest_v); + T retval = *dest; + *dest |= val; + return retval; +} + #endif #endif //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp index fc8955d9092ca3dfef9dc3428d4c49e98e8e6a7f..28aca0aeed25090ec2c6bb7655c9ead3757b841d 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -266,6 +266,17 @@ T atomic_fetch_sub( volatile T * const dest , const T val ) return retval; } +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + +template< typename T > +T atomic_fetch_sub( volatile T * const dest_v , const T val ) +{ + T* dest = const_cast<T*>(dest_v); + T retval = *dest; + *dest -= val; + return retval; +} + #endif #endif #endif // !defined ROCM_ATOMICS diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp index 3a2a9e1f80ae498d9bed1b7dcde282903769e3c0..6140d45896f5041bfb2c31b76e5c192e1179c77f 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -338,6 +338,8 @@ T atomic_fetch_mod(volatile T * const dest, const T val) { return Impl::atomic_fetch_oper(Impl::ModOper<T,const T>(),dest,val); } +#if !defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + template < typename T > KOKKOS_INLINE_FUNCTION T atomic_fetch_and(volatile T * const dest, const T val) { @@ -350,6 +352,8 @@ T atomic_fetch_or(volatile T * const dest, const T val) { return Impl::atomic_fetch_oper(Impl::OrOper<T,const T>(),dest,val); } +#endif + template < typename T > KOKKOS_INLINE_FUNCTION T atomic_fetch_xor(volatile T * const dest, const T val) { diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Increment.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Increment.hpp index e7626603fc66f89df8cc0a2d61581c5ef43deccb..a1a8357b61313519865ca04a6c7d0624f26cfaec 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Increment.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Increment.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -65,8 +65,11 @@ void atomic_increment<char>(volatile char* a) { : "m" (a[0]) : "memory" ); +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + char* a_nv = const_cast<char*>(a); + ++(*a_nv); #else - Kokkos::atomic_fetch_add(a,1); + Kokkos::atomic_fetch_add(a, char(1)); #endif } @@ -83,8 +86,11 @@ void atomic_increment<short>(volatile short* a) { : "m" (a[0]) : "memory" ); +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + short* a_nv = const_cast<short*>(a); + ++(*a_nv); #else - Kokkos::atomic_fetch_add(a,1); + Kokkos::atomic_fetch_add(a, short(1)); #endif } @@ -101,8 +107,11 @@ void atomic_increment<int>(volatile int* a) { : "m" (a[0]) : "memory" ); +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + int* a_nv = const_cast<int*>(a); + ++(*a_nv); #else - Kokkos::atomic_fetch_add(a,1); + Kokkos::atomic_fetch_add(a,int(1)); #endif } @@ -119,15 +128,24 @@ void atomic_increment<long long int>(volatile long long int* a) { : "m" (a[0]) : "memory" ); +#elif defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + long long int* a_nv = const_cast<long long int*>(a); + ++(*a_nv); #else - Kokkos::atomic_fetch_add(a,1); + using T = long long int; + Kokkos::atomic_fetch_add(a,T(1)); #endif } template<typename T> KOKKOS_INLINE_FUNCTION void atomic_increment(volatile T* a) { - Kokkos::atomic_fetch_add(a,1); +#if defined( KOKKOS_ENABLE_SERIAL_ATOMICS ) + T* a_nv = const_cast<T*>(a); + ++(*a_nv); +#else + Kokkos::atomic_fetch_add(a,T(1)); +#endif } } // End of namespace Kokkos diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_View.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_View.hpp index 5b555e51a3dc10faf9537aa63033a5aa2e7762cc..7f63f93060560bf43f94c7f71dde11e998becf48 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_View.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_View.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -86,24 +86,24 @@ public: KOKKOS_INLINE_FUNCTION const_value_type operator ++ () const { - const_value_type tmp = Kokkos::atomic_fetch_add(ptr,1); + const_value_type tmp = Kokkos::atomic_fetch_add(ptr,non_const_value_type(1)); return tmp+1; } KOKKOS_INLINE_FUNCTION const_value_type operator -- () const { - const_value_type tmp = Kokkos::atomic_fetch_add(ptr,-1); + const_value_type tmp = Kokkos::atomic_fetch_sub(ptr,non_const_value_type(1)); return tmp-1; } KOKKOS_INLINE_FUNCTION const_value_type operator ++ (int) const { - return Kokkos::atomic_fetch_add(ptr,1); + return Kokkos::atomic_fetch_add(ptr,non_const_value_type(1)); } KOKKOS_INLINE_FUNCTION const_value_type operator -- (int) const { - return Kokkos::atomic_fetch_add(ptr,-1); + return Kokkos::atomic_fetch_sub(ptr,non_const_value_type(1)); } KOKKOS_INLINE_FUNCTION @@ -119,12 +119,12 @@ public: KOKKOS_INLINE_FUNCTION const_value_type operator -= (const_value_type& val) const { - const_value_type tmp = Kokkos::atomic_fetch_add(ptr,-val); + const_value_type tmp = Kokkos::atomic_fetch_sub(ptr,val); return tmp-val; } KOKKOS_INLINE_FUNCTION const_value_type operator -= (volatile const_value_type& val) const { - const_value_type tmp = Kokkos::atomic_fetch_add(ptr,-val); + const_value_type tmp = Kokkos::atomic_fetch_sub(ptr,val); return tmp-val; } diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp index ea6807a2e97f8f90c1c5df53ec12bc9fc0072563..eeec2d1f4b57fa7ac7a4b03008d921ebe7d6a1e8 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_BitOps.hpp b/lib/kokkos/core/src/impl/Kokkos_BitOps.hpp index 18c61a209c0a15d02a5b1e9bb07e0611ef2ffaa5..8f461baea9d71ac1e728b752d5105a7ad1a3f3d3 100644 --- a/lib/kokkos/core/src/impl/Kokkos_BitOps.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_BitOps.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -48,6 +48,10 @@ #include <cstdint> #include <climits> +#ifdef KOKKOS_COMPILER_INTEL +#include<immintrin.h> +#endif + #if defined( __HCC_ACCELERATOR__ ) #include <hc.hpp> #endif diff --git a/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.cpp b/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.cpp index 79c348515be78d38315e64c3bbf69c115b05836c..7b16a8a998ac385dd40c93174c7e017a8b855b40 100644 --- a/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.hpp b/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.hpp index af474bc40617968fbc87fb2cf6b70e1bec0d42f5..2b200b057dbc2bc65ea3b7c2e6721f9594f73751 100644 --- a/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_ClockTic.hpp b/lib/kokkos/core/src/impl/Kokkos_ClockTic.hpp index c59c59d4979247a9131835c8ee41393a5f5e3836..68ca3b48f61723a0f6c05d5036e04d97f2dcb3b7 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ClockTic.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ClockTic.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_ConcurrentBitset.hpp b/lib/kokkos/core/src/impl/Kokkos_ConcurrentBitset.hpp index 8f52087caa8a6b165a43d99fbaeb9f169c7632a5..ca76c2ff72023a8112b1cfb9812fe977b857912d 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ConcurrentBitset.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ConcurrentBitset.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Core.cpp b/lib/kokkos/core/src/impl/Kokkos_Core.cpp index 2d03cd2f723f9b2a32dceec8980ee19e8a3a9bcf..a0ef8dcacb2c58bfeb002379fa02cfbb1a8890ad 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Core.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Core.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -48,12 +48,14 @@ #include <iostream> #include <sstream> #include <cstdlib> +#include <stack> //---------------------------------------------------------------------------- namespace { bool g_is_initialized = false; bool g_show_warnings = true; +std::stack<std::function<void()> > finalize_hooks; } namespace Kokkos { namespace Impl { namespace { @@ -188,6 +190,26 @@ setenv("MEMKIND_HBW_NODES", "1", 0); void finalize_internal( const bool all_spaces = false ) { + typename decltype(finalize_hooks)::size_type numSuccessfulCalls = 0; + while(! finalize_hooks.empty()) { + auto f = finalize_hooks.top(); + try { + f(); + } + catch(...) { + std::cerr << "Kokkos::finalize: A finalize hook (set via " + "Kokkos::push_finalize_hook) threw an exception that it did not catch." + " Per std::atexit rules, this results in std::terminate. This is " + "finalize hook number " << numSuccessfulCalls << " (1-based indexing) " + "out of " << finalize_hooks.size() << " to call. Remember that " + "Kokkos::finalize calls finalize hooks in reverse order from how they " + "were pushed." << std::endl; + std::terminate(); + } + finalize_hooks.pop(); + ++numSuccessfulCalls; + } + #if defined(KOKKOS_ENABLE_PROFILING) Kokkos::Profiling::finalize(); #endif @@ -477,6 +499,11 @@ void initialize(const InitArguments& arguments) { Impl::initialize_internal(arguments); } +void push_finalize_hook(std::function<void()> f) +{ + finalize_hooks.push(f); +} + void finalize() { Impl::finalize_internal(); @@ -639,7 +666,12 @@ void print_configuration( std::ostream & out , const bool detail ) #else msg << "no" << std::endl; #endif - + msg << " KOKKOS_ENABLE_SERIAL_ATOMICS: "; +#ifdef KOKKOS_ENABLE_SERIAL_ATOMICS + msg << "yes" << std::endl; +#else + msg << "no" << std::endl; +#endif msg << "Vectorization:" << std::endl; msg << " KOKKOS_ENABLE_PRAGMA_IVDEP: "; diff --git a/lib/kokkos/core/src/impl/Kokkos_Error.cpp b/lib/kokkos/core/src/impl/Kokkos_Error.cpp index 3e9eebbc4cec1cdb830d529886e32d34efd7ba14..33b0ba918d3a4d63fb04edf559dc05ce9ef24424 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Error.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Error.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Error.hpp b/lib/kokkos/core/src/impl/Kokkos_Error.hpp index b4390f14a16d14bd7fafcfbecb805071bec8696e..f15c20fa70332f9485a1bc515c643f7cc0cbdffd 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Error.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Error.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_ExecPolicy.cpp b/lib/kokkos/core/src/impl/Kokkos_ExecPolicy.cpp index 5a004193d09d0fc94719e55f4c3440ca9bfd3de3..72ba5156136e6ddc460d36d65af8a27e3317561d 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ExecPolicy.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_ExecPolicy.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_FunctorAdapter.hpp b/lib/kokkos/core/src/impl/Kokkos_FunctorAdapter.hpp index 87f153cd657aa4d023e2acc3ef5c7aaae4a17890..7d4ffb85c124fe6b9249e7521f251e1a30692105 100644 --- a/lib/kokkos/core/src/impl/Kokkos_FunctorAdapter.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_FunctorAdapter.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -224,26 +224,201 @@ private: KOKKOS_INLINE_FUNCTION static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember ) const ) {} + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > KOKKOS_INLINE_FUNCTION static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & ) const ) {} + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > KOKKOS_INLINE_FUNCTION static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember ) const ) {} + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > KOKKOS_INLINE_FUNCTION static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & ) const ) {} + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + + template< class TagType , class ArgMember > KOKKOS_INLINE_FUNCTION static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember ) const ) {} + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class TagType , class ArgMember > KOKKOS_INLINE_FUNCTION static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & ) const ) {} + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class TagType , class ArgMember > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + //---------------------------------------- // parallel_for operator with a tag: @@ -251,45 +426,333 @@ private: KOKKOS_INLINE_FUNCTION static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember ) const ) {} + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > KOKKOS_INLINE_FUNCTION static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember ) const ) {} + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember ) const ) {} + + template< class ArgMember > KOKKOS_INLINE_FUNCTION static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & ) const ) {} + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > KOKKOS_INLINE_FUNCTION static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & ) const ) {} + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + template< class ArgMember > + KOKKOS_INLINE_FUNCTION + static VOIDTAG deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & ) const ) {} + + //---------------------------------------- // parallel_reduce operator without a tag: - template< class ArgMember , class T > KOKKOS_INLINE_FUNCTION static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , T & ) const ) {} + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > KOKKOS_INLINE_FUNCTION static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , T & ) const ) {} + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > KOKKOS_INLINE_FUNCTION static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , T & ) const ) {} + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > KOKKOS_INLINE_FUNCTION static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , T & ) const ) {} + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( TagType , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > KOKKOS_INLINE_FUNCTION static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , T & ) const ) {} + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class TagType , class ArgMember , class T > KOKKOS_INLINE_FUNCTION static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , T & ) const ) {} + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class TagType , class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static REJECTTAG deduce_reduce_type( VOIDTAG , void (FunctorType::*)( const TagType & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + //---------------------------------------- // parallel_reduce operator with a tag: @@ -297,18 +760,133 @@ private: KOKKOS_INLINE_FUNCTION static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , T & ) const ) {} + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > KOKKOS_INLINE_FUNCTION static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , T & ) const ) {} + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , ArgMember , T & ) const ) {} + + template< class ArgMember , class T > KOKKOS_INLINE_FUNCTION static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , T & ) const ) {} + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( tag_type , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > KOKKOS_INLINE_FUNCTION static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , T & ) const ) {} + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + + template< class ArgMember , class T > + KOKKOS_INLINE_FUNCTION + static T deduce_reduce_type( tag_type , void (FunctorType::*)( const tag_type & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , const ArgMember & , T & ) const ) {} + //---------------------------------------- // parallel_scan operator without a tag: @@ -467,7 +1045,7 @@ struct FunctorValueInitFunction< FunctorType , void > { // If a proper FunctorType::init is declared then use it, // otherwise use default constructor. template< class FunctorType , class ArgTag - , class T = typename FunctorValueTraits<FunctorType,ArgTag>::reference_type + , class T = typename FunctorValueTraits<FunctorType,ArgTag>::reference_type // FIXME Fix FunctorValueTraits for multi-dim operator , class Enable = void > struct FunctorValueInit ; diff --git a/lib/kokkos/core/src/impl/Kokkos_FunctorAnalysis.hpp b/lib/kokkos/core/src/impl/Kokkos_FunctorAnalysis.hpp index aabc291a98d704fc9a0631aa593f4550dc57f628..cc4b2af1a20a7b73650093cacbb00300f9ff4a86 100644 --- a/lib/kokkos/core/src/impl/Kokkos_FunctorAnalysis.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_FunctorAnalysis.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -160,6 +160,34 @@ private: KOKKOS_INLINE_FUNCTION static A deduce( void (Functor::*)( M , A & ) const ); + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( M , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( M , M , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( M , M , M , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( M , M , M , M , M , M , M , M , A & ) const ); + using type = decltype( deduce( & F::operator() ) ); }; @@ -170,10 +198,67 @@ private: KOKKOS_INLINE_FUNCTION static A deduce( void (Functor::*)( WTag , M , A & ) const ); + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag , M , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag , M , M , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag , M , M , M , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag , M , M , M , M , M , M , M , M , A & ) const ); + + template< typename M , typename A > KOKKOS_INLINE_FUNCTION static A deduce( void (Functor::*)( WTag const & , M , A & ) const ); + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag const & , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag const & , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag const & , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag const & , M , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag const & , M , M , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag const & , M , M , M , M , M , M , M , A & ) const ); + + template< typename M , typename A > + KOKKOS_INLINE_FUNCTION static + A deduce( void (Functor::*)( WTag const & , M , M , M , M , M , M , M , M , A & ) const ); + using type = decltype( deduce( & F::operator() ) ); }; diff --git a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp index cd0553218d0753bf9185fd9a91014b47ea68a80b..160ac5a851dcaebe8c0f53d5015ee613da0a3ba9 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_HostBarrier.cpp b/lib/kokkos/core/src/impl/Kokkos_HostBarrier.cpp index e382acae3291a6e0d4d38f7cb34b7842522c760d..987da1c6b38e0c799edd1526dee5ac192f4435ed 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HostBarrier.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HostBarrier.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -47,12 +47,12 @@ #include <impl/Kokkos_HostBarrier.hpp> #include <impl/Kokkos_Spinwait.hpp> +#include <chrono> + namespace Kokkos { namespace Impl { namespace { -enum : int { HEADER_SIZE = HostBarrier::HEADER / sizeof(uint64_t) }; - inline constexpr int length64( const int nthreads ) noexcept { return (nthreads-1 + sizeof(uint64_t)-1) / sizeof(uint64_t); @@ -92,11 +92,11 @@ void rendezvous_initialize( volatile void * buffer else { const int n = length64(size); - volatile uint64_t * buff = reinterpret_cast<volatile uint64_t *>(buffer) + HEADER_SIZE; + volatile uint64_t * buff = reinterpret_cast<volatile uint64_t *>(buffer) + RENDEZVOUS_HEADER/sizeof(uint64_t); // wait for other threads to finish initializing for (int i=0; i<n; ++i) { - spinwait_until_equal( buff[i], zero64 ); + root_spinwait_until_equal( buff[i], zero64 ); } // release the waiting threads @@ -146,7 +146,7 @@ bool rendezvous( volatile void * buffer } } else { // rank 0 - volatile uint64_t * buff = reinterpret_cast<volatile uint64_t *>(buffer) + HEADER_SIZE; + volatile uint64_t * buff = reinterpret_cast<volatile uint64_t *>(buffer) + RENDEZVOUS_HEADER/sizeof(uint64_t); const int n = length64(size); uint64_t comp = byte_value; @@ -168,9 +168,9 @@ bool rendezvous( volatile void * buffer const uint64_t tail = rem ? tmp.value : comp; for (int i=0; i<n-1; ++i) { - spinwait_until_equal( buff[i], comp ); + root_spinwait_until_equal( buff[i], comp ); } - spinwait_until_equal( buff[n-1], tail ); + root_spinwait_until_equal( buff[n-1], tail ); } diff --git a/lib/kokkos/core/src/impl/Kokkos_HostBarrier.hpp b/lib/kokkos/core/src/impl/Kokkos_HostBarrier.hpp index 733b69e79f8153b6f43e94586f1f8bf6abf13e1d..ad527e5aee42227b496ae79980b3dfc30d0bacf6 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HostBarrier.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_HostBarrier.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp b/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp index 4cec5ebad95a0c0bd16a431825bb6d60a8c56924..96bced0bb780bc9f861ca9117f1b37a418a7a13b 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_HostThreadTeam.cpp b/lib/kokkos/core/src/impl/Kokkos_HostThreadTeam.cpp index c2c6e45ef8f17856ae40931e28b23232bce5fbb1..8f28f396323a5be72e22d378db372fc55f3614f3 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HostThreadTeam.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HostThreadTeam.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_HostThreadTeam.hpp b/lib/kokkos/core/src/impl/Kokkos_HostThreadTeam.hpp index dc3b89c7c7c3811cae7a009a56c65da92eb70d93..78770f2d5ea383e28ec3e6274a797d353d84f834 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HostThreadTeam.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_HostThreadTeam.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -402,10 +402,13 @@ fflush(stdout); std::pair<int64_t,int64_t> get_work_partition() noexcept { + int64_t first = m_work_range.first; + int64_t second = m_work_range.second; + first *= m_work_chunk; + second *= m_work_chunk; return std::pair<int64_t,int64_t> - ( m_work_range.first * m_work_chunk - , m_work_range.second * m_work_chunk < m_work_end - ? m_work_range.second * m_work_chunk : m_work_end ); + ( first + , second < m_work_end ? second : m_work_end ); } std::pair<int64_t,int64_t> get_work_stealing_chunk() noexcept @@ -546,6 +549,7 @@ public: template< class Closure , typename T > KOKKOS_INLINE_FUNCTION void team_broadcast( Closure const & f , T & value , const int source_team_rank) const noexcept +#if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) { T volatile * const shared_value = (T*) m_data.team_reduce(); @@ -569,6 +573,9 @@ public: value = *shared_value ; } } +#else + { Kokkos::abort("HostThreadTeamMember team_broadcast\n"); } +#endif //-------------------------------------------------------------------------- // team_reduce( Sum(result) ); diff --git a/lib/kokkos/core/src/impl/Kokkos_MemoryPool.cpp b/lib/kokkos/core/src/impl/Kokkos_MemoryPool.cpp index d7fe74a6d880a106e969574916405d06760ff940..0394ccb5ad2c4dbbc28361002f0076fa91ca65f1 100644 --- a/lib/kokkos/core/src/impl/Kokkos_MemoryPool.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_MemoryPool.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp b/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp index abd9fe6724c6f186dcfbb46351c8f2c66a46196f..b74e8a7ac0d571a763db40144cbcb55e7506e39e 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp b/lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp index a408199088c5e0b7bd67e3944b72af35d96cef55..6144b5b70b0e195c001c9ebd54746ffd46b37234 100644 --- a/lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_PhysicalLayout.hpp b/lib/kokkos/core/src/impl/Kokkos_PhysicalLayout.hpp index 37503ec38d5277fd7b4c2227701ebbff182567a4..919f6769452a7378794b9c3b2050da27c52c8ed8 100644 --- a/lib/kokkos/core/src/impl/Kokkos_PhysicalLayout.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_PhysicalLayout.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -53,7 +53,7 @@ struct PhysicalLayout { enum LayoutType {Left,Right,Scalar,Error}; LayoutType layout_type; int rank; - long long int stride[8]; //distance between two neighboring elements in a given dimension + long long int stride[9]; //distance between two neighboring elements in a given dimension template< class T , class L , class D , class M > PhysicalLayout( const View<T,L,D,M> & view ) @@ -61,7 +61,7 @@ struct PhysicalLayout { is_same< typename View<T,L,D,M>::array_layout , LayoutRight >::value ? Right : Error )) , rank( view.Rank ) { - for(int i=0;i<8;i++) stride[i] = 0; + for(int i=0;i<9;i++) stride[i] = 0; view.stride( stride ); } }; diff --git a/lib/kokkos/core/src/impl/Kokkos_Profiling_DeviceInfo.hpp b/lib/kokkos/core/src/impl/Kokkos_Profiling_DeviceInfo.hpp index 20eaf99136e33baaf915a2b90ce2924e846d34ec..7f2f2bc3943369d1689f03cbdeb1dc290dbc1f24 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Profiling_DeviceInfo.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Profiling_DeviceInfo.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // - // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) + // Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.cpp b/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.cpp index a90bd507d58d1ff01827159518a394fdc98e930d..51c94781505a09e42d81fb3d0a40a00d45598b25 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.cpp @@ -35,13 +35,14 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // - // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) + // Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER */ #include <Kokkos_Macros.hpp> + #if defined(KOKKOS_ENABLE_PROFILING) #include <impl/Kokkos_Profiling_Interface.hpp> @@ -228,6 +229,8 @@ void initialize() { if(nullptr == firstProfileLibrary) { std::cerr << "Error: Unable to load KokkosP library: " << profileLibraryName << std::endl; + std::cerr << "dlopen(" << profileLibraryName << ", RTLD_NOW | RTLD_GLOBAL) failed with " + << dlerror() << '\n'; } else { #ifdef KOKKOS_ENABLE_PROFILING_LOAD_PRINT std::cout << "KokkosP: Library Loaded: " << profileLibraryName << std::endl; @@ -336,6 +339,43 @@ void finalize() { } #else -void KOKKOS_CORE_SRC_IMPL_PROFILING_INTERFACE_PREVENT_LINK_ERROR() {} -#endif +#include <impl/Kokkos_Profiling_Interface.hpp> +#include <cstring> + +namespace Kokkos { +namespace Profiling { + +bool profileLibraryLoaded() { return false; } + + +void beginParallelFor(const std::string& , const uint32_t , uint64_t* ) {} +void endParallelFor(const uint64_t ) {} +void beginParallelScan(const std::string& , const uint32_t , uint64_t* ) {} +void endParallelScan(const uint64_t ) {} +void beginParallelReduce(const std::string& , const uint32_t , uint64_t* ) {} +void endParallelReduce(const uint64_t ) {} + +void pushRegion(const std::string& ) {} +void popRegion() {} +void createProfileSection(const std::string& , uint32_t* ) {} +void startSection(const uint32_t ) {} +void stopSection(const uint32_t ) {} +void destroyProfileSection(const uint32_t ) {} + +void markEvent(const std::string& ) {} + +void allocateData(const SpaceHandle , const std::string , const void* , const uint64_t ) {} +void deallocateData(const SpaceHandle , const std::string , const void* , const uint64_t ) {} + +void beginDeepCopy(const SpaceHandle , const std::string , const void* , + const SpaceHandle , const std::string , const void* , + const uint64_t ) {} +void endDeepCopy() {} + +void initialize() {} +void finalize() {} + +}} // end namespace Kokkos::Profiling + +#endif diff --git a/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.hpp b/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.hpp index f348239e082a06555abc36c273ad78df30a7c6d9..b245db09a723ffe62a9d24d0455c64ba5d02506c 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // - // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) + // Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -45,19 +45,20 @@ #define KOKKOSP_INTERFACE_HPP #include <Kokkos_Macros.hpp> - -#if defined(KOKKOS_ENABLE_PROFILING) - +#include <cinttypes> #include <cstddef> #include <Kokkos_Core_fwd.hpp> #include <string> -#include <cinttypes> -#include <impl/Kokkos_Profiling_DeviceInfo.hpp> -#include <dlfcn.h> #include <iostream> #include <cstdlib> + +#if defined(KOKKOS_ENABLE_PROFILING) +#include <dlfcn.h> + +#include <impl/Kokkos_Profiling_DeviceInfo.hpp> + #define KOKKOSP_INTERFACE_VERSION 20171029 namespace Kokkos { @@ -128,6 +129,49 @@ void finalize(); } } +#else +namespace Kokkos { +namespace Profiling { + +struct SpaceHandle { + SpaceHandle(const char* space_name); + char name[64]; +}; + + +bool profileLibraryLoaded(); + + +void beginParallelFor(const std::string& , const uint32_t , uint64_t* ); +void endParallelFor(const uint64_t ); +void beginParallelScan(const std::string& , const uint32_t , uint64_t* ); +void endParallelScan(const uint64_t ); +void beginParallelReduce(const std::string& , const uint32_t , uint64_t* ); +void endParallelReduce(const uint64_t ); + +void pushRegion(const std::string& ); +void popRegion(); +void createProfileSection(const std::string& , uint32_t* ); +void startSection(const uint32_t ); +void stopSection(const uint32_t ); +void destroyProfileSection(const uint32_t ); + +void markEvent(const std::string& ); + +void allocateData(const SpaceHandle , const std::string , const void* , const uint64_t ); +void deallocateData(const SpaceHandle , const std::string , const void* , const uint64_t ); + +void beginDeepCopy(const SpaceHandle , const std::string , const void* , + const SpaceHandle , const std::string , const void* , + const uint64_t ); +void endDeepCopy(); + +void initialize(); +void finalize(); + +} +} + #endif #endif diff --git a/lib/kokkos/core/src/impl/Kokkos_Serial.cpp b/lib/kokkos/core/src/impl/Kokkos_Serial.cpp index f3b048d58cef3e0ab6d23942a9ee4b398f1f66f9..c3fcf778a68f443674e53d8370a2547f7201e8dd 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Serial.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Serial.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Serial_Task.cpp b/lib/kokkos/core/src/impl/Kokkos_Serial_Task.cpp index 0b6fbd9af0e169520136bea28154dbe1f5166b77..7b85909ed53feeb3edb5d2da479ca0a6c8e24682 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Serial_Task.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Serial_Task.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Serial_Task.hpp b/lib/kokkos/core/src/impl/Kokkos_Serial_Task.hpp index 39deebbbf1d513248d3ad028ad809ee32c1fa95e..2fec5dfb897bb4c4e86a3976076be44cfdf5371e 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Serial_Task.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Serial_Task.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Serial_WorkGraphPolicy.hpp b/lib/kokkos/core/src/impl/Kokkos_Serial_WorkGraphPolicy.hpp index 6f247608d917553e064ab9982f8c218d7b3de3b1..07a207b556316f34af0cd514986668c0809cfd33 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Serial_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Serial_WorkGraphPolicy.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp index 87228ea7841b963b9cc8fdedc31d7ca7edb11094..4452bb42731cf797853e0b019bb74c60f35367e6 100644 --- a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -46,26 +46,7 @@ namespace Kokkos { namespace Impl { -namespace { - -__thread int t_tracking_enabled = 1; - -} - -int SharedAllocationRecord< void , void >::tracking_enabled() -{ return t_tracking_enabled; } - -void SharedAllocationRecord< void , void >::tracking_disable() -{ - t_tracking_enabled = 0; -} - -void SharedAllocationRecord< void , void >::tracking_enable() -{ - t_tracking_enabled = 1; -} - -//---------------------------------------------------------------------------- +__thread int SharedAllocationRecord<void, void>::t_tracking_enabled = 1; bool SharedAllocationRecord< void , void >:: diff --git a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp index 73fabe0e0acfc9df8de44799a93621a29ffb0e14..27e3c35ec18a5a105898e75dda97792586629db5 100644 --- a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -107,21 +107,24 @@ protected: , size_t arg_alloc_size , function_type arg_dealloc ); +private: + + static __thread int t_tracking_enabled; public: inline std::string get_label() const { return std::string("Unmanaged"); } - static int tracking_enabled(); + static int tracking_enabled() { return t_tracking_enabled; } /**\brief A host process thread claims and disables the * shared allocation tracking flag. */ - static void tracking_disable(); + static void tracking_disable() { t_tracking_enabled = 0; } /**\brief A host process thread releases and enables the * shared allocation tracking flag. */ - static void tracking_enable(); + static void tracking_enable() { t_tracking_enabled = 1; } ~SharedAllocationRecord() = default ; @@ -280,6 +283,12 @@ public: #endif +#define KOKKOS_IMPL_SHARED_ALLOCATION_CARRY_RECORD_BITS(rhs, override_tracking) \ + (((!override_tracking) || (rhs.m_record_bits & DO_NOT_DEREF_FLAG) \ + || (!KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED)) \ + ? rhs.m_record_bits | DO_NOT_DEREF_FLAG \ + : rhs.m_record_bits) + /** \brief Assign a specialized record */ inline void assign_allocated_record_to_uninitialized( Record * arg_record ) @@ -355,11 +364,9 @@ public: KOKKOS_FORCEINLINE_FUNCTION SharedAllocationTracker & operator = ( SharedAllocationTracker && rhs ) { - // If this is tracking then must decrement - KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT - // Move and reset RHS to default constructed value. - m_record_bits = rhs.m_record_bits ; - rhs.m_record_bits = DO_NOT_DEREF_FLAG ; + auto swap_tmp = m_record_bits; + m_record_bits = rhs.m_record_bits; + rhs.m_record_bits = swap_tmp; return *this ; } @@ -367,9 +374,7 @@ public: KOKKOS_FORCEINLINE_FUNCTION SharedAllocationTracker( const SharedAllocationTracker & rhs ) - : m_record_bits( KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED - ? rhs.m_record_bits - : rhs.m_record_bits | DO_NOT_DEREF_FLAG ) + : m_record_bits( KOKKOS_IMPL_SHARED_ALLOCATION_CARRY_RECORD_BITS(rhs, true) ) { KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT } @@ -378,10 +383,7 @@ public: KOKKOS_FORCEINLINE_FUNCTION SharedAllocationTracker( const SharedAllocationTracker & rhs , const bool enable_tracking ) - : m_record_bits( KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED - && enable_tracking - ? rhs.m_record_bits - : rhs.m_record_bits | DO_NOT_DEREF_FLAG ) + : m_record_bits( KOKKOS_IMPL_SHARED_ALLOCATION_CARRY_RECORD_BITS(rhs, enable_tracking) ) { KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT } KOKKOS_FORCEINLINE_FUNCTION @@ -389,9 +391,7 @@ public: { // If this is tracking then must decrement KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT - m_record_bits = KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED - ? rhs.m_record_bits - : rhs.m_record_bits | DO_NOT_DEREF_FLAG ; + m_record_bits = KOKKOS_IMPL_SHARED_ALLOCATION_CARRY_RECORD_BITS(rhs, true); KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT return *this ; } @@ -402,10 +402,7 @@ public: , const bool enable_tracking ) { KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT - m_record_bits = KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED - && enable_tracking - ? rhs.m_record_bits - : rhs.m_record_bits | DO_NOT_DEREF_FLAG ; + m_record_bits = KOKKOS_IMPL_SHARED_ALLOCATION_CARRY_RECORD_BITS(rhs, enable_tracking); KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT } diff --git a/lib/kokkos/core/src/impl/Kokkos_Spinwait.cpp b/lib/kokkos/core/src/impl/Kokkos_Spinwait.cpp index f151071a9f5b51b1296579d2f2caa26c82ae24d6..a647e89e34bc932b093c5bcb4d238b1b9d958bce 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Spinwait.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Spinwait.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -71,45 +71,64 @@ void host_thread_yield( const uint32_t i , const WaitMode mode ) const int c = Kokkos::Impl::bit_scan_reverse(i); - if ( sleep_limit < i ) { + if ( WaitMode::ROOT != mode ) { + if ( sleep_limit < i ) { - // Attempt to put the thread to sleep for 'c' milliseconds + // Attempt to put the thread to sleep for 'c' milliseconds - #if defined( KOKKOS_ENABLE_STDTHREAD ) || defined( _WIN32 ) - auto start = std::chrono::high_resolution_clock::now(); - std::this_thread::yield(); - std::this_thread::sleep_until( start + std::chrono::nanoseconds( c * 1000 ) ); - #else - timespec req ; - req.tv_sec = 0 ; - req.tv_nsec = 1000 * c ; - nanosleep( &req, nullptr ); - #endif - } + #if defined( KOKKOS_ENABLE_STDTHREAD ) || defined( _WIN32 ) + auto start = std::chrono::high_resolution_clock::now(); + std::this_thread::yield(); + std::this_thread::sleep_until( start + std::chrono::nanoseconds( c * 1000 ) ); + #else + timespec req ; + req.tv_sec = 0 ; + req.tv_nsec = 1000 * c ; + nanosleep( &req, nullptr ); + #endif + } - else if ( mode == WaitMode::PASSIVE || yield_limit < i ) { + else if ( mode == WaitMode::PASSIVE || yield_limit < i ) { - // Attempt to yield thread resources to runtime + // Attempt to yield thread resources to runtime - #if defined( KOKKOS_ENABLE_STDTHREAD ) || defined( _WIN32 ) - std::this_thread::yield(); - #else - sched_yield(); - #endif - } + #if defined( KOKKOS_ENABLE_STDTHREAD ) || defined( _WIN32 ) + std::this_thread::yield(); + #else + sched_yield(); + #endif + } - #if defined( KOKKOS_ENABLE_ASM ) + #if defined( KOKKOS_ENABLE_ASM ) - else if ( (1u<<4) < i ) { + else if ( (1u<<4) < i ) { - // Insert a few no-ops to quiet the thread: + // Insert a few no-ops to quiet the thread: + for ( int k = 0 ; k < c ; ++k ) { + #if defined( __amd64 ) || defined( __amd64__ ) || \ + defined( __x86_64 ) || defined( __x86_64__ ) + #if !defined( _WIN32 ) /* IS NOT Microsoft Windows */ + asm volatile( "nop\n" ); + #else + __asm__ __volatile__( "nop\n" ); + #endif + #elif defined(__PPC64__) + asm volatile( "nop\n" ); + #endif + } + } + #endif /* defined( KOKKOS_ENABLE_ASM ) */ + } + #if defined( KOKKOS_ENABLE_ASM ) + else if ( (1u<<3) < i ) { + // no-ops for root thread for ( int k = 0 ; k < c ; ++k ) { #if defined( __amd64 ) || defined( __amd64__ ) || \ - defined( __x86_64 ) || defined( __x86_64__ ) - #if !defined( _WIN32 ) /* IS NOT Microsoft Windows */ + defined( __x86_64 ) || defined( __x86_64__ ) + #if !defined( _WIN32 ) /* IS NOT Microsoft Windows */ asm volatile( "nop\n" ); - #else + #else __asm__ __volatile__( "nop\n" ); #endif #elif defined(__PPC64__) diff --git a/lib/kokkos/core/src/impl/Kokkos_Spinwait.hpp b/lib/kokkos/core/src/impl/Kokkos_Spinwait.hpp index 8846f1ca51a68b720e92c52c82ab21303234cdd6..5cad7e48ccaf8c7c5a35775028745fce7d966928 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Spinwait.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Spinwait.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -55,16 +55,38 @@ namespace Kokkos { namespace Impl { -#if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) - enum class WaitMode : int { ACTIVE // Used for tight loops to keep threads active longest , PASSIVE // Used to quickly yield the thread to quite down the system + , ROOT // Never sleep or yield the root thread }; void host_thread_yield( const uint32_t i , const WaitMode mode ); +template <typename T> +typename std::enable_if< std::is_integral<T>::value, void>::type +root_spinwait_while_equal( T const volatile & flag, const T value ) +{ + Kokkos::store_fence(); + uint32_t i = 0 ; + while( value == flag ) { + host_thread_yield(++i, WaitMode::ROOT); + } + Kokkos::load_fence(); +} + +template <typename T> +typename std::enable_if< std::is_integral<T>::value, void>::type +root_spinwait_until_equal( T const volatile & flag, const T value ) +{ + Kokkos::store_fence(); + uint32_t i = 0 ; + while( value != flag ) { + host_thread_yield(++i, WaitMode::ROOT); + } + Kokkos::load_fence(); +} template <typename T> typename std::enable_if< std::is_integral<T>::value, void>::type @@ -114,30 +136,6 @@ yield_until_equal( T const volatile & flag, const T value ) Kokkos::load_fence(); } -#else - -template <typename T> -KOKKOS_INLINE_FUNCTION -typename std::enable_if< std::is_integral<T>::value, void>::type -spinwait_while_equal( T const volatile & flag, const T value ) {} - -template <typename T> -KOKKOS_INLINE_FUNCTION -typename std::enable_if< std::is_integral<T>::value, void>::type -yield_while_equal( T const volatile & flag, const T value ) {} - -template <typename T> -KOKKOS_INLINE_FUNCTION -typename std::enable_if< std::is_integral<T>::value, void>::type -spinwait_until_equal( T const volatile & flag, const T value ) {} - -template <typename T> -KOKKOS_INLINE_FUNCTION -typename std::enable_if< std::is_integral<T>::value, void>::type -yield_until_equal( T const volatile & flag, const T value ) {} - -#endif - } /* namespace Impl */ } /* namespace Kokkos */ diff --git a/lib/kokkos/core/src/impl/Kokkos_StaticAssert.hpp b/lib/kokkos/core/src/impl/Kokkos_StaticAssert.hpp index 7bbe0fea9595f8fb3dbd9eb7c1cb9c8533a2b791..d001e0a88c56c8de3e970c096d3ee0604d897b75 100644 --- a/lib/kokkos/core/src/impl/Kokkos_StaticAssert.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_StaticAssert.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Tags.hpp b/lib/kokkos/core/src/impl/Kokkos_Tags.hpp index e23c8b749c0e2344a8330ef71548aa8519d6de5a..0cd84108baae39f707d1c499d5e30421b222ca70 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Tags.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Tags.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_TaskQueue.hpp b/lib/kokkos/core/src/impl/Kokkos_TaskQueue.hpp index 5f8699302d7d040266c7c4596ccb773305e26f49..c7c8890cb9cc67f69b286fda1b795d01b81d624a 100644 --- a/lib/kokkos/core/src/impl/Kokkos_TaskQueue.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_TaskQueue.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -180,7 +180,7 @@ public: TaskBase & operator = ( TaskBase && ) = delete ; TaskBase & operator = ( const TaskBase & ) = delete ; - KOKKOS_INLINE_FUNCTION ~TaskBase() = default ; + KOKKOS_INLINE_FUNCTION_DEFAULTED ~TaskBase() = default ; KOKKOS_INLINE_FUNCTION constexpr TaskBase() @@ -518,15 +518,22 @@ public: member_type * const member = reinterpret_cast< member_type * >( exec ); result_type * const result = TaskResult< result_type >::ptr( task ); - task->apply_functor( member , result ); - // Task may be serial or team. // If team then must synchronize before querying if respawn was requested. // If team then only one thread calls destructor. + const bool only_one_thread = +#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA) + 0 == threadIdx.x && 0 == threadIdx.y ; +#else + 0 == member->team_rank(); +#endif + + task->apply_functor( member , result ); + member->team_barrier(); - if ( 0 == member->team_rank() && !(task->requested_respawn()) ) { + if ( only_one_thread && !(task->requested_respawn()) ) { // Did not respawn, destroy the functor to free memory. static_cast<functor_type*>(task)->~functor_type(); // Cannot destroy and deallocate the task until its dependences @@ -537,7 +544,7 @@ public: // Constructor for runnable task KOKKOS_INLINE_FUNCTION constexpr TaskBase( FunctorType && arg_functor ) - : root_type() , functor_type( std::move(arg_functor) ) {} + : root_type() , functor_type( arg_functor ) {} KOKKOS_INLINE_FUNCTION ~TaskBase() {} diff --git a/lib/kokkos/core/src/impl/Kokkos_TaskQueue_impl.hpp b/lib/kokkos/core/src/impl/Kokkos_TaskQueue_impl.hpp index 0cce45b2e710f337f26b2790afe014722a2386e7..5bcf672ff638ded5179528bc7473e5ab96ecd636 100644 --- a/lib/kokkos/core/src/impl/Kokkos_TaskQueue_impl.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_TaskQueue_impl.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -655,7 +655,9 @@ void TaskQueue< ExecSpace >::complete schedule_runnable( x ); } else { +#if !defined( __HCC_ACCELERATOR__ ) schedule_aggregate( x ); +#endif } x = next ; diff --git a/lib/kokkos/core/src/impl/Kokkos_Timer.hpp b/lib/kokkos/core/src/impl/Kokkos_Timer.hpp index 293e395b88489f9cb63aa4c9717d8dc45ea2a56e..9897225c3801a3f581f5423559cace0d6eb35dee 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Timer.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Timer.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Traits.hpp b/lib/kokkos/core/src/impl/Kokkos_Traits.hpp index b59548ea1d626afa2a5c2d909889a12be09ed877..475a696719a962d571899077ef49dcdef8001809 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Traits.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Traits.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Utilities.hpp b/lib/kokkos/core/src/impl/Kokkos_Utilities.hpp index 580d152dc79a1db00d17bcf2e31e97c5bb2c0907..868b31861a7b10575b8deb137969cdb2807d8648 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Utilities.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Utilities.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewArray.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewArray.hpp index ed1a71bea7ab49ef8813beba5fb7e6a88b6588fe..f23db87a98d88b0633048c8517335e2311610f2b 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ViewArray.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ViewArray.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewCtor.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewCtor.hpp index 70522d40676ff9225ee2386bc72f794adb6d01a3..f5b19f915fd81f26913884b158ca6be647520bf4 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ViewCtor.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ViewCtor.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp index 413b55298c6654191420d7004c88606aa666ddfc..39c6048958f944d6c66ce84ce86963e722d3645e 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -361,7 +361,8 @@ struct SubviewExtents { private: // Cannot declare zero-length arrays - enum { InternalRangeRank = RangeRank ? RangeRank : 1u }; + // '+' is used to silence GCC 7.2.0 -Wduplicated-branches warning when RangeRank=1 + enum { InternalRangeRank = RangeRank ? RangeRank : +1u }; size_t m_begin[ DomainRank ]; size_t m_length[ InternalRangeRank ]; @@ -2825,23 +2826,26 @@ public: , ( (Kokkos::Impl::ViewCtorProp<void,std::string> const &) arg_prop ).value , alloc_size ); - // Only set the the pointer and initialize if the allocation is non-zero. - // May be zero if one of the dimensions is zero. +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE if ( alloc_size ) { +#endif + m_handle = handle_type( reinterpret_cast< pointer_type >( record->data() ) ); +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + } +#endif - m_handle = handle_type( reinterpret_cast< pointer_type >( record->data() ) ); - - if ( alloc_prop::initialize ) { - // Assume destruction is only required when construction is requested. - // The ViewValueFunctor has both value construction and destruction operators. - record->m_destroy = functor_type( ( (Kokkos::Impl::ViewCtorProp<void,execution_space> const &) arg_prop).value - , (value_type *) m_handle - , m_offset.span() - ); - - // Construct values - record->m_destroy.construct_shared_allocation(); - } + // Only initialize if the allocation is non-zero. + // May be zero if one of the dimensions is zero. + if ( alloc_size && alloc_prop::initialize ) { + // Assume destruction is only required when construction is requested. + // The ViewValueFunctor has both value construction and destruction operators. + record->m_destroy = functor_type( ( (Kokkos::Impl::ViewCtorProp<void,execution_space> const &) arg_prop).value + , (value_type *) m_handle + , m_offset.span() + ); + + // Construct values + record->m_destroy.construct_shared_allocation(); } return record ; @@ -3191,10 +3195,8 @@ template< class MapType > struct OperatorBoundsErrorOnDevice< MapType, true > { KOKKOS_INLINE_FUNCTION static void run(MapType const& map) { - char const* const user_alloc_start = reinterpret_cast<char const*>(map.data()); - char const* const header_start = user_alloc_start - sizeof(SharedAllocationHeader); SharedAllocationHeader const* const header = - reinterpret_cast<SharedAllocationHeader const*>(header_start); + SharedAllocationHeader::get_header((void*)(map.data())); char const* const label = header->label(); enum { LEN = 128 }; char msg[LEN]; diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewTile.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewTile.hpp index 54d061a5037e1ba08838d4b651a97fa6c1d088fd..19f7127d57b27e037ea47f25b9f0f4ce1082a817 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ViewTile.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ViewTile.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp b/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp index 8a17623c3ec299165e8ed1608b7dbd75b8c3c748..f36ffc8addefbd610a71be2ce86037a35270bc61 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/src/impl/Kokkos_hwloc.cpp b/lib/kokkos/core/src/impl/Kokkos_hwloc.cpp index b8de8674d439a0c6d3be88a5ec1de1a63b85b9fe..7dc8a5356691c6609329882cfee55abaaebd9ae3 100644 --- a/lib/kokkos/core/src/impl/Kokkos_hwloc.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_hwloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/CMakeLists.txt b/lib/kokkos/core/unit_test/CMakeLists.txt index 83d617b9a6e826fbc0e9292c79d7c942e164d899..74033e27db537d2d6a3ead60cc8393af23f73093 100644 --- a/lib/kokkos/core/unit_test/CMakeLists.txt +++ b/lib/kokkos/core/unit_test/CMakeLists.txt @@ -171,6 +171,16 @@ IF(Kokkos_ENABLE_OpenMP) FAIL_REGULAR_EXPRESSION " FAILED " TESTONLYLIBS kokkos_gtest ${TEST_LINK_TARGETS} ) + TRIBITS_ADD_EXECUTABLE_AND_TEST( + UnitTest_OpenMPInterOp + SOURCES + UnitTestMain.cpp + openmp/TestOpenMP_InterOp.cpp + COMM serial mpi + NUM_MPI_PROCS 1 + FAIL_REGULAR_EXPRESSION " FAILED " + TESTONLYLIBS kokkos_gtest ${TEST_LINK_TARGETS} + ) ENDIF() IF(Kokkos_ENABLE_Qthreads) @@ -266,6 +276,16 @@ IF(Kokkos_ENABLE_Cuda) FAIL_REGULAR_EXPRESSION " FAILED " TESTONLYLIBS kokkos_gtest ${TEST_LINK_TARGETS} ) + TRIBITS_ADD_EXECUTABLE_AND_TEST( + UnitTest_CudaInterOp + SOURCES + UnitTestMain.cpp + cuda/TestCuda_InterOp.cpp + COMM serial mpi + NUM_MPI_PROCS 1 + FAIL_REGULAR_EXPRESSION " FAILED " + TESTONLYLIBS kokkos_gtest ${TEST_LINK_TARGETS} + ) ENDIF() TRIBITS_ADD_EXECUTABLE_AND_TEST( @@ -284,6 +304,35 @@ TRIBITS_ADD_EXECUTABLE_AND_TEST( TESTONLYLIBS kokkos_gtest ${TEST_LINK_TARGETS} ) +TRIBITS_ADD_EXECUTABLE_AND_TEST( + UnitTest_PushFinalizeHook + SOURCES + UnitTest_PushFinalizeHook.cpp + COMM serial mpi + NUM_MPI_PROCS 1 + FAIL_REGULAR_EXPRESSION "FAILED" + TESTONLYLIBS kokkos_gtest ${TEST_LINK_TARGETS} +) + +# This test is special, because it passes exactly when it prints the +# message "PASSED: I am the custom std::terminate handler.", AND calls +# std::terminate. This means that we can't use +# TRIBITS_ADD_EXECUTABLE_AND_TEST. See GitHub issue #2147. + +TRIBITS_ADD_EXECUTABLE( push_finalize_hook_terminate + SOURCES UnitTest_PushFinalizeHook_terminate.cpp + TESTONLYLIBS kokkos_gtest ${TEST_LINK_TARGETS} +) + +TRIBITS_ADD_ADVANCED_TEST( UnitTest_PushFinalizeHook_terminate + TEST_0 + EXEC push_finalize_hook_terminate + NUM_MPI_PROCS 1 + PASS_REGULAR_EXPRESSION + "PASSED: I am the custom std::terminate handler." + ALWAYS_FAIL_ON_ZERO_RETURN +) + foreach(INITTESTS_NUM RANGE 1 16) TRIBITS_ADD_EXECUTABLE_AND_TEST( UnitTest_DefaultInit_${INITTESTS_NUM} diff --git a/lib/kokkos/core/unit_test/Makefile b/lib/kokkos/core/unit_test/Makefile index ace6181ddf40ea268b3da952ce7353f361f213bd..42d604548e2f06de561a22f99ac6fc11ab7dcf95 100644 --- a/lib/kokkos/core/unit_test/Makefile +++ b/lib/kokkos/core/unit_test/Makefile @@ -49,16 +49,12 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) OBJ_CUDA += TestCudaHostPinned_ViewAPI.o OBJ_CUDA += TestCudaHostPinned_ViewMapping_a.o TestCudaHostPinned_ViewMapping_b.o TestCudaHostPinned_ViewMapping_subview.o OBJ_CUDA += TestCuda_ViewOfClass.o -ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1) - OBJ_CUDA += TestCuda_SubView_c_all.o -else OBJ_CUDA += TestCuda_SubView_a.o TestCuda_SubView_b.o OBJ_CUDA += TestCuda_SubView_c01.o TestCuda_SubView_c02.o TestCuda_SubView_c03.o OBJ_CUDA += TestCuda_SubView_c04.o TestCuda_SubView_c05.o TestCuda_SubView_c06.o OBJ_CUDA += TestCuda_SubView_c07.o TestCuda_SubView_c08.o TestCuda_SubView_c09.o OBJ_CUDA += TestCuda_SubView_c10.o TestCuda_SubView_c11.o TestCuda_SubView_c12.o OBJ_CUDA += TestCuda_SubView_c13.o -endif OBJ_CUDA += TestCuda_Reductions.o TestCuda_Scan.o OBJ_CUDA += TestCuda_Complex.o OBJ_CUDA += TestCuda_AtomicOperations.o TestCuda_AtomicViews.o TestCuda_Atomics.o @@ -72,7 +68,7 @@ endif OBJ_CUDA += TestCuda_UniqueToken.o TARGETS += KokkosCore_UnitTest_Cuda - + TARGETS += KokkosCore_UnitTest_CudaInterOp TEST_TARGETS += test-cuda endif @@ -80,18 +76,18 @@ ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1) OBJ_ROCM = UnitTestMainInit.o gtest-all.o OBJ_ROCM += TestROCm_Init.o OBJ_ROCM += TestROCm_Complex.o -# OBJ_ROCM += TestROCm_RangePolicy.o -# rocm.range_scan locking up + OBJ_ROCM += TestROCm_RangePolicy.o OBJ_ROCM += TestROCm_AtomicOperations.o OBJ_ROCM += TestROCm_Atomics.o # complex failing OBJ_ROCM += TestROCm_AtomicViews.o OBJ_ROCM += TestROCm_Other.o +# OBJ_ROCM += TestROCm_MDRange.o # rocm.memory_pool OBJ_ROCM += TestROCm_Scan.o OBJ_ROCM += TestROCm_SharedAlloc.o OBJ_ROCM += TestROCm_SubView_a.o -# OBJ_ROCM += TestROCm_SubView_b.o + OBJ_ROCM += TestROCm_SubView_b.o # relies on host accessable device memory # OBJ_ROCM += TestROCm_SubView_c01.o # OBJ_ROCM += TestROCm_SubView_c02.o @@ -111,9 +107,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1) # OBJ_ROCM += TestROCm_TeamReductionScan.o # compile fails # OBJ_ROCM += TestROCm_TeamScratch.o -# compile fails OBJ_ROCM += TestROCm_ViewAPI_b.o -# test fail in view_api OBJ_ROCM += TestROCm_ViewMapping_a.o OBJ_ROCM += TestROCm_ViewMapping_b.o OBJ_ROCM += TestROCm_ViewMapping_subview.o @@ -163,16 +157,12 @@ ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1) OBJ_OPENMP += TestOpenMP_ViewAPI_b.o OBJ_OPENMP += TestOpenMP_ViewMapping_a.o TestOpenMP_ViewMapping_b.o TestOpenMP_ViewMapping_subview.o OBJ_OPENMP += TestOpenMP_ViewOfClass.o -ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1) - OBJ_OPENMP += TestOpenMP_SubView_c_all.o -else OBJ_OPENMP += TestOpenMP_SubView_a.o TestOpenMP_SubView_b.o OBJ_OPENMP += TestOpenMP_SubView_c01.o TestOpenMP_SubView_c02.o TestOpenMP_SubView_c03.o OBJ_OPENMP += TestOpenMP_SubView_c04.o TestOpenMP_SubView_c05.o TestOpenMP_SubView_c06.o OBJ_OPENMP += TestOpenMP_SubView_c07.o TestOpenMP_SubView_c08.o TestOpenMP_SubView_c09.o OBJ_OPENMP += TestOpenMP_SubView_c10.o TestOpenMP_SubView_c11.o TestOpenMP_SubView_c12.o OBJ_OPENMP += TestOpenMP_SubView_c13.o -endif OBJ_OPENMP += TestOpenMP_Reductions.o TestOpenMP_Scan.o OBJ_OPENMP += TestOpenMP_Complex.o OBJ_OPENMP += TestOpenMP_AtomicOperations.o TestOpenMP_AtomicViews.o TestOpenMP_Atomics.o @@ -185,6 +175,7 @@ endif OBJ_OPENMP += TestOpenMP_UniqueToken.o TARGETS += KokkosCore_UnitTest_OpenMP + TARGETS += KokkosCore_UnitTest_OpenMPInterOp TEST_TARGETS += test-openmp endif @@ -227,14 +218,10 @@ endif ifeq ($(KOKKOS_INTERNAL_USE_QTHREADS), 1) OBJ_QTHREADS = TestQthreads_Other.o TestQthreads_Reductions.o TestQthreads_Atomics.o TestQthreads_Team.o OBJ_QTHREADS += TestQthreads_SubView_a.o TestQthreads_SubView_b.o -ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1) - OBJ_QTHREADS += TestQthreads_SubView_c_all.o -else OBJ_QTHREADS += TestQthreads_SubView_c01.o TestQthreads_SubView_c02.o TestQthreads_SubView_c03.o OBJ_QTHREADS += TestQthreads_SubView_c04.o TestQthreads_SubView_c05.o TestQthreads_SubView_c06.o OBJ_QTHREADS += TestQthreads_SubView_c07.o TestQthreads_SubView_c08.o TestQthreads_SubView_c09.o OBJ_QTHREADS += TestQthreads_SubView_c10.o TestQthreads_SubView_c11.o TestQthreads_SubView_c12.o -endif OBJ_QTHREADS += TestQthreads_ViewAPI_a.o TestQthreads_ViewAPI_b.o UnitTestMain.o gtest-all.o TARGETS += KokkosCore_UnitTest_Qthreads @@ -253,16 +240,12 @@ ifeq ($(KOKKOS_INTERNAL_USE_SERIAL), 1) OBJ_SERIAL += TestSerial_ViewAPI_b.o OBJ_SERIAL += TestSerial_ViewMapping_a.o TestSerial_ViewMapping_b.o TestSerial_ViewMapping_subview.o OBJ_SERIAL += TestSerial_ViewOfClass.o -ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1) - OBJ_SERIAL += TestSerial_SubView_c_all.o -else OBJ_SERIAL += TestSerial_SubView_a.o TestSerial_SubView_b.o OBJ_SERIAL += TestSerial_SubView_c01.o TestSerial_SubView_c02.o TestSerial_SubView_c03.o OBJ_SERIAL += TestSerial_SubView_c04.o TestSerial_SubView_c05.o TestSerial_SubView_c06.o OBJ_SERIAL += TestSerial_SubView_c07.o TestSerial_SubView_c08.o TestSerial_SubView_c09.o OBJ_SERIAL += TestSerial_SubView_c10.o TestSerial_SubView_c11.o TestSerial_SubView_c12.o OBJ_SERIAL += TestSerial_SubView_c13.o -endif OBJ_SERIAL += TestSerial_Reductions.o TestSerial_Scan.o OBJ_SERIAL += TestSerial_Complex.o OBJ_SERIAL += TestSerial_AtomicOperations.o TestSerial_AtomicViews.o TestSerial_Atomics.o @@ -295,6 +278,12 @@ endif TARGETS += KokkosCore_UnitTest_Default TEST_TARGETS += test-default +TARGETS += KokkosCore_UnitTest_PushFinalizeHook +TEST_TARGETS += test-push-finalize-hook + +TARGETS += KokkosCore_UnitTest_PushFinalizeHook_terminate +TEST_TARGETS += test-push-finalize-hook-terminate + NUM_INITTESTS = 16 INITTESTS_NUMBERS := $(shell seq 1 ${NUM_INITTESTS}) INITTESTS_TARGETS := $(addprefix KokkosCore_UnitTest_DefaultDeviceTypeInit_,${INITTESTS_NUMBERS}) @@ -304,7 +293,10 @@ TEST_TARGETS += ${INITTESTS_TEST_TARGETS} KokkosCore_UnitTest_Cuda: $(OBJ_CUDA) $(KOKKOS_LINK_DEPENDS) $(LINK) $(EXTRA_PATH) $(OBJ_CUDA) $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosCore_UnitTest_Cuda - + +KokkosCore_UnitTest_CudaInterOp: UnitTestMain.o gtest-all.o TestCuda_InterOp.o + $(LINK) $(EXTRA_PATH) UnitTestMain.o gtest-all.o TestCuda_InterOp.o $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosCore_UnitTest_CudaInterOp + KokkosCore_UnitTest_ROCm: $(OBJ_ROCM) $(KOKKOS_LINK_DEPENDS) $(LINK) $(EXTRA_PATH) $(OBJ_ROCM) $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosCore_UnitTest_ROCm @@ -314,6 +306,9 @@ KokkosCore_UnitTest_Threads: $(OBJ_THREADS) $(KOKKOS_LINK_DEPENDS) KokkosCore_UnitTest_OpenMP: $(OBJ_OPENMP) $(KOKKOS_LINK_DEPENDS) $(LINK) $(EXTRA_PATH) $(OBJ_OPENMP) $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosCore_UnitTest_OpenMP +KokkosCore_UnitTest_OpenMPInterOp: UnitTestMain.o gtest-all.o TestOpenMP_InterOp.o + $(LINK) $(EXTRA_PATH) UnitTestMain.o gtest-all.o TestOpenMP_InterOp.o $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosCore_UnitTest_OpenMPInterOp + KokkosCore_UnitTest_OpenMPTarget: $(OBJ_OPENMPTARGET) $(KOKKOS_LINK_DEPENDS) $(LINK) $(KOKKOS_LDFLAGS) $(LDFLAGS) $(EXTRA_PATH) $(OBJ_OPENMPTARGET) $(KOKKOS_LIBS) $(LIB) -o KokkosCore_UnitTest_OpenMPTarget @@ -335,11 +330,19 @@ KokkosCore_UnitTest_AllocationTracker: $(OBJ_ALLOCATIONTRACKER) $(KOKKOS_LINK_DE KokkosCore_UnitTest_Default: $(OBJ_DEFAULT) $(KOKKOS_LINK_DEPENDS) $(LINK) $(EXTRA_PATH) $(OBJ_DEFAULT) $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosCore_UnitTest_Default +KokkosCore_UnitTest_PushFinalizeHook: $(OBJ_DEFAULT) $(KOKKOS_LINK_DEPENDS) + $(LINK) $(EXTRA_PATH) $(OBJ_DEFAULT) $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosCore_UnitTest_PushFinalizeHook + +KokkosCore_UnitTest_PushFinalizeHook_terminate: $(OBJ_DEFAULT) $(KOKKOS_LINK_DEPENDS) + $(LINK) $(EXTRA_PATH) $(OBJ_DEFAULT) $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosCore_UnitTest_PushFinalizeHook_terminate + + ${INITTESTS_TARGETS}: KokkosCore_UnitTest_DefaultDeviceTypeInit_%: TestDefaultDeviceTypeInit_%.o UnitTestMain.o gtest-all.o $(KOKKOS_LINK_DEPENDS) $(LINK) $(EXTRA_PATH) TestDefaultDeviceTypeInit_$*.o UnitTestMain.o gtest-all.o $(KOKKOS_LIBS) $(LIB) $(KOKKOS_LDFLAGS) $(LDFLAGS) -o KokkosCore_UnitTest_DefaultDeviceTypeInit_$* test-cuda: KokkosCore_UnitTest_Cuda ./KokkosCore_UnitTest_Cuda + ./KokkosCore_UnitTest_CudaInterOp test-rocm: KokkosCore_UnitTest_ROCm ./KokkosCore_UnitTest_ROCm @@ -349,6 +352,7 @@ test-threads: KokkosCore_UnitTest_Threads test-openmp: KokkosCore_UnitTest_OpenMP ./KokkosCore_UnitTest_OpenMP + ./KokkosCore_UnitTest_OpenMPInterOp test-openmptarget: KokkosCore_UnitTest_OpenMPTarget ./KokkosCore_UnitTest_OpenMPTarget @@ -369,6 +373,12 @@ test-allocationtracker: KokkosCore_UnitTest_AllocationTracker test-default: KokkosCore_UnitTest_Default ./KokkosCore_UnitTest_Default +test-push-finalize-hook: KokkosCore_UnitTest_PushFinalizeHook + ./KokkosCore_UnitTest_PushFinalizeHook + +test-push-finalize-hook-terminate: KokkosCore_UnitTest_PushFinalizeHook_terminate + ./KokkosCore_UnitTest_PushFinalizeHook_terminate + ${INITTESTS_TEST_TARGETS}: test-default-init-%: KokkosCore_UnitTest_DefaultDeviceTypeInit_% ./KokkosCore_UnitTest_DefaultDeviceTypeInit_$* diff --git a/lib/kokkos/core/unit_test/TestAggregate.hpp b/lib/kokkos/core/unit_test/TestAggregate.hpp index 87440c36be645e6911ba3ff1c13ef2ca568a572f..83813b5b1b47667a0648fc0726bfd5f6edbd0634 100644 --- a/lib/kokkos/core/unit_test/TestAggregate.hpp +++ b/lib/kokkos/core/unit_test/TestAggregate.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestAtomic.hpp b/lib/kokkos/core/unit_test/TestAtomic.hpp index fffe6b46999291c1debfab0d7a4b00d1c191b781..915e1e8d979dcb3948d3346ec6770837163ea213 100644 --- a/lib/kokkos/core/unit_test/TestAtomic.hpp +++ b/lib/kokkos/core/unit_test/TestAtomic.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestAtomicOperations.hpp b/lib/kokkos/core/unit_test/TestAtomicOperations.hpp index 89b2ee7047ad733110ba09bc331935f96c8d012c..2b90ac3cd135e32ad1b6477aab16d08faeef4094 100644 --- a/lib/kokkos/core/unit_test/TestAtomicOperations.hpp +++ b/lib/kokkos/core/unit_test/TestAtomicOperations.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestAtomicViews.hpp b/lib/kokkos/core/unit_test/TestAtomicViews.hpp index 1ebb3fd43fae962ec1c73782d74bfec422fada6c..38b49730d41164811f1b9ece85ee6e573f597fa8 100644 --- a/lib/kokkos/core/unit_test/TestAtomicViews.hpp +++ b/lib/kokkos/core/unit_test/TestAtomicViews.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -119,12 +119,17 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 1 > KOKKOS_INLINE_FUNCTION void operator()( const size_type, value_type & update ) const { - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) { // Below checks that values match, but unable to check the references. // Should this be able to be checked? - if ( left( i0 ) != left( i0, 0, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } - if ( right( i0 ) != right( i0, 0, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + if ( left( i0 ) != left( i0, 0, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } + if ( right( i0 ) != right( i0, 0, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } +#else + if ( left( i0 ) != left.access( i0, 0, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } + if ( right( i0 ) != right.access( i0, 0, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } +#endif if ( left( i0 ) != left_stride( i0 ) ) { update |= 4; } if ( right( i0 ) != right_stride( i0 ) ) { update |= 8; } /* @@ -228,7 +233,7 @@ public: ASSERT_EQ( ax.use_count(), size_t( 3 ) ); aView4_unmanaged unmanaged_ax_from_ptr_dx = - aView4_unmanaged( dx.data(), dx.dimension_0(), dx.dimension_1(), dx.dimension_2(), dx.dimension_3() ); + aView4_unmanaged( dx.data(), dx.extent(0), dx.extent(1), dx.extent(2), dx.extent(3) ); ASSERT_EQ( ax.use_count(), size_t( 3 ) ); const_aView4 const_ax = ax; @@ -244,17 +249,17 @@ public: // Above test results in following runtime error from gtest: // Expected: (ax) != (ay), actual: 32-byte object <30-01 D0-A0 D8-7F 00-00 00-31 44-0C 01-00 00-00 E8-03 00-00 00-00 00-00 69-00 00-00 00-00 00-00> vs 32-byte object <80-01 D0-A0 D8-7F 00-00 00-A1 4A-0C 01-00 00-00 E8-03 00-00 00-00 00-00 69-00 00-00 00-00 00-00> - ASSERT_EQ( ax.dimension_0(), unsigned( N0 ) ); - ASSERT_EQ( ax.dimension_1(), unsigned( N1 ) ); - ASSERT_EQ( ax.dimension_2(), unsigned( N2 ) ); - ASSERT_EQ( ax.dimension_3(), unsigned( N3 ) ); + ASSERT_EQ( ax.extent(0), unsigned( N0 ) ); + ASSERT_EQ( ax.extent(1), unsigned( N1 ) ); + ASSERT_EQ( ax.extent(2), unsigned( N2 ) ); + ASSERT_EQ( ax.extent(3), unsigned( N3 ) ); - ASSERT_EQ( ay.dimension_0(), unsigned( N0 ) ); - ASSERT_EQ( ay.dimension_1(), unsigned( N1 ) ); - ASSERT_EQ( ay.dimension_2(), unsigned( N2 ) ); - ASSERT_EQ( ay.dimension_3(), unsigned( N3 ) ); + ASSERT_EQ( ay.extent(0), unsigned( N0 ) ); + ASSERT_EQ( ay.extent(1), unsigned( N1 ) ); + ASSERT_EQ( ay.extent(2), unsigned( N2 ) ); + ASSERT_EQ( ay.extent(3), unsigned( N3 ) ); - ASSERT_EQ( unmanaged_ax_from_ptr_dx.capacity(), unsigned( N0 ) * unsigned( N1 ) * unsigned( N2 ) * unsigned( N3 ) ); + ASSERT_EQ( unmanaged_ax_from_ptr_dx.span(), unsigned( N0 ) * unsigned( N1 ) * unsigned( N2 ) * unsigned( N3 ) ); } typedef T DataType[2]; diff --git a/lib/kokkos/core/unit_test/TestCXX11.hpp b/lib/kokkos/core/unit_test/TestCXX11.hpp index 7e6a0b79d7992f7b6ea5e02190e1339a76d39047..b6c34d2d4b7e6e68128c3ff81a5782614d2db28c 100644 --- a/lib/kokkos/core/unit_test/TestCXX11.hpp +++ b/lib/kokkos/core/unit_test/TestCXX11.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestCXX11Deduction.hpp b/lib/kokkos/core/unit_test/TestCXX11Deduction.hpp index 3ee1c02c5e6e77ae47074949c66d3378c30a53cd..220732918d1b1fc0fd6c0ebf19b920179e27980a 100644 --- a/lib/kokkos/core/unit_test/TestCXX11Deduction.hpp +++ b/lib/kokkos/core/unit_test/TestCXX11Deduction.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestCompilerMacros.hpp b/lib/kokkos/core/unit_test/TestCompilerMacros.hpp index f0391134ba9c772546c62434e324cb0749b952e0..e6b5c48d3d790084227a6abd66e9b3a7022d114c 100644 --- a/lib/kokkos/core/unit_test/TestCompilerMacros.hpp +++ b/lib/kokkos/core/unit_test/TestCompilerMacros.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -67,7 +67,7 @@ struct AddFunctor { type a, b; int length; - AddFunctor( type a_, type b_ ) : a( a_ ), b( b_ ), length( a.dimension_1() ) {} + AddFunctor( type a_, type b_ ) : a( a_ ), b( b_ ), length( a.extent(1) ) {} KOKKOS_INLINE_FUNCTION void operator()( int i ) const { diff --git a/lib/kokkos/core/unit_test/TestComplex.hpp b/lib/kokkos/core/unit_test/TestComplex.hpp index b5f7e2b6ec0613c81d887b06149ffd71630cb71b..240e16d467d171ec148ccbd1a8841a6a7201a724 100644 --- a/lib/kokkos/core/unit_test/TestComplex.hpp +++ b/lib/kokkos/core/unit_test/TestComplex.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestConcurrentBitset.hpp b/lib/kokkos/core/unit_test/TestConcurrentBitset.hpp index 404566cc6f78153d37303eaf978b7fa1763c44da..f479998ede4a6b0b054da947f1cfabd356b60ed6 100644 --- a/lib/kokkos/core/unit_test/TestConcurrentBitset.hpp +++ b/lib/kokkos/core/unit_test/TestConcurrentBitset.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestCrs.hpp b/lib/kokkos/core/unit_test/TestCrs.hpp index 50811fb8a95ea0d0d46ddfa3fcaa02375c67e1ce..77ea508b894c250bc3e1991e74cf72e79b83b355 100644 --- a/lib/kokkos/core/unit_test/TestCrs.hpp +++ b/lib/kokkos/core/unit_test/TestCrs.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp b/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp index 68864c8d66b622426382da2381164ee0933cc3f1..7fc879fbf4e44baa77b716a4d5ba567d2782e335 100644 --- a/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp +++ b/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestFunctorAnalysis.hpp b/lib/kokkos/core/unit_test/TestFunctorAnalysis.hpp index 5bd196d924d30568dd39affdb13efa696d861118..e1dcbbdb4d0394bf4004ad713182164fa6fd2534 100644 --- a/lib/kokkos/core/unit_test/TestFunctorAnalysis.hpp +++ b/lib/kokkos/core/unit_test/TestFunctorAnalysis.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestHWLOC.cpp b/lib/kokkos/core/unit_test/TestHWLOC.cpp index d03d9b816f9c3ac3ee85b61886baa243e5160714..40a4a441eb4be9034463a75ce1532fac7617239e 100644 --- a/lib/kokkos/core/unit_test/TestHWLOC.cpp +++ b/lib/kokkos/core/unit_test/TestHWLOC.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestInit.hpp b/lib/kokkos/core/unit_test/TestInit.hpp index 0b4246a2bfff24a5bf1c3523d959ee3e71f6f9c8..1f3aef7141f47cc2c4afc0fc4efc4ae2c6014016 100644 --- a/lib/kokkos/core/unit_test/TestInit.hpp +++ b/lib/kokkos/core/unit_test/TestInit.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestMDRange.hpp b/lib/kokkos/core/unit_test/TestMDRange.hpp index b84b13be7c9b3896f7db4ab917f86f112f52b1dd..48d8c290b5a53e72cdbe388fe5fe0e6c3ebde1ba 100644 --- a/lib/kokkos/core/unit_test/TestMDRange.hpp +++ b/lib/kokkos/core/unit_test/TestMDRange.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -51,6 +51,8 @@ namespace Test { namespace { +using namespace Kokkos; + template <typename ExecSpace > struct TestMDRange_ReduceArray_2D { @@ -110,11 +112,10 @@ struct TestMDRange_ReduceArray_2D { static void test_arrayreduce2( const int N0, const int N1 ) { - using namespace Kokkos::Experimental; { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2>, Kokkos::IndexType<int>, InitTag > range_type_init; - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int>, InitTag > range_type_init; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -198,11 +199,10 @@ struct TestMDRange_ReduceArray_3D { static void test_arrayreduce3( const int N0, const int N1, const int N2 ) { - using namespace Kokkos::Experimental; { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3>, Kokkos::IndexType<int>, InitTag > range_type_init; - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int>, InitTag > range_type_init; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -265,10 +265,27 @@ struct TestMDRange_2D { static void test_reduce2( const int N0, const int N1 ) { - using namespace Kokkos::Experimental; +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::tile_type tile_type; + typedef typename range_type::point_type point_type; + + range_type range( point_type{ { 0, 0 } }, point_type{ { N0, N1 } }, tile_type{ { 3, 3 } } ); + double sum = 0.0; + parallel_reduce( range + , KOKKOS_LAMBDA(const int i, const int j, double &lsum) { + lsum+=1.0; + } + , sum ); + ASSERT_EQ( sum, N0 * N1 ); + } +#endif +#endif { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -285,7 +302,7 @@ struct TestMDRange_2D { // Test with reducers - scalar { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; int s0 = 1; int s1 = 1; range_type range( {{ s0, s1 }}, {{ N0, N1 }}, {{ 3, 3 }} ); @@ -303,7 +320,7 @@ struct TestMDRange_2D { } // Test with reducers - scalar view { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; range_type range( {{ 0, 0 }}, {{ N0, N1 }}, {{ 3, 3 }} ); TestMDRange_2D functor( N0, N1 ); @@ -323,7 +340,7 @@ struct TestMDRange_2D { // Tagged operator test { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -358,7 +375,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -374,7 +391,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -390,7 +407,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -406,7 +423,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -422,7 +439,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -440,10 +457,50 @@ struct TestMDRange_2D { static void test_for2( const int N0, const int N1 ) { - using namespace Kokkos::Experimental; + +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::tile_type tile_type; + typedef typename range_type::point_type point_type; + + const int s0 = 1; + const int s1 = 1; + + range_type range( point_type{ { s0, s1 } }, point_type{ { N0, N1 } }, tile_type{ { 3, 3 } } ); + + TestMDRange_2D::ViewType v( "v", N0, N1 ); + + parallel_for( range, + KOKKOS_LAMBDA ( const int i , const int j ) { + v(i, j) = 3; + } + ); + + TestMDRange_2D::HostViewType h_view = Kokkos::create_mirror_view( v ); + Kokkos::deep_copy( h_view, v ); + + int counter = 0; + for ( int i = s0; i < N0; ++i ) + for ( int j = s1; j < N1; ++j ) + { + if ( h_view( i, j ) != 3 ) { + ++counter; + } + } + + if ( counter != 0 ) { + printf( "Offset Start + Default Layouts + InitTag op(): Errors in test_for2; mismatches = %d\n\n", counter ); + } + + ASSERT_EQ( counter, 0 ); + } +#endif +#endif { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2>, Kokkos::IndexType<int>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -474,7 +531,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -503,7 +560,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, InitTag > range_type; typedef typename range_type::point_type point_type; range_type range( point_type{ { 0, 0 } }, point_type{ { N0, N1 } } ); @@ -531,7 +588,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -560,7 +617,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -589,7 +646,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -618,7 +675,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -647,7 +704,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -676,7 +733,7 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -747,10 +804,27 @@ struct TestMDRange_3D { static void test_reduce3( const int N0, const int N1, const int N2 ) { - using namespace Kokkos::Experimental; +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::tile_type tile_type; + typedef typename range_type::point_type point_type; + + range_type range( point_type{ { 0, 0, 0 } }, point_type{ { N0, N1, N2 } }, tile_type{ { 3, 3, 3 } } ); + double sum = 0.0; + parallel_reduce( range + , KOKKOS_LAMBDA(const int i, const int j, const int k, double &lsum) { + lsum+=1.0; + } + , sum ); + ASSERT_EQ( sum, N0 * N1 * N2 ); + } +#endif +#endif { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -770,7 +844,7 @@ struct TestMDRange_3D { // Test with reducers - scalar { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; range_type range( {{ 0, 0, 0 }}, {{ N0, N1, N2 }}, {{ 3, 3, 3 }} ); TestMDRange_3D functor( N0, N1, N2 ); @@ -786,7 +860,7 @@ struct TestMDRange_3D { } // Test with reducers - scalar view { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; range_type range( {{ 0, 0, 0 }}, {{ N0, N1, N2 }}, {{ 3, 3, 3 }} ); TestMDRange_3D functor( N0, N1, N2 ); @@ -806,7 +880,7 @@ struct TestMDRange_3D { // Tagged operator test { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -842,7 +916,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -858,7 +932,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -874,7 +948,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -890,7 +964,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -906,7 +980,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -924,10 +998,51 @@ struct TestMDRange_3D { static void test_for3( const int N0, const int N1, const int N2 ) { - using namespace Kokkos::Experimental; +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::tile_type tile_type; + typedef typename range_type::point_type point_type; + + const int s0 = 1; + const int s1 = 1; + const int s2 = 1; + + range_type range( point_type{ { s0, s1, s2 } }, point_type{ { N0, N1, N2 } }, tile_type{ { 3, 3, 3 } } ); + + TestMDRange_3D::ViewType v( "v", N0, N1, N2 ); + + parallel_for( range, + KOKKOS_LAMBDA ( const int i , const int j , const int k ) { + v(i, j, k) = 3; + } + ); + + TestMDRange_3D::HostViewType h_view = Kokkos::create_mirror_view( v ); + Kokkos::deep_copy( h_view, v ); + + int counter = 0; + for ( int i = s0; i < N0; ++i ) + for ( int j = s1; j < N1; ++j ) + for ( int k = s2; k < N2; ++k ) + { + if ( h_view( i, j, k ) != 3 ) { + ++counter; + } + } + + if ( counter != 0 ) { + printf( "Offset Start + Default Layouts + InitTag op(): Errors in test_for3; mismatches = %d\n\n", counter ); + } + + ASSERT_EQ( counter, 0 ); + } +#endif +#endif { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3> > range_type; typedef typename range_type::point_type point_type; range_type range( point_type{ { 0, 0, 0 } }, point_type{ { N0, N1, N2 } } ); @@ -956,7 +1071,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3>, Kokkos::IndexType<int>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -989,7 +1104,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1020,7 +1135,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1050,7 +1165,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1080,7 +1195,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1110,7 +1225,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1140,7 +1255,7 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1211,10 +1326,27 @@ struct TestMDRange_4D { static void test_reduce4( const int N0, const int N1, const int N2, const int N3 ) { - using namespace Kokkos::Experimental; +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::tile_type tile_type; + typedef typename range_type::point_type point_type; + + range_type range( point_type{ { 0, 0, 0, 0 } }, point_type{ { N0, N1, N2, N3 } }, tile_type{ { 3, 3, 3, 3 } } ); + double sum = 0.0; + parallel_reduce( range + , KOKKOS_LAMBDA(const int i, const int j, const int k, const int l, double &lsum) { + lsum+=1.0; + } + , sum ); + ASSERT_EQ( sum, N0 * N1 * N2 * N3 ); + } +#endif +#endif { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1235,7 +1367,7 @@ struct TestMDRange_4D { // Test with reducers - scalar { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int> > range_type; range_type range( {{ 0, 0, 0, 0 }}, {{ N0, N1, N2, N3 }}, {{ 3, 3, 3, 3 }} ); TestMDRange_4D functor( N0, N1, N2, N3 ); @@ -1252,7 +1384,7 @@ struct TestMDRange_4D { // Test with reducers - scalar view { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int> > range_type; range_type range( {{ 0, 0, 0, 0 }}, {{ N0, N1, N2, N3 }}, {{ 3, 3, 3, 3 }} ); TestMDRange_4D functor( N0, N1, N2, N3 ); @@ -1272,7 +1404,7 @@ struct TestMDRange_4D { // Tagged operator test { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1309,7 +1441,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1325,7 +1457,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1341,7 +1473,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1357,7 +1489,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1373,7 +1505,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1393,10 +1525,53 @@ struct TestMDRange_4D { static void test_for4( const int N0, const int N1, const int N2, const int N3 ) { - using namespace Kokkos::Experimental; +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::tile_type tile_type; + typedef typename range_type::point_type point_type; + + const int s0 = 1; + const int s1 = 1; + const int s2 = 1; + const int s3 = 1; + + range_type range( point_type{ { s0, s1, s2, s3 } }, point_type{ { N0, N1, N2, N3 } }, tile_type{ { 3, 3, 3, 3 } } ); + + TestMDRange_4D::ViewType v( "v", N0, N1, N2, N3 ); + + parallel_for( range, + KOKKOS_LAMBDA ( const int i , const int j , const int k, const int l ) { + v(i, j, k, l) = 3; + } + ); + + TestMDRange_4D::HostViewType h_view = Kokkos::create_mirror_view( v ); + Kokkos::deep_copy( h_view, v ); + + int counter = 0; + for ( int i = s0; i < N0; ++i ) + for ( int j = s1; j < N1; ++j ) + for ( int k = s2; k < N2; ++k ) + for ( int l = s3; l < N3; ++l ) + { + if ( h_view( i, j, k, l ) != 3 ) { + ++counter; + } + } + + if ( counter != 0 ) { + printf( "Offset Start + Default Layouts + InitTag op(): Errors in test_for4; mismatches = %d\n\n", counter ); + } + + ASSERT_EQ( counter, 0 ); + } +#endif +#endif { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4> > range_type; typedef typename range_type::point_type point_type; range_type range( point_type{ { 0, 0, 0, 0 } }, point_type{ { N0, N1, N2, N3 } } ); @@ -1426,7 +1601,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4>, Kokkos::IndexType<int>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1461,7 +1636,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1493,7 +1668,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1525,7 +1700,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1557,7 +1732,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1589,7 +1764,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1621,7 +1796,7 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1694,10 +1869,27 @@ struct TestMDRange_5D { static void test_reduce5( const int N0, const int N1, const int N2, const int N3, const int N4 ) { - using namespace Kokkos::Experimental; +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::tile_type tile_type; + typedef typename range_type::point_type point_type; + + range_type range( point_type{ { 0, 0, 0, 0, 0 } }, point_type{ { N0, N1, N2, N3, N4 } }, tile_type{ { 3, 3, 3, 3, 1 } } ); + double sum = 0.0; + parallel_reduce( range + , KOKKOS_LAMBDA(const int i, const int j, const int k, const int l, const int m, double &lsum) { + lsum+=1.0; + } + , sum ); + ASSERT_EQ( sum, N0 * N1 * N2 * N3 * N4 ); + } +#endif +#endif { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1719,7 +1911,7 @@ struct TestMDRange_5D { // Test with reducers - scalar { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int> > range_type; range_type range( {{ 0, 0, 0, 0, 0 }}, {{ N0, N1, N2, N3, N4 }}, {{ 3, 3, 3, 3, 3 }} ); TestMDRange_5D functor( N0, N1, N2, N3, N4 ); @@ -1736,7 +1928,7 @@ struct TestMDRange_5D { // Test with reducers - scalar view { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int> > range_type; range_type range( {{ 0, 0, 0, 0, 0 }}, {{ N0, N1, N2, N3, N4 }}, {{ 3, 3, 3, 3, 3 }} ); TestMDRange_5D functor( N0, N1, N2, N3, N4 ); @@ -1756,7 +1948,7 @@ struct TestMDRange_5D { // Tagged operator test { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1796,10 +1988,55 @@ struct TestMDRange_5D { static void test_for5( const int N0, const int N1, const int N2, const int N3, const int N4 ) { - using namespace Kokkos::Experimental; +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::tile_type tile_type; + typedef typename range_type::point_type point_type; + + const int s0 = 1; + const int s1 = 1; + const int s2 = 1; + const int s3 = 1; + const int s4 = 1; + + range_type range( point_type{ { s0, s1, s2, s3, s4 } }, point_type{ { N0, N1, N2, N3, N4 } }, tile_type{ { 3, 3, 3, 3, 1 } } ); + + TestMDRange_5D::ViewType v( "v", N0, N1, N2, N3, N4 ); + + parallel_for( range, + KOKKOS_LAMBDA ( const int i , const int j , const int k, const int l, const int m ) { + v(i, j, k, l, m) = 3; + } + ); + + TestMDRange_5D::HostViewType h_view = Kokkos::create_mirror_view( v ); + Kokkos::deep_copy( h_view, v ); + + int counter = 0; + for ( int i = s0; i < N0; ++i ) + for ( int j = s1; j < N1; ++j ) + for ( int k = s2; k < N2; ++k ) + for ( int l = s3; l < N3; ++l ) + for ( int m = s4; m < N4; ++m ) + { + if ( h_view( i, j, k, l, m ) != 3 ) { + ++counter; + } + } + + if ( counter != 0 ) { + printf( "Offset Start + Default Layouts + InitTag op(): Errors in test_for5; mismatches = %d\n\n", counter ); + } + + ASSERT_EQ( counter, 0 ); + } +#endif +#endif { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5> > range_type; typedef typename range_type::point_type point_type; range_type range( point_type{ { 0, 0, 0, 0, 0 } }, point_type{ { N0, N1, N2, N3, N4 } } ); @@ -1830,7 +2067,7 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5>, Kokkos::IndexType<int>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1867,7 +2104,7 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1900,7 +2137,7 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1933,7 +2170,7 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1966,7 +2203,7 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -1999,7 +2236,7 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2032,7 +2269,7 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2106,10 +2343,27 @@ struct TestMDRange_6D { static void test_reduce6( const int N0, const int N1, const int N2, const int N3, const int N4, const int N5 ) { - using namespace Kokkos::Experimental; +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::tile_type tile_type; + typedef typename range_type::point_type point_type; + + range_type range( point_type{ { 0, 0, 0, 0, 0, 0 } }, point_type{ { N0, N1, N2, N3, N4, N5 } }, tile_type{ { 3, 3, 3, 3, 1, 1 } } ); + double sum = 0.0; + parallel_reduce( range + , KOKKOS_LAMBDA(const int i, const int j, const int k, const int l, const int m, const int n, double &lsum) { + lsum+=1.0; + } + , sum ); + ASSERT_EQ( sum, N0 * N1 * N2 * N3 * N4 * N5 ); + } +#endif +#endif { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2132,7 +2386,7 @@ struct TestMDRange_6D { // Test with reducers - scalar { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int> > range_type; range_type range( {{ 0, 0, 0, 0, 0, 0 }}, {{ N0, N1, N2, N3, N4, N5 }}, {{ 3, 3, 3, 3, 3, 2 }} ); TestMDRange_6D functor( N0, N1, N2, N3, N4, N5 ); @@ -2149,7 +2403,7 @@ struct TestMDRange_6D { // Test with reducers - scalar view { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int> > range_type; range_type range( {{ 0, 0, 0, 0, 0, 0 }}, {{ N0, N1, N2, N3, N4, N5 }}, {{ 3, 3, 3, 3, 3, 2 }} ); TestMDRange_6D functor( N0, N1, N2, N3, N4, N5 ); @@ -2169,7 +2423,7 @@ struct TestMDRange_6D { // Tagged operator test { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Default, Iterate::Default >, Kokkos::IndexType<int>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2210,10 +2464,57 @@ struct TestMDRange_6D { static void test_for6( const int N0, const int N1, const int N2, const int N3, const int N4, const int N5 ) { - using namespace Kokkos::Experimental; +#if defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) +#if !defined(KOKKOS_ENABLE_CUDA) || ( 8000 <= CUDA_VERSION ) + { + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int> > range_type; + typedef typename range_type::tile_type tile_type; + typedef typename range_type::point_type point_type; + + const int s0 = 1; + const int s1 = 1; + const int s2 = 1; + const int s3 = 1; + const int s4 = 1; + const int s5 = 1; + + range_type range( point_type{ { s0, s1, s2, s3, s4, s5 } }, point_type{ { N0, N1, N2, N3, N4, N5 } }, tile_type{ { 3, 3, 3, 3, 1, 1 } } ); + + TestMDRange_6D::ViewType v( "v", N0, N1, N2, N3, N4, N5 ); + + parallel_for( range, + KOKKOS_LAMBDA ( const int i , const int j , const int k, const int l, const int m, const int n ) { + v(i, j, k, l, m, n) = 3; + } + ); + + TestMDRange_6D::HostViewType h_view = Kokkos::create_mirror_view( v ); + Kokkos::deep_copy( h_view, v ); + + int counter = 0; + for ( int i = s0; i < N0; ++i ) + for ( int j = s1; j < N1; ++j ) + for ( int k = s2; k < N2; ++k ) + for ( int l = s3; l < N3; ++l ) + for ( int m = s4; m < N4; ++m ) + for ( int n = s5; n < N5; ++n ) + { + if ( h_view( i, j, k, l, m, n ) != 3 ) { + ++counter; + } + } + + if ( counter != 0 ) { + printf( "Offset Start + Default Layouts + InitTag op(): Errors in test_for6; mismatches = %d\n\n", counter ); + } + + ASSERT_EQ( counter, 0 ); + } +#endif +#endif { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6> > range_type; typedef typename range_type::point_type point_type; range_type range( point_type{ { 0, 0, 0, 0, 0, 0 } }, point_type{ { N0, N1, N2, N3, N4, N5 } } ); @@ -2245,7 +2546,7 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6>, Kokkos::IndexType<int>, InitTag > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int>, InitTag > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2284,7 +2585,7 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2318,7 +2619,7 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Default, Iterate::Default>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2352,7 +2653,7 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Left, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2386,7 +2687,7 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Left, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2420,7 +2721,7 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Right, Iterate::Left>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2454,7 +2755,7 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Right, Iterate::Right>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2523,10 +2824,9 @@ struct TestMDRange_2D_NegIdx { static void test_2D_negidx( const int N0, const int N1 ) { - using namespace Kokkos::Experimental; { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<2>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2581,10 +2881,9 @@ struct TestMDRange_3D_NegIdx { static void test_3D_negidx( const int N0, const int N1, const int N2 ) { - using namespace Kokkos::Experimental; { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<3>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2640,10 +2939,9 @@ struct TestMDRange_4D_NegIdx { static void test_4D_negidx( const int N0, const int N1, const int N2, const int N3 ) { - using namespace Kokkos::Experimental; { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<4>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2700,10 +2998,9 @@ struct TestMDRange_5D_NegIdx { static void test_5D_negidx( const int N0, const int N1, const int N2, const int N3, const int N4 ) { - using namespace Kokkos::Experimental; { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<5>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; @@ -2761,10 +3058,9 @@ struct TestMDRange_6D_NegIdx { static void test_6D_negidx( const int N0, const int N1, const int N2, const int N3, const int N4, const int N5 ) { - using namespace Kokkos::Experimental; { - typedef typename Kokkos::Experimental::MDRangePolicy< ExecSpace, Rank<6>, Kokkos::IndexType<int> > range_type; + typedef typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6>, Kokkos::IndexType<int> > range_type; typedef typename range_type::tile_type tile_type; typedef typename range_type::point_type point_type; diff --git a/lib/kokkos/core/unit_test/TestMemoryPool.hpp b/lib/kokkos/core/unit_test/TestMemoryPool.hpp index 8034ae4ca0ffcca5d8d6e79bae9df379702cd102..9fb1d900f7580a384ab16754a1b13316ef94cf4f 100644 --- a/lib/kokkos/core/unit_test/TestMemoryPool.hpp +++ b/lib/kokkos/core/unit_test/TestMemoryPool.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestPolicyConstruction.hpp b/lib/kokkos/core/unit_test/TestPolicyConstruction.hpp index 9d5fc6464154dfd948dee9181202556585164bd2..8329cbd395d15c99dc55a92635c50169b0ad6eba 100644 --- a/lib/kokkos/core/unit_test/TestPolicyConstruction.hpp +++ b/lib/kokkos/core/unit_test/TestPolicyConstruction.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -56,6 +56,7 @@ class TestRangePolicyConstruction { public: TestRangePolicyConstruction() { test_compile_time_parameters(); + test_runtime_parameters(); } private: @@ -247,6 +248,34 @@ private: ASSERT_TRUE( ( std::is_same< work_tag, SomeTag >::value ) ); } } + void test_runtime_parameters() { + { + typedef Kokkos::RangePolicy<> policy_t; + policy_t p(5,15); + ASSERT_TRUE( (p.begin() == 5) ); + ASSERT_TRUE( (p.end() == 15) ); + } + { + typedef Kokkos::RangePolicy<> policy_t; + policy_t p(Kokkos::DefaultExecutionSpace(),5,15); + ASSERT_TRUE( (p.begin() == 5) ); + ASSERT_TRUE( (p.end() == 15) ); + } + { + typedef Kokkos::RangePolicy<> policy_t; + policy_t p(5,15,Kokkos::ChunkSize(10)); + ASSERT_TRUE( (p.begin() == 5) ); + ASSERT_TRUE( (p.end() == 15) ); + ASSERT_TRUE( (p.chunk_size() == 10) ); + } + { + typedef Kokkos::RangePolicy<> policy_t; + policy_t p(Kokkos::DefaultExecutionSpace(),5,15,Kokkos::ChunkSize(10)); + ASSERT_TRUE( (p.begin() == 5) ); + ASSERT_TRUE( (p.end() == 15) ); + ASSERT_TRUE( (p.chunk_size() == 10) ); + } + } }; template< class ExecutionSpace > @@ -451,6 +480,7 @@ private: int per_team_scratch = 1024; int per_thread_scratch = 16; int scratch_size = per_team_scratch + per_thread_scratch * team_size; + int vector_length = 4; policy_t p1( league_size, team_size ); ASSERT_EQ ( p1.league_size(), league_size ); @@ -518,6 +548,133 @@ private: ASSERT_EQ ( p7.team_size(), team_size ); ASSERT_EQ ( p7.chunk_size(), chunk_size ); ASSERT_EQ ( p7.scratch_size( 0 ), scratch_size ); + + policy_t p8(league_size, team_size, Kokkos::ChunkSize(chunk_size) ); + ASSERT_EQ ( p8.league_size(), league_size ); + ASSERT_EQ ( p8.team_size(), team_size ); + ASSERT_EQ ( p8.chunk_size(), chunk_size ); + ASSERT_EQ ( p8.scratch_size( 0 ), 0 ); + + policy_t p10( league_size, team_size, Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ) ) ); + ASSERT_EQ ( p10.league_size(), league_size ); + ASSERT_EQ ( p10.team_size(), team_size ); + ASSERT_TRUE( p10.chunk_size() > 0 ); + ASSERT_EQ ( p10.scratch_size( 0 ), per_team_scratch ); + + policy_t p11( league_size, team_size, Kokkos::ScratchRequest( 0, Kokkos::PerThread( per_thread_scratch ) ) ); + ASSERT_EQ ( p11.league_size(), league_size ); + ASSERT_EQ ( p11.team_size(), team_size ); + ASSERT_TRUE( p11.chunk_size() > 0 ); + ASSERT_EQ ( p11.scratch_size( 0 ), per_thread_scratch * team_size ); + + policy_t p12( league_size, team_size, Kokkos::ScratchRequest( 0, Kokkos::PerThread( per_thread_scratch ), Kokkos::PerTeam( per_team_scratch ) ) ); + ASSERT_EQ ( p12.league_size(), league_size ); + ASSERT_EQ ( p12.team_size(), team_size ); + ASSERT_TRUE( p12.chunk_size() > 0 ); + ASSERT_EQ ( p12.scratch_size( 0 ), scratch_size ); + + policy_t p13( league_size, team_size, Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ), Kokkos::PerThread( per_thread_scratch ) ) ); + ASSERT_EQ ( p13.league_size(), league_size ); + ASSERT_EQ ( p13.team_size(), team_size ); + ASSERT_TRUE( p13.chunk_size() > 0 ); + ASSERT_EQ ( p13.scratch_size( 0 ), scratch_size ); + + policy_t p14( league_size, team_size, Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ), Kokkos::PerThread( per_thread_scratch ) ) ); + ASSERT_EQ ( p14.league_size(), league_size ); + ASSERT_EQ ( p14.team_size(), team_size ); + ASSERT_TRUE( p14.chunk_size() > 0 ); + ASSERT_EQ ( p14.scratch_size( 0 ), scratch_size ); + + policy_t p15( league_size, team_size, Kokkos::ChunkSize(chunk_size), Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ) ) ); + ASSERT_EQ ( p15.league_size(), league_size ); + ASSERT_EQ ( p15.team_size(), team_size ); + ASSERT_TRUE( p15.chunk_size() > 0 ); + ASSERT_EQ ( p15.scratch_size( 0 ), per_team_scratch ); + + policy_t p16( league_size, team_size, Kokkos::ScratchRequest( 0, Kokkos::PerThread( per_thread_scratch ) ), Kokkos::ChunkSize(chunk_size) ); + ASSERT_EQ ( p16.league_size(), league_size ); + ASSERT_EQ ( p16.team_size(), team_size ); + ASSERT_EQ ( p16.chunk_size(), chunk_size ); + ASSERT_EQ ( p16.scratch_size( 0 ), per_thread_scratch * team_size ); + + policy_t p17( league_size, team_size, Kokkos::ChunkSize(chunk_size), Kokkos::ScratchRequest( 0, Kokkos::PerThread( per_thread_scratch ), Kokkos::PerTeam( per_team_scratch ) ) ); + ASSERT_EQ ( p17.league_size(), league_size ); + ASSERT_EQ ( p17.team_size(), team_size ); + ASSERT_EQ ( p17.chunk_size(), chunk_size ); + ASSERT_EQ ( p17.scratch_size( 0 ), scratch_size ); + + policy_t p18( league_size, team_size, Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ), Kokkos::PerThread( per_thread_scratch ) ), Kokkos::ChunkSize(chunk_size) ); + ASSERT_EQ ( p18.league_size(), league_size ); + ASSERT_EQ ( p18.team_size(), team_size ); + ASSERT_EQ ( p18.chunk_size(), chunk_size ); + ASSERT_EQ ( p18.scratch_size( 0 ), scratch_size ); + + policy_t p19( league_size, team_size, Kokkos::ChunkSize(chunk_size), Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ), Kokkos::PerThread( per_thread_scratch ) ) ); + ASSERT_EQ ( p19.league_size(), league_size ); + ASSERT_EQ ( p19.team_size(), team_size ); + ASSERT_EQ ( p19.chunk_size(), chunk_size ); + ASSERT_EQ ( p19.scratch_size( 0 ), scratch_size ); + + policy_t p20( league_size, team_size, vector_length, Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ) ) ); + ASSERT_EQ ( p20.league_size(), league_size ); + ASSERT_EQ ( p20.team_size(), team_size ); + ASSERT_TRUE( p20.chunk_size() > 0 ); + ASSERT_EQ ( p20.scratch_size( 0 ), per_team_scratch ); + + policy_t p21( league_size, team_size, vector_length, Kokkos::ScratchRequest( 0, Kokkos::PerThread( per_thread_scratch ) ) ); + ASSERT_EQ ( p21.league_size(), league_size ); + ASSERT_EQ ( p21.team_size(), team_size ); + ASSERT_TRUE( p21.chunk_size() > 0 ); + ASSERT_EQ ( p21.scratch_size( 0 ), per_thread_scratch * team_size ); + + policy_t p22( league_size, team_size, vector_length, Kokkos::ScratchRequest( 0, Kokkos::PerThread( per_thread_scratch ), Kokkos::PerTeam( per_team_scratch ) ) ); + ASSERT_EQ ( p22.league_size(), league_size ); + ASSERT_EQ ( p22.team_size(), team_size ); + ASSERT_TRUE( p22.chunk_size() > 0 ); + ASSERT_EQ ( p22.scratch_size( 0 ), scratch_size ); + + policy_t p23( league_size, team_size, (size_t) vector_length, Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ), Kokkos::PerThread( per_thread_scratch ) ) ); + ASSERT_EQ ( p23.league_size(), league_size ); + ASSERT_EQ ( p23.team_size(), team_size ); + ASSERT_TRUE( p23.chunk_size() > 0 ); + ASSERT_EQ ( p23.scratch_size( 0 ), scratch_size ); + + policy_t p24( league_size, team_size, (size_t) vector_length, Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ), Kokkos::PerThread( per_thread_scratch ) ) ); + ASSERT_EQ ( p24.league_size(), league_size ); + ASSERT_EQ ( p24.team_size(), team_size ); + ASSERT_TRUE( p24.chunk_size() > 0 ); + ASSERT_EQ ( p24.scratch_size( 0 ), scratch_size ); + + policy_t p25( league_size, team_size, vector_length, Kokkos::ChunkSize(chunk_size), Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ) ) ); + ASSERT_EQ ( p25.league_size(), league_size ); + ASSERT_EQ ( p25.team_size(), team_size ); + ASSERT_TRUE( p25.chunk_size() > 0 ); + ASSERT_EQ ( p25.scratch_size( 0 ), per_team_scratch ); + + policy_t p26( league_size, team_size, vector_length, Kokkos::ScratchRequest( 0, Kokkos::PerThread( per_thread_scratch ) ), Kokkos::ChunkSize(chunk_size) ); + ASSERT_EQ ( p26.league_size(), league_size ); + ASSERT_EQ ( p26.team_size(), team_size ); + ASSERT_EQ ( p26.chunk_size(), chunk_size ); + ASSERT_EQ ( p26.scratch_size( 0 ), per_thread_scratch * team_size ); + + policy_t p27( league_size, team_size, vector_length, Kokkos::ChunkSize(chunk_size), Kokkos::ScratchRequest( 0, Kokkos::PerThread( per_thread_scratch ), Kokkos::PerTeam( per_team_scratch ) ) ); + ASSERT_EQ ( p27.league_size(), league_size ); + ASSERT_EQ ( p27.team_size(), team_size ); + ASSERT_EQ ( p27.chunk_size(), chunk_size ); + ASSERT_EQ ( p27.scratch_size( 0 ), scratch_size ); + + policy_t p28( league_size, team_size, (size_t) vector_length, Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ), Kokkos::PerThread( per_thread_scratch ) ), Kokkos::ChunkSize(chunk_size) ); + ASSERT_EQ ( p28.league_size(), league_size ); + ASSERT_EQ ( p28.team_size(), team_size ); + ASSERT_EQ ( p28.chunk_size(), chunk_size ); + ASSERT_EQ ( p28.scratch_size( 0 ), scratch_size ); + + policy_t p29( league_size, team_size, (size_t) vector_length, Kokkos::ChunkSize(chunk_size), Kokkos::ScratchRequest( 0, Kokkos::PerTeam( per_team_scratch ), Kokkos::PerThread( per_thread_scratch ) ) ); + ASSERT_EQ ( p29.league_size(), league_size ); + ASSERT_EQ ( p29.team_size(), team_size ); + ASSERT_EQ ( p29.chunk_size(), chunk_size ); + ASSERT_EQ ( p29.scratch_size( 0 ), scratch_size ); + } void test_run_time_parameters() { diff --git a/lib/kokkos/core/unit_test/TestRange.hpp b/lib/kokkos/core/unit_test/TestRange.hpp index e6857a4d2f6937be1489ba3b54ed32524e520779..85c270887dbc0be38e0d2ebb114ce4f7cf28f230 100644 --- a/lib/kokkos/core/unit_test/TestRange.hpp +++ b/lib/kokkos/core/unit_test/TestRange.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestReduce.hpp b/lib/kokkos/core/unit_test/TestReduce.hpp index 56d6259b5aaf53d381b92c4d4eaf66408e6c24bd..cf8c4d5d0d128dbd2cd01a7f76465be619a9c760 100644 --- a/lib/kokkos/core/unit_test/TestReduce.hpp +++ b/lib/kokkos/core/unit_test/TestReduce.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -453,10 +453,10 @@ public: std::string str( "TestKernelReduce" ); if ( count % 2 == 0 ) { - Kokkos::parallel_reduce( nw, functor_type( nw, count ), host_result.ptr_on_device() ); + Kokkos::parallel_reduce( nw, functor_type( nw, count ), host_result.data() ); } else { - Kokkos::parallel_reduce( str, nw, functor_type( nw, count ), host_result.ptr_on_device() ); + Kokkos::parallel_reduce( str, nw, functor_type( nw, count ), host_result.data() ); } for ( unsigned j = 0; j < count; ++j ) { diff --git a/lib/kokkos/core/unit_test/TestReduceCombinatorical.hpp b/lib/kokkos/core/unit_test/TestReduceCombinatorical.hpp index 2651df92318e97e2e9eb2eee7816d848c0d517e8..3b5fe712cc69ac1f30f4b13b7bb03faeed8841e1 100644 --- a/lib/kokkos/core/unit_test/TestReduceCombinatorical.hpp +++ b/lib/kokkos/core/unit_test/TestReduceCombinatorical.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestResize.hpp b/lib/kokkos/core/unit_test/TestResize.hpp index aaf0422b19ce0e3b90d688b249de386befaaa565..d62bc68b31d77583b16f4cf0dfce6394f5f099b8 100644 --- a/lib/kokkos/core/unit_test/TestResize.hpp +++ b/lib/kokkos/core/unit_test/TestResize.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestScan.hpp b/lib/kokkos/core/unit_test/TestScan.hpp index 823f0c99a81c3bd80b6b9c0d49983c13d30663b2..7a0948e7ace118114661a029e2826f3c45cecebe 100644 --- a/lib/kokkos/core/unit_test/TestScan.hpp +++ b/lib/kokkos/core/unit_test/TestScan.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestSharedAlloc.hpp b/lib/kokkos/core/unit_test/TestSharedAlloc.hpp index 6eca6bb38db08d562672d39b32eb22663da9f5b2..1dc52f0fd1aada419ee4397dea28dc3396a235ad 100644 --- a/lib/kokkos/core/unit_test/TestSharedAlloc.hpp +++ b/lib/kokkos/core/unit_test/TestSharedAlloc.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestTaskScheduler.hpp b/lib/kokkos/core/unit_test/TestTaskScheduler.hpp index 2ababe6a49faf48ca2e0452ffeded0d409674814..f080c0d3be2c186ba5198be2a9284af3b2594116 100644 --- a/lib/kokkos/core/unit_test/TestTaskScheduler.hpp +++ b/lib/kokkos/core/unit_test/TestTaskScheduler.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestTeam.hpp b/lib/kokkos/core/unit_test/TestTeam.hpp index a9d733e5ef11eab8a347c92e381e5376e3f50a56..51f70737ed4fc347b9dd16c1272450c5a61e6aa5 100644 --- a/lib/kokkos/core/unit_test/TestTeam.hpp +++ b/lib/kokkos/core/unit_test/TestTeam.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -339,7 +339,7 @@ public: const long int thread_rank = ind.team_rank() + ind.team_size() * ind.league_rank(); - ind.team_scan( 1 + thread_rank, accum.ptr_on_device() ); + ind.team_scan( 1 + thread_rank, accum.data() ); } }; @@ -426,8 +426,8 @@ struct SharedTeamFunctor { const shared_int_array_type shared_A( ind.team_shmem(), SHARED_COUNT ); const shared_int_array_type shared_B( ind.team_shmem(), SHARED_COUNT ); - if ( ( shared_A.ptr_on_device () == NULL && SHARED_COUNT > 0 ) || - ( shared_B.ptr_on_device () == NULL && SHARED_COUNT > 0 ) ) + if ( ( shared_A.data() == nullptr && SHARED_COUNT > 0 ) || + ( shared_B.data() == nullptr && SHARED_COUNT > 0 ) ) { printf ("member( %d/%d , %d/%d ) Failed to allocate shared memory of size %lu\n" , ind.league_rank() @@ -526,8 +526,8 @@ struct TestLambdaSharedTeam { const shared_int_array_type shared_A( ind.team_shmem(), SHARED_COUNT ); const shared_int_array_type shared_B( ind.team_shmem(), SHARED_COUNT ); - if ( ( shared_A.ptr_on_device () == NULL && SHARED_COUNT > 0 ) || - ( shared_B.ptr_on_device () == NULL && SHARED_COUNT > 0 ) ) + if ( ( shared_A.data () == nullptr && SHARED_COUNT > 0 ) || + ( shared_B.data () == nullptr && SHARED_COUNT > 0 ) ) { printf( "Failed to allocate shared memory of size %lu\n", static_cast<unsigned long>( SHARED_COUNT ) ); @@ -588,9 +588,9 @@ struct ScratchTeamFunctor { const shared_int_array_type scratch_A( ind.team_scratch( 1 ), SHARED_TEAM_COUNT ); const shared_int_array_type scratch_B( ind.thread_scratch( 1 ), SHARED_THREAD_COUNT ); - if ( ( scratch_ptr.ptr_on_device () == NULL ) || - ( scratch_A. ptr_on_device () == NULL && SHARED_TEAM_COUNT > 0 ) || - ( scratch_B. ptr_on_device () == NULL && SHARED_THREAD_COUNT > 0 ) ) + if ( ( scratch_ptr.data() == nullptr ) || + ( scratch_A. data() == nullptr && SHARED_TEAM_COUNT > 0 ) || + ( scratch_B. data() == nullptr && SHARED_THREAD_COUNT > 0 ) ) { printf( "Failed to allocate shared memory of size %lu\n", static_cast<unsigned long>( SHARED_TEAM_COUNT ) ); @@ -606,8 +606,8 @@ struct ScratchTeamFunctor { scratch_B[i] = 10000 * ind.league_rank() + 100 * ind.team_rank() + i; } - scratch_ptr[ind.team_rank()] = (size_t) scratch_A.ptr_on_device(); - scratch_ptr[ind.team_rank() + ind.team_size()] = (size_t) scratch_B.ptr_on_device(); + scratch_ptr[ind.team_rank()] = (size_t) scratch_A.data(); + scratch_ptr[ind.team_rank() + ind.team_size()] = (size_t) scratch_B.data(); ind.team_barrier(); @@ -646,10 +646,11 @@ struct TestScratchTeam { { typedef Test::ScratchTeamFunctor<ExecSpace, ScheduleType> Functor; typedef Kokkos::View< typename Functor::value_type, Kokkos::HostSpace, Kokkos::MemoryUnmanaged > result_type; + typedef Kokkos::TeamPolicy< ScheduleType, ExecSpace > p_type; - const size_t team_size = Kokkos::TeamPolicy< ScheduleType, ExecSpace >::team_size_max( Functor() ); + const size_t team_size = p_type::team_size_max( Functor() ); - Kokkos::TeamPolicy< ScheduleType, ExecSpace > team_exec( 8192 / team_size, team_size ); + p_type team_exec( 8192 / team_size, team_size ); typename Functor::value_type error_count = 0; @@ -661,8 +662,15 @@ struct TestScratchTeam { Kokkos::parallel_reduce( team_exec.set_scratch_size( 1, Kokkos::PerTeam( team_scratch_size ), Kokkos::PerThread( thread_scratch_size ) ), Functor(), result_type( & error_count ) ); + ASSERT_EQ( error_count, 0 ); + Kokkos::parallel_reduce( p_type( 8192 / team_size, team_size , + Kokkos::ScratchRequest( 1, Kokkos::PerTeam( team_scratch_size ), + Kokkos::PerThread( thread_scratch_size )) + ), + Functor(), result_type( & error_count ) ); ASSERT_EQ( error_count, 0 ); + } }; @@ -946,8 +954,19 @@ struct TestShmemSize { size_t size = view_type::shmem_size( d1, d2, d3 ); ASSERT_EQ( size, d1 * d2 * d3 * sizeof( long ) ); + + test_layout_stride(); } -}; + void test_layout_stride() + { + int rank = 3; + int order[3] = {2, 0, 1}; + int extents[3] = {100, 10, 3}; + auto s1 = Kokkos::View<double***, Kokkos::LayoutStride, ExecSpace>::shmem_size(Kokkos::LayoutStride::order_dimensions(rank, order, extents)); + auto s2 = Kokkos::View<double***, Kokkos::LayoutRight, ExecSpace>::shmem_size(extents[0], extents[1], extents[2]); + ASSERT_EQ(s1, s2); + } +}; } // namespace Test diff --git a/lib/kokkos/core/unit_test/TestTeamVector.hpp b/lib/kokkos/core/unit_test/TestTeamVector.hpp index be048b19e498b534051e8bd0c3b0019dd5549bb5..51884a625adb000388dc922af86e875ea576d38c 100644 --- a/lib/kokkos/core/unit_test/TestTeamVector.hpp +++ b/lib/kokkos/core/unit_test/TestTeamVector.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -47,6 +47,7 @@ #include <iostream> #include <cstdlib> #include <cstdint> +#include <cinttypes> namespace TestTeamVector { @@ -203,7 +204,7 @@ struct functor_team_for { const size_type shmemSize = team.team_size() * 13; shared_int values = shared_int( team.team_shmem(), shmemSize ); - if ( values.ptr_on_device() == NULL || values.dimension_0() < shmemSize ) { + if ( values.data() == nullptr || values.extent(0) < shmemSize ) { printf( "FAILED to allocate shared memory of size %u\n", static_cast<unsigned int>( shmemSize ) ); } @@ -352,7 +353,7 @@ struct functor_team_vector_for { const size_type shmemSize = team.team_size() * 13; shared_int values = shared_int( team.team_shmem(), shmemSize ); - if ( values.ptr_on_device() == NULL || values.dimension_0() < shmemSize ) { + if ( values.data() == nullptr || values.extent(0) < shmemSize ) { printf( "FAILED to allocate shared memory of size %u\n", static_cast<unsigned int>( shmemSize ) ); } @@ -542,7 +543,7 @@ struct functor_vec_for { shared_int values = shared_int( team.team_shmem(), team.team_size() * 13 ); - if ( values.ptr_on_device() == NULL || values.dimension_0() < (unsigned) team.team_size() * 13 ) { + if ( values.data() == nullptr || values.extent(0) < (unsigned) team.team_size() * 13 ) { printf( "FAILED to allocate memory of size %i\n", static_cast<int>( team.team_size() * 13 ) ); flag() = 1; } diff --git a/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp b/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp index 6501f16ca50f30e20a7838400d2396fbcf851c39..ac32aeb0bedf79bde394d26770c26dd4a5b47dd0 100644 --- a/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp +++ b/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestTile.hpp b/lib/kokkos/core/unit_test/TestTile.hpp index f15667322fd3f423c61598daea7065de67c7f380..704c7f994090144f034a1c435d0bd85af80f8ec6 100644 --- a/lib/kokkos/core/unit_test/TestTile.hpp +++ b/lib/kokkos/core/unit_test/TestTile.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -73,10 +73,10 @@ struct ReduceTileErrors KOKKOS_INLINE_FUNCTION void operator()( size_t iwork ) const { - const size_t i = iwork % m_array.dimension_0(); - const size_t j = iwork / m_array.dimension_0(); + const size_t i = iwork % m_array.extent(0); + const size_t j = iwork / m_array.extent(0); - if ( j < m_array.dimension_1() ) { + if ( j < m_array.extent(1) ) { m_array( i, j ) = &m_array( i, j ) - &m_array( 0, 0 ); //printf( "m_array(%d, %d) = %d\n", int( i ), int( j ), int( m_array( i, j ) ) ); @@ -87,8 +87,8 @@ struct ReduceTileErrors KOKKOS_INLINE_FUNCTION void operator()( size_t iwork, value_type & errors ) const { - const size_t tile_dim0 = ( m_array.dimension_0() + TileLayout::N0 - 1 ) / TileLayout::N0; - const size_t tile_dim1 = ( m_array.dimension_1() + TileLayout::N1 - 1 ) / TileLayout::N1; + const size_t tile_dim0 = ( m_array.extent(0) + TileLayout::N0 - 1 ) / TileLayout::N0; + const size_t tile_dim1 = ( m_array.extent(1) + TileLayout::N1 - 1 ) / TileLayout::N1; const size_t itile = iwork % tile_dim0; const size_t jtile = iwork / tile_dim0; @@ -105,7 +105,7 @@ struct ReduceTileErrors const size_t iglobal = i + itile * TileLayout::N0; const size_t jglobal = j + jtile * TileLayout::N1; - if ( iglobal < m_array.dimension_0() && jglobal < m_array.dimension_1() ) { + if ( iglobal < m_array.extent(0) && jglobal < m_array.extent(1) ) { if ( tile( i, j ) != ptrdiff_t( tile( 0, 0 ) + i + j * TileLayout::N0 ) ) ++errors; //printf( "tile(%d, %d)(%d, %d) = %d\n", int( itile ), int( jtile ), int( i ), int( j ), int( tile( i, j ) ) ); diff --git a/lib/kokkos/core/unit_test/TestUniqueToken.hpp b/lib/kokkos/core/unit_test/TestUniqueToken.hpp index 28add61a8a8f74f878d02ff61307c7ad1f6937b0..5c8324c63d7fb0f3699be4130b962136c4dc2afc 100644 --- a/lib/kokkos/core/unit_test/TestUniqueToken.hpp +++ b/lib/kokkos/core/unit_test/TestUniqueToken.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestUtilities.hpp b/lib/kokkos/core/unit_test/TestUtilities.hpp index be4a93b8942cdfd69e97f68b9ea109a2be10de19..f3deabad032ae2bbb8a7798d57ee052c3ee7d4a6 100644 --- a/lib/kokkos/core/unit_test/TestUtilities.hpp +++ b/lib/kokkos/core/unit_test/TestUtilities.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestViewAPI.hpp b/lib/kokkos/core/unit_test/TestViewAPI.hpp index 0f5650d2842fec2574e27b037568bbadc46be438..8f624fab9321b4244b495f82831f534756e4635d 100644 --- a/lib/kokkos/core/unit_test/TestViewAPI.hpp +++ b/lib/kokkos/core/unit_test/TestViewAPI.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -153,14 +153,14 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 8 > { long offset = -1; - for ( unsigned i7 = 0; i7 < unsigned( left.dimension_7() ); ++i7 ) - for ( unsigned i6 = 0; i6 < unsigned( left.dimension_6() ); ++i6 ) - for ( unsigned i5 = 0; i5 < unsigned( left.dimension_5() ); ++i5 ) - for ( unsigned i4 = 0; i4 < unsigned( left.dimension_4() ); ++i4 ) - for ( unsigned i3 = 0; i3 < unsigned( left.dimension_3() ); ++i3 ) - for ( unsigned i2 = 0; i2 < unsigned( left.dimension_2() ); ++i2 ) - for ( unsigned i1 = 0; i1 < unsigned( left.dimension_1() ); ++i1 ) - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) + for ( unsigned i7 = 0; i7 < unsigned( left.extent(7) ); ++i7 ) + for ( unsigned i6 = 0; i6 < unsigned( left.extent(6) ); ++i6 ) + for ( unsigned i5 = 0; i5 < unsigned( left.extent(5) ); ++i5 ) + for ( unsigned i4 = 0; i4 < unsigned( left.extent(4) ); ++i4 ) + for ( unsigned i3 = 0; i3 < unsigned( left.extent(3) ); ++i3 ) + for ( unsigned i2 = 0; i2 < unsigned( left.extent(2) ); ++i2 ) + for ( unsigned i1 = 0; i1 < unsigned( left.extent(1) ); ++i1 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) { const long j = & left( i0, i1, i2, i3, i4, i5, i6, i7 ) - & left( 0, 0, 0, 0, 0, 0, 0, 0 ); @@ -175,14 +175,14 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 8 > offset = -1; - for ( unsigned i0 = 0; i0 < unsigned( right.dimension_0() ); ++i0 ) - for ( unsigned i1 = 0; i1 < unsigned( right.dimension_1() ); ++i1 ) - for ( unsigned i2 = 0; i2 < unsigned( right.dimension_2() ); ++i2 ) - for ( unsigned i3 = 0; i3 < unsigned( right.dimension_3() ); ++i3 ) - for ( unsigned i4 = 0; i4 < unsigned( right.dimension_4() ); ++i4 ) - for ( unsigned i5 = 0; i5 < unsigned( right.dimension_5() ); ++i5 ) - for ( unsigned i6 = 0; i6 < unsigned( right.dimension_6() ); ++i6 ) - for ( unsigned i7 = 0; i7 < unsigned( right.dimension_7() ); ++i7 ) + for ( unsigned i0 = 0; i0 < unsigned( right.extent(0) ); ++i0 ) + for ( unsigned i1 = 0; i1 < unsigned( right.extent(1) ); ++i1 ) + for ( unsigned i2 = 0; i2 < unsigned( right.extent(2) ); ++i2 ) + for ( unsigned i3 = 0; i3 < unsigned( right.extent(3) ); ++i3 ) + for ( unsigned i4 = 0; i4 < unsigned( right.extent(4) ); ++i4 ) + for ( unsigned i5 = 0; i5 < unsigned( right.extent(5) ); ++i5 ) + for ( unsigned i6 = 0; i6 < unsigned( right.extent(6) ); ++i6 ) + for ( unsigned i7 = 0; i7 < unsigned( right.extent(7) ); ++i7 ) { const long j = & right( i0, i1, i2, i3, i4, i5, i6, i7 ) - & right( 0, 0, 0, 0, 0, 0, 0, 0 ); @@ -245,13 +245,13 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 7 > { long offset = -1; - for ( unsigned i6 = 0; i6 < unsigned( left.dimension_6() ); ++i6 ) - for ( unsigned i5 = 0; i5 < unsigned( left.dimension_5() ); ++i5 ) - for ( unsigned i4 = 0; i4 < unsigned( left.dimension_4() ); ++i4 ) - for ( unsigned i3 = 0; i3 < unsigned( left.dimension_3() ); ++i3 ) - for ( unsigned i2 = 0; i2 < unsigned( left.dimension_2() ); ++i2 ) - for ( unsigned i1 = 0; i1 < unsigned( left.dimension_1() ); ++i1 ) - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) + for ( unsigned i6 = 0; i6 < unsigned( left.extent(6) ); ++i6 ) + for ( unsigned i5 = 0; i5 < unsigned( left.extent(5) ); ++i5 ) + for ( unsigned i4 = 0; i4 < unsigned( left.extent(4) ); ++i4 ) + for ( unsigned i3 = 0; i3 < unsigned( left.extent(3) ); ++i3 ) + for ( unsigned i2 = 0; i2 < unsigned( left.extent(2) ); ++i2 ) + for ( unsigned i1 = 0; i1 < unsigned( left.extent(1) ); ++i1 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) { const long j = & left( i0, i1, i2, i3, i4, i5, i6 ) - & left( 0, 0, 0, 0, 0, 0, 0 ); @@ -261,13 +261,13 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 7 > offset = -1; - for ( unsigned i0 = 0; i0 < unsigned( right.dimension_0() ); ++i0 ) - for ( unsigned i1 = 0; i1 < unsigned( right.dimension_1() ); ++i1 ) - for ( unsigned i2 = 0; i2 < unsigned( right.dimension_2() ); ++i2 ) - for ( unsigned i3 = 0; i3 < unsigned( right.dimension_3() ); ++i3 ) - for ( unsigned i4 = 0; i4 < unsigned( right.dimension_4() ); ++i4 ) - for ( unsigned i5 = 0; i5 < unsigned( right.dimension_5() ); ++i5 ) - for ( unsigned i6 = 0; i6 < unsigned( right.dimension_6() ); ++i6 ) + for ( unsigned i0 = 0; i0 < unsigned( right.extent(0) ); ++i0 ) + for ( unsigned i1 = 0; i1 < unsigned( right.extent(1) ); ++i1 ) + for ( unsigned i2 = 0; i2 < unsigned( right.extent(2) ); ++i2 ) + for ( unsigned i3 = 0; i3 < unsigned( right.extent(3) ); ++i3 ) + for ( unsigned i4 = 0; i4 < unsigned( right.extent(4) ); ++i4 ) + for ( unsigned i5 = 0; i5 < unsigned( right.extent(5) ); ++i5 ) + for ( unsigned i6 = 0; i6 < unsigned( right.extent(6) ); ++i6 ) { const long j = & right( i0, i1, i2, i3, i4, i5, i6 ) - & right( 0, 0, 0, 0, 0, 0, 0 ); @@ -325,12 +325,12 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 6 > { long offset = -1; - for ( unsigned i5 = 0; i5 < unsigned( left.dimension_5() ); ++i5 ) - for ( unsigned i4 = 0; i4 < unsigned( left.dimension_4() ); ++i4 ) - for ( unsigned i3 = 0; i3 < unsigned( left.dimension_3() ); ++i3 ) - for ( unsigned i2 = 0; i2 < unsigned( left.dimension_2() ); ++i2 ) - for ( unsigned i1 = 0; i1 < unsigned( left.dimension_1() ); ++i1 ) - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) + for ( unsigned i5 = 0; i5 < unsigned( left.extent(5) ); ++i5 ) + for ( unsigned i4 = 0; i4 < unsigned( left.extent(4) ); ++i4 ) + for ( unsigned i3 = 0; i3 < unsigned( left.extent(3) ); ++i3 ) + for ( unsigned i2 = 0; i2 < unsigned( left.extent(2) ); ++i2 ) + for ( unsigned i1 = 0; i1 < unsigned( left.extent(1) ); ++i1 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) { const long j = & left( i0, i1, i2, i3, i4, i5 ) - & left( 0, 0, 0, 0, 0, 0 ); @@ -340,12 +340,12 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 6 > offset = -1; - for ( unsigned i0 = 0; i0 < unsigned( right.dimension_0() ); ++i0 ) - for ( unsigned i1 = 0; i1 < unsigned( right.dimension_1() ); ++i1 ) - for ( unsigned i2 = 0; i2 < unsigned( right.dimension_2() ); ++i2 ) - for ( unsigned i3 = 0; i3 < unsigned( right.dimension_3() ); ++i3 ) - for ( unsigned i4 = 0; i4 < unsigned( right.dimension_4() ); ++i4 ) - for ( unsigned i5 = 0; i5 < unsigned( right.dimension_5() ); ++i5 ) + for ( unsigned i0 = 0; i0 < unsigned( right.extent(0) ); ++i0 ) + for ( unsigned i1 = 0; i1 < unsigned( right.extent(1) ); ++i1 ) + for ( unsigned i2 = 0; i2 < unsigned( right.extent(2) ); ++i2 ) + for ( unsigned i3 = 0; i3 < unsigned( right.extent(3) ); ++i3 ) + for ( unsigned i4 = 0; i4 < unsigned( right.extent(4) ); ++i4 ) + for ( unsigned i5 = 0; i5 < unsigned( right.extent(5) ); ++i5 ) { const long j = & right( i0, i1, i2, i3, i4, i5 ) - & right( 0, 0, 0, 0, 0, 0 ); @@ -408,11 +408,11 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 5 > { long offset = -1; - for ( unsigned i4 = 0; i4 < unsigned( left.dimension_4() ); ++i4 ) - for ( unsigned i3 = 0; i3 < unsigned( left.dimension_3() ); ++i3 ) - for ( unsigned i2 = 0; i2 < unsigned( left.dimension_2() ); ++i2 ) - for ( unsigned i1 = 0; i1 < unsigned( left.dimension_1() ); ++i1 ) - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) + for ( unsigned i4 = 0; i4 < unsigned( left.extent(4) ); ++i4 ) + for ( unsigned i3 = 0; i3 < unsigned( left.extent(3) ); ++i3 ) + for ( unsigned i2 = 0; i2 < unsigned( left.extent(2) ); ++i2 ) + for ( unsigned i1 = 0; i1 < unsigned( left.extent(1) ); ++i1 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) { const long j = & left( i0, i1, i2, i3, i4 ) - & left( 0, 0, 0, 0, 0 ); @@ -425,11 +425,11 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 5 > offset = -1; - for ( unsigned i0 = 0; i0 < unsigned( right.dimension_0() ); ++i0 ) - for ( unsigned i1 = 0; i1 < unsigned( right.dimension_1() ); ++i1 ) - for ( unsigned i2 = 0; i2 < unsigned( right.dimension_2() ); ++i2 ) - for ( unsigned i3 = 0; i3 < unsigned( right.dimension_3() ); ++i3 ) - for ( unsigned i4 = 0; i4 < unsigned( right.dimension_4() ); ++i4 ) + for ( unsigned i0 = 0; i0 < unsigned( right.extent(0) ); ++i0 ) + for ( unsigned i1 = 0; i1 < unsigned( right.extent(1) ); ++i1 ) + for ( unsigned i2 = 0; i2 < unsigned( right.extent(2) ); ++i2 ) + for ( unsigned i3 = 0; i3 < unsigned( right.extent(3) ); ++i3 ) + for ( unsigned i4 = 0; i4 < unsigned( right.extent(4) ); ++i4 ) { const long j = & right( i0, i1, i2, i3, i4 ) - & right( 0, 0, 0, 0, 0 ); @@ -490,10 +490,10 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 4 > { long offset = -1; - for ( unsigned i3 = 0; i3 < unsigned( left.dimension_3() ); ++i3 ) - for ( unsigned i2 = 0; i2 < unsigned( left.dimension_2() ); ++i2 ) - for ( unsigned i1 = 0; i1 < unsigned( left.dimension_1() ); ++i1 ) - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) + for ( unsigned i3 = 0; i3 < unsigned( left.extent(3) ); ++i3 ) + for ( unsigned i2 = 0; i2 < unsigned( left.extent(2) ); ++i2 ) + for ( unsigned i1 = 0; i1 < unsigned( left.extent(1) ); ++i1 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) { const long j = & left( i0, i1, i2, i3 ) - & left( 0, 0, 0, 0 ); @@ -503,10 +503,10 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 4 > offset = -1; - for ( unsigned i0 = 0; i0 < unsigned( right.dimension_0() ); ++i0 ) - for ( unsigned i1 = 0; i1 < unsigned( right.dimension_1() ); ++i1 ) - for ( unsigned i2 = 0; i2 < unsigned( right.dimension_2() ); ++i2 ) - for ( unsigned i3 = 0; i3 < unsigned( right.dimension_3() ); ++i3 ) + for ( unsigned i0 = 0; i0 < unsigned( right.extent(0) ); ++i0 ) + for ( unsigned i1 = 0; i1 < unsigned( right.extent(1) ); ++i1 ) + for ( unsigned i2 = 0; i2 < unsigned( right.extent(2) ); ++i2 ) + for ( unsigned i3 = 0; i3 < unsigned( right.extent(3) ); ++i3 ) { const long j = & right( i0, i1, i2, i3 ) - & right( 0, 0, 0, 0 ); @@ -569,9 +569,9 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 3 > { long offset = -1; - for ( unsigned i2 = 0; i2 < unsigned( left.dimension_2() ); ++i2 ) - for ( unsigned i1 = 0; i1 < unsigned( left.dimension_1() ); ++i1 ) - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) + for ( unsigned i2 = 0; i2 < unsigned( left.extent(2) ); ++i2 ) + for ( unsigned i1 = 0; i1 < unsigned( left.extent(1) ); ++i1 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) { const long j = & left( i0, i1, i2 ) - & left( 0, 0, 0 ); @@ -583,9 +583,9 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 3 > offset = -1; - for ( unsigned i0 = 0; i0 < unsigned( right.dimension_0() ); ++i0 ) - for ( unsigned i1 = 0; i1 < unsigned( right.dimension_1() ); ++i1 ) - for ( unsigned i2 = 0; i2 < unsigned( right.dimension_2() ); ++i2 ) + for ( unsigned i0 = 0; i0 < unsigned( right.extent(0) ); ++i0 ) + for ( unsigned i1 = 0; i1 < unsigned( right.extent(1) ); ++i1 ) + for ( unsigned i2 = 0; i2 < unsigned( right.extent(2) ); ++i2 ) { const long j = & right( i0, i1, i2 ) - & right( 0, 0, 0 ); @@ -595,12 +595,17 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 3 > if ( & right( i0, i1, i2 ) != & right_stride( i0, i1, i2 ) ) { update |= 8; } } - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) - for ( unsigned i1 = 0; i1 < unsigned( left.dimension_1() ); ++i1 ) - for ( unsigned i2 = 0; i2 < unsigned( left.dimension_2() ); ++i2 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) + for ( unsigned i1 = 0; i1 < unsigned( left.extent(1) ); ++i1 ) + for ( unsigned i2 = 0; i2 < unsigned( left.extent(2) ); ++i2 ) { - if ( & left( i0, i1, i2 ) != & left( i0, i1, i2, 0, 0, 0, 0, 0 ) ) { update |= 3; } - if ( & right( i0, i1, i2 ) != & right( i0, i1, i2, 0, 0, 0, 0, 0 ) ) { update |= 3; } +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE + if ( & left( i0, i1, i2 ) != & left( i0, i1, i2, 0, 0, 0, 0, 0 ) ) { update |= 3; } + if ( & right( i0, i1, i2 ) != & right( i0, i1, i2, 0, 0, 0, 0, 0 ) ) { update |= 3; } +#else + if ( & left( i0, i1, i2 ) != & left.access( i0, i1, i2, 0, 0, 0, 0, 0 ) ) { update |= 3; } + if ( & right( i0, i1, i2 ) != & right.access( i0, i1, i2, 0, 0, 0, 0, 0 ) ) { update |= 3; } +#endif } } }; @@ -653,8 +658,8 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 2 > { long offset = -1; - for ( unsigned i1 = 0; i1 < unsigned( left.dimension_1() ); ++i1 ) - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) + for ( unsigned i1 = 0; i1 < unsigned( left.extent(1) ); ++i1 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) { const long j = & left( i0, i1 ) - & left( 0, 0 ); @@ -664,8 +669,8 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 2 > offset = -1; - for ( unsigned i0 = 0; i0 < unsigned( right.dimension_0() ); ++i0 ) - for ( unsigned i1 = 0; i1 < unsigned( right.dimension_1() ); ++i1 ) + for ( unsigned i0 = 0; i0 < unsigned( right.extent(0) ); ++i0 ) + for ( unsigned i1 = 0; i1 < unsigned( right.extent(1) ); ++i1 ) { const long j = & right( i0, i1 ) - & right( 0, 0 ); @@ -673,11 +678,16 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 2 > offset = j; } - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) - for ( unsigned i1 = 0; i1 < unsigned( left.dimension_1() ); ++i1 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) + for ( unsigned i1 = 0; i1 < unsigned( left.extent(1) ); ++i1 ) { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE if ( & left( i0, i1 ) != & left( i0, i1, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } if ( & right( i0, i1 ) != & right( i0, i1, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } +#else + if ( & left( i0, i1 ) != & left.access( i0, i1, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } + if ( & right( i0, i1 ) != & right.access( i0, i1, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } +#endif } } }; @@ -734,10 +744,15 @@ struct TestViewOperator_LeftAndRight< DataType, DeviceType, 1 > KOKKOS_INLINE_FUNCTION void operator()( const size_type, value_type & update ) const { - for ( unsigned i0 = 0; i0 < unsigned( left.dimension_0() ); ++i0 ) + for ( unsigned i0 = 0; i0 < unsigned( left.extent(0) ); ++i0 ) { +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE if ( & left( i0 ) != & left( i0, 0, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } if ( & right( i0 ) != & right( i0, 0, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } +#else + if ( & left( i0 ) != & left.access( i0, 0, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } + if ( & right( i0 ) != & right.access( i0, 0, 0, 0, 0, 0, 0, 0 ) ) { update |= 3; } +#endif if ( & left( i0 ) != & left_stride( i0 ) ) { update |= 4; } if ( & right( i0 ) != & right_stride( i0 ) ) { update |= 8; } } @@ -762,8 +777,8 @@ struct TestViewMirror ASSERT_EQ( equal_ptr_h_d, 0 ); ASSERT_EQ( equal_ptr_h2_d, 0 ); - ASSERT_EQ( a_h.dimension_0(), a_h2.dimension_0() ); - ASSERT_EQ( a_h.dimension_0(), a_d .dimension_0() ); + ASSERT_EQ( a_h.extent(0), a_h2.extent(0) ); + ASSERT_EQ( a_h.extent(0), a_d .extent(0) ); } template< class MemoryTraits > @@ -782,8 +797,8 @@ struct TestViewMirror ASSERT_EQ( equal_ptr_h_d, is_same_memspace ); ASSERT_EQ( equal_ptr_h2_d, is_same_memspace ); - ASSERT_EQ( a_h.dimension_0(), a_h2.dimension_0() ); - ASSERT_EQ( a_h.dimension_0(), a_d .dimension_0() ); + ASSERT_EQ( a_h.extent(0), a_h2.extent(0) ); + ASSERT_EQ( a_h.extent(0), a_d .extent(0) ); } template< class MemoryTraits > @@ -806,9 +821,9 @@ struct TestViewMirror ASSERT_EQ( equal_ptr_h2_d, is_same_memspace ); ASSERT_EQ( equal_ptr_h3_d, is_same_memspace ); - ASSERT_EQ( a_h.dimension_0(), a_h3.dimension_0() ); - ASSERT_EQ( a_h.dimension_0(), a_h2.dimension_0() ); - ASSERT_EQ( a_h.dimension_0(), a_d .dimension_0() ); + ASSERT_EQ( a_h.extent(0), a_h3.extent(0) ); + ASSERT_EQ( a_h.extent(0), a_h2.extent(0) ); + ASSERT_EQ( a_h.extent(0), a_d .extent(0) ); ASSERT_EQ( a_org(5), a_h3(5) ); } @@ -945,24 +960,24 @@ public: dView4 dx, dy, dz; hView4 hx, hy, hz; - ASSERT_TRUE( dx.ptr_on_device() == 0 ); - ASSERT_TRUE( dy.ptr_on_device() == 0 ); - ASSERT_TRUE( dz.ptr_on_device() == 0 ); - ASSERT_TRUE( hx.ptr_on_device() == 0 ); - ASSERT_TRUE( hy.ptr_on_device() == 0 ); - ASSERT_TRUE( hz.ptr_on_device() == 0 ); - ASSERT_EQ( dx.dimension_0(), 0u ); - ASSERT_EQ( dy.dimension_0(), 0u ); - ASSERT_EQ( dz.dimension_0(), 0u ); - ASSERT_EQ( hx.dimension_0(), 0u ); - ASSERT_EQ( hy.dimension_0(), 0u ); - ASSERT_EQ( hz.dimension_0(), 0u ); - ASSERT_EQ( dx.dimension_1(), unsigned( N1 ) ); - ASSERT_EQ( dy.dimension_1(), unsigned( N1 ) ); - ASSERT_EQ( dz.dimension_1(), unsigned( N1 ) ); - ASSERT_EQ( hx.dimension_1(), unsigned( N1 ) ); - ASSERT_EQ( hy.dimension_1(), unsigned( N1 ) ); - ASSERT_EQ( hz.dimension_1(), unsigned( N1 ) ); + ASSERT_TRUE( dx.data() == 0 ); + ASSERT_TRUE( dy.data() == 0 ); + ASSERT_TRUE( dz.data() == 0 ); + ASSERT_TRUE( hx.data() == 0 ); + ASSERT_TRUE( hy.data() == 0 ); + ASSERT_TRUE( hz.data() == 0 ); + ASSERT_EQ( dx.extent(0), 0u ); + ASSERT_EQ( dy.extent(0), 0u ); + ASSERT_EQ( dz.extent(0), 0u ); + ASSERT_EQ( hx.extent(0), 0u ); + ASSERT_EQ( hy.extent(0), 0u ); + ASSERT_EQ( hz.extent(0), 0u ); + ASSERT_EQ( dx.extent(1), unsigned( N1 ) ); + ASSERT_EQ( dy.extent(1), unsigned( N1 ) ); + ASSERT_EQ( dz.extent(1), unsigned( N1 ) ); + ASSERT_EQ( hx.extent(1), unsigned( N1 ) ); + ASSERT_EQ( hy.extent(1), unsigned( N1 ) ); + ASSERT_EQ( hz.extent(1), unsigned( N1 ) ); dx = dView4( "dx", N0 ); dy = dView4( "dy", N0 ); @@ -972,19 +987,19 @@ public: dView4_unmanaged unmanaged_dx = dx; ASSERT_EQ( dx.use_count(), size_t( 1 ) ); - dView4_unmanaged unmanaged_from_ptr_dx = dView4_unmanaged( dx.ptr_on_device(), - dx.dimension_0(), - dx.dimension_1(), - dx.dimension_2(), - dx.dimension_3() ); + dView4_unmanaged unmanaged_from_ptr_dx = dView4_unmanaged( dx.data(), + dx.extent(0), + dx.extent(1), + dx.extent(2), + dx.extent(3) ); { // Destruction of this view should be harmless. - const_dView4 unmanaged_from_ptr_const_dx( dx.ptr_on_device(), - dx.dimension_0(), - dx.dimension_1(), - dx.dimension_2(), - dx.dimension_3() ); + const_dView4 unmanaged_from_ptr_const_dx( dx.data(), + dx.extent(0), + dx.extent(1), + dx.extent(2), + dx.extent(3) ); } const_dView4 const_dx = dx; @@ -1007,24 +1022,24 @@ public: ASSERT_EQ( dx.use_count(), size_t( 2 ) ); - ASSERT_FALSE( dx.ptr_on_device() == 0 ); - ASSERT_FALSE( const_dx.ptr_on_device() == 0 ); - ASSERT_FALSE( unmanaged_dx.ptr_on_device() == 0 ); - ASSERT_FALSE( unmanaged_from_ptr_dx.ptr_on_device() == 0 ); - ASSERT_FALSE( dy.ptr_on_device() == 0 ); + ASSERT_FALSE( dx.data() == 0 ); + ASSERT_FALSE( const_dx.data() == 0 ); + ASSERT_FALSE( unmanaged_dx.data() == 0 ); + ASSERT_FALSE( unmanaged_from_ptr_dx.data() == 0 ); + ASSERT_FALSE( dy.data() == 0 ); ASSERT_NE( dx, dy ); - ASSERT_EQ( dx.dimension_0(), unsigned( N0 ) ); - ASSERT_EQ( dx.dimension_1(), unsigned( N1 ) ); - ASSERT_EQ( dx.dimension_2(), unsigned( N2 ) ); - ASSERT_EQ( dx.dimension_3(), unsigned( N3 ) ); + ASSERT_EQ( dx.extent(0), unsigned( N0 ) ); + ASSERT_EQ( dx.extent(1), unsigned( N1 ) ); + ASSERT_EQ( dx.extent(2), unsigned( N2 ) ); + ASSERT_EQ( dx.extent(3), unsigned( N3 ) ); - ASSERT_EQ( dy.dimension_0(), unsigned( N0 ) ); - ASSERT_EQ( dy.dimension_1(), unsigned( N1 ) ); - ASSERT_EQ( dy.dimension_2(), unsigned( N2 ) ); - ASSERT_EQ( dy.dimension_3(), unsigned( N3 ) ); + ASSERT_EQ( dy.extent(0), unsigned( N0 ) ); + ASSERT_EQ( dy.extent(1), unsigned( N1 ) ); + ASSERT_EQ( dy.extent(2), unsigned( N2 ) ); + ASSERT_EQ( dy.extent(3), unsigned( N3 ) ); - ASSERT_EQ( unmanaged_from_ptr_dx.capacity(), unsigned( N0 ) * unsigned( N1 ) * unsigned( N2 ) * unsigned( N3 ) ); + ASSERT_EQ( unmanaged_from_ptr_dx.span(), unsigned( N0 ) * unsigned( N1 ) * unsigned( N2 ) * unsigned( N3 ) ); #ifdef KOKKOS_ENABLE_OPENMPTARGET return; #endif @@ -1040,9 +1055,9 @@ return; size_t count = 0; for ( size_t ip = 0; ip < N0; ++ip ) - for ( size_t i1 = 0; i1 < hx.dimension_1(); ++i1 ) - for ( size_t i2 = 0; i2 < hx.dimension_2(); ++i2 ) - for ( size_t i3 = 0; i3 < hx.dimension_3(); ++i3 ) + for ( size_t i1 = 0; i1 < hx.extent(1); ++i1 ) + for ( size_t i2 = 0; i2 < hx.extent(2); ++i2 ) + for ( size_t i3 = 0; i3 < hx.extent(3); ++i3 ) { hx( ip, i1, i2, i3 ) = ++count; } @@ -1076,9 +1091,9 @@ return; size_t count = 0; for ( size_t ip = 0; ip < N0; ++ip ) - for ( size_t i1 = 0; i1 < hx.dimension_1(); ++i1 ) - for ( size_t i2 = 0; i2 < hx.dimension_2(); ++i2 ) - for ( size_t i3 = 0; i3 < hx.dimension_3(); ++i3 ) + for ( size_t i1 = 0; i1 < hx.extent(1); ++i1 ) + for ( size_t i2 = 0; i2 < hx.extent(2); ++i2 ) + for ( size_t i3 = 0; i3 < hx.extent(3); ++i3 ) { hx( ip, i1, i2, i3 ) = ++count; } @@ -1112,9 +1127,9 @@ return; size_t count = 0; for ( size_t ip = 0; ip < N0; ++ip ) - for ( size_t i1 = 0; i1 < hx.dimension_1(); ++i1 ) - for ( size_t i2 = 0; i2 < hx.dimension_2(); ++i2 ) - for ( size_t i3 = 0; i3 < hx.dimension_3(); ++i3 ) + for ( size_t i1 = 0; i1 < hx.extent(1); ++i1 ) + for ( size_t i2 = 0; i2 < hx.extent(2); ++i2 ) + for ( size_t i3 = 0; i3 < hx.extent(3); ++i3 ) { hx( ip, i1, i2, i3 ) = ++count; } @@ -1152,19 +1167,44 @@ return; ASSERT_NE( dx, dz ); dx = dView4(); - ASSERT_TRUE( dx.ptr_on_device() == 0 ); - ASSERT_FALSE( dy.ptr_on_device() == 0 ); - ASSERT_FALSE( dz.ptr_on_device() == 0 ); + ASSERT_TRUE( dx.data() == 0 ); + ASSERT_FALSE( dy.data() == 0 ); + ASSERT_FALSE( dz.data() == 0 ); dy = dView4(); - ASSERT_TRUE( dx.ptr_on_device() == 0 ); - ASSERT_TRUE( dy.ptr_on_device() == 0 ); - ASSERT_FALSE( dz.ptr_on_device() == 0 ); + ASSERT_TRUE( dx.data() == 0 ); + ASSERT_TRUE( dy.data() == 0 ); + ASSERT_FALSE( dz.data() == 0 ); dz = dView4(); - ASSERT_TRUE( dx.ptr_on_device() == 0 ); - ASSERT_TRUE( dy.ptr_on_device() == 0 ); - ASSERT_TRUE( dz.ptr_on_device() == 0 ); + ASSERT_TRUE( dx.data() == 0 ); + ASSERT_TRUE( dy.data() == 0 ); + ASSERT_TRUE( dz.data() == 0 ); + + // Check Deep Copy of LayoutLeft to LayoutRight + { + Kokkos::View<double*,Kokkos::LayoutLeft> dll("dll",10); + Kokkos::View<double*,Kokkos::LayoutRight,Kokkos::HostSpace> hlr("hlr",10); + Kokkos::deep_copy(dll,hlr); + Kokkos::deep_copy(hlr,dll); + } + + // Check Deep Copy of two empty 1D views + { + Kokkos::View<double*> d; + Kokkos::View<double*,Kokkos::HostSpace> h; + Kokkos::deep_copy(d,h); + Kokkos::deep_copy(h,d); + } + + // Check Deep Copy of two empty 2D views + { + Kokkos::View<double*[3],Kokkos::LayoutRight> d; + Kokkos::View<double*[3],Kokkos::LayoutRight,Kokkos::HostSpace> h; + Kokkos::deep_copy(d,h); + Kokkos::deep_copy(h,d); + } + } typedef T DataType[2]; @@ -1197,7 +1237,7 @@ return; if ( !std::is_same< typename device::execution_space, Kokkos::Cuda >::value ) #endif { - ASSERT_TRUE( x.ptr_on_device() == xr.ptr_on_device() ); + ASSERT_TRUE( x.data() == xr.data() ); } // typeX xf = xc; // Setting non-const from const must not compile. @@ -1239,10 +1279,10 @@ return; view_stride_1 yr1 = Kokkos::subview( xr2, 0, Kokkos::ALL() ); view_stride_1 yr2 = Kokkos::subview( xr2, 1, Kokkos::ALL() ); - ASSERT_EQ( yl1.dimension_0(), xl2.dimension_1() ); - ASSERT_EQ( yl2.dimension_0(), xl2.dimension_1() ); - ASSERT_EQ( yr1.dimension_0(), xr2.dimension_1() ); - ASSERT_EQ( yr2.dimension_0(), xr2.dimension_1() ); + ASSERT_EQ( yl1.extent(0), xl2.extent(1) ); + ASSERT_EQ( yl2.extent(0), xl2.extent(1) ); + ASSERT_EQ( yr1.extent(0), xr2.extent(1) ); + ASSERT_EQ( yr2.extent(0), xr2.extent(1) ); ASSERT_EQ( & yl1( 0 ) - & xl2( 0, 0 ), 0 ); ASSERT_EQ( & yl2( 0 ) - & xl2( 1, 0 ), 0 ); @@ -1255,10 +1295,10 @@ return; view_stride_2 yl4 = Kokkos::subview( xl4, 1, Kokkos::ALL(), 2, Kokkos::ALL() ); view_stride_2 yr4 = Kokkos::subview( xr4, 1, Kokkos::ALL(), 2, Kokkos::ALL() ); - ASSERT_EQ( yl4.dimension_0(), xl4.dimension_1() ); - ASSERT_EQ( yl4.dimension_1(), xl4.dimension_3() ); - ASSERT_EQ( yr4.dimension_0(), xr4.dimension_1() ); - ASSERT_EQ( yr4.dimension_1(), xr4.dimension_3() ); + ASSERT_EQ( yl4.extent(0), xl4.extent(1) ); + ASSERT_EQ( yl4.extent(1), xl4.extent(3) ); + ASSERT_EQ( yr4.extent(0), xr4.extent(1) ); + ASSERT_EQ( yr4.extent(1), xr4.extent(3) ); ASSERT_EQ( & yl4( 4, 4 ) - & xl4( 1, 4, 2, 4 ), 0 ); ASSERT_EQ( & yr4( 4, 4 ) - & xr4( 1, 4, 2, 4 ), 0 ); @@ -1420,4 +1460,84 @@ TEST_F( TEST_CATEGORY, view_mirror_nonconst ) Kokkos::deep_copy(h_view2, d_view_const); } +template <typename DataType, typename ... Extents> +void test_left_stride(Extents ... extents) { + using view_type = Kokkos::View<DataType, Kokkos::LayoutLeft, Kokkos::HostSpace>; + view_type view("view", extents...); + size_t expected_stride = 1; + size_t all_strides[view_type::rank + 1]; + view.stride(all_strides); + for (int i = 0; i < view_type::rank; ++i) { + ASSERT_EQ(view.stride(i), expected_stride); + ASSERT_EQ(all_strides[i], expected_stride); + expected_stride *= view.extent(i); + } +} + +template <typename DataType, typename ... Extents> +void test_right_stride(Extents ... extents) { + using view_type = Kokkos::View<DataType, Kokkos::LayoutRight, Kokkos::HostSpace>; + view_type view("view", extents...); + size_t expected_stride = 1; + size_t all_strides[view_type::rank + 1]; + view.stride(all_strides); + for (int ri = 0; ri < view_type::rank; ++ri) { + auto i = view_type::rank - 1 - ri; + ASSERT_EQ(view.stride(i), expected_stride); + ASSERT_EQ(all_strides[i], expected_stride); + expected_stride *= view.extent(i); + } +} + +template <typename DataType, typename ... Extents> +void test_stride(Extents ... extents) { + test_right_stride<DataType>(extents...); + test_left_stride<DataType>(extents...); +} + +TEST_F( TEST_CATEGORY, view_stride_method ) +{ + test_stride<double[3]>(); + test_stride<double*>(3); + test_stride<double[3][7][13]>(); + test_stride<double***>(3, 7, 13); + // factorial(8) = 40320 + test_stride<double[1][2][3][4][5][6][7][8]>(); + test_stride<double********>(1, 2, 3, 4, 5, 6, 7, 8); +} + +inline void test_anonymous_space() { + /* apparently TEST_EXECSPACE is sometimes a memory space. */ + using ExecSpace = TEST_EXECSPACE::execution_space; + int host_array[10]; + Kokkos::View<int[10], Kokkos::AnonymousSpace> host_anon_stat_view(host_array); + Kokkos::View<int*, Kokkos::AnonymousSpace> host_anon_dyn_view(host_array, 10); + Kokkos::View<int*, Kokkos::HostSpace> host_view("host_view", 10); + Kokkos::View<int*, Kokkos::AnonymousSpace> host_anon_assign_view = host_view; + for (int i = 0; i < 10; ++i) { + host_anon_stat_view(i) = host_anon_dyn_view(i) = 142; + host_anon_assign_view(i) = 142; + } + Kokkos::View<int**, Kokkos::LayoutRight, ExecSpace> d_view("d_view", 100, 10); +#ifdef KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA + Kokkos::parallel_for(Kokkos::RangePolicy<ExecSpace, int>(0, 100), KOKKOS_LAMBDA(int i) { + int* ptr = &(d_view(i, 0)); + Kokkos::View<int[10], Kokkos::AnonymousSpace> d_anon_stat_view(ptr); + Kokkos::View<int*, Kokkos::AnonymousSpace> d_anon_dyn_view(ptr, 10); + auto sub = Kokkos::subview(d_view, i, Kokkos::ALL()); + Kokkos::View<int*, Kokkos::AnonymousSpace> d_anon_assign_view = sub; + for (int j = 0; j < 10; ++j) { + d_anon_stat_view(j) = 50; + d_anon_assign_view(j) += 50; + d_anon_dyn_view(j) += 42; + } + }); +#endif +} + +TEST_F( TEST_CATEGORY, anonymous_space ) +{ + test_anonymous_space(); +} + } // namespace Test diff --git a/lib/kokkos/core/unit_test/TestViewCtorPropEmbeddedDim.hpp b/lib/kokkos/core/unit_test/TestViewCtorPropEmbeddedDim.hpp index 61b43a588ae4badda6c19680d2a3d4882fea649c..0b880521293d47e465f6a898e08f4188e35b2f35 100644 --- a/lib/kokkos/core/unit_test/TestViewCtorPropEmbeddedDim.hpp +++ b/lib/kokkos/core/unit_test/TestViewCtorPropEmbeddedDim.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestViewMapping_a.hpp b/lib/kokkos/core/unit_test/TestViewMapping_a.hpp index f963875ae1b67ce441c4b963ea20ad646f0452bc..ff3f3cd4284da9e0d4d888f31a465fe0f741c615 100644 --- a/lib/kokkos/core/unit_test/TestViewMapping_a.hpp +++ b/lib/kokkos/core/unit_test/TestViewMapping_a.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -708,7 +708,7 @@ void test_view_mapping() ASSERT_EQ( C::Rank, 1 ); - ASSERT_EQ( vr1.dimension_0(), N ); + ASSERT_EQ( vr1.extent(0), N ); if ( Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space >::accessible ) { for ( int i = 0; i < N; ++i ) data[i] = i + 1; @@ -751,7 +751,7 @@ void test_view_mapping() ASSERT_TRUE( ( std::is_same< typename T::reference_type, int & >::value ) ); ASSERT_EQ( T::Rank, 1 ); - ASSERT_EQ( vr1.dimension_0(), N ); + ASSERT_EQ( vr1.extent(0), N ); if ( Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space >::accessible ) { for ( int i = 0; i < N; ++i ) vr1( i ) = i + 1; @@ -778,8 +778,8 @@ void test_view_mapping() T vr1( "vr1", N ); C cr1( vr1 ); - ASSERT_EQ( vr1.dimension_0(), 0 ); - ASSERT_EQ( cr1.dimension_0(), 0 ); + ASSERT_EQ( vr1.extent(0), 0 ); + ASSERT_EQ( cr1.extent(0), 0 ); } // Testing using space instance for allocation. @@ -881,12 +881,12 @@ void test_view_mapping() Kokkos::realloc( c, 5, 6 ); Kokkos::realloc( d, 5, 6 ); - ASSERT_EQ( b.dimension_0(), 5 ); - ASSERT_EQ( b.dimension_1(), 6 ); - ASSERT_EQ( c.dimension_0(), 5 ); - ASSERT_EQ( c.dimension_1(), 6 ); - ASSERT_EQ( d.dimension_0(), 5 ); - ASSERT_EQ( d.dimension_1(), 6 ); + ASSERT_EQ( b.extent(0), 5 ); + ASSERT_EQ( b.extent(1), 6 ); + ASSERT_EQ( c.extent(0), 5 ); + ASSERT_EQ( c.extent(1), 6 ); + ASSERT_EQ( d.extent(0), 5 ); + ASSERT_EQ( d.extent(1), 6 ); layout_type layout( 7, 8 ); Kokkos::resize( b, layout ); @@ -912,12 +912,12 @@ void test_view_mapping() Kokkos::realloc( c, layout ); Kokkos::realloc( d, layout ); - ASSERT_EQ( b.dimension_0(), 7 ); - ASSERT_EQ( b.dimension_1(), 8 ); - ASSERT_EQ( c.dimension_0(), 7 ); - ASSERT_EQ( c.dimension_1(), 8 ); - ASSERT_EQ( d.dimension_0(), 7 ); - ASSERT_EQ( d.dimension_1(), 8 ); + ASSERT_EQ( b.extent(0), 7 ); + ASSERT_EQ( b.extent(1), 8 ); + ASSERT_EQ( c.extent(0), 7 ); + ASSERT_EQ( c.extent(1), 8 ); + ASSERT_EQ( d.extent(0), 7 ); + ASSERT_EQ( d.extent(1), 8 ); } { @@ -967,12 +967,12 @@ void test_view_mapping() Kokkos::realloc( c, layout ); Kokkos::realloc( d, layout ); - ASSERT_EQ( b.dimension_0(), 7 ); - ASSERT_EQ( b.dimension_1(), 8 ); - ASSERT_EQ( c.dimension_0(), 7 ); - ASSERT_EQ( c.dimension_1(), 8 ); - ASSERT_EQ( d.dimension_0(), 7 ); - ASSERT_EQ( d.dimension_1(), 8 ); + ASSERT_EQ( b.extent(0), 7 ); + ASSERT_EQ( b.extent(1), 8 ); + ASSERT_EQ( c.extent(0), 7 ); + ASSERT_EQ( c.extent(1), 8 ); + ASSERT_EQ( d.extent(0), 7 ); + ASSERT_EQ( d.extent(1), 8 ); } @@ -1048,14 +1048,18 @@ struct TestViewMapOperator { KOKKOS_INLINE_FUNCTION void test_left( size_t i0, long & error_count ) const { +#ifdef KOKKOS_ENABLE_DEPPRECATED_CODE typename ViewType::value_type * const base_ptr = & v( 0, 0, 0, 0, 0, 0, 0, 0 ); - const size_t n1 = v.dimension_1(); - const size_t n2 = v.dimension_2(); - const size_t n3 = v.dimension_3(); - const size_t n4 = v.dimension_4(); - const size_t n5 = v.dimension_5(); - const size_t n6 = v.dimension_6(); - const size_t n7 = v.dimension_7(); +#else + typename ViewType::value_type * const base_ptr = & v.access( 0, 0, 0, 0, 0, 0, 0, 0 ); +#endif + const size_t n1 = v.extent(1); + const size_t n2 = v.extent(2); + const size_t n3 = v.extent(3); + const size_t n4 = v.extent(4); + const size_t n5 = v.extent(5); + const size_t n6 = v.extent(6); + const size_t n7 = v.extent(7); long offset = 0; @@ -1067,8 +1071,12 @@ struct TestViewMapOperator { for ( size_t i2 = 0; i2 < n2; ++i2 ) for ( size_t i1 = 0; i1 < n1; ++i1 ) { - const long d = & v( i0, i1, i2, i3, i4, i5, i6, i7 ) - base_ptr; - if ( d < offset ) ++error_count; +#ifdef KOKKOS_ENABLE_DEPREACATED_CODE + const long d = & v( i0, i1, i2, i3, i4, i5, i6, i7 ) - base_ptr; +#else + const long d = & v.access( i0, i1, i2, i3, i4, i5, i6, i7 ) - base_ptr; +#endif + if ( d < offset ) ++error_count; offset = d; } @@ -1078,14 +1086,18 @@ struct TestViewMapOperator { KOKKOS_INLINE_FUNCTION void test_right( size_t i0, long & error_count ) const { +#ifdef KOKKOS_ENABLE_DEPREACATED_CODE typename ViewType::value_type * const base_ptr = & v( 0, 0, 0, 0, 0, 0, 0, 0 ); - const size_t n1 = v.dimension_1(); - const size_t n2 = v.dimension_2(); - const size_t n3 = v.dimension_3(); - const size_t n4 = v.dimension_4(); - const size_t n5 = v.dimension_5(); - const size_t n6 = v.dimension_6(); - const size_t n7 = v.dimension_7(); +#else + typename ViewType::value_type * const base_ptr = & v.access( 0, 0, 0, 0, 0, 0, 0, 0 ); +#endif + const size_t n1 = v.extent(1); + const size_t n2 = v.extent(2); + const size_t n3 = v.extent(3); + const size_t n4 = v.extent(4); + const size_t n5 = v.extent(5); + const size_t n6 = v.extent(6); + const size_t n7 = v.extent(7); long offset = 0; @@ -1097,8 +1109,12 @@ struct TestViewMapOperator { for ( size_t i6 = 0; i6 < n6; ++i6 ) for ( size_t i7 = 0; i7 < n7; ++i7 ) { - const long d = & v( i0, i1, i2, i3, i4, i5, i6, i7 ) - base_ptr; - if ( d < offset ) ++error_count; +#ifdef KOKKOS_ENABLE_DEPREACATED_CODE + const long d = & v( i0, i1, i2, i3, i4, i5, i6, i7 ) - base_ptr; +#else + const long d = & v.access( i0, i1, i2, i3, i4, i5, i6, i7 ) - base_ptr; +#endif + if ( d < offset ) ++error_count; offset = d; } @@ -1129,27 +1145,27 @@ struct TestViewMapOperator { void run() { - ASSERT_EQ( v.dimension_0(), ( 0 < ViewType::rank ? TestViewMapOperator<ViewType>::N0 : 1 ) ); - ASSERT_EQ( v.dimension_1(), ( 1 < ViewType::rank ? TestViewMapOperator<ViewType>::N1 : 1 ) ); - ASSERT_EQ( v.dimension_2(), ( 2 < ViewType::rank ? TestViewMapOperator<ViewType>::N2 : 1 ) ); - ASSERT_EQ( v.dimension_3(), ( 3 < ViewType::rank ? TestViewMapOperator<ViewType>::N3 : 1 ) ); - ASSERT_EQ( v.dimension_4(), ( 4 < ViewType::rank ? TestViewMapOperator<ViewType>::N4 : 1 ) ); - ASSERT_EQ( v.dimension_5(), ( 5 < ViewType::rank ? TestViewMapOperator<ViewType>::N5 : 1 ) ); - ASSERT_EQ( v.dimension_6(), ( 6 < ViewType::rank ? TestViewMapOperator<ViewType>::N6 : 1 ) ); - ASSERT_EQ( v.dimension_7(), ( 7 < ViewType::rank ? TestViewMapOperator<ViewType>::N7 : 1 ) ); - - ASSERT_LE( v.dimension_0() * - v.dimension_1() * - v.dimension_2() * - v.dimension_3() * - v.dimension_4() * - v.dimension_5() * - v.dimension_6() * - v.dimension_7() + ASSERT_EQ( v.extent(0), ( 0 < ViewType::rank ? TestViewMapOperator<ViewType>::N0 : 1 ) ); + ASSERT_EQ( v.extent(1), ( 1 < ViewType::rank ? TestViewMapOperator<ViewType>::N1 : 1 ) ); + ASSERT_EQ( v.extent(2), ( 2 < ViewType::rank ? TestViewMapOperator<ViewType>::N2 : 1 ) ); + ASSERT_EQ( v.extent(3), ( 3 < ViewType::rank ? TestViewMapOperator<ViewType>::N3 : 1 ) ); + ASSERT_EQ( v.extent(4), ( 4 < ViewType::rank ? TestViewMapOperator<ViewType>::N4 : 1 ) ); + ASSERT_EQ( v.extent(5), ( 5 < ViewType::rank ? TestViewMapOperator<ViewType>::N5 : 1 ) ); + ASSERT_EQ( v.extent(6), ( 6 < ViewType::rank ? TestViewMapOperator<ViewType>::N6 : 1 ) ); + ASSERT_EQ( v.extent(7), ( 7 < ViewType::rank ? TestViewMapOperator<ViewType>::N7 : 1 ) ); + + ASSERT_LE( v.extent(0) * + v.extent(1) * + v.extent(2) * + v.extent(3) * + v.extent(4) * + v.extent(5) * + v.extent(6) * + v.extent(7) , v.span() ); long error_count; - Kokkos::RangePolicy< typename ViewType::execution_space > range( 0, v.dimension_0() ); + Kokkos::RangePolicy< typename ViewType::execution_space > range( 0, v.extent(0) ); Kokkos::parallel_reduce( range, *this, error_count ); ASSERT_EQ( 0, error_count ); } diff --git a/lib/kokkos/core/unit_test/TestViewMapping_b.hpp b/lib/kokkos/core/unit_test/TestViewMapping_b.hpp index d0cbfe9e7d4449f6897798d1cd09d714603c96dc..7c7807f60d5dccf30b0eb90e79015a2a42eccaab 100644 --- a/lib/kokkos/core/unit_test/TestViewMapping_b.hpp +++ b/lib/kokkos/core/unit_test/TestViewMapping_b.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestViewMapping_subview.hpp b/lib/kokkos/core/unit_test/TestViewMapping_subview.hpp index d6db548665f6771ee256cf2ac029aaef839cbb85..2414276161cdb789210fd01947b6cae42f1e2aa3 100644 --- a/lib/kokkos/core/unit_test/TestViewMapping_subview.hpp +++ b/lib/kokkos/core/unit_test/TestViewMapping_subview.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -104,16 +104,16 @@ struct TestViewMappingSubview TestViewMappingSubview() : Aa( "Aa", AN ) - , Ab( Kokkos::Experimental::subview( Aa, std::pair< int, int >( 1, AN - 1 ) ) ) + , Ab( Kokkos::subview( Aa, std::pair< int, int >( 1, AN - 1 ) ) ) , Ac( Aa, std::pair< int, int >( 1, AN - 1 ) ) , Ba( "Ba", BN0, BN1, BN2 ) - , Bb( Kokkos::Experimental::subview( Ba + , Bb( Kokkos::subview( Ba , std::pair< int, int >( 1, BN0 - 1 ) , std::pair< int, int >( 1, BN1 - 1 ) , std::pair< int, int >( 1, BN2 - 1 ) ) ) , Ca( "Ca", CN0, CN1, CN2 ) - , Cb( Kokkos::Experimental::subview( Ca + , Cb( Kokkos::subview( Ca , std::pair< int, int >( 1, CN0 - 1 ) , std::pair< int, int >( 1, CN1 - 1 ) , std::pair< int, int >( 1, CN2 - 1 ) @@ -121,7 +121,7 @@ struct TestViewMappingSubview , 2 ) ) , Da( "Da", DN0, DN1, DN2 ) - , Db( Kokkos::Experimental::subview( Da + , Db( Kokkos::subview( Da , 1 , std::pair< int, int >( 1, DN1 - 1 ) , std::pair< int, int >( 1, DN2 - 1 ) @@ -133,7 +133,7 @@ struct TestViewMappingSubview KOKKOS_INLINE_FUNCTION void operator()( const int, long & error_count ) const { - auto Ad = Kokkos::Experimental::subview< Kokkos::MemoryUnmanaged >( Aa, Kokkos::pair< int, int >( 1, AN - 1 ) ); + auto Ad = Kokkos::subview< Kokkos::MemoryUnmanaged >( Aa, Kokkos::pair< int, int >( 1, AN - 1 ) ); for ( int i = 1; i < AN - 1; ++i ) if( & Aa[i] != & Ab[i - 1] ) ++error_count; for ( int i = 1; i < AN - 1; ++i ) if( & Aa[i] != & Ac[i - 1] ) ++error_count; @@ -167,34 +167,34 @@ struct TestViewMappingSubview TestViewMappingSubview< ExecSpace > self; - ASSERT_EQ( Aa.dimension_0(), AN ); - ASSERT_EQ( Ab.dimension_0(), AN - 2 ); - ASSERT_EQ( Ac.dimension_0(), AN - 2 ); - ASSERT_EQ( Ba.dimension_0(), BN0 ); - ASSERT_EQ( Ba.dimension_1(), BN1 ); - ASSERT_EQ( Ba.dimension_2(), BN2 ); - ASSERT_EQ( Bb.dimension_0(), BN0 - 2 ); - ASSERT_EQ( Bb.dimension_1(), BN1 - 2 ); - ASSERT_EQ( Bb.dimension_2(), BN2 - 2 ); - - ASSERT_EQ( Ca.dimension_0(), CN0 ); - ASSERT_EQ( Ca.dimension_1(), CN1 ); - ASSERT_EQ( Ca.dimension_2(), CN2 ); - ASSERT_EQ( Ca.dimension_3(), 13 ); - ASSERT_EQ( Ca.dimension_4(), 14 ); - ASSERT_EQ( Cb.dimension_0(), CN0 - 2 ); - ASSERT_EQ( Cb.dimension_1(), CN1 - 2 ); - ASSERT_EQ( Cb.dimension_2(), CN2 - 2 ); - - ASSERT_EQ( Da.dimension_0(), DN0 ); - ASSERT_EQ( Da.dimension_1(), DN1 ); - ASSERT_EQ( Da.dimension_2(), DN2 ); - ASSERT_EQ( Da.dimension_3(), DN3 ); - ASSERT_EQ( Da.dimension_4(), DN4 ); - - ASSERT_EQ( Db.dimension_0(), DN1 - 2 ); - ASSERT_EQ( Db.dimension_1(), DN2 - 2 ); - ASSERT_EQ( Db.dimension_2(), DN3 - 2 ); + ASSERT_EQ( Aa.extent(0), AN ); + ASSERT_EQ( Ab.extent(0), AN - 2 ); + ASSERT_EQ( Ac.extent(0), AN - 2 ); + ASSERT_EQ( Ba.extent(0), BN0 ); + ASSERT_EQ( Ba.extent(1), BN1 ); + ASSERT_EQ( Ba.extent(2), BN2 ); + ASSERT_EQ( Bb.extent(0), BN0 - 2 ); + ASSERT_EQ( Bb.extent(1), BN1 - 2 ); + ASSERT_EQ( Bb.extent(2), BN2 - 2 ); + + ASSERT_EQ( Ca.extent(0), CN0 ); + ASSERT_EQ( Ca.extent(1), CN1 ); + ASSERT_EQ( Ca.extent(2), CN2 ); + ASSERT_EQ( Ca.extent(3), 13 ); + ASSERT_EQ( Ca.extent(4), 14 ); + ASSERT_EQ( Cb.extent(0), CN0 - 2 ); + ASSERT_EQ( Cb.extent(1), CN1 - 2 ); + ASSERT_EQ( Cb.extent(2), CN2 - 2 ); + + ASSERT_EQ( Da.extent(0), DN0 ); + ASSERT_EQ( Da.extent(1), DN1 ); + ASSERT_EQ( Da.extent(2), DN2 ); + ASSERT_EQ( Da.extent(3), DN3 ); + ASSERT_EQ( Da.extent(4), DN4 ); + + ASSERT_EQ( Db.extent(0), DN1 - 2 ); + ASSERT_EQ( Db.extent(1), DN2 - 2 ); + ASSERT_EQ( Db.extent(2), DN3 - 2 ); ASSERT_EQ( Da.stride_1(), Db.stride_0() ); ASSERT_EQ( Da.stride_2(), Db.stride_1() ); diff --git a/lib/kokkos/core/unit_test/TestViewOfClass.hpp b/lib/kokkos/core/unit_test/TestViewOfClass.hpp index 8576d3042ed822eedadeb763fe286520d1cc31d2..7198b4c1400a0a9792192ea6b0642d89b456ee17 100644 --- a/lib/kokkos/core/unit_test/TestViewOfClass.hpp +++ b/lib/kokkos/core/unit_test/TestViewOfClass.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -62,14 +62,14 @@ public: NestedView & operator=( const Kokkos::View< int*, Space > & lhs ) { member = lhs; - if ( member.dimension_0() ) Kokkos::atomic_add( & member( 0 ), 1 ); + if ( member.extent(0) ) Kokkos::atomic_add( & member( 0 ), 1 ); return *this; } KOKKOS_INLINE_FUNCTION ~NestedView() { - if ( member.dimension_0() ) { + if ( member.extent(0) ) { Kokkos::atomic_add( & member( 0 ), -1 ); } } diff --git a/lib/kokkos/core/unit_test/TestViewSpaceAssign.hpp b/lib/kokkos/core/unit_test/TestViewSpaceAssign.hpp index 21ae92e93ccdc09c3e42057f706c7bec383239eb..ecec47d7ba179d5434aaa8dd4b2a9512de3c480e 100644 --- a/lib/kokkos/core/unit_test/TestViewSpaceAssign.hpp +++ b/lib/kokkos/core/unit_test/TestViewSpaceAssign.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/TestViewSubview.hpp b/lib/kokkos/core/unit_test/TestViewSubview.hpp index e4ea090e8075424c31e5484f70465f1af00f4619..207fbb148d14ba720d3f77d4d9d6718b424a355b 100644 --- a/lib/kokkos/core/unit_test/TestViewSubview.hpp +++ b/lib/kokkos/core/unit_test/TestViewSubview.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -99,7 +99,7 @@ struct fill_2D { KOKKOS_INLINE_FUNCTION void operator()( const int i ) const { - for ( int j = 0; j < static_cast< int >( a.dimension_1() ); j++ ) { + for ( int j = 0; j < static_cast< int >( a.extent(1) ); j++ ) { a( i, j ) = val; } } @@ -122,7 +122,7 @@ void test_auto_1d () typename mv_type::HostMirror X_h = Kokkos::create_mirror_view( X ); fill_2D< mv_type, Space > f1( X, ONE ); - Kokkos::parallel_for( X.dimension_0(), f1 ); + Kokkos::parallel_for( X.extent(0), f1 ); Kokkos::fence(); Kokkos::deep_copy( X_h, X ); for ( size_type j = 0; j < numCols; ++j ) { @@ -132,7 +132,7 @@ void test_auto_1d () } fill_2D< mv_type, Space > f2( X, 0.0 ); - Kokkos::parallel_for( X.dimension_0(), f2 ); + Kokkos::parallel_for( X.extent(0), f2 ); Kokkos::fence(); Kokkos::deep_copy( X_h, X ); for ( size_type j = 0; j < numCols; ++j ) { @@ -142,7 +142,7 @@ void test_auto_1d () } fill_2D< mv_type, Space > f3( X, TWO ); - Kokkos::parallel_for( X.dimension_0(), f3 ); + Kokkos::parallel_for( X.extent(0), f3 ); Kokkos::fence(); Kokkos::deep_copy( X_h, X ); for ( size_type j = 0; j < numCols; ++j ) { @@ -155,7 +155,7 @@ void test_auto_1d () auto X_j = Kokkos::subview( X, Kokkos::ALL, j ); fill_1D< decltype( X_j ), Space > f4( X_j, ZERO ); - Kokkos::parallel_for( X_j.dimension_0(), f4 ); + Kokkos::parallel_for( X_j.extent(0), f4 ); Kokkos::fence(); Kokkos::deep_copy( X_h, X ); for ( size_type i = 0; i < numRows; ++i ) { @@ -165,7 +165,7 @@ void test_auto_1d () for ( size_type jj = 0; jj < numCols; ++jj ) { auto X_jj = Kokkos::subview ( X, Kokkos::ALL, jj ); fill_1D< decltype( X_jj ), Space > f5( X_jj, ONE ); - Kokkos::parallel_for( X_jj.dimension_0(), f5 ); + Kokkos::parallel_for( X_jj.extent(0), f5 ); Kokkos::fence(); Kokkos::deep_copy( X_h, X ); for ( size_type i = 0; i < numRows; ++i ) { @@ -243,17 +243,17 @@ void test_left_0() if ( Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space >::accessible ) { view_static_8_type x_static_8( "x_static_left_8" ); - ASSERT_TRUE( x_static_8.is_contiguous() ); + ASSERT_TRUE( x_static_8.span_is_contiguous() ); Kokkos::View< int, Kokkos::LayoutLeft, Space > x0 = Kokkos::subview( x_static_8, 0, 0, 0, 0, 0, 0, 0, 0 ); - ASSERT_TRUE( x0.is_contiguous() ); + ASSERT_TRUE( x0.span_is_contiguous() ); ASSERT_TRUE( & x0() == & x_static_8( 0, 0, 0, 0, 0, 0, 0, 0 ) ); Kokkos::View< int*, Kokkos::LayoutLeft, Space > x1 = Kokkos::subview( x_static_8, Kokkos::pair< int, int >( 0, 2 ), 1, 2, 3, 0, 1, 2, 3 ); - ASSERT_TRUE( x1.is_contiguous() ); + ASSERT_TRUE( x1.span_is_contiguous() ); ASSERT_TRUE( & x1( 0 ) == & x_static_8( 0, 1, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & x1( 1 ) == & x_static_8( 1, 1, 2, 3, 0, 1, 2, 3 ) ); @@ -261,7 +261,7 @@ void test_left_0() Kokkos::subview( x_static_8, Kokkos::pair< int, int >( 0, 2 ), 1, 2, 3 , Kokkos::pair< int, int >( 0, 2 ), 1, 2, 3 ); - ASSERT_TRUE( ! x2.is_contiguous() ); + ASSERT_TRUE( ! x2.span_is_contiguous() ); ASSERT_TRUE( & x2( 0, 0 ) == & x_static_8( 0, 1, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & x2( 1, 0 ) == & x_static_8( 1, 1, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & x2( 0, 1 ) == & x_static_8( 0, 1, 2, 3, 1, 1, 2, 3 ) ); @@ -272,7 +272,7 @@ void test_left_0() Kokkos::subview( x_static_8, 1, Kokkos::pair< int, int >( 0, 2 ), 2, 3 , Kokkos::pair< int, int >( 0, 2 ), 1, 2, 3 ); - ASSERT_TRUE( ! sx2.is_contiguous() ); + ASSERT_TRUE( ! sx2.span_is_contiguous() ); ASSERT_TRUE( & sx2( 0, 0 ) == & x_static_8( 1, 0, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & sx2( 1, 0 ) == & x_static_8( 1, 1, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & sx2( 0, 1 ) == & x_static_8( 1, 0, 2, 3, 1, 1, 2, 3 ) ); @@ -285,12 +285,12 @@ void test_left_0() , 2, Kokkos::pair< int, int >( 2, 4 ) /* of [5] */ ); - ASSERT_TRUE( ! sx4.is_contiguous() ); + ASSERT_TRUE( ! sx4.span_is_contiguous() ); - for ( int i0 = 0; i0 < (int) sx4.dimension_0(); ++i0 ) - for ( int i1 = 0; i1 < (int) sx4.dimension_1(); ++i1 ) - for ( int i2 = 0; i2 < (int) sx4.dimension_2(); ++i2 ) - for ( int i3 = 0; i3 < (int) sx4.dimension_3(); ++i3 ) + for ( int i0 = 0; i0 < (int) sx4.extent(0); ++i0 ) + for ( int i1 = 0; i1 < (int) sx4.extent(1); ++i1 ) + for ( int i2 = 0; i2 < (int) sx4.extent(2); ++i2 ) + for ( int i3 = 0; i3 < (int) sx4.extent(3); ++i3 ) { ASSERT_TRUE( & sx4( i0, i1, i2, i3 ) == & x_static_8( 0, 0 + i0, 1, 1 + i1, 1, 0 + i2, 2, 2 + i3 ) ); } @@ -305,17 +305,17 @@ void test_left_1() if ( Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space >::accessible ) { view_type x8( "x_left_8", 2, 3, 4, 5 ); - ASSERT_TRUE( x8.is_contiguous() ); + ASSERT_TRUE( x8.span_is_contiguous() ); Kokkos::View< int, Kokkos::LayoutLeft, Space > x0 = Kokkos::subview( x8, 0, 0, 0, 0, 0, 0, 0, 0 ); - ASSERT_TRUE( x0.is_contiguous() ); + ASSERT_TRUE( x0.span_is_contiguous() ); ASSERT_TRUE( & x0() == & x8( 0, 0, 0, 0, 0, 0, 0, 0 ) ); Kokkos::View< int*, Kokkos::LayoutLeft, Space > x1 = Kokkos::subview( x8, Kokkos::pair< int, int >( 0, 2 ), 1, 2, 3, 0, 1, 2, 3 ); - ASSERT_TRUE( x1.is_contiguous() ); + ASSERT_TRUE( x1.span_is_contiguous() ); ASSERT_TRUE( & x1( 0 ) == & x8( 0, 1, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & x1( 1 ) == & x8( 1, 1, 2, 3, 0, 1, 2, 3 ) ); @@ -323,7 +323,7 @@ void test_left_1() Kokkos::subview( x8, Kokkos::pair< int, int >( 0, 2 ), 1, 2, 3 , Kokkos::pair< int, int >( 0, 2 ), 1, 2, 3 ); - ASSERT_TRUE( ! x2.is_contiguous() ); + ASSERT_TRUE( ! x2.span_is_contiguous() ); ASSERT_TRUE( & x2( 0, 0 ) == & x8( 0, 1, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & x2( 1, 0 ) == & x8( 1, 1, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & x2( 0, 1 ) == & x8( 0, 1, 2, 3, 1, 1, 2, 3 ) ); @@ -334,7 +334,7 @@ void test_left_1() Kokkos::subview( x8, 1, Kokkos::pair< int, int >( 0, 2 ), 2, 3 , Kokkos::pair< int, int >( 0, 2 ), 1, 2, 3 ); - ASSERT_TRUE( ! sx2.is_contiguous() ); + ASSERT_TRUE( ! sx2.span_is_contiguous() ); ASSERT_TRUE( & sx2( 0, 0 ) == & x8( 1, 0, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & sx2( 1, 0 ) == & x8( 1, 1, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & sx2( 0, 1 ) == & x8( 1, 0, 2, 3, 1, 1, 2, 3 ) ); @@ -347,12 +347,12 @@ void test_left_1() , 2, Kokkos::pair< int, int >( 2, 4 ) /* of [5] */ ); - ASSERT_TRUE( ! sx4.is_contiguous() ); + ASSERT_TRUE( ! sx4.span_is_contiguous() ); - for ( int i0 = 0; i0 < (int) sx4.dimension_0(); ++i0 ) - for ( int i1 = 0; i1 < (int) sx4.dimension_1(); ++i1 ) - for ( int i2 = 0; i2 < (int) sx4.dimension_2(); ++i2 ) - for ( int i3 = 0; i3 < (int) sx4.dimension_3(); ++i3 ) + for ( int i0 = 0; i0 < (int) sx4.extent(0); ++i0 ) + for ( int i1 = 0; i1 < (int) sx4.extent(1); ++i1 ) + for ( int i2 = 0; i2 < (int) sx4.extent(2); ++i2 ) + for ( int i3 = 0; i3 < (int) sx4.extent(3); ++i3 ) { ASSERT_TRUE( & sx4( i0, i1, i2, i3 ) == & x8( 0, 0 + i0, 1, 1 + i1, 1, 0 + i2, 2, 2 + i3 ) ); } @@ -367,17 +367,17 @@ void test_left_2() if ( Kokkos::Impl::SpaceAccessibility<Kokkos::HostSpace, typename Space::memory_space>::accessible ) { view_type x4( "x4", 2, 3, 4, 5 ); - ASSERT_TRUE( x4.is_contiguous() ); + ASSERT_TRUE( x4.span_is_contiguous() ); Kokkos::View< int, Kokkos::LayoutLeft, Space > x0 = Kokkos::subview( x4, 0, 0, 0, 0 ); - ASSERT_TRUE( x0.is_contiguous() ); + ASSERT_TRUE( x0.span_is_contiguous() ); ASSERT_TRUE( & x0() == & x4( 0, 0, 0, 0 ) ); Kokkos::View< int*, Kokkos::LayoutLeft, Space > x1 = Kokkos::subview( x4, Kokkos::pair< int, int >( 0, 2 ), 1, 2, 3 ); - ASSERT_TRUE( x1.is_contiguous() ); + ASSERT_TRUE( x1.span_is_contiguous() ); ASSERT_TRUE( & x1( 0 ) == & x4( 0, 1, 2, 3 ) ); ASSERT_TRUE( & x1( 1 ) == & x4( 1, 1, 2, 3 ) ); @@ -385,7 +385,7 @@ void test_left_2() Kokkos::subview( x4, Kokkos::pair< int, int >( 0, 2 ), 1 , Kokkos::pair< int, int >( 1, 3 ), 2 ); - ASSERT_TRUE( ! x2.is_contiguous() ); + ASSERT_TRUE( ! x2.span_is_contiguous() ); ASSERT_TRUE( & x2( 0, 0 ) == & x4( 0, 1, 1, 2 ) ); ASSERT_TRUE( & x2( 1, 0 ) == & x4( 1, 1, 1, 2 ) ); ASSERT_TRUE( & x2( 0, 1 ) == & x4( 0, 1, 2, 2 ) ); @@ -396,7 +396,7 @@ void test_left_2() Kokkos::subview( x4, 1, Kokkos::pair< int, int >( 0, 2 ) , 2, Kokkos::pair< int, int >( 1, 4 ) ); - ASSERT_TRUE( ! sx2.is_contiguous() ); + ASSERT_TRUE( ! sx2.span_is_contiguous() ); ASSERT_TRUE( & sx2( 0, 0 ) == & x4( 1, 0, 2, 1 ) ); ASSERT_TRUE( & sx2( 1, 0 ) == & x4( 1, 1, 2, 1 ) ); ASSERT_TRUE( & sx2( 0, 1 ) == & x4( 1, 0, 2, 2 ) ); @@ -411,12 +411,12 @@ void test_left_2() , Kokkos::pair< int, int >( 2, 4 ) /* of [5] */ ); - ASSERT_TRUE( ! sx4.is_contiguous() ); + ASSERT_TRUE( ! sx4.span_is_contiguous() ); - for ( int i0 = 0; i0 < (int) sx4.dimension_0(); ++i0 ) - for ( int i1 = 0; i1 < (int) sx4.dimension_1(); ++i1 ) - for ( int i2 = 0; i2 < (int) sx4.dimension_2(); ++i2 ) - for ( int i3 = 0; i3 < (int) sx4.dimension_3(); ++i3 ) + for ( int i0 = 0; i0 < (int) sx4.extent(0); ++i0 ) + for ( int i1 = 0; i1 < (int) sx4.extent(1); ++i1 ) + for ( int i2 = 0; i2 < (int) sx4.extent(2); ++i2 ) + for ( int i3 = 0; i3 < (int) sx4.extent(3); ++i3 ) { ASSERT_TRUE( & sx4( i0, i1, i2, i3 ) == & x4( 1 + i0, 1 + i1, 0 + i2, 2 + i3 ) ); } @@ -431,26 +431,26 @@ void test_left_3() if ( Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space >::accessible ) { view_type xm( "x4", 10, 5 ); - ASSERT_TRUE( xm.is_contiguous() ); + ASSERT_TRUE( xm.span_is_contiguous() ); Kokkos::View< int, Kokkos::LayoutLeft, Space > x0 = Kokkos::subview( xm, 5, 3 ); - ASSERT_TRUE( x0.is_contiguous() ); + ASSERT_TRUE( x0.span_is_contiguous() ); ASSERT_TRUE( & x0() == & xm( 5, 3 ) ); Kokkos::View< int*, Kokkos::LayoutLeft, Space > x1 = Kokkos::subview( xm, Kokkos::ALL, 3 ); - ASSERT_TRUE( x1.is_contiguous() ); - for ( int i = 0; i < int( xm.dimension_0() ); ++i ) { + ASSERT_TRUE( x1.span_is_contiguous() ); + for ( int i = 0; i < int( xm.extent(0) ); ++i ) { ASSERT_TRUE( & x1( i ) == & xm( i, 3 ) ); } Kokkos::View< int**, Kokkos::LayoutLeft, Space > x2 = Kokkos::subview( xm, Kokkos::pair< int, int >( 1, 9 ), Kokkos::ALL ); - ASSERT_TRUE( ! x2.is_contiguous() ); - for ( int j = 0; j < int( x2.dimension_1() ); ++j ) - for ( int i = 0; i < int( x2.dimension_0() ); ++i ) + ASSERT_TRUE( ! x2.span_is_contiguous() ); + for ( int j = 0; j < int( x2.extent(1) ); ++j ) + for ( int i = 0; i < int( x2.extent(0) ); ++i ) { ASSERT_TRUE( & x2( i, j ) == & xm( 1 + i, j ) ); } @@ -458,9 +458,9 @@ void test_left_3() Kokkos::View< int**, Kokkos::LayoutLeft, Space > x2c = Kokkos::subview( xm, Kokkos::ALL, std::pair< int, int >( 2, 4 ) ); - ASSERT_TRUE( x2c.is_contiguous() ); - for ( int j = 0; j < int( x2c.dimension_1() ); ++j ) - for ( int i = 0; i < int( x2c.dimension_0() ); ++i ) + ASSERT_TRUE( x2c.span_is_contiguous() ); + for ( int j = 0; j < int( x2c.extent(1) ); ++j ) + for ( int i = 0; i < int( x2c.extent(0) ); ++i ) { ASSERT_TRUE( & x2c( i, j ) == & xm( i, 2 + j ) ); } @@ -468,14 +468,14 @@ void test_left_3() Kokkos::View< int**, Kokkos::LayoutLeft, Space > x2_n1 = Kokkos::subview( xm, std::pair< int, int >( 1, 1 ), Kokkos::ALL ); - ASSERT_TRUE( x2_n1.dimension_0() == 0 ); - ASSERT_TRUE( x2_n1.dimension_1() == xm.dimension_1() ); + ASSERT_TRUE( x2_n1.extent(0) == 0 ); + ASSERT_TRUE( x2_n1.extent(1) == xm.extent(1) ); Kokkos::View< int**, Kokkos::LayoutLeft, Space > x2_n2 = Kokkos::subview( xm, Kokkos::ALL, std::pair< int, int >( 1, 1 ) ); - ASSERT_TRUE( x2_n2.dimension_0() == xm.dimension_0() ); - ASSERT_TRUE( x2_n2.dimension_1() == 0 ); + ASSERT_TRUE( x2_n2.extent(0) == xm.extent(0) ); + ASSERT_TRUE( x2_n2.extent(1) == 0 ); } } @@ -496,7 +496,7 @@ void test_right_0() Kokkos::View< int*, Kokkos::LayoutRight, Space > x1 = Kokkos::subview( x_static_8, 0, 1, 2, 3, 0, 1, 2, Kokkos::pair< int, int >( 1, 3 ) ); - ASSERT_TRUE( x1.dimension_0() == 2 ); + ASSERT_TRUE( x1.extent(0) == 2 ); ASSERT_TRUE( & x1( 0 ) == & x_static_8( 0, 1, 2, 3, 0, 1, 2, 1 ) ); ASSERT_TRUE( & x1( 1 ) == & x_static_8( 0, 1, 2, 3, 0, 1, 2, 2 ) ); @@ -504,8 +504,8 @@ void test_right_0() Kokkos::subview( x_static_8, 0, 1, 2, Kokkos::pair< int, int >( 1, 3 ) , 0, 1, 2, Kokkos::pair< int, int >( 1, 3 ) ); - ASSERT_TRUE( x2.dimension_0() == 2 ); - ASSERT_TRUE( x2.dimension_1() == 2 ); + ASSERT_TRUE( x2.extent(0) == 2 ); + ASSERT_TRUE( x2.extent(1) == 2 ); ASSERT_TRUE( & x2( 0, 0 ) == & x_static_8( 0, 1, 2, 1, 0, 1, 2, 1 ) ); ASSERT_TRUE( & x2( 1, 0 ) == & x_static_8( 0, 1, 2, 2, 0, 1, 2, 1 ) ); ASSERT_TRUE( & x2( 0, 1 ) == & x_static_8( 0, 1, 2, 1, 0, 1, 2, 2 ) ); @@ -516,8 +516,8 @@ void test_right_0() Kokkos::subview( x_static_8, 1, Kokkos::pair< int, int >( 0, 2 ), 2, 3 , Kokkos::pair< int, int >( 0, 2 ), 1, 2, 3 ); - ASSERT_TRUE( sx2.dimension_0() == 2 ); - ASSERT_TRUE( sx2.dimension_1() == 2 ); + ASSERT_TRUE( sx2.extent(0) == 2 ); + ASSERT_TRUE( sx2.extent(1) == 2 ); ASSERT_TRUE( & sx2( 0, 0 ) == & x_static_8( 1, 0, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & sx2( 1, 0 ) == & x_static_8( 1, 1, 2, 3, 0, 1, 2, 3 ) ); ASSERT_TRUE( & sx2( 0, 1 ) == & x_static_8( 1, 0, 2, 3, 1, 1, 2, 3 ) ); @@ -530,14 +530,14 @@ void test_right_0() , 2, Kokkos::pair< int, int >( 2, 4 ) /* of [5] */ ); - ASSERT_TRUE( sx4.dimension_0() == 2 ); - ASSERT_TRUE( sx4.dimension_1() == 2 ); - ASSERT_TRUE( sx4.dimension_2() == 2 ); - ASSERT_TRUE( sx4.dimension_3() == 2 ); - for ( int i0 = 0; i0 < (int) sx4.dimension_0(); ++i0 ) - for ( int i1 = 0; i1 < (int) sx4.dimension_1(); ++i1 ) - for ( int i2 = 0; i2 < (int) sx4.dimension_2(); ++i2 ) - for ( int i3 = 0; i3 < (int) sx4.dimension_3(); ++i3 ) + ASSERT_TRUE( sx4.extent(0) == 2 ); + ASSERT_TRUE( sx4.extent(1) == 2 ); + ASSERT_TRUE( sx4.extent(2) == 2 ); + ASSERT_TRUE( sx4.extent(3) == 2 ); + for ( int i0 = 0; i0 < (int) sx4.extent(0); ++i0 ) + for ( int i1 = 0; i1 < (int) sx4.extent(1); ++i1 ) + for ( int i2 = 0; i2 < (int) sx4.extent(2); ++i2 ) + for ( int i3 = 0; i3 < (int) sx4.extent(3); ++i3 ) { ASSERT_TRUE( & sx4( i0, i1, i2, i3 ) == & x_static_8( 0, 0 + i0, 1, 1 + i1, 1, 0 + i2, 2, 2 + i3 ) ); } @@ -588,10 +588,10 @@ void test_right_1() , 2, Kokkos::pair< int, int >( 2, 4 ) /* of [5] */ ); - for ( int i0 = 0; i0 < (int) sx4.dimension_0(); ++i0 ) - for ( int i1 = 0; i1 < (int) sx4.dimension_1(); ++i1 ) - for ( int i2 = 0; i2 < (int) sx4.dimension_2(); ++i2 ) - for ( int i3 = 0; i3 < (int) sx4.dimension_3(); ++i3 ) + for ( int i0 = 0; i0 < (int) sx4.extent(0); ++i0 ) + for ( int i1 = 0; i1 < (int) sx4.extent(1); ++i1 ) + for ( int i2 = 0; i2 < (int) sx4.extent(2); ++i2 ) + for ( int i3 = 0; i3 < (int) sx4.extent(3); ++i3 ) { ASSERT_TRUE( & sx4( i0, i1, i2, i3 ) == & x8( 0, 0 + i0, 1, 1 + i1, 1, 0 + i2, 2, 2 + i3 ) ); } @@ -606,35 +606,35 @@ void test_right_3() if ( Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space >::accessible ) { view_type xm( "x4", 10, 5 ); - ASSERT_TRUE( xm.is_contiguous() ); + ASSERT_TRUE( xm.span_is_contiguous() ); Kokkos::View< int, Kokkos::LayoutRight, Space > x0 = Kokkos::subview( xm, 5, 3 ); - ASSERT_TRUE( x0.is_contiguous() ); + ASSERT_TRUE( x0.span_is_contiguous() ); ASSERT_TRUE( & x0() == & xm( 5, 3 ) ); Kokkos::View< int*, Kokkos::LayoutRight, Space > x1 = Kokkos::subview( xm, 3, Kokkos::ALL ); - ASSERT_TRUE( x1.is_contiguous() ); - for ( int i = 0; i < int( xm.dimension_1() ); ++i ) { + ASSERT_TRUE( x1.span_is_contiguous() ); + for ( int i = 0; i < int( xm.extent(1) ); ++i ) { ASSERT_TRUE( & x1( i ) == & xm( 3, i ) ); } Kokkos::View< int**, Kokkos::LayoutRight, Space > x2c = Kokkos::subview( xm, Kokkos::pair< int, int >( 1, 9 ), Kokkos::ALL ); - ASSERT_TRUE( x2c.is_contiguous() ); - for ( int j = 0; j < int( x2c.dimension_1() ); ++j ) - for ( int i = 0; i < int( x2c.dimension_0() ); ++i ) { + ASSERT_TRUE( x2c.span_is_contiguous() ); + for ( int j = 0; j < int( x2c.extent(1) ); ++j ) + for ( int i = 0; i < int( x2c.extent(0) ); ++i ) { ASSERT_TRUE( & x2c( i, j ) == & xm( 1 + i, j ) ); } Kokkos::View< int**, Kokkos::LayoutRight, Space > x2 = Kokkos::subview( xm, Kokkos::ALL, std::pair< int, int >( 2, 4 ) ); - ASSERT_TRUE( ! x2.is_contiguous() ); - for ( int j = 0; j < int( x2.dimension_1() ); ++j ) - for ( int i = 0; i < int( x2.dimension_0() ); ++i ) + ASSERT_TRUE( ! x2.span_is_contiguous() ); + for ( int j = 0; j < int( x2.extent(1) ); ++j ) + for ( int i = 0; i < int( x2.extent(0) ); ++i ) { ASSERT_TRUE( & x2( i, j ) == & xm( i, 2 + j ) ); } @@ -642,14 +642,14 @@ void test_right_3() Kokkos::View< int**, Kokkos::LayoutRight, Space > x2_n1 = Kokkos::subview( xm, std::pair< int, int >( 1, 1 ), Kokkos::ALL ); - ASSERT_TRUE( x2_n1.dimension_0() == 0 ); - ASSERT_TRUE( x2_n1.dimension_1() == xm.dimension_1() ); + ASSERT_TRUE( x2_n1.extent(0) == 0 ); + ASSERT_TRUE( x2_n1.extent(1) == xm.extent(1) ); Kokkos::View< int**, Kokkos::LayoutRight, Space > x2_n2 = Kokkos::subview( xm, Kokkos::ALL, std::pair< int, int >( 1, 1 ) ); - ASSERT_TRUE( x2_n2.dimension_0() == xm.dimension_0() ); - ASSERT_TRUE( x2_n2.dimension_1() == 0 ); + ASSERT_TRUE( x2_n2.extent(0) == xm.extent(0) ); + ASSERT_TRUE( x2_n2.extent(1) == 0 ); } } @@ -1091,16 +1091,16 @@ struct FillView_3D { void operator()( const int & ii ) const { const int i = std::is_same< Layout, Kokkos::LayoutLeft >::value - ? ii % a.dimension_0() - : ii / ( a.dimension_1() * a.dimension_2() ); + ? ii % a.extent(0) + : ii / ( a.extent(1) * a.extent(2) ); const int j = std::is_same< Layout, Kokkos::LayoutLeft >::value - ? ( ii / a.dimension_0() ) % a.dimension_1() - : ( ii / a.dimension_2() ) % a.dimension_1(); + ? ( ii / a.extent(0) ) % a.extent(1) + : ( ii / a.extent(2) ) % a.extent(1); const int k = std::is_same< Layout, Kokkos::LayoutRight >::value - ? ii / ( a.dimension_0() * a.dimension_1() ) - : ii % a.dimension_2(); + ? ii / ( a.extent(0) * a.extent(1) ) + : ii % a.extent(2); a( i, j, k ) = 1000000 * i + 1000 * j + k; } @@ -1113,20 +1113,20 @@ struct FillView_4D { KOKKOS_INLINE_FUNCTION void operator()( const int & ii ) const { const int i = std::is_same< Layout, Kokkos::LayoutLeft >::value - ? ii % a.dimension_0() - : ii / ( a.dimension_1() * a.dimension_2() * a.dimension_3() ); + ? ii % a.extent(0) + : ii / ( a.extent(1) * a.extent(2) * a.extent(3) ); const int j = std::is_same< Layout, Kokkos::LayoutLeft >::value - ? ( ii / a.dimension_0() ) % a.dimension_1() - : ( ii / ( a.dimension_2() * a.dimension_3() ) % a.dimension_1() ); + ? ( ii / a.extent(0) ) % a.extent(1) + : ( ii / ( a.extent(2) * a.extent(3) ) % a.extent(1) ); const int k = std::is_same< Layout, Kokkos::LayoutRight >::value - ? ( ii / ( a.dimension_0() * a.dimension_1() ) ) % a.dimension_2() - : ( ii / a.dimension_3() ) % a.dimension_2(); + ? ( ii / ( a.extent(0) * a.extent(1) ) ) % a.extent(2) + : ( ii / a.extent(3) ) % a.extent(2); const int l = std::is_same< Layout, Kokkos::LayoutRight >::value - ? ii / ( a.dimension_0() * a.dimension_1() * a.dimension_2() ) - : ii % a.dimension_3(); + ? ii / ( a.extent(0) * a.extent(1) * a.extent(2) ) + : ii % a.extent(3); a( i, j, k, l ) = 1000000 * i + 10000 * j + 100 * k + l; } @@ -1142,16 +1142,16 @@ struct CheckSubviewCorrectness_3D_3D { void operator()( const int & ii ) const { const int i = std::is_same< Layout, Kokkos::LayoutLeft >::value - ? ii % b.dimension_0() - : ii / ( b.dimension_1() * b.dimension_2() ); + ? ii % b.extent(0) + : ii / ( b.extent(1) * b.extent(2) ); const int j = std::is_same< Layout, Kokkos::LayoutLeft >::value - ? ( ii / b.dimension_0() ) % b.dimension_1() - : ( ii / b.dimension_2() ) % b.dimension_1(); + ? ( ii / b.extent(0) ) % b.extent(1) + : ( ii / b.extent(2) ) % b.extent(1); const int k = std::is_same< Layout, Kokkos::LayoutRight >::value - ? ii / ( b.dimension_0() * b.dimension_1() ) - : ii % b.dimension_2(); + ? ii / ( b.extent(0) * b.extent(1) ) + : ii % b.extent(2); if ( a( i + offset_0, j, k + offset_2 ) != b( i, j, k ) ) { Kokkos::abort( "Error: check_subview_correctness 3D-3D (LayoutLeft -> LayoutLeft or LayoutRight -> LayoutRight)" ); @@ -1168,16 +1168,16 @@ struct CheckSubviewCorrectness_3D_4D { KOKKOS_INLINE_FUNCTION void operator()( const int & ii ) const { const int i = std::is_same< Layout, Kokkos::LayoutLeft >::value - ? ii % b.dimension_0() - : ii / ( b.dimension_1() * b.dimension_2() ); + ? ii % b.extent(0) + : ii / ( b.extent(1) * b.extent(2) ); const int j = std::is_same< Layout, Kokkos::LayoutLeft >::value - ? ( ii / b.dimension_0() ) % b.dimension_1() - : ( ii / b.dimension_2() ) % b.dimension_1(); + ? ( ii / b.extent(0) ) % b.extent(1) + : ( ii / b.extent(2) ) % b.extent(1); const int k = std::is_same< Layout, Kokkos::LayoutRight >::value - ? ii / ( b.dimension_0() * b.dimension_1() ) - : ii % b.dimension_2(); + ? ii / ( b.extent(0) * b.extent(1) ) + : ii % b.extent(2); int i0, i1, i2, i3; @@ -1306,7 +1306,7 @@ struct TestUnmanagedSubviewReset { auto sub_a = Kokkos::subview(a,0,Kokkos::ALL,Kokkos::ALL,Kokkos::ALL); - for ( int i = 0 ; i < int(a.dimension(0)) ; ++i ) { + for ( int i = 0 ; i < int(a.extent(0)) ; ++i ) { sub_a.assign_data( & a(i,0,0,0) ); if ( & sub_a(1,1,1) != & a(i,1,1,1) ) { Kokkos::abort("TestUnmanagedSubviewReset"); diff --git a/lib/kokkos/core/unit_test/TestWorkGraph.hpp b/lib/kokkos/core/unit_test/TestWorkGraph.hpp index 37483a54607a81d6cd1a1ce8c01270db146bd4fa..b7bbb2759fa9c77bf80d9548e2fe4cb7b0e98386 100644 --- a/lib/kokkos/core/unit_test/TestWorkGraph.hpp +++ b/lib/kokkos/core/unit_test/TestWorkGraph.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/UnitTestMain.cpp b/lib/kokkos/core/unit_test/UnitTestMain.cpp index a7dc7c4973c4930239b3e0689ed85435ff80c5f1..5f9091eced47c420c1055c4826dbc0025bd23ca2 100644 --- a/lib/kokkos/core/unit_test/UnitTestMain.cpp +++ b/lib/kokkos/core/unit_test/UnitTestMain.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/UnitTestMainInit.cpp b/lib/kokkos/core/unit_test/UnitTestMainInit.cpp index 62a01e9033eae9ca9b1f4f260d92efeda66ff8b2..82c8ee89958d1a320a66e6e9ad31163e359ed919 100644 --- a/lib/kokkos/core/unit_test/UnitTestMainInit.cpp +++ b/lib/kokkos/core/unit_test/UnitTestMainInit.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/UnitTest_PushFinalizeHook.cpp b/lib/kokkos/core/unit_test/UnitTest_PushFinalizeHook.cpp new file mode 100644 index 0000000000000000000000000000000000000000..97a7f9df26261e4a6bebfc421aa53ef98c683ed7 --- /dev/null +++ b/lib/kokkos/core/unit_test/UnitTest_PushFinalizeHook.cpp @@ -0,0 +1,139 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <cstdlib> +#include <exception> +#include <iostream> +#include <sstream> +#include <Kokkos_Core.hpp> + +namespace { // (anonymous) + +// Output for the finalize hooks. Use this to make sure that all the +// hooks ran, and that they ran in the correct order. +std::ostringstream hookOutput; + +const char hook1str[] = "Behold, I am Hook 1; first pushed, last to be called."; +const char hook2str[] = "Yea verily, I am Hook 2."; +const char hook3str[] = "Indeed, I am Hook 3."; +const char hook4str[] = "Last but not least, I am Hook 4."; + +} // namespace (anonymous) + +// Don't just have all the hooks print the same thing except for a +// number. Have them print different things, so we can detect +// interleaving. The hooks need to run sequentially, in LIFO order. +// Also, make sure that the function accepts at least the following +// kinds of hooks: +// +// 1. A plain old function that takes no arguments and returns nothing. +// 2. Lambda, that can be assigned to std::function<void()> +// 3. An actual std::function<void()> +// 4. A named object with operator(). This is what C++ programmers +// unfortunately like to call "functor," even though this word +// means something different in other languages. + +void hook1 () { + hookOutput << hook1str << std::endl; +} + +struct Hook4 { + void operator () () const { + hookOutput << hook4str << std::endl; + } +}; + +int main( int argc, char *argv[] ) { + using std::cout; + using std::endl; + + const std::string expectedOutput ([] { + std::ostringstream os; + os << hook4str << endl + << hook3str << endl + << hook2str << endl + << hook1str << endl; + return os.str(); + }()); + + Kokkos::initialize(argc, argv); + + Kokkos::push_finalize_hook(hook1); // plain old function + Kokkos::push_finalize_hook ([] { + hookOutput << hook2str << endl; + }); // lambda + std::function<void()> hook3 = [] { + hookOutput << hook3str << endl; + }; + Kokkos::push_finalize_hook(hook3); // actual std::function + Hook4 hook4; + Kokkos::push_finalize_hook(hook4); // function object instance + + // This should invoke the finalize hooks in reverse order. + // Furthermore, it should not throw an exception. + try { + Kokkos::finalize(); + } + catch (std::exception& e) { + cout << "FAILED: Kokkos::finalize threw an exception: " << e.what() << endl; + return EXIT_FAILURE; + } + catch (...) { + cout << "FAILED: Kokkos::finalize threw an exception whose base class " + "is not std::exception." << endl; + return EXIT_FAILURE; + } + + const bool success = (hookOutput.str() == expectedOutput); + if (success) { + cout << "SUCCESS" << endl; + } + else { + cout << "FAILED:" << endl + << " Expected output:" << endl + << expectedOutput << endl + << " Actual output:" << endl + << hookOutput.str() << endl; + } + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/lib/kokkos/core/unit_test/UnitTest_PushFinalizeHook_terminate.cpp b/lib/kokkos/core/unit_test/UnitTest_PushFinalizeHook_terminate.cpp new file mode 100644 index 0000000000000000000000000000000000000000..50b7a3f2850a1d8518c22aad064e5203d02c6a52 --- /dev/null +++ b/lib/kokkos/core/unit_test/UnitTest_PushFinalizeHook_terminate.cpp @@ -0,0 +1,86 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <cstdlib> +#include <iostream> +#include <exception> +#include <Kokkos_Core.hpp> + +// If any of the finalize hooks given to Kokkos::push_finalize_hook +// throws but does not catch an exception, make sure that +// Kokkos::finalize calls std::terminate. + +namespace { // (anonymous) + +// If you change this, change CMakeLists.txt in this directory too! +// I verified that changing this string makes the test fail. +const char my_terminate_str[] = "PASSED: I am the custom std::terminate handler."; + +// Tell compilers not to complain that this function doesn't return. +[[ noreturn ]] void my_terminate_handler () +{ + std::cerr << my_terminate_str << std::endl; + std::abort(); // terminate handlers normally would end by calling this +} + +} // namespace (anonymous) + +int main(int argc, char *argv[]) +{ + // If std::terminate is called, it will call my_terminate_handler. + std::set_terminate (my_terminate_handler); + + Kokkos::initialize(argc, argv); + Kokkos::push_finalize_hook([] { + throw std::runtime_error ("I am an uncaught exception!"); + }); + + // This should call std::terminate, which in turn will call + // my_terminate_handler above. That will print the message that + // makes this test count as passed. + Kokkos::finalize(); + + // The test actually failed if we got to this point. + std::cerr << "FAILED to call std::terminate!" << std::endl; + return EXIT_FAILURE; +} diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_Category.hpp b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_Category.hpp index 8c69933e2bf546338726b2e7504d0a28c8bc6c26..98191be7be26c39a7bed2be9b419039320b99dd6 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_Category.hpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_SharedAlloc.cpp b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_SharedAlloc.cpp index 6e2f7dd597b8ba7e24c0fb7130d4c49af339b317..8a8a758e67cc03cb5d14f9327c73707685e45775 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_SharedAlloc.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_SharedAlloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewAPI.cpp b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewAPI.cpp index cae49fd3ef1a520678c1686585554c6ca563c665..2515794de718e4d9376d087ba84bfcf5203be6db 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewAPI.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewAPI.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_a.cpp b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_a.cpp index 0af34336b80c3481810a33eb6d448b120d6fb82f..21ed986b7f0454570301b3f407c6e3d6f33e04f7 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_a.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_b.cpp b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_b.cpp index cf8d3c2b975bfca0f35514c02345d93abc452e3f..3024cf6e41eb1889ac02e0fc8b5006601fffb96f 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_b.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_subview.cpp b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_subview.cpp index 207d162d7e28d13271c14a06e6aed8df646858a0..56c1ee013da0473cf74c0ec11c9aad693689bac1 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_subview.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaHostPinned_ViewMapping_subview.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_Category.hpp b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_Category.hpp index 15203588d1b91e910f70f576d52b995e0be251e3..34b528d04ef550aa97bdf610647ead1f92cfb170 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_Category.hpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_SharedAlloc.cpp b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_SharedAlloc.cpp index 9aab558042e5f7799f81256f34fb6aa4abfd62d7..57a0848527056222c8fd63e521f2c4b4b1646b9a 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_SharedAlloc.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_SharedAlloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewAPI.cpp b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewAPI.cpp index a4e5528a15f0157b19a716c335399c669943b356..e3a632619e755314eb799dfe3cb37cb63f498c28 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewAPI.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewAPI.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_a.cpp b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_a.cpp index 035a8a3d3b0b088124ea001d4ecf4e268c3396a7..5be4404c9e32294c2040ed7cc2ac7f40916badc0 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_a.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_b.cpp b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_b.cpp index 776a3acfca8ed72cc9945f040ed98265d97f3bff..2664c472e6b5157969dc12ba45570da3aa3deba2 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_b.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_subview.cpp b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_subview.cpp index 969d9a42176e452e41aced38610892cb4c953335..c08e00ba4900324bab6915d6c706941d3d296ae7 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_subview.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCudaUVM_ViewMapping_subview.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_AtomicOperations.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_AtomicOperations.cpp index 0922c7991582e80a13c1c5aa2fa7e1fd497cd1ac..e20683aa827d94ed3e84923042135475d11b22ee 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_AtomicOperations.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_AtomicOperations.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_AtomicViews.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_AtomicViews.cpp index 999dab9a06238487620fed4be5de444af81ae521..debbc10ea77b09d21cff090cd43ef088fbc5f394 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_AtomicViews.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_AtomicViews.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Atomics.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Atomics.cpp index 9e05a0f67695803bcc9878fe0e907970f718e7a9..1875143f320438d77850ece2df73442ea58e1151 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Atomics.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Atomics.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Category.hpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Category.hpp index a52438a9c80a57c383462e1f877e0d0c9df43289..45ea9dcf9481ed50a6644c8257c4f45960f58a88 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Category.hpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Complex.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Complex.cpp index ff4b2e1d8563adc4d1083e6f96d9526f82f7fb1d..7c92f111fcc51e713b701d835d20ec3112d97ee4 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Complex.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Complex.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Crs.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Crs.cpp index a90e88933e12e5b9e0ac899e401a9958ab7d0d8d..98f5e3793a91e07a498ed4de6b8841681275ea3d 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Crs.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Crs.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Init.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Init.cpp index d5e89625eddb83abb3c31f1ddab61ffc227e91c2..97e2867ddc05f8a4bb3197fca88c19b850b18d76 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Init.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Init.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_InterOp.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_InterOp.cpp new file mode 100644 index 0000000000000000000000000000000000000000..963a7194b3b89b17b18181d21597cfb7a38d968e --- /dev/null +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_InterOp.cpp @@ -0,0 +1,85 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <Kokkos_Core.hpp> +#include <cuda/TestCuda_Category.hpp> + +namespace Test { + +__global__ void offset(int* p) { + int idx = blockIdx.x*blockDim.x + threadIdx.x; + if(idx<100) { + p[idx]+=idx; + } +} + +// Test whether allocations survive Kokkos initialize/finalize if done via Raw Cuda. +TEST_F( cuda, raw_cuda_interop ) +{ + int* p; + cudaMalloc(&p,sizeof(int)*100); + Kokkos::InitArguments arguments{-1,-1,-1, false}; + Kokkos::initialize(arguments); + + Kokkos::View<int*,Kokkos::MemoryTraits<Kokkos::Unmanaged>> + v(p,100); + Kokkos::deep_copy(v,5); + + Kokkos::finalize(); + + offset<<<100,64>>>(p); + CUDA_SAFE_CALL( cudaDeviceSynchronize()); + + int* h_p = new int[100]; + cudaMemcpy( h_p , p , sizeof(int)*100 , cudaMemcpyDefault ); + CUDA_SAFE_CALL( cudaDeviceSynchronize()); + int64_t sum = 0; + int64_t sum_expect = 0; + for(int i=0; i<100; i++) { + sum += h_p[i]; + sum_expect += 5+i; + } + + ASSERT_EQ(sum,sum_expect); +} +} diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_MDRange.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_MDRange.cpp index a246fcce49f2d901f91cee4f55906b867bba43e7..90a7b33f96318eb5d25dacede258c1b6a5886a6b 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_MDRange.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_MDRange.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp index fa6722615c875b6a026e0f992ad8290f2c2c0058..f63409da29ccd1975dbed248a54724712d0afad9 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_RangePolicy.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_RangePolicy.cpp index b39e959f72d4e2c4dfa33023560e51fd67a0f680..b671929d848936fef5144f1602277c88a4a6d968 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_RangePolicy.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_RangePolicy.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Reductions.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Reductions.cpp index 911cbdf4209ecd4e3174f6b846473480c80dfca7..0720af0fda03c910561a2773a01edcbd39ab5641 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Reductions.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Reductions.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Scan.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Scan.cpp index 44c8ae70fb78355ea0dc44d5d4f6f8c3f00cd19e..57f9857a8723a19330cab94ed37a5892528d1f00 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Scan.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Scan.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SharedAlloc.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SharedAlloc.cpp index 05fdca355baecc917a2ac9f343c786010000f862..fc0b02505deb51841fc0507b02ce21c9246d32cd 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SharedAlloc.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SharedAlloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Spaces.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Spaces.cpp index aa19fc88eaeb5141558e10f94db075ce522a0972..f7bfdc67873e2bec8d15dae017d30ed5f7e4c9b8 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Spaces.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Spaces.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_a.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_a.cpp index e4a622aec61a39a6468b34ffb3d157233715b0a9..805da988c6261f693da4fbb3277d41f98e9e3deb 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_a.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_b.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_b.cpp index d655c71319459ac525f0218fb84de21971eec555..a2018fc5c8f480bbe26266db432050b0b8fdb6a9 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_b.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c01.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c01.cpp index ae4339448d114c42754c6752a0acbf551efb49ab..946de0e111db0b2983b1f9cce599a6864266a57c 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c01.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c01.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c02.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c02.cpp index fd1f8eae1dd8338beeb7df3433d18bcdbcd475e1..7a1c895583336dac104631ece45145aa3d3b59f6 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c02.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c02.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c03.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c03.cpp index 8b508a3253bc414897c916d2c468479755a0c4cf..8c27d66a835ce94948bc3c3b9a5226bb93e2f476 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c03.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c03.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c04.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c04.cpp index 562be4cee4149bb5a73af82163e4fdc1b969185c..704bab5a0d9a90d6c51cf5dcb11059d34aaa0b32 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c04.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c04.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c05.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c05.cpp index 6689c8724d08dd1a96f9656b04c82bce787f2f45..7510ba2afc607cfbaca569a028afcac9b7c79534 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c05.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c05.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c06.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c06.cpp index 2d665f167bca5154820c1802c1ba3e3879173f8b..0b580f7dcd57c40666cc526f53345fe8f828c125 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c06.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c06.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c07.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c07.cpp index 5d30bf7c6a55a4933f6663409681f464a937b905..5d8484c352ef803a57cfde8236a7edd348179560 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c07.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c07.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c08.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c08.cpp index a72e37acad069ca4d70c78d859eecb8a8826862a..e896470e85c8b044980b0b02f0caf03a01870523 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c08.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c08.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c09.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c09.cpp index 0c8b7008423c5fccf34bccd32aceecd5c39b1be4..61c8e0ff73d218620af1febe7700cbd8ccb3e0da 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c09.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c09.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c10.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c10.cpp index 38b9dbad02a27f12a4ec860098269fbce68d5bd5..9ce886295fd18e0287016c69c643b9997788242a 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c10.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c10.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c11.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c11.cpp index cc3639f4386b7fa1d27afff964e3eb5f36679614..8b49f3694697346effdb47af40230ff50ca50f2e 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c11.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c11.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c12.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c12.cpp index 0805f2be01e085c6a1966540e301757f13c373fa..8132cb3469196cfd46f1d89dfb22cf7a5b00e0ee 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c12.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c12.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c13.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c13.cpp index 2c38bb0d91f5c7728dd8105dc62cb3b5d0062e87..f397eb6b7b344adad1d4e954ed72cdbbb723fb13 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c13.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_SubView_c13.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Task.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Task.cpp index a5510e24067b313d1cf91726f74d238afde262f2..3d93266981977e864ff050172cb90f624aafde34 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Task.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Task.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Team.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Team.cpp index dae6eda4476d79ea09599a4adf260081ad46ce28..c633585096b8711e8d93e2a83fe92a1a3edc3e4b 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Team.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Team.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_TeamReductionScan.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_TeamReductionScan.cpp index 27a689a53ef00c80477d4cb64585992ef228a053..4f84c964f8f71598fd8b353f210e8c23afede53c 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_TeamReductionScan.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_TeamReductionScan.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_TeamScratch.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_TeamScratch.cpp index 8e8fa9ac2a092e5b8cbb0395cbf5dd036dffcbd4..879633b0c85834fe06268e01639e01e15d8c77f4 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_TeamScratch.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_TeamScratch.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_UniqueToken.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_UniqueToken.cpp index 8424ae10d64b4df809ae185f37a7bdfe79fd78f5..a04ee57a96bef70fc275f1558c8b1e576e1d4df1 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_UniqueToken.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_UniqueToken.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewAPI_b.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewAPI_b.cpp index aa1fc28af68a5979b4a1a1c75c555fcc858a20f1..8b77ab399d5c2293b15597946497909fe9815cc2 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewAPI_b.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewAPI_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_a.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_a.cpp index b13ab93da358b2abbff6cf57efefe4a2393cbcbd..e8e3d18fc0a31632c7b2e0f539d381aea10bcf90 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_a.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_b.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_b.cpp index 367922a3e23c097575baf6a0ab5795a5ead815a5..0a3b6c0bebef58ffd7be6d26ea2463ef3407e8af 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_b.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_subview.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_subview.cpp index 22f78ebe740a355746431c792e08ca122a708924..caddacb07b2de84bbf95de874dbeb2fb92fe9166 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_subview.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewMapping_subview.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewOfClass.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewOfClass.cpp index bc989ccaa4bfb375c649991af982cb99f3a744f8..c457098ed52f2737c04f69e3e1ac5162661e0e1e 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewOfClass.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewOfClass.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_WorkGraph.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_WorkGraph.cpp index 663ca1d560ce66b9d6b887625c616e439f281443..c51f95810a6aff86aca67ef7fb4cdcffc68d4e48 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_WorkGraph.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_WorkGraph.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType.cpp b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType.cpp index e52df4df741b04eb222c4ec22f71342610382c35..515cd5412923fb3eb0269caa6c5f06cca1171e2f 100644 --- a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType.cpp +++ b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/default/TestDefaultDeviceTypeResize.cpp b/lib/kokkos/core/unit_test/default/TestDefaultDeviceTypeResize.cpp index c02905535ba0e638a2d358b612e0d035114b3784..fd8224ce34669c18e9cc9cc7e39e620a0a09c303 100644 --- a/lib/kokkos/core/unit_test/default/TestDefaultDeviceTypeResize.cpp +++ b/lib/kokkos/core/unit_test/default/TestDefaultDeviceTypeResize.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_Category.hpp b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_Category.hpp index 8b9c14b76f6668f95a4ac3f6719b0fdec753e143..e981dcb7991eba4a7901843ccb239dce5631242d 100644 --- a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_Category.hpp +++ b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_a.cpp b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_a.cpp index b50ef3446bd833e6e8b5f3f170df7dc4e2096d31..c8d21f38026a4d0c9c75ee8a274ffd3524f19f02 100644 --- a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_a.cpp +++ b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_b.cpp b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_b.cpp index c947e935dd538b5d8e0f219163d6d30457cf3d03..131e79271aaa6f6a56ae8ab54eb9a7e5d0ccbfee 100644 --- a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_b.cpp +++ b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_c.cpp b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_c.cpp index 4500392b27081a7f80c5da98cd44204ac1086f23..2af50101f42f1093fef62a332cea3fe80deb62b7 100644 --- a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_c.cpp +++ b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_c.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_d.cpp b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_d.cpp index 8b98a35384ee139cf92bf788a7741582e9fda4a4..21a4df25ecdba28895a646b5c1772e3914e05cb2 100644 --- a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_d.cpp +++ b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType_d.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp index c12574a65a6e6ef66687cd8b0d39e7a343017a46..9fdf627001b3272ac172dbd85c49e88f0c44a30d 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_AtomicOperations.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_AtomicOperations.cpp index f9002421984c64467ff9fc057f61385aa93c4262..0d0f99ba032b85591b4db50ccca0f7290545be28 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_AtomicOperations.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_AtomicOperations.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_AtomicViews.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_AtomicViews.cpp index 6ba4d29bafd6f73e73e347348c33d5850564ed7f..6e7355ff59560771300d0ee12d63e656c22f1eb9 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_AtomicViews.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_AtomicViews.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Atomics.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Atomics.cpp index 497153e07e0bc1943487cc6f1f8785421224886d..ea062b4c0a73df9727a894204f21db4f123feddc 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Atomics.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Atomics.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Category.hpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Category.hpp index 6fcc117a8c74ff4bac9144129f44515dc2716e63..76391a6d963a3c83afe43e36c34602a86f942aa3 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Category.hpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Complex.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Complex.cpp index c7e13b1a97e3b2dfedc07e9c8862917654c90a89..9040ea56369171fd2f4ea95faa4113b6053c7c1d 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Complex.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Complex.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Crs.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Crs.cpp index 54b283f5390a22dc5f4a90acee3129ef34170f5c..1f97bb95d1c0ec1c0240a7eb668267c4b3588b33 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Crs.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Crs.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Init.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Init.cpp index e5c9bb13534bef1acd3a76bd7555a92427c6f529..48c033a735d8e4ce2711751c871e121591902301 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Init.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Init.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_InterOp.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_InterOp.cpp new file mode 100644 index 0000000000000000000000000000000000000000..148366bc0d2da9602dbee8ccec123e3d9cb27de4 --- /dev/null +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_InterOp.cpp @@ -0,0 +1,90 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include <Kokkos_Core.hpp> +#include <openmp/TestOpenMP_Category.hpp> +#include <omp.h> + +namespace Test { + +// Test whether allocations survive Kokkos initialize/finalize if done via Raw Cuda. +TEST_F( openmp, raw_openmp_interop ) +{ + int count = 0; + int num_threads,concurrency; + #pragma omp parallel + { + #pragma omp atomic + count++; + if(omp_get_thread_num()==0) + num_threads = omp_get_num_threads(); + } + + ASSERT_EQ(count,num_threads); + + Kokkos::InitArguments arguments{-1,-1,-1, false}; + Kokkos::initialize(arguments); + + count = 0; + #pragma omp parallel + { + #pragma omp atomic + count++; + } + + concurrency = Kokkos::OpenMP::concurrency(); + ASSERT_EQ(count,concurrency); + + Kokkos::finalize(); + + count = 0; + #pragma omp parallel + { + #pragma omp atomic + count++; + } + + ASSERT_EQ(count,concurrency); + +} +} diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_MDRange.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_MDRange.cpp index cfc46977d1eb2fb7ebd613d843a8ac8b54492e2d..979a6a4476b31d1ad7865d0622ad9d8c8ca9d84d 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_MDRange.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_MDRange.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp index 33e7402ce65704d90a628183d50f952e559dead9..989f971c09ee8b5f743b32910cba7ed71e090238 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_RangePolicy.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_RangePolicy.cpp index a5a9d7e99b274766bfa3f02f5056438da2f2b274..4fd097c84d7e27508402aab1538323d89d3cd4c8 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_RangePolicy.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_RangePolicy.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Reductions.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Reductions.cpp index 820e06361475f4ba0f4911d0e3c79c6020adf414..8ff39c01db0da82acdc089177aa23769ce1c6171 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Reductions.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Reductions.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Scan.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Scan.cpp index d8427e284805e394676bd36a1d318d4c4fd4bd49..04a38163a49da8e47da374d8302380525916d94e 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Scan.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Scan.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SharedAlloc.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SharedAlloc.cpp index ee9ab45edfa8475c9282711b948d8d00d5c09ba1..82e9cf6e33360a497888624c657f3d835d4b25dc 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SharedAlloc.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SharedAlloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_a.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_a.cpp index bbb12c2ddb6e9ec26bead40359dd0885c1e88d82..524836d20b70f39192b84977ae5c8687a2d1aeb7 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_a.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_b.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_b.cpp index 591129916d820b14181a6cbdb8bad0ae0247cc34..3bf63b641ae440cf75c114e908099ba087c990a3 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_b.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c01.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c01.cpp index c8bf28e777b87e3ec8269d89fee2fd265f539c87..676ef18a38c31ec643df42992395ea9253896c03 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c01.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c01.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c02.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c02.cpp index 64bccc297da4974e95128979cf7d6c4e62d30c8d..f1af02c73ad01e240e9a0c7d64fda8282b3e3967 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c02.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c02.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c03.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c03.cpp index 668f583de7bde91a4ab3439beabee623cc264838..b5dc8b4f84e644d7f722826d91a1a42f6d7ae261 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c03.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c03.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c04.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c04.cpp index 9cad90a10a1dc13b4ac77b996d73be98785335f3..7c008a6bb223d9ed6ae52919c7aa12f72ddaefca 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c04.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c04.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c05.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c05.cpp index a292fb85e21b95588e117563a3a173dc9e719008..4f43cbc8770ec518dfed29f43acd2a84405253a1 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c05.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c05.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c06.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c06.cpp index 37aa23406e525210a638d526322fd79ded1ea103..fbb55ee7c75f1a2322d9f24f4ce97fbb128c4423 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c06.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c06.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c07.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c07.cpp index 33391fcfa2f6e23fcce11f2bc91c2e0c4e12ce2d..503997cfcae2d1c111915c571b219de8657c95e9 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c07.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c07.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c08.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c08.cpp index c9958e7bcb6a37bff6eb02e87332fc9f5a5d1034..34133feb1b4ddb2870ca253a841b081bdfd3af6c 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c08.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c08.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c09.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c09.cpp index e482c6e87ebb589c75d56414621e4ceb09b71015..d70cb0bd2577cc3ae0f07030e4d707df2e9b9c0a 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c09.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c09.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c10.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c10.cpp index 348eb2a795595c2ecf119187c15d57e75cafd788..72bbb2c36bde850ad6169c6dd640477bc48fe76e 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c10.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c10.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c11.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c11.cpp index 1341d65e6f7220e92fd216095deebdb422bbaad0..f715f70e771de71f618262f90c0b5d0c1c0fa3c1 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c11.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c11.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c12.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c12.cpp index da38096bcaaa17aaefcacdcb80d227c64f6dc911..c93581112a1339f5422508d4f3761e7626a2c1a8 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c12.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c12.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c13.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c13.cpp index 937bf69f19a2065ba5813a7209bf7543ef33fe32..594c62d1453beba6fe5098d6fad48f0150e26d16 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c13.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_SubView_c13.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Task.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Task.cpp index 90692648c11a2d29db440699cb95ab4fb4c2f87b..95a6cbdf9b68fc29f8e53c1189167baeb848e039 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Task.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Task.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp index a937ea41ab0d711aa83e3772f2389b466fef962d..790ea9e6da2974ed2d1081d313b4e00cd48b949e 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_TeamReductionScan.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_TeamReductionScan.cpp index 3e4183be8b0acce0d37cc1cf5d20e8271fbc7359..482005c8838a59a4e8f14ab1f36b7daed8f0331d 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_TeamReductionScan.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_TeamReductionScan.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_TeamScratch.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_TeamScratch.cpp index b9bf7ac439a0b6ada5e01459360fa0f91b17e5c0..f57da139a62614a5aa1dace9244f697c10514c6e 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_TeamScratch.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_TeamScratch.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_UniqueToken.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_UniqueToken.cpp index 143a6d99104607ad2bb31d79074ead5670c81177..473ec73a2f3cc860b386d13dd9f8e969c6aca9fc 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_UniqueToken.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_UniqueToken.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewAPI_b.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewAPI_b.cpp index d53bc77684e42f01932129333c1bf5c342622c21..5e7a05590ea32e38a09b671146c1592d88b936b4 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewAPI_b.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewAPI_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_a.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_a.cpp index f6e7ed97982b38f46f236b9d59d1b778d50405a2..781dabeeed5420c8eb3ddae65e90634a0bd3e87a 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_a.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_b.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_b.cpp index 793c4620c138f601c5c2c5822546d0a7093408ac..910d043fb38d0b28ba2c3582d4dd366ac059bd95 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_b.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_subview.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_subview.cpp index 09a28d95a179a3ab74d78d7527c685f2524a1c40..900e760979e3df2815ee9c40ffcacdd089613e0d 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_subview.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewMapping_subview.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewOfClass.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewOfClass.cpp index 4daad9eddccb5943e90f2f99cdece484d3694d96..87a49902f438fe677f78190b16cb6216bd647346 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewOfClass.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewOfClass.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_WorkGraph.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_WorkGraph.cpp index ec6fa1653c051d03ac92ee1436041f0b587fee9a..916257e2036dd9f400e85b4196c7243fe630ba42 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_WorkGraph.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_WorkGraph.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget.hpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget.hpp index 9a5f4afad003cf30af0170fc37c2de603d52f59f..b08320c07f8ba6e0abfe805d1fac76947cf1cf6e 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget.hpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_AtomicOperations.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_AtomicOperations.cpp index df9d6b55304ed754d9f603978124ad64f5a82c10..e2d2e95e400a3edac5126c04c6e3fccb449a64f2 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_AtomicOperations.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_AtomicOperations.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_AtomicViews.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_AtomicViews.cpp index 8dd7385e432d4d00634aadc5a8fe6346fc4ad5ba..a9232540e888e7b2c79769b372e496e37854d8d6 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_AtomicViews.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_AtomicViews.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Atomics.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Atomics.cpp index 7d2d721d4411c6f28b9643a9575fa952fb3f1fa9..8285bc97f71a8a41973a719d9846e80f52e61dd0 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Atomics.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Atomics.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Category.hpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Category.hpp index e3ac705faf1e9ca37e3628dfd42559a4378e5a30..9b9d943944266876da4e4a2f4eb4dcd56c430448 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Category.hpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Complex.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Complex.cpp index d2a5d233ef970e86a9e8fbabe5523eaed148b9c3..5d0525f1b05fe10b1ea05a8b0f7e323ec830c3e6 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Complex.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Complex.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Init.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Init.cpp index ff153b6c4709fd0c65a30e90bfe4aa78833ce7ae..957bfe359a623d3f386a6b6c9a8b6a20807e051e 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Init.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Init.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_MDRange.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_MDRange.cpp index ef67dfe1c53b2c037190d5e754885c9eda3e726b..e8b5febbf70ddd9df9bd1149c19efe0f6a1cddc3 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_MDRange.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_MDRange.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Other.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Other.cpp index d53c1d01c9a783d60b53b25371e2e1668072448a..fce37dd719ac3ea76303fe6e955ac2bccb18ed59 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Other.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Other.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_RangePolicy.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_RangePolicy.cpp index 8f9ade4e83fbcba61ddedfd20230195af66c8df9..4fea6a32b4745d082b4254c1ce74b468f82ac909 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_RangePolicy.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_RangePolicy.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Reductions.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Reductions.cpp index b9758300bc5f1e2144d116570089115d0a27f957..1052fea30175f25decbcf66c6ad27c9a1a94cebf 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Reductions.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Reductions.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Scan.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Scan.cpp index 9f6c0a57f1bd7d2de7380e1b705b428729c1617b..56fc1a00a529b8650039d7ca42b2f93389629d13 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Scan.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Scan.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SharedAlloc.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SharedAlloc.cpp index 4e08046aa9853f58c5b40b3aec7aa372a0b08981..e3e8ac281455f32a2f0b54dded26811d9ee729a3 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SharedAlloc.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SharedAlloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_a.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_a.cpp index 4aafb9a408c7c6d45acbc2d8a3d4a8ea39e346a7..df809ae2a911508cc7e1a22a18850cc1ca6b424f 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_a.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_b.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_b.cpp index d9bc921cc3635377af0ba8f8e6b1c65e91a06eef..5b84bc623fbb0e8325c9d1335704aba462e9162e 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_b.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c01.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c01.cpp index 009554ea2a452f7bb37502d469f016ea17534a87..8b8d3fd5e75ed38fca7968bcce231a9de2feeeae 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c01.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c01.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c02.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c02.cpp index 9993ec888e34dc20218a416bb9fa2ee662784c49..bb1d02436769a61fb2ba6ac73e03390a93ba63af 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c02.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c02.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c03.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c03.cpp index dfa1aac6ba09fa770c5414eb12beb8b1b1b07e40..ec31b3688e6c4018970f865faf03d5dbdbb56f36 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c03.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c03.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c04.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c04.cpp index 9f2bafb72a6504087f1b3379cc7afe9821716397..c1db2cf0ec44bd069024e6fcc5d00a63c71e705e 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c04.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c04.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c05.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c05.cpp index ca6b613f9f8433aec45d4e461ee32d044a44c33f..a4d30f68b80a68ba4431db610c99e6ad104fdc4c 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c05.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c05.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c06.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c06.cpp index c4e3b1f6cf8453ba8426eaae57171000cce495bc..34b4dfb4092f84614a0cc4bfa3ba2b29a3b9dfef 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c06.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c06.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c07.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c07.cpp index d1cd0a7336dba68cb041e3d3d1fa1507e782e597..50ac0b06acbe83438df054153545b30ffdf14ac4 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c07.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c07.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c08.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c08.cpp index 15bc73c1de26793e465179fb8da9657bdb7f1f30..5da4797472cc8d3c7e19f67c102abc5a575844d3 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c08.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c08.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c09.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c09.cpp index 447437528a2447c647538e9319e156eb42b02aed..9041e5121dc7782aa9e6a2133bc2cf36f9aa3725 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c09.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c09.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c10.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c10.cpp index 60c94db90dcb12bb6ebb87cc80cd1743c8c16026..3887d2b70820002469900f2e6bf7cdb15b544eec 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c10.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c10.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c11.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c11.cpp index 4b486c72ec1e9be72446b45a1f7bd8a25b5ff7a6..4e36841887ee074b9bcb13c934b2d3cfecb4a17c 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c11.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c11.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c12.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c12.cpp index 32cf5a0e16636c87b0c045b7ff1bbd124c4e2007..dc33f1e0a924e66fc6ab23a287e2a7079de17209 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c12.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_SubView_c12.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Team.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Team.cpp index e3c91b286a3e3ca02301b64164ead8bb56282973..4eef325ea1ef0f0684a3f1d3cdf1d66621295e46 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Team.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Team.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamReductionScan.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamReductionScan.cpp index b6d6c0237cd83102c0a11f11e89f799e76a8704d..b8ea6ce7aea1fa1ffd85a5a9cd15886d0b6885d6 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamReductionScan.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamReductionScan.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamScratch.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamScratch.cpp index 9442782749740d06378dc59dee639331f9b33295..f13bfd2dcbec815696ec5c688ef4507cae14701f 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamScratch.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamScratch.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewAPI_b.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewAPI_b.cpp index 3e5151b681e26641f6bfdc972f7d8e8596bf2c94..fc39a6135e6f3b392beff4697742f0b36ce3d7c1 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewAPI_b.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewAPI_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_a.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_a.cpp index 8e32fa10eecc8d2d901565bf6f020f53fb920349..b9a84fdc1fe7b0110a3c589a2d573224fb19ea18 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_a.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_b.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_b.cpp index cd629d7083de0b146c9a83c4b7801cdcc17d8115..a749270ed1637569113aef6bfe70534c1c483ae6 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_b.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_subview.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_subview.cpp index 9a3457bcffa9346259d129bb7cf0618af7b5c48a..5dc6517529c7fd2de52cfa277d13cc8fa98c99ae 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_subview.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewMapping_subview.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewOfClass.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewOfClass.cpp index d0a38c873c8b05a1e78ec715e4da949633c511f8..9d7c49ee46e9d0c8c88e6206eb2bba58743ca24b 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewOfClass.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewOfClass.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads.hpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads.hpp index 907fe23ea5e7c6b11a52c6327787ddee0108f89e..989ea48ce679c43c108296c6ce6dde9a42302d95 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads.hpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_Atomics.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_Atomics.cpp index e64c3305db616b09c24c2b47d64c9153e3aeb0df..199dbdcb9c47b9f596c78efee8acd58f177e6745 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_Atomics.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_Atomics.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_Category.hpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_Category.hpp index eb2a4de4c7f9a07c312cb3731dd9568c9b6fbf04..4500863cb49ebfe3b763a61308764bff1db296a1 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_Category.hpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_Other.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_Other.cpp index 4e53fecf441a901271484d76540a85f9563d1914..a4c1ec227835eb581a4d5a73e116feeeea425f6c 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_Other.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_Other.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_Reductions.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_Reductions.cpp index a2470ac15c45431e852981a94f792bb2710535d7..f2e2c2339de91f31067dc807a16f76f0975b892a 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_Reductions.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_Reductions.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_a.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_a.cpp index ab873359a748e6086533454f7a0842a5e8dee9e6..8fdee75d86b1c479b5cd4a97a84c892ff74c4971 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_a.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_b.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_b.cpp index 199c5c795557bb4da254c24d320a99240768e014..e32a42461bb78b37a5796eb4d4a2ca69819024a5 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_b.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c01.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c01.cpp index f44909f3daffd71b13a12eba33b4e8e142e946ad..a0ada2859d126858435ce0286b606890934056b4 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c01.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c01.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c02.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c02.cpp index 7bb936f8dd511034924d779362f34e10833b2668..1b0e09811347b63a515c643b8ac123e85e34997e 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c02.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c02.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c03.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c03.cpp index 27073dfa814683a77a0edc602e23f3c3aadcd0e2..2062fbeaf023286c0d18857421f2a0948408087a 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c03.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c03.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c04.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c04.cpp index 1b3cf488521b6ed84aa7eda62084ba737d485abf..07b84de90e30fbe1422deaeb6e6b5349e7c600d1 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c04.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c04.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c05.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c05.cpp index 34dda63e64da0cb39b1a7d977ff08477aa8bbfec..4d5d2a9915aafe02382b181ff75c70f774a2ba4c 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c05.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c05.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c06.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c06.cpp index 5a4ee50fb2f6b41ddfc504192a3815d4a1775f5e..4330f00a6242a3aefe7a89c23eff6b81f5b6eb4d 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c06.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c06.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c07.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c07.cpp index fe386e34a8083a8bc2084b6957f57124a78d41c3..154f5de69481574a9bd304593dc89b08c25a1cf4 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c07.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c07.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c08.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c08.cpp index a3e0ab25291334f291adf3ba743c822eea552380..66832558de433055f4e8a74b106cfb591143d6cf 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c08.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c08.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c09.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c09.cpp index df1f570e9dce927b75c11695a11124564e39d567..5305ce1defe448030894dcb3e7dc9a0a56012b66 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c09.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c09.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c10.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c10.cpp index cc3c80d10d7b3fd544ed7b49fa56b9f2f4e8b5a7..039414a6813b28bda02f277b7d9b1322ddb7edf5 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c10.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c10.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c11.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c11.cpp index 14b331a4585efeb912c0ec7001cf0195657c60de..05dcde77e2219158f1a6789bbf6f2a2c8271b92e 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c11.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c11.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c12.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c12.cpp index 571382e66f52d5a6c8294af1d117ebaeb6fe25f5..58d79d609d1e13432ad63f36f7f20df0ac3a0cd5 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c12.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c12.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c13.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c13.cpp index 54897c922d8cbef2189e0c05fd019f802e42d219..347c4a5b86a8b52c821f74a77adbbf1b08ba7817 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c13.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_SubView_c13.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_Team.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_Team.cpp index e7b81283fbf27e97427defbf1b0894793cc44ed2..2b0d397804cf7c77144992b6c60bdde0921f0107 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_Team.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_Team.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_ViewAPI_a.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_ViewAPI_a.cpp index cd876a36bfa457f3c5f895d604f38be27fa4e986..a68049e79d19a92a015dc8936bc9c94ace1f17f5 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_ViewAPI_a.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_ViewAPI_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/qthreads/TestQthreads_ViewAPI_b.cpp b/lib/kokkos/core/unit_test/qthreads/TestQthreads_ViewAPI_b.cpp index adf048b61360b1aa9d49d9ce0f93453d580eb1a4..3bfd1763b8179ded3bb080e8570da7339d32be52 100644 --- a/lib/kokkos/core/unit_test/qthreads/TestQthreads_ViewAPI_b.cpp +++ b/lib/kokkos/core/unit_test/qthreads/TestQthreads_ViewAPI_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_Category.hpp b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_Category.hpp index 94e778b3bcd086fa9649d3326905f587dde62e66..7f77d83e8133fa4cf2fbbf401a1f64db94602225 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_Category.hpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_SharedAlloc.cpp b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_SharedAlloc.cpp index 2f8f379db02943e5b7bf1bab70e2ea3a2fe01e90..de058aaead45a2b5564e9380183221624b3b318d 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_SharedAlloc.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_SharedAlloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewAPI.cpp b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewAPI.cpp index 32ecbbb48f564cbc4eb145c57e503fb2c740b5eb..93ddf8cc852a6f27ab5a1ff627387402f183d3d5 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewAPI.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewAPI.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_a.cpp b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_a.cpp index 5523fac7fc6443cfcf70db74a286a4a2497f707c..1e44f51778c3c034fa8c46089533f8c1a054b0f3 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_a.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_b.cpp b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_b.cpp index 5e29612d72440e016a960fd6ad4d714ee5f4131b..a5d68a0c6174e9de302cc813d526e4bab1d6f5c3 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_b.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_subview.cpp b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_subview.cpp index 6a6194b38f66f5b26dfd3f8d43c166fefd1ff357..ef9b8e3702913774614b0ba8f09c3b556c907f95 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_subview.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCmHostPinned_ViewMapping_subview.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_AtomicOperations.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_AtomicOperations.cpp index e6b7a2531677e5451308642e2854fb44e2e8ef82..50ed7ac442a2e4518b4e1f17aa172bd37b71090b 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_AtomicOperations.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_AtomicOperations.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_AtomicViews.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_AtomicViews.cpp index d5f82826b08c499f857fd807ab65ee8026aaf9f5..385fbe8bbbf1b8549f8a87dbc53a21b6981427f6 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_AtomicViews.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_AtomicViews.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_Atomics.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_Atomics.cpp index 5944830c43f1253f747e83cbf2e68aab5ee09446..a7cbc3de2f19ec25f0733a03c2bd8a310dcab4a5 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_Atomics.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_Atomics.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_Category.hpp b/lib/kokkos/core/unit_test/rocm/TestROCm_Category.hpp index a34068f533cc11290f72f2a1e99043ef3cf4a9f2..d520bbc5a7c827f78c3ac33e46bbfaf7e1c757e9 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_Category.hpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_Complex.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_Complex.cpp index 2b72cdee88cbdfdd5818acb88192d675ff0addc2..5488925a5d6eea1617e026ca19929732b55a9edf 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_Complex.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_Complex.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_Init.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_Init.cpp index dafe9fb52914ef2999286732493e4c1192d91505..a1d47810bfbb02aeb4ae796595b4c2f3f33a53b8 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_Init.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_Init.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_MDRange.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_MDRange.cpp new file mode 100644 index 0000000000000000000000000000000000000000..765d0adfc2d5dc36e7f7b025d53ee4478eb6a0cd --- /dev/null +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_MDRange.cpp @@ -0,0 +1,47 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include<rocm/TestROCm_Category.hpp> +#include<TestMDRange.hpp> + diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_Other.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_Other.cpp index 3e182dacbad413dc5dd18043d4337ae782e0d74f..3396265b0fb5444b1044264ad126d1098fbfca4d 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_Other.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_Other.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_RangePolicy.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_RangePolicy.cpp index ef7dad95a3afd5481258368ae5f7ae4d9f171c77..dd390a0a3df271961c3b2ea650b2f77629e1f31d 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_RangePolicy.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_RangePolicy.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_Reductions.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_Reductions.cpp index 33c4d960f865d14d28355eba053c7f4a1c8dbf90..611bb34fd392af1ed6ffe625416adce7a7c9ba5d 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_Reductions.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_Reductions.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_Scan.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_Scan.cpp index ae0a016af3d285f17da0cf71200f3410c2428bf6..f13a98331140cd3e1abcfa867741d566ac4ff8c5 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_Scan.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_Scan.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SharedAlloc.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SharedAlloc.cpp index 7a038edf4b2a330a2f8c71037cbb56acff85eca6..c2c68d021c806787c8d75e5f45ffe21ac6681e7d 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SharedAlloc.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SharedAlloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_Spaces.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_Spaces.cpp index d44e7afec385bb08385d4a7a178593b3e7d8a1b2..04a7378ec9376f78ae4d77e4fd395b43fb2b50a3 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_Spaces.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_Spaces.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_a.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_a.cpp index ea39a25b5c755bef4f5421321336aba5d1e6efbd..dd88d3d5ec9bdd15c5fa2807478a4278ceafcef9 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_a.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_b.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_b.cpp index 00a3a341bbdaaea802aa89477b25224af30b3bda..5b64dbf2140c592e43496c84c018411b6e310595 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_b.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c01.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c01.cpp index c17b0722e99f88947d854a759184ab4ff9a913b1..29eea90807a443b0922ed9586b97e4254ade5351 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c01.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c01.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c02.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c02.cpp index e723b433239a2ac94a541f7d6949b93b0d256bbd..ba4d224e664e16f3a97e021b62ba40b4d1ae2c11 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c02.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c02.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c03.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c03.cpp index b1170a70f50ad622330ad3e58e4fff9c27c1215f..d8816cc8ceb4cf5094059e26d56fc08363eaefc7 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c03.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c03.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c04.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c04.cpp index 0788a82ba4d4833a8b51652a22ae92469b5625f7..6ec5dcd47fb43b07cb454cc1ba2748a439825034 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c04.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c04.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c05.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c05.cpp index 8d075a37c099e887542f311e19f8f0d99d618aa3..5928200f783953880ddc5b922c416e1fb5eb468a 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c05.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c05.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c06.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c06.cpp index b9dc782571a5a00b39a54ddb5090f6de0f36326f..0954c53dca51750f094a5b2c5928fc0d3c583742 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c06.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c06.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c07.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c07.cpp index 54c46095aa9df55bc66451a76be4d4ec862f069a..965d99f5dde5fcc636bf30272586e3f5fba0b2bb 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c07.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c07.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c08.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c08.cpp index 369e16a795acc12cbe22f5fc5bf22ff82c019c0b..e02158a2c0a6f1a1bd2b0a592c7c2867614e1b06 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c08.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c08.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c09.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c09.cpp index b97926f98e8815229f4ed16fac9bc19fbe95eeec..3c6e67b1d134dad25856fa30267da4bd28c4c361 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c09.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c09.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c10.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c10.cpp index a1d47e0fbdcaed6b064e039289b3cf500c613d98..2bd27835cfd4937a65b37abd077d6741a7c1c9c0 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c10.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c10.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c11.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c11.cpp index 5be70dc22e80c159730aa3134dd3d1b7b01cfa58..3a537ddc20a921b5bea87379e4f4c08d8dfbb0f6 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c11.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c11.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c12.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c12.cpp index 81354766623fc7336025493a7a2bca61079d21fa..d6a48f822cc56be2c967b904c29485ae4c51c532 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c12.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_SubView_c12.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_Team.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_Team.cpp index 054bbd83c830724612cb6c2dd49d9a88a4853241..4f35ab77d35c18d8ebe0d1c14bf5722408e089c5 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_Team.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_Team.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_TeamReductionScan.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_TeamReductionScan.cpp index ba0eb0e1bd54c8073ac078a5191ff83bd920d593..e1025f1baa140c4d95fca606a58727eedde4f86c 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_TeamReductionScan.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_TeamReductionScan.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_TeamScratch.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_TeamScratch.cpp index 351dfee2b5cd2b23cab117738a8fb8bd8dfc054d..1968ab31ea0a705d97d8a8780d4cca9573174a93 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_TeamScratch.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_TeamScratch.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_ViewAPI_b.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_ViewAPI_b.cpp index 3e6f559438a410a900fcea2808330ffdc227073f..b307d9c81046a741c046b2fae56c7fc8251ecb26 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_ViewAPI_b.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_ViewAPI_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_a.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_a.cpp index a7b2b9695de8f910d089f50de86928a60d09225f..1d79e6a63d57f99385686d948c10a43bd324b566 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_a.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_b.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_b.cpp index fa5b209f1b39530e518ee3d1803ef1b70aa9504e..15bf92affe3d42dfd0ad6c5327def1e8dbf55344 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_b.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_subview.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_subview.cpp index 0af114c7ea2b0691127a92632036941e6fdea82b..7e35355215bd48188dff435184c8741148651ca5 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_subview.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_ViewMapping_subview.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_ViewOfClass.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_ViewOfClass.cpp index f0b95c0e004cb5dc6f4c0ffa668cd1dda8e5719d..c03385b64e779bb79b3c3526cc28611ecab9474c 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_ViewOfClass.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_ViewOfClass.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_AtomicOperations.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_AtomicOperations.cpp index c6cc6a8b45df309a17c390d675953a21dccc6924..9e8345f06516e47a18a6e4877c4d39fd450afc1f 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_AtomicOperations.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_AtomicOperations.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_AtomicViews.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_AtomicViews.cpp index 9bcb8f2655e386b21155a68af144f460510b4f83..a03c74a00826de3eae80bc9694a7350e07adb81d 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_AtomicViews.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_AtomicViews.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Atomics.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Atomics.cpp index ed338875d065373b25a03b7f8aa5057b9bfedd34..398ab10ccff423ca03fe3a1e0d10b2ffe9395aee 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Atomics.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Atomics.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Category.hpp b/lib/kokkos/core/unit_test/serial/TestSerial_Category.hpp index 025437f15b81ea27c9e092200369d1a018e16b42..f052a2e7755d86909ae8d770197f1917af581134 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Category.hpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Complex.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Complex.cpp index 01b1fcd521bbc40711cab98c3cb8016be49f874f..fa9eacd2b33e6d76cbaf549e0a4650ef2ad41c0c 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Complex.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Complex.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Crs.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Crs.cpp index 5799ab816c2ce2c9f97c78f208809717f93d8404..367c1028a8deceae575fd26ef752673b30f7b010 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Crs.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Crs.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Init.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Init.cpp index 752e61b6d96adfb2d2e444bd7ea1c62189344dbf..ccadb041ce134da319840211eddeab93ea2133bd 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Init.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Init.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_MDRange.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_MDRange.cpp index 5dcdac84709751a22d32adb7a48979bac902d02f..6be3a8aa209c54ed37e7cc422c6eaa062385ac9d 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_MDRange.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_MDRange.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp index bc39b1e16088c3c2933aa28d792f39226fe11e9c..0c3bae3774446b0d76f75ebdc5ccec89b0f9a4c5 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_RangePolicy.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_RangePolicy.cpp index ed9242925f00cafc1663e1fdd59ba7fddb41f2a7..5740eb74fc6a12fc4e516e0b60555776bf3e8967 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_RangePolicy.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_RangePolicy.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Reductions.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Reductions.cpp index db41a19ee6a7df5f081dc70797c95b1cbed795b8..7b5f9b0dfa69c15efbccbafba99e9b3d3aed0ae6 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Reductions.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Reductions.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Scan.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Scan.cpp index a368a80894dc400358c95dfe6c6fd236ffb5a8ed..23ca25d48c2d6143b36aa3a7fb2f49a9d5fb2dbb 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Scan.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Scan.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SharedAlloc.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SharedAlloc.cpp index 1b9786191fd442a3c42aa97e2dd75d3981d28fca..348ce654285924933e5547a6d93042a17a3c6736 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SharedAlloc.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SharedAlloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_a.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_a.cpp index 3fffcc74149e9e3bd2e6d93c38f42a561682989a..b9041ae44123b0ca17935f708ae8415204a08088 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_a.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_b.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_b.cpp index d49a2ba9c5c938b5b7253105cb6db7ed55194061..b6869f95f19bb8a31a1cc6e6159e8d5cd6d5820f 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_b.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c01.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c01.cpp index 173fb7f68c193a7815fcd91a887ceeffd63ca29b..395880493fe0cafb1b07149cb90d43d227269e57 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c01.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c01.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c02.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c02.cpp index 88594c70d3ffc9c6c13cf3d8314f0af195320513..5bb21aba7b178cf0810ddc19b5850ae61affb2f7 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c02.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c02.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c03.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c03.cpp index 5c754ecdeea10c1710fd5dcabbf370ba6027e70e..7f112ea326aec41dededeb0d4180a0583897509d 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c03.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c03.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c04.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c04.cpp index 6b5ab72d9095f1c6f3e77c0b417f3316d4e67c0d..fdcc3b90fa11f49720a67e433da2a5fa1c54b2e3 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c04.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c04.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c05.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c05.cpp index 27cb44dcc773cf77efdfe707b7f0c3823e8edad1..4df5e8508b7a404d868f764b41b2a36709788314 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c05.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c05.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c06.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c06.cpp index ce15de135c96279394d609afe8653810491736dc..1e715eccf6cae574cbd9a2c83effc35adabc58ab 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c06.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c06.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c07.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c07.cpp index 68694038e5377411d5d43a0ad294363a14e769bd..a5189fc7d86acef945910b10a3826c9e2b1a5492 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c07.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c07.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c08.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c08.cpp index 5cdfd892ce8dcc70869e619648eff264ea70befb..96ae5d7374d8f87083027062ddd8e7daf23a5bc0 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c08.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c08.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c09.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c09.cpp index 4d08803fc229bf78d6b519b6bb084cf03783f074..f4d716540a59ed45e0d15f0ffd04c94b5ca13c0e 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c09.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c09.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c10.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c10.cpp index 938d1e1dccee7188e4a912a9b049ceb87a789d84..e393e5d4d380eab7833f1ad693b291b06556c7fd 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c10.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c10.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c11.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c11.cpp index 6166d3a684c022fc364d67469685d0e54c2e0e30..e9ea9a601067d9f7d2faf632efd56743dbadc64e 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c11.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c11.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c12.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c12.cpp index 6bdb0e943bffd5fa87bd3aae7b7839ac1feb7404..01b57903cf87883a236f84ca6573094bea40cb64 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c12.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c12.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c13.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c13.cpp index b716dc82548c1f85f617e8e8e445646fc7e44ab3..f50d28b251dc18816fba30c6efde6437f4c2e559 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c13.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_SubView_c13.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Task.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Task.cpp index a943334cd53493775afabc50f67389e86e1d4743..d2d748d942a596cb8542100f691230a2ee7da6ab 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Task.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Task.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Team.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Team.cpp index fc0520721038999fef9f3b5026c5d936e7915038..619cb727ac9e94e257c5bdc8298e34e136295bf2 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Team.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Team.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_TeamReductionScan.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_TeamReductionScan.cpp index 5076b380bda5145493f9d090bbaabf2a3502a779..e626beaeb6158e684055b437746df0658abb7872 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_TeamReductionScan.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_TeamReductionScan.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_TeamScratch.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_TeamScratch.cpp index 8fa823920102dfb241b37da5e6b65a8df64e5b97..963908c92d76b63904128cb7b1bb355ed708aecc 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_TeamScratch.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_TeamScratch.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_ViewAPI_b.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_ViewAPI_b.cpp index 6f657d1da8188df2cf75fcabdf13fd67c79f035a..c80b897ab6f864fd34efc5c7ac43d79c7903cf19 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_ViewAPI_b.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_ViewAPI_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_a.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_a.cpp index f5058d88fd801f41bce799a1af35973d439b5ec8..f9f89d714c2c247fac2228faf39d7f8f39dbe834 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_a.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_b.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_b.cpp index 6d5af0c975317093b993c9924c53ff0956e43b00..69024441ac6c8f06f9de23ba027687b5d00c0cf5 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_b.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_subview.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_subview.cpp index e9ae239942ca9db4f6eb4581ebca9f98d475b63b..d7fb364291a95e831bbe1127b43e041e849e550c 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_subview.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_ViewMapping_subview.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_ViewOfClass.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_ViewOfClass.cpp index c5eeafaf3b5af4527dfdb7de061b35e4feba81b9..d3e10238df2bbbd8e4ebc0c6fb7740930deba769 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_ViewOfClass.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_ViewOfClass.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_WorkGraph.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_WorkGraph.cpp index de1638de5ed8a1e4f9ce3af8a50e5a2af9feab5c..80925cb9dfa5e7fde94a55b0bb06cb57de2989c6 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_WorkGraph.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_WorkGraph.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads.hpp b/lib/kokkos/core/unit_test/threads/TestThreads.hpp index 2b4c7c1518daf20a34c0ccab55944e093e8be11d..42279ee1cf53d8076d77db882c2eb83f79518f27 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads.hpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_AtomicOperations.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_AtomicOperations.cpp index aaa568717fb8db99d495c03ef3b18b9f825a21e5..0d9804cb9027d7f6afa4ceaf358f7a5b2f7f0c12 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_AtomicOperations.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_AtomicOperations.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_AtomicViews.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_AtomicViews.cpp index 864ba89d7019a29e73d35f0adf572cfd853401ce..d71baf8fc2c129d54b034b7e62f5db859b8a69cc 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_AtomicViews.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_AtomicViews.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Atomics.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Atomics.cpp index c7fc35a2698758761e19aafafd3edee0d4315bcc..350a8d90fd995e67d424f311dcc7c1176b8c8bd5 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Atomics.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Atomics.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Category.hpp b/lib/kokkos/core/unit_test/threads/TestThreads_Category.hpp index 01a990b654f7199675a3507b85db4a5fa01624e3..c4d0ed6da2958ed239e96ed4d5c64369d85e4fab 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Category.hpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Category.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Complex.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Complex.cpp index e2cd66a33cbe08bb1f961ebf0c1e23ccd19ac8ef..a19aaea9ea6b3238410932201b7b919bce157f95 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Complex.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Complex.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Crs.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Crs.cpp index 25243273fe82b73c41bef5702e45db6e7ada6860..f5a1de15fabd565f04d317dbb3190ec3d30ca858 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Crs.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Crs.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Init.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Init.cpp index 0abd6413280d0c7ecc6b1b1d58216726537fcb2e..39ded8fae0acb59f8a9da29a3f430e7fdc2bf345 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Init.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Init.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_MDRange.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_MDRange.cpp index 46d7126093e56061e53b4a4530d0425fdcd5663d..79a134d5dd11144e667aee1e0e51f367de8d4232 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_MDRange.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_MDRange.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp index 160b37a2c8c8c9c737b8bfac6e87887db55ece7d..a0c8b4159735bbd90d6fd896a7d3f5c18efde241 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_RangePolicy.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_RangePolicy.cpp index 9eed794dec779bef351456a5248a0eb2f9cfdbfb..7404cae78688ebd0277f9462c46a019872d690e7 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_RangePolicy.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_RangePolicy.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Reductions.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Reductions.cpp index c4b3850120be86364de95ec0217acfa1137c7e07..33788b9ca5e443d7c0f97d27f1eb7417e43ab4fc 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Reductions.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Reductions.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Scan.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Scan.cpp index 11e99a7893386229a4516c470bc0b6babc8ba7f9..9d9583e9658453e62135a9befe0ff8ea820c2a3e 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Scan.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Scan.cpp @@ -36,7 +36,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SharedAlloc.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SharedAlloc.cpp index 75a824d5daeafe1a188020b9be768083a4020ddd..a028728ecb85d27b6b9ff331620509dfce11bcaa 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SharedAlloc.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SharedAlloc.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_a.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_a.cpp index c78714feba817dad40282bf7510bea8bf9bff89d..cccf334fc4fafd7b66588ac627f334716a3572d9 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_a.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_b.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_b.cpp index 6cea72c31bfcc5fee6bb990684baa3e41f3c3795..ab1aa3df4fecb19bc6f962f2f8f79012292097b6 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_b.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c01.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c01.cpp index 4ff2f871bc5212e8a25ec89a200632deda3d1f89..3000d4c717f4b0519ab30563d3546b75753713be 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c01.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c01.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c02.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c02.cpp index e522def61492e7bb5c29c5c8c2c3f79d098dc8e2..84f1907576e0064ffc77f6082c44ee8eff145efc 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c02.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c02.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c03.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c03.cpp index bb3f9a6106f4c251294e41867ec3d151b10fe021..8076ecf1f93b8aebefcc58379bc26a1fe46129e5 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c03.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c03.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c04.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c04.cpp index 8cc26b5ce72b6d874237c235f2c294a7e0ff05bf..bd354fa1f247bb8090618cd56802abb630a972c9 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c04.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c04.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c05.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c05.cpp index 9d5824ba98f569da0a1fd0a0460597716ba30a4e..88286df275e8d424f952748f57119ccc2ebf42e5 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c05.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c05.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c06.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c06.cpp index 9e6426d48e32c1b63e4d887b909a0c67c02f3d38..12c3bbcbde9cedc6e3aaaacd9b05119167f74b25 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c06.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c06.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c07.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c07.cpp index 9671df9ddab5ea1c96c17db2398f8f93cfecbe3e..17a0804dd67611af9c88d99dda499f346157e8b7 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c07.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c07.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c08.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c08.cpp index 96f6a808d3a733cbf2117b3b2d7a14ffc69640ea..76b9dc39944e0ad0286b193fa4ebb68d13ed6a1a 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c08.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c08.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c09.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c09.cpp index d837cc086b0b66fa5ccfd961bdc75a98303486e7..efa1f516cb9817f58aeaa1128ddc10c59aa24428 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c09.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c09.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c10.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c10.cpp index 84b90c76e501e95fd25b9c7e81eaccfcfc22b5be..90f56d257314576868d7ab2821574fcac68174fa 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c10.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c10.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c11.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c11.cpp index aafbfd01d3d3f0a6b2231508decb2c90ca745155..35f4994ba2e502fd7ac3d957989bd5ce832a6e8f 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c11.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c11.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c12.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c12.cpp index 2b855258a690616b082117a6ddf816dffc3ee450..05b5dc2cc59c1e7800405106814dc2fd16fdbb3f 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c12.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c12.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c13.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c13.cpp index 1f9679d3ae57efad54b786da0b83d1869e85f411..50cd7cecd9ba660e5a59b738a7f3904a90c079d9 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c13.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_SubView_c13.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Team.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Team.cpp index 1da6fb8fe6b0eb7648a5e5fd7d2350a2fce21588..b87c1f77d3c60384ec5f067897ee77ea75e86244 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Team.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Team.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_TeamReductionScan.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_TeamReductionScan.cpp index 8f4f3a515cd86f436b98a2a202c5cf5304cdb324..1df976f10dfb4ddab0c493ae4a6fad84e338ac1c 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_TeamReductionScan.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_TeamReductionScan.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_TeamScratch.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_TeamScratch.cpp index dcf7c7463423e9c0dc3953fdcadce3fb5b5529f3..c07fae77c3964f59331518cfb54c1f16561e6958 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_TeamScratch.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_TeamScratch.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_ViewAPI_b.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_ViewAPI_b.cpp index cd3d73dfd099de4de15059bd8bb01b28cdd79d8d..a8d5a6f5ff2af38cbb6049b3876d14d96f901415 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_ViewAPI_b.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_ViewAPI_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_a.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_a.cpp index d37938a3a398a6a55b1ef8817899667638bbb505..d67f376fc609aa24d5d5ed8526bdafb83d033f19 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_a.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_a.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_b.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_b.cpp index 43cc97aa228b7b1ebbe19676a6062edf6398f451..49c7f6d3d75714bab5689a9b44ea39a82186aa82 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_b.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_b.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_subview.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_subview.cpp index 931bef0127b41e95cbb135752ca03aca95ead2ad..6c4f14873e040eebf0378c04597652c0589364e7 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_subview.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_ViewMapping_subview.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_ViewOfClass.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_ViewOfClass.cpp index c2d371283adfd41d9ba55f689ba9ccdf993cb667..d9a9c17feaec5af5bce08b3e1eed40ee6e92f102 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_ViewOfClass.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_ViewOfClass.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_WorkGraph.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_WorkGraph.cpp index 6b7dbb26db222624a3efe26eb5c718da50a51ce7..e7801d1179c70b6ba5c760fcfac68fbbc6131a07 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_WorkGraph.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_WorkGraph.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/config/query_cuda_arch.cpp b/lib/kokkos/doc/hardware_identification/query_cuda_arch.cpp similarity index 100% rename from lib/kokkos/config/query_cuda_arch.cpp rename to lib/kokkos/doc/hardware_identification/query_cuda_arch.cpp diff --git a/lib/kokkos/config/kokkos-promotion.txt b/lib/kokkos/doc/kokkos-promotion.txt similarity index 86% rename from lib/kokkos/config/kokkos-promotion.txt rename to lib/kokkos/doc/kokkos-promotion.txt index d56298b4163c9506ed0b4a551b220752de8449b2..5f245fa0f177dee1fcfe70b743f6a1e0d0fd36fa 100644 --- a/lib/kokkos/config/kokkos-promotion.txt +++ b/lib/kokkos/doc/kokkos-promotion.txt @@ -2,9 +2,9 @@ Summary: - Step 1: Testing Kokkos itself using test_all_sandia -- Step 2: Testing of Kokkos integrated into Trilinos (config/trilinos-integration/*.sh) +- Step 2: Testing of Kokkos integrated into Trilinos (scripts/trilinos-integration/*.sh) -- Step 3: Locally update CHANGELOG, merge into master, edit config/master_history.txt +- Step 3: Locally update CHANGELOG, merge into master, edit scripts/master_history.txt - Step 4: Locally snapshot new master into corresponding Trilinos branch (develop or temporary), push with checking-test-sems.sh @@ -34,17 +34,17 @@ supported compilers. Those machines are: 1.3. Run the test_all_sandia script with no options to test all compilers - nohup ../config/test_all_sandia & + nohup ../scripts/test_all_sandia & tail -f nohup.out # to watch progress // -------------------------------------------------------------------------------- // Step 2: - 2.1. Build and test Trilinos with 4 different configurations; Run scripts for white and shepard that are provided in kokkos/config/trilinos-integration. These scripts load their own modules/environment, so don't require preparation. You can run all four at the same time, use separate directories for each. + 2.1. Build and test Trilinos with 4 different configurations; Run scripts for white and shepard that are provided in kokkos/scripts/trilinos-integration. These scripts load their own modules/environment, so don't require preparation. You can run all four at the same time, use separate directories for each. mkdir serial cd serial - nohup KOKKOS_PATH/config/trilinos-integration/shepard_jenkins_run_script_serial_intel & + nohup KOKKOS_PATH/scripts/trilinos-integration/shepard_jenkins_run_script_serial_intel & 2.2. Compare the compile errors and test failures between updated and pristine versions. There may be compile failures that happen in both, tests that fail in both, and there may be tests that only fail some times (thus, rerun tests manually as needed). @@ -78,7 +78,7 @@ Step 3: This step should be run on kokkos-dev git checkout master git merge --no-ff origin/develop - 3.6. Update the tag in kokkos/config/master_history.txt + 3.6. Update the tag in kokkos/scripts/master_history.txt Tag description: MajorNumber.MinorNumber.WeeksSinceMinorNumberUpdate Tag field widths: #.#.## @@ -88,7 +88,7 @@ Step 3: This step should be run on kokkos-dev develop description: SHA1 of merged develop branch SHA1 field width: ######## (8 chars) - # Append to config/master_history.txt: + # Append to scripts/master_history.txt: tag: 2.03.13 date: 07:27:2017 master: da314444 develop: 29ccb58a @@ -120,7 +120,7 @@ Step 4: This step can be done on any SEMS machine (e.g. kokkos-dev). Actually, t 4.2 Snapshot Kokkos into Trilinos - this requires python/2.7.9 and that both Trilinos and Kokkos be clean - no untracked or modified files. Run the following outside of the Kokkos and Trilinos source trees. module load sems-python/2.7.9 - python KOKKOS_PATH/config/snapshot.py KOKKOS_PATH TRILINOS_PATH/packages + python KOKKOS_PATH/scripts/snapshot.py KOKKOS_PATH TRILINOS_PATH/packages 4.3. Run checkin-test to push to trilinos using the CI build modules (gcc/4.9.3) diff --git a/lib/kokkos/example/cmake_build/cmake_example.cpp b/lib/kokkos/example/cmake_build/cmake_example.cpp index bba4b7bd01528aee924f3cf7140a80493bb5bd96..a73b65abf05239328ac6f6c5b98ce3d8b0b53733 100644 --- a/lib/kokkos/example/cmake_build/cmake_example.cpp +++ b/lib/kokkos/example/cmake_build/cmake_example.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/common/VectorImport.hpp b/lib/kokkos/example/common/VectorImport.hpp index 4623272923eb179f5b67a9fe303b548410d631fc..566f03a2931e02574a0c064bdc60adb3eef4c33d 100644 --- a/lib/kokkos/example/common/VectorImport.hpp +++ b/lib/kokkos/example/common/VectorImport.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/common/WrapMPI.hpp b/lib/kokkos/example/common/WrapMPI.hpp index f6c5b7ff3e0c1f070035ccb2dfa216089d85ea47..cad2bb5cdfe0d094fed6a6ac83977ef3e1e104da 100644 --- a/lib/kokkos/example/common/WrapMPI.hpp +++ b/lib/kokkos/example/common/WrapMPI.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/feint/ElemFunctor.hpp b/lib/kokkos/example/feint/ElemFunctor.hpp index 581faf46a417f96f963f5aa1776115361d8bcca0..eebe777d98004f9441c50d1a3aef20db47aae9a4 100644 --- a/lib/kokkos/example/feint/ElemFunctor.hpp +++ b/lib/kokkos/example/feint/ElemFunctor.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -353,10 +353,10 @@ struct LumpElemToNode { : m_node_value( node_value ) , m_elem_value( elem_value ) , m_node_scan( "node_scan" , - AlreadyUsedAtomic ? 0 : node_value.dimension_0() + 1 ) + AlreadyUsedAtomic ? 0 : node_value.extent(0) + 1 ) , m_node_elem( "node_elem" , - AlreadyUsedAtomic ? 0 : elem_node.dimension_0() * - elem_node.dimension_1() ) + AlreadyUsedAtomic ? 0 : elem_node.extent(0) * + elem_node.extent(1) ) { if ( ! AlreadyUsedAtomic ) { map_node_to_elem( elem_node , m_node_scan , m_node_elem ); @@ -442,9 +442,9 @@ void map_node_to_elem( const ViewElemNode & elem_node , const typename ViewNodeElem::HostMirror host_node_elem = Kokkos::create_mirror_view(node_elem); - const int elem_count = host_elem_node.dimension_0(); - const int elem_node_count = host_elem_node.dimension_1(); - const int node_count = host_node_scan.dimension_0() - 1 ; + const int elem_count = host_elem_node.extent(0); + const int elem_node_count = host_elem_node.extent(1); + const int node_count = host_node_scan.extent(0) - 1 ; const View<int*, host_mirror_space > node_elem_count( "node_elem_count" , node_count ); diff --git a/lib/kokkos/example/feint/feint.hpp b/lib/kokkos/example/feint/feint.hpp index 4b7196c4c713f1bd1c1f077818393edfa5ff506f..1be8762a85bd74e789ebadc7b810a5cddfb73183 100644 --- a/lib/kokkos/example/feint/feint.hpp +++ b/lib/kokkos/example/feint/feint.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/feint/feint_cuda.cpp b/lib/kokkos/example/feint/feint_cuda.cpp index 06f9c8b9132c7a09dd36b188389b99cf85f3fea5..c2f4a68e42aabef38d03761b2af01ebec043cfe0 100644 --- a/lib/kokkos/example/feint/feint_cuda.cpp +++ b/lib/kokkos/example/feint/feint_cuda.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/feint/feint_fwd.hpp b/lib/kokkos/example/feint/feint_fwd.hpp index f02e547cfccbb6b89c7bca192a87bcad95a266f0..cc969ae572cce07890a8a0012ec4c707d3186c14 100644 --- a/lib/kokkos/example/feint/feint_fwd.hpp +++ b/lib/kokkos/example/feint/feint_fwd.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/feint/feint_openmp.cpp b/lib/kokkos/example/feint/feint_openmp.cpp index c80725f4a8223204712e9c9a7792632e4c451ea0..8c7e0b6a08364541bc926e32585591baca1de449 100644 --- a/lib/kokkos/example/feint/feint_openmp.cpp +++ b/lib/kokkos/example/feint/feint_openmp.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/feint/feint_rocm.cpp b/lib/kokkos/example/feint/feint_rocm.cpp index 2bb9e0ee15f78ba6848f71d7cb8d5ce7f6cf8939..65debe44d11e3ff3b51031326f9ca061985a9017 100644 --- a/lib/kokkos/example/feint/feint_rocm.cpp +++ b/lib/kokkos/example/feint/feint_rocm.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/feint/feint_threads.cpp b/lib/kokkos/example/feint/feint_threads.cpp index 44016caadad17a368d32e9570104930d2ea722e0..560dbf8874ed670840529878ffd4948f42404c6a 100644 --- a/lib/kokkos/example/feint/feint_threads.cpp +++ b/lib/kokkos/example/feint/feint_threads.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/feint/main.cpp b/lib/kokkos/example/feint/main.cpp index 57a8f8fafb366fd11fba7b6a4f250f0c6f2559f3..8e8b57cca972aaad80e14e103ea03c1cddeaf67c 100644 --- a/lib/kokkos/example/feint/main.cpp +++ b/lib/kokkos/example/feint/main.cpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/fenl/CGSolve.hpp b/lib/kokkos/example/fenl/CGSolve.hpp index 9533db312edf0141cc278311fd2acffb6c8b21d9..c3d3b0bc6f7ca3bdda69481f5cdfac3bfb950988 100644 --- a/lib/kokkos/example/fenl/CGSolve.hpp +++ b/lib/kokkos/example/fenl/CGSolve.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -69,7 +69,7 @@ struct CrsMatrix { CrsMatrix( const StaticCrsGraphType & arg_graph ) : graph( arg_graph ) - , coeff( "crs_matrix_coeff" , arg_graph.entries.dimension_0() ) + , coeff( "crs_matrix_coeff" , arg_graph.entries.extent(0) ) {} }; diff --git a/lib/kokkos/example/fenl/fenl.cpp b/lib/kokkos/example/fenl/fenl.cpp index 62a614019cc937925e0972df89e35845981e141f..1178ec6b9c9c551c5d6effda50b3ac7922fe1807 100644 --- a/lib/kokkos/example/fenl/fenl.cpp +++ b/lib/kokkos/example/fenl/fenl.cpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ */ diff --git a/lib/kokkos/example/fenl/fenl.hpp b/lib/kokkos/example/fenl/fenl.hpp index a23585fe7f4f6aa530a209f8c68fa0863b77b91a..f97a4c76b38ce3b9aa1528cd6665ce44e672ea67 100644 --- a/lib/kokkos/example/fenl/fenl.hpp +++ b/lib/kokkos/example/fenl/fenl.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/fenl/fenl_functors.hpp b/lib/kokkos/example/fenl/fenl_functors.hpp index d23c934bd2c4feb50730309a5cd2ed8efc0a9d0e..d0b484b5fb8fc31bec626cf8e1a943f0dd2deac5 100644 --- a/lib/kokkos/example/fenl/fenl_functors.hpp +++ b/lib/kokkos/example/fenl/fenl_functors.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -156,7 +156,7 @@ public: // May be larger that requested: set_capacity = node_node_set.capacity(); - Kokkos::parallel_reduce( Kokkos::RangePolicy<execution_space,TagFillNodeSet>(0,elem_node_id.dimension_0()) + Kokkos::parallel_reduce( Kokkos::RangePolicy<execution_space,TagFillNodeSet>(0,elem_node_id.extent(0)) , *this , failed_insert_count ); @@ -220,8 +220,8 @@ public: // Element-to-graph mapping: wall_clock.reset(); phase = FILL_ELEMENT_GRAPH ; - elem_graph = ElemGraphType("elem_graph", elem_node_id.dimension_0() ); - Kokkos::parallel_for( elem_node_id.dimension_0() , *this ); + elem_graph = ElemGraphType("elem_graph", elem_node_id.extent(0) ); + Kokkos::parallel_for( elem_node_id.extent(0) , *this ); execution_space::fence(); results.fill_element_graph = wall_clock.seconds(); @@ -234,17 +234,17 @@ public: void operator()( const TagFillNodeSet & , unsigned ielem , unsigned & count ) const { // Loop over element's (row_local_node,col_local_node) pairs: - for ( unsigned row_local_node = 0 ; row_local_node < elem_node_id.dimension_1() ; ++row_local_node ) { + for ( unsigned row_local_node = 0 ; row_local_node < elem_node_id.extent(1) ; ++row_local_node ) { const unsigned row_node = elem_node_id( ielem , row_local_node ); - for ( unsigned col_local_node = row_local_node ; col_local_node < elem_node_id.dimension_1() ; ++col_local_node ) { + for ( unsigned col_local_node = row_local_node ; col_local_node < elem_node_id.extent(1) ; ++col_local_node ) { const unsigned col_node = elem_node_id( ielem , col_local_node ); // If either node is locally owned then insert the pair into the unordered map: - if ( row_node < row_count.dimension_0() || col_node < row_count.dimension_0() ) { + if ( row_node < row_count.extent(0) || col_node < row_count.extent(0) ) { const key_type key = (row_node < col_node) ? make_pair( row_node, col_node ) : make_pair( col_node, row_node ) ; @@ -254,10 +254,10 @@ public: if ( result.success() ) { // If row node is owned then increment count - if ( row_node < row_count.dimension_0() ) { atomic_fetch_add( & row_count( row_node ) , 1 ); } + if ( row_node < row_count.extent(0) ) { atomic_fetch_add( & row_count( row_node ) , 1 ); } // If column node is owned and not equal to row node then increment count - if ( col_node < row_count.dimension_0() && col_node != row_node ) { atomic_fetch_add( & row_count( col_node ) , 1 ); } + if ( col_node < row_count.extent(0) && col_node != row_node ) { atomic_fetch_add( & row_count( col_node ) , 1 ); } } else if ( result.failed() ) { ++count ; @@ -277,12 +277,12 @@ public: const unsigned row_node = key.first ; const unsigned col_node = key.second ; - if ( row_node < row_count.dimension_0() ) { + if ( row_node < row_count.extent(0) ) { const unsigned offset = graph.row_map( row_node ) + atomic_fetch_add( & row_count( row_node ) , 1 ); graph.entries( offset ) = col_node ; } - if ( col_node < row_count.dimension_0() && col_node != row_node ) { + if ( col_node < row_count.extent(0) && col_node != row_node ) { const unsigned offset = graph.row_map( col_node ) + atomic_fetch_add( & row_count( col_node ) , 1 ); graph.entries( offset ) = row_node ; } @@ -307,17 +307,17 @@ public: KOKKOS_INLINE_FUNCTION void fill_elem_graph_map( const unsigned ielem ) const { - for ( unsigned row_local_node = 0 ; row_local_node < elem_node_id.dimension_1() ; ++row_local_node ) { + for ( unsigned row_local_node = 0 ; row_local_node < elem_node_id.extent(1) ; ++row_local_node ) { const unsigned row_node = elem_node_id( ielem , row_local_node ); - for ( unsigned col_local_node = 0 ; col_local_node < elem_node_id.dimension_1() ; ++col_local_node ) { + for ( unsigned col_local_node = 0 ; col_local_node < elem_node_id.extent(1) ; ++col_local_node ) { const unsigned col_node = elem_node_id( ielem , col_local_node ); unsigned entry = ~0u ; - if ( row_node + 1 < graph.row_map.dimension_0() ) { + if ( row_node + 1 < graph.row_map.extent(0) ) { const unsigned entry_end = graph.row_map( row_node + 1 ); @@ -366,7 +366,7 @@ public: update += row_count( irow ); if ( final ) { - if ( irow + 1 == row_count.dimension_0() ) { + if ( irow + 1 == row_count.extent(0) ) { row_map( irow + 1 ) = update ; row_total() = update ; } @@ -482,8 +482,8 @@ public: : elem_node_id( arg_elem_node_id ) , elem_graph( arg_elem_graph ) , row_total( "row_total" ) - , row_count( "row_count" , arg_residual.dimension_0() ) - , row_map( "graph_row_map" , arg_residual.dimension_0() + 1 ) + , row_count( "row_count" , arg_residual.extent(0) ) + , row_map( "graph_row_map" , arg_residual.extent(0) + 1 ) , graph() , residual( arg_residual ) , jacobian( arg_jacobian ) @@ -496,7 +496,7 @@ public: phase = FILL_NODE_COUNT ; - Kokkos::parallel_for( elem_node_id.dimension_0() , *this ); + Kokkos::parallel_for( elem_node_id.extent(0) , *this ); //-------------------------------- @@ -505,7 +505,7 @@ public: // Exclusive scan of row_count into row_map // including the final total in the 'node_count + 1' position. // Zero the 'row_count' values. - Kokkos::parallel_scan( residual.dimension_0() , *this ); + Kokkos::parallel_scan( residual.extent(0) , *this ); // Zero the row count for the fill: Kokkos::deep_copy( row_count , typename RowMapType::value_type(0) ); @@ -527,7 +527,7 @@ public: phase = FILL_GRAPH_ENTRIES ; Kokkos::deep_copy( row_count , 0u ); - Kokkos::parallel_for( elem_node_id.dimension_0() , *this ); + Kokkos::parallel_for( elem_node_id.extent(0) , *this ); execution_space::fence(); @@ -541,7 +541,7 @@ public: //-------------------------------- phase = SORT_GRAPH_ENTRIES ; - Kokkos::parallel_for( residual.dimension_0() , *this ); + Kokkos::parallel_for( residual.extent(0) , *this ); execution_space::fence(); @@ -550,7 +550,7 @@ public: void apply() const { - Kokkos::parallel_for( residual.dimension_0() , *this ); + Kokkos::parallel_for( residual.extent(0) , *this ); } //------------------------------------ @@ -560,11 +560,11 @@ public: KOKKOS_INLINE_FUNCTION void fill_node_count( const unsigned ielem ) const { - for ( unsigned row_local_node = 0 ; row_local_node < elem_node_id.dimension_1() ; ++row_local_node ) { + for ( unsigned row_local_node = 0 ; row_local_node < elem_node_id.extent(1) ; ++row_local_node ) { const unsigned row_node = elem_node_id( ielem , row_local_node ); - if ( row_node < row_count.dimension_0() ) { + if ( row_node < row_count.extent(0) ) { atomic_fetch_add( & row_count( row_node ) , 1 ); } } @@ -573,11 +573,11 @@ public: KOKKOS_INLINE_FUNCTION void fill_graph_entries( const unsigned ielem ) const { - for ( unsigned row_local_node = 0 ; row_local_node < elem_node_id.dimension_1() ; ++row_local_node ) { + for ( unsigned row_local_node = 0 ; row_local_node < elem_node_id.extent(1) ; ++row_local_node ) { const unsigned row_node = elem_node_id( ielem , row_local_node ); - if ( row_node < row_count.dimension_0() ) { + if ( row_node < row_count.extent(0) ) { const unsigned offset = graph.row_map( row_node ) + atomic_fetch_add( & row_count( row_node ) , 1 ); @@ -667,7 +667,7 @@ public: update += row_count( irow ); if ( final ) { - if ( irow + 1 == row_count.dimension_0() ) { + if ( irow + 1 == row_count.extent(0) ) { row_map( irow + 1 ) = update ; row_total() = update ; } @@ -796,7 +796,7 @@ public: void apply() const { - parallel_for( elem_node_ids.dimension_0() , *this ); + parallel_for( elem_node_ids.extent(0) , *this ); } //------------------------------------ @@ -1009,7 +1009,7 @@ if ( 1 == ielem ) { #endif - if ( ! residual.dimension_0() ) { + if ( ! residual.extent(0) ) { for( unsigned i = 0; i < FunctionCount ; i++){ elem_residuals(ielem, i) = elem_vec[i] ; for( unsigned j = 0; j < FunctionCount ; j++){ @@ -1020,7 +1020,7 @@ if ( 1 == ielem ) { else { for( unsigned i = 0 ; i < FunctionCount ; i++ ) { const unsigned row = node_index[i] ; - if ( row < residual.dimension_0() ) { + if ( row < residual.extent(0) ) { atomic_fetch_add( & residual( row ) , elem_vec[i] ); for( unsigned j = 0 ; j < FunctionCount ; j++ ) { diff --git a/lib/kokkos/example/fenl/fenl_impl.hpp b/lib/kokkos/example/fenl/fenl_impl.hpp index 6b2326c102e63de60c506479db0d7643526d4f8a..1996a79729a72004a5ea0d3d7b04d9d3e9d5243d 100644 --- a/lib/kokkos/example/fenl/fenl_impl.hpp +++ b/lib/kokkos/example/fenl/fenl_impl.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -367,11 +367,11 @@ Perf fenl( std::cout << "}" << std::endl ; std::cout << "ElemGraph {" << std::endl ; - for ( unsigned ielem = 0 ; ielem < mesh_to_graph.elem_graph.dimension_0() ; ++ielem ) { + for ( unsigned ielem = 0 ; ielem < mesh_to_graph.elem_graph.extent(0) ; ++ielem ) { std::cout << " elem[" << ielem << "]{" ; - for ( unsigned irow = 0 ; irow < mesh_to_graph.elem_graph.dimension_1() ; ++irow ) { + for ( unsigned irow = 0 ; irow < mesh_to_graph.elem_graph.extent(1) ; ++irow ) { std::cout << " {" ; - for ( unsigned icol = 0 ; icol < mesh_to_graph.elem_graph.dimension_2() ; ++icol ) { + for ( unsigned icol = 0 ; icol < mesh_to_graph.elem_graph.extent(2) ; ++icol ) { std::cout << " " << mesh_to_graph.elem_graph(ielem,irow,icol); } std::cout << " }" ; diff --git a/lib/kokkos/example/fenl/main.cpp b/lib/kokkos/example/fenl/main.cpp index 0df5a60b89b1c35efa126500370468abe892dddc..086bd4d13f38744337e0341dd194149cca159226 100644 --- a/lib/kokkos/example/fenl/main.cpp +++ b/lib/kokkos/example/fenl/main.cpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/fixture/BoxElemFixture.hpp b/lib/kokkos/example/fixture/BoxElemFixture.hpp index d659bf80342dacc2991362b2b4a242572c84182e..be2f03a27d5f52c0fe9acf0b55f736779679562a 100644 --- a/lib/kokkos/example/fixture/BoxElemFixture.hpp +++ b/lib/kokkos/example/fixture/BoxElemFixture.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -157,7 +157,7 @@ public: inline bool ok() const { return m_box_part.ok(); } KOKKOS_INLINE_FUNCTION - size_t node_count() const { return m_node_grid.dimension_0(); } + size_t node_count() const { return m_node_grid.extent(0); } KOKKOS_INLINE_FUNCTION size_t node_count_owned() const { return m_box_part.owns_node_count(); } @@ -166,7 +166,7 @@ public: size_t node_count_global() const { return m_box_part.global_node_count(); } KOKKOS_INLINE_FUNCTION - size_t elem_count() const { return m_elem_node.dimension_0(); } + size_t elem_count() const { return m_elem_node.extent(0); } KOKKOS_INLINE_FUNCTION size_t elem_count_global() const { return m_box_part.global_elem_count(); } @@ -280,11 +280,11 @@ public: } const size_t nwork = - std::max( m_recv_node.dimension_0() , - std::max( m_send_node.dimension_0() , - std::max( m_send_node_id.dimension_0() , - std::max( m_node_grid.dimension_0() , - m_elem_node.dimension_0() * m_elem_node.dimension_1() )))); + std::max( m_recv_node.extent(0) , + std::max( m_send_node.extent(0) , + std::max( m_send_node_id.extent(0) , + std::max( m_node_grid.extent(0) , + m_elem_node.extent(0) * m_elem_node.extent(1) )))); Kokkos::parallel_for( nwork , *this ); } @@ -295,7 +295,7 @@ public: KOKKOS_INLINE_FUNCTION void operator()( size_t i ) const { - if ( i < m_elem_node.dimension_0() * m_elem_node.dimension_1() ) { + if ( i < m_elem_node.extent(0) * m_elem_node.extent(1) ) { const size_t ielem = i / ElemNode ; const size_t inode = i % ElemNode ; @@ -315,7 +315,7 @@ public: m_elem_node(ielem,inode) = m_box_part.local_node_id( tmp_node_grid ); } - if ( i < m_node_grid.dimension_0() ) { + if ( i < m_node_grid.extent(0) ) { size_t tmp_node_grid[SpaceDim] ; m_box_part.local_node_coord( i , tmp_node_grid ); m_node_grid(i,0) = tmp_node_grid[0] ; @@ -330,17 +330,17 @@ public: m_node_coord(i,2) ); } - if ( i < m_recv_node.dimension_0() ) { + if ( i < m_recv_node.extent(0) ) { m_recv_node(i,0) = m_box_part.recv_node_rank(i); m_recv_node(i,1) = m_box_part.recv_node_count(i); } - if ( i < m_send_node.dimension_0() ) { + if ( i < m_send_node.extent(0) ) { m_send_node(i,0) = m_box_part.send_node_rank(i); m_send_node(i,1) = m_box_part.send_node_count(i); } - if ( i < m_send_node_id.dimension_0() ) { + if ( i < m_send_node_id.extent(0) ) { m_send_node_id(i) = m_box_part.send_node_id(i); } } diff --git a/lib/kokkos/example/fixture/BoxElemPart.cpp b/lib/kokkos/example/fixture/BoxElemPart.cpp index fe89246689ea41c1157035231e34c9f3a94dfceb..7b85936da7f01b61fc4e6223df986442d3631c97 100644 --- a/lib/kokkos/example/fixture/BoxElemPart.cpp +++ b/lib/kokkos/example/fixture/BoxElemPart.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/fixture/BoxElemPart.hpp b/lib/kokkos/example/fixture/BoxElemPart.hpp index 98f44e7d9da92a9b3c04a2df936cc850d9b1d632..6cd91c6f6f6e5b5063c8f819d9d0b71350a148d3 100644 --- a/lib/kokkos/example/fixture/BoxElemPart.hpp +++ b/lib/kokkos/example/fixture/BoxElemPart.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/fixture/HexElement.hpp b/lib/kokkos/example/fixture/HexElement.hpp index cb39358f9d23a6e01a45f9ca6f277613bb321301..72bc45fd21d81018cdd6af3cdabb49a979bf4d46 100644 --- a/lib/kokkos/example/fixture/HexElement.hpp +++ b/lib/kokkos/example/fixture/HexElement.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/fixture/Main.cpp b/lib/kokkos/example/fixture/Main.cpp index 1f17531bd04935fea51afff245f01f37e1168e55..76e9214bd72a0f9f998b1ae66d35fb7da9703b13 100644 --- a/lib/kokkos/example/fixture/Main.cpp +++ b/lib/kokkos/example/fixture/Main.cpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/fixture/TestFixture.cpp b/lib/kokkos/example/fixture/TestFixture.cpp index d47621b3cd1fb8474b97b08eb43c7d6b4f6f22ec..b83d40588f0cea5652ad8811f367e3f97b594e23 100644 --- a/lib/kokkos/example/fixture/TestFixture.cpp +++ b/lib/kokkos/example/fixture/TestFixture.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/fixture/TestFixture.hpp b/lib/kokkos/example/fixture/TestFixture.hpp index dbf5ca56f512a0a3757b1084e294c016fb038154..12297a2aaa959beb18bbec861f14f02a835c46a2 100644 --- a/lib/kokkos/example/fixture/TestFixture.hpp +++ b/lib/kokkos/example/fixture/TestFixture.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -132,7 +132,7 @@ void test_fixture() typename FixtureVerifyElemNodeCoord<Device>::value_type result = { 0 , 0 }; - Kokkos::parallel_reduce( fixture.elem_node().dimension_0() , FixtureVerifyElemNodeCoord<Device>( fixture ) , result ); + Kokkos::parallel_reduce( fixture.elem_node().extent(0) , FixtureVerifyElemNodeCoord<Device>( fixture ) , result ); if ( result.error ) { std::cout << "P[" << my_rank << ":" << global_size diff --git a/lib/kokkos/example/global_2_local_ids/G2L.hpp b/lib/kokkos/example/global_2_local_ids/G2L.hpp index 9023ae04267835ec38f0fd20b9dcd3caf798ad04..9d40bd76281091d6a2b526b05df10fa024324b40 100644 --- a/lib/kokkos/example/global_2_local_ids/G2L.hpp +++ b/lib/kokkos/example/global_2_local_ids/G2L.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/global_2_local_ids/G2L_Main.cpp b/lib/kokkos/example/global_2_local_ids/G2L_Main.cpp index b6b8b2f5e0322f2a50ac1fb0d23f84bd5419a6f3..c8318be9fcdeae7a9dcdcf6c87aaedffa3008944 100644 --- a/lib/kokkos/example/global_2_local_ids/G2L_Main.cpp +++ b/lib/kokkos/example/global_2_local_ids/G2L_Main.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/grow_array/grow_array.hpp b/lib/kokkos/example/grow_array/grow_array.hpp index f9c94ea2ed11b1683ac45490942ca9d5157544be..f5d0698d821cb3097c29fa0911faf2deb604e0c6 100644 --- a/lib/kokkos/example/grow_array/grow_array.hpp +++ b/lib/kokkos/example/grow_array/grow_array.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/grow_array/main.cpp b/lib/kokkos/example/grow_array/main.cpp index 3f1d534d933ec3a90f921ed73404cb132bc0e46c..598729459a4c3e3e2140488d0ce08c9894a61703 100644 --- a/lib/kokkos/example/grow_array/main.cpp +++ b/lib/kokkos/example/grow_array/main.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/md_skeleton/force.cpp b/lib/kokkos/example/md_skeleton/force.cpp index 4115bafad45ea69298b23eca225daee710f917b1..53a48f3fef28871d6c8b3697b0c702e8cc813ea7 100644 --- a/lib/kokkos/example/md_skeleton/force.cpp +++ b/lib/kokkos/example/md_skeleton/force.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/md_skeleton/main.cpp b/lib/kokkos/example/md_skeleton/main.cpp index 8d67425f9403f4031532bb54d9e7e8852149e0f0..fe783b39cb75e0302cf723d368952b318ae33dda 100644 --- a/lib/kokkos/example/md_skeleton/main.cpp +++ b/lib/kokkos/example/md_skeleton/main.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/md_skeleton/neighbor.cpp b/lib/kokkos/example/md_skeleton/neighbor.cpp index 2a77932946f9dec0badb133ac1d6a08d5465d240..25cabb33026342da73eddceee5413c3b34662fb2 100644 --- a/lib/kokkos/example/md_skeleton/neighbor.cpp +++ b/lib/kokkos/example/md_skeleton/neighbor.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/md_skeleton/setup.cpp b/lib/kokkos/example/md_skeleton/setup.cpp index 7815a89101ce53dbe7c7b9cf51e0ab314acbd36b..52defbc4694c486a8fe2fce1aff47bdb12a0e649 100644 --- a/lib/kokkos/example/md_skeleton/setup.cpp +++ b/lib/kokkos/example/md_skeleton/setup.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/md_skeleton/system.h b/lib/kokkos/example/md_skeleton/system.h index 0184a119ff2d260442e624cd1f5e8a890cefe24f..4a0708ed340fbdc4c372e64bee613e2db76567a8 100644 --- a/lib/kokkos/example/md_skeleton/system.h +++ b/lib/kokkos/example/md_skeleton/system.h @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/md_skeleton/types.h b/lib/kokkos/example/md_skeleton/types.h index c9689188a1c289c67e08dbe07707a51a0f8bff28..71d8c9bca03c8f9ae4ab3672bb6cf2241f14f496 100644 --- a/lib/kokkos/example/md_skeleton/types.h +++ b/lib/kokkos/example/md_skeleton/types.h @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/BoxMeshFixture.hpp b/lib/kokkos/example/multi_fem/BoxMeshFixture.hpp index 195bb4a6ae483dfc3ef07b78b17de4dea9b02226..6fbf1d5a0a05a7d76f45876ee943825383fae861 100644 --- a/lib/kokkos/example/multi_fem/BoxMeshFixture.hpp +++ b/lib/kokkos/example/multi_fem/BoxMeshFixture.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/BoxMeshPartition.cpp b/lib/kokkos/example/multi_fem/BoxMeshPartition.cpp index 17a6696fb9d934974a5c244802a93a2272e9c3da..99c93e5eb1a74929354a27299711a12725485a6c 100644 --- a/lib/kokkos/example/multi_fem/BoxMeshPartition.cpp +++ b/lib/kokkos/example/multi_fem/BoxMeshPartition.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/BoxMeshPartition.hpp b/lib/kokkos/example/multi_fem/BoxMeshPartition.hpp index f2aa6f57cc2b8f5b3b64682dddfb2f94dba7e0d1..b8f43d2a22d5b47bcd137345a2d7a5e9e06e19ab 100644 --- a/lib/kokkos/example/multi_fem/BoxMeshPartition.hpp +++ b/lib/kokkos/example/multi_fem/BoxMeshPartition.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/Explicit.hpp b/lib/kokkos/example/multi_fem/Explicit.hpp index 9566aeff02b1abb2ef72f4cda155c679fca82e08..723cab861adb74b6c0d318bac457421530ed650d 100644 --- a/lib/kokkos/example/multi_fem/Explicit.hpp +++ b/lib/kokkos/example/multi_fem/Explicit.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/ExplicitFunctors.hpp b/lib/kokkos/example/multi_fem/ExplicitFunctors.hpp index 889f0caa0d9447eacd0f50727e9fc15dbfb6c7f7..43d21c6022d516ced0b0b2ce3c809e7be7eb1b60 100644 --- a/lib/kokkos/example/multi_fem/ExplicitFunctors.hpp +++ b/lib/kokkos/example/multi_fem/ExplicitFunctors.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/FEMesh.hpp b/lib/kokkos/example/multi_fem/FEMesh.hpp index 33468e2fbd7a3739f92bdb9473b0ae01b60b1311..e836cac43fb301f6afd45f985bf76e89180fb3f1 100644 --- a/lib/kokkos/example/multi_fem/FEMesh.hpp +++ b/lib/kokkos/example/multi_fem/FEMesh.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/HexElement.hpp b/lib/kokkos/example/multi_fem/HexElement.hpp index 7dec087cbdad3334d2dc264ca8560cc5e3b5ea3b..c1c045a29bf7e0e3660b21a4cf33677337d8bc9b 100644 --- a/lib/kokkos/example/multi_fem/HexElement.hpp +++ b/lib/kokkos/example/multi_fem/HexElement.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/HexExplicitFunctions.hpp b/lib/kokkos/example/multi_fem/HexExplicitFunctions.hpp index 5de8a51fe885b587d693fd92cfa165fde43806c4..48f535f35b941c90339563040bbfc9491be0cf62 100644 --- a/lib/kokkos/example/multi_fem/HexExplicitFunctions.hpp +++ b/lib/kokkos/example/multi_fem/HexExplicitFunctions.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/Implicit.hpp b/lib/kokkos/example/multi_fem/Implicit.hpp index 53f602f11ae3fe6e0a61bf29ded6ad8464f653b0..bc8659942e2f969f4a63c9a2b718ba1aea984ca4 100644 --- a/lib/kokkos/example/multi_fem/Implicit.hpp +++ b/lib/kokkos/example/multi_fem/Implicit.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/ImplicitFunctors.hpp b/lib/kokkos/example/multi_fem/ImplicitFunctors.hpp index 9d9aa771636c7ec9af064b9346ffed7f01344a2f..4855939bb878bd651eab086d5a9dd2d27ee68426 100644 --- a/lib/kokkos/example/multi_fem/ImplicitFunctors.hpp +++ b/lib/kokkos/example/multi_fem/ImplicitFunctors.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/LinAlgBLAS.hpp b/lib/kokkos/example/multi_fem/LinAlgBLAS.hpp index 73aaaf5d953f63d10c5d5b89124842a49e06c073..fa03e200800fdf3eceb5147aab55d6a1d5b8a17b 100644 --- a/lib/kokkos/example/multi_fem/LinAlgBLAS.hpp +++ b/lib/kokkos/example/multi_fem/LinAlgBLAS.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/Nonlinear.hpp b/lib/kokkos/example/multi_fem/Nonlinear.hpp index 58b9661170717d9f67795a4d8a52f1ad5cad8e74..7e91529e1c53b92e912a0a6597aa784952ecd8ba 100644 --- a/lib/kokkos/example/multi_fem/Nonlinear.hpp +++ b/lib/kokkos/example/multi_fem/Nonlinear.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/NonlinearElement_Cuda.hpp b/lib/kokkos/example/multi_fem/NonlinearElement_Cuda.hpp index 295a971e9d921773ddf2da4de97555b18d44ab83..2f6e94520477f214851664a9114df14e59145c8a 100644 --- a/lib/kokkos/example/multi_fem/NonlinearElement_Cuda.hpp +++ b/lib/kokkos/example/multi_fem/NonlinearElement_Cuda.hpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/NonlinearFunctors.hpp b/lib/kokkos/example/multi_fem/NonlinearFunctors.hpp index 9628236181f034f242ce11c2f56783ba9b934797..ef831a569878ae494590f09d59547c88083398b8 100644 --- a/lib/kokkos/example/multi_fem/NonlinearFunctors.hpp +++ b/lib/kokkos/example/multi_fem/NonlinearFunctors.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/ParallelComm.hpp b/lib/kokkos/example/multi_fem/ParallelComm.hpp index 0b3ceb4c3e9728f45214dab24e1685b0a7246679..37fa6243c92cbf3adee6920d065b42cd9d2cfc89 100644 --- a/lib/kokkos/example/multi_fem/ParallelComm.hpp +++ b/lib/kokkos/example/multi_fem/ParallelComm.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/ParallelDataMap.hpp b/lib/kokkos/example/multi_fem/ParallelDataMap.hpp index 8373c94d7d4b29f88d1ed338f53e79aa157a0455..12d7add5a55b7e095827033a03730df376ae9bac 100644 --- a/lib/kokkos/example/multi_fem/ParallelDataMap.hpp +++ b/lib/kokkos/example/multi_fem/ParallelDataMap.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/ParallelMachine.cpp b/lib/kokkos/example/multi_fem/ParallelMachine.cpp index f9a05754b67d59c168828a3479ca42b52b35b45a..49545e6a57f9e7d9e687d3dd36e8516ebe2d15cb 100644 --- a/lib/kokkos/example/multi_fem/ParallelMachine.cpp +++ b/lib/kokkos/example/multi_fem/ParallelMachine.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/ParallelMachine.hpp b/lib/kokkos/example/multi_fem/ParallelMachine.hpp index 97b21e0c3d30071edda9671a452a2e010cc1bfb7..14894f32138ed58814abfe69e78a515349fdc80f 100644 --- a/lib/kokkos/example/multi_fem/ParallelMachine.hpp +++ b/lib/kokkos/example/multi_fem/ParallelMachine.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/SparseLinearSystem.hpp b/lib/kokkos/example/multi_fem/SparseLinearSystem.hpp index e50b088a8c514a6cfaca52b9308fc124c5c59fec..5180e57b93aded357f37d2a2df8fcca399d31a88 100644 --- a/lib/kokkos/example/multi_fem/SparseLinearSystem.hpp +++ b/lib/kokkos/example/multi_fem/SparseLinearSystem.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/SparseLinearSystemFill.hpp b/lib/kokkos/example/multi_fem/SparseLinearSystemFill.hpp index 78680cfb6a1ea00e514c2a17cc8ed162542ee732..980f14ac1b1c31fa72ec1e45e18d7c9f190255fa 100644 --- a/lib/kokkos/example/multi_fem/SparseLinearSystemFill.hpp +++ b/lib/kokkos/example/multi_fem/SparseLinearSystemFill.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/SparseLinearSystem_Cuda.hpp b/lib/kokkos/example/multi_fem/SparseLinearSystem_Cuda.hpp index 3b22d4c5d0e73d9c5c39e92ad043debf796993a5..8dfae4758d0dcf9e081dded8f80ff09e37f25363 100644 --- a/lib/kokkos/example/multi_fem/SparseLinearSystem_Cuda.hpp +++ b/lib/kokkos/example/multi_fem/SparseLinearSystem_Cuda.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/TestBoxMeshFixture.hpp b/lib/kokkos/example/multi_fem/TestBoxMeshFixture.hpp index d01aceb28847fda5de02407f0f24389e1ddfc483..9903c998fe63aece380cb34f5cb23d0b7440a4a0 100644 --- a/lib/kokkos/example/multi_fem/TestBoxMeshFixture.hpp +++ b/lib/kokkos/example/multi_fem/TestBoxMeshFixture.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/TestBoxMeshPartition.cpp b/lib/kokkos/example/multi_fem/TestBoxMeshPartition.cpp index ffaeeb6af5e1403b0b57b72af909905f7811ccf8..93778c85841dfa81a62354b9ff6598e86b235e3d 100644 --- a/lib/kokkos/example/multi_fem/TestBoxMeshPartition.cpp +++ b/lib/kokkos/example/multi_fem/TestBoxMeshPartition.cpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/TestCuda.cpp b/lib/kokkos/example/multi_fem/TestCuda.cpp index fafa077a994c1cc48c455dfe87370feeb9b9d6ed..4b6b739050a2394c84577f52967413c69595b7ca 100644 --- a/lib/kokkos/example/multi_fem/TestCuda.cpp +++ b/lib/kokkos/example/multi_fem/TestCuda.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/TestHost.cpp b/lib/kokkos/example/multi_fem/TestHost.cpp index facdd0f28a2e0f5d19f42cfefaccb643c01becdd..d12ac837ca79b29e09f7fbb4d2ff3b1c70de9a80 100644 --- a/lib/kokkos/example/multi_fem/TestHost.cpp +++ b/lib/kokkos/example/multi_fem/TestHost.cpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/multi_fem/TestHybridFEM.cpp b/lib/kokkos/example/multi_fem/TestHybridFEM.cpp index 62980f8302b5fc805565ef419b91033b8c3b9b21..0be4e69973a6daed75cc5a110483390ecc227889 100644 --- a/lib/kokkos/example/multi_fem/TestHybridFEM.cpp +++ b/lib/kokkos/example/multi_fem/TestHybridFEM.cpp @@ -34,7 +34,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/query_device/query_device.cpp b/lib/kokkos/example/query_device/query_device.cpp index f35ddadfb4189a55997dc8f27ab8ffa1a607964d..7dd2e0c7ebdc5bb7d5c2db8856213a792a5a526b 100644 --- a/lib/kokkos/example/query_device/query_device.cpp +++ b/lib/kokkos/example/query_device/query_device.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/sort_array/main.cpp b/lib/kokkos/example/sort_array/main.cpp index b091a55d705d2672f0b549f70b4bba4f9fa23f47..331b2ef62d9619799308699d6a1c2c36477a8773 100644 --- a/lib/kokkos/example/sort_array/main.cpp +++ b/lib/kokkos/example/sort_array/main.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/sort_array/sort_array.hpp b/lib/kokkos/example/sort_array/sort_array.hpp index fc607b81dbf368547cd3bffcc0d47b3059609ee8..ae045b61af434d6f5cb9e64a71a10948b54fbd20 100644 --- a/lib/kokkos/example/sort_array/sort_array.hpp +++ b/lib/kokkos/example/sort_array/sort_array.hpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/01_hello_world/hello_world.cpp b/lib/kokkos/example/tutorial/01_hello_world/hello_world.cpp index 459b9b094fc93475ef62482ab4fff62d956cc9eb..3092b5a5746f08429ffa28304569552322754c66 100644 --- a/lib/kokkos/example/tutorial/01_hello_world/hello_world.cpp +++ b/lib/kokkos/example/tutorial/01_hello_world/hello_world.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/01_hello_world_lambda/hello_world_lambda.cpp b/lib/kokkos/example/tutorial/01_hello_world_lambda/hello_world_lambda.cpp index 249d44ab559682ce2622842048b47af4613ec16f..a304a0f3ab24059df0b1ced8c4ae4a2053a28bf5 100644 --- a/lib/kokkos/example/tutorial/01_hello_world_lambda/hello_world_lambda.cpp +++ b/lib/kokkos/example/tutorial/01_hello_world_lambda/hello_world_lambda.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/02_simple_reduce/simple_reduce.cpp b/lib/kokkos/example/tutorial/02_simple_reduce/simple_reduce.cpp index 236618f7be9cf59044169cb82b0894e43bf8351e..04a3cfb9a02097a483086ca0a9d9e3de90a58e52 100644 --- a/lib/kokkos/example/tutorial/02_simple_reduce/simple_reduce.cpp +++ b/lib/kokkos/example/tutorial/02_simple_reduce/simple_reduce.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/02_simple_reduce_lambda/simple_reduce_lambda.cpp b/lib/kokkos/example/tutorial/02_simple_reduce_lambda/simple_reduce_lambda.cpp index f7f467ad2d1dbd866ad185776cea5d45a9abce3c..8ed5d8f62dfb49400cf28d529c8907c7f653b298 100644 --- a/lib/kokkos/example/tutorial/02_simple_reduce_lambda/simple_reduce_lambda.cpp +++ b/lib/kokkos/example/tutorial/02_simple_reduce_lambda/simple_reduce_lambda.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/03_simple_view/simple_view.cpp b/lib/kokkos/example/tutorial/03_simple_view/simple_view.cpp index dbbb9d867dc626ae251efe3fa3f5be27b2b8dfcf..b6930dc62476d073d72623dd73ced16210084610 100644 --- a/lib/kokkos/example/tutorial/03_simple_view/simple_view.cpp +++ b/lib/kokkos/example/tutorial/03_simple_view/simple_view.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp b/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp index 3450ad1bb468095a9d821a1c8e0560b256607166..c9d76cedfb5f7977a4388bee7c023aafd0fd6f65 100644 --- a/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp +++ b/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/04_simple_memoryspaces/simple_memoryspaces.cpp b/lib/kokkos/example/tutorial/04_simple_memoryspaces/simple_memoryspaces.cpp index c6a4bebfa525c6114681122af59e0dfaf1a71c70..13df7cf450e104be75b21e3b72aadea27131dda0 100644 --- a/lib/kokkos/example/tutorial/04_simple_memoryspaces/simple_memoryspaces.cpp +++ b/lib/kokkos/example/tutorial/04_simple_memoryspaces/simple_memoryspaces.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/05_simple_atomics/simple_atomics.cpp b/lib/kokkos/example/tutorial/05_simple_atomics/simple_atomics.cpp index 8acd2464c7c0d96beeaa951ab10cf3c83c8b7cec..585ba29fa7633bcd280bbbeb3a87768e56bc46a5 100644 --- a/lib/kokkos/example/tutorial/05_simple_atomics/simple_atomics.cpp +++ b/lib/kokkos/example/tutorial/05_simple_atomics/simple_atomics.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -123,12 +123,12 @@ int main () { // Fill the 'data' array on the host with random numbers. We assume // that they come from some process which is only implemented on the // host, via some library. (That's true in this case.) - for (size_type i = 0; i < data.dimension_0 (); ++i) { + for (size_type i = 0; i < data.extent(0); ++i) { h_data(i) = rand () % nnumbers; } Kokkos::deep_copy (data, h_data); // copy from host to device - Kokkos::parallel_for (data.dimension_0 (), findprimes (data, result, count)); + Kokkos::parallel_for (data.extent(0), findprimes (data, result, count)); Kokkos::deep_copy (h_count, count); // copy from device to host printf ("Found %i prime numbers in %i random numbers\n", h_count(), nnumbers); diff --git a/lib/kokkos/example/tutorial/06_simple_mdrangepolicy/simple_mdrangepolicy.cpp b/lib/kokkos/example/tutorial/06_simple_mdrangepolicy/simple_mdrangepolicy.cpp index 3712d6c5e275637a81c9a61c7746071c6bbc6ac9..38cf00dd19409eb576e41481f95ffd11f5599fcb 100644 --- a/lib/kokkos/example/tutorial/06_simple_mdrangepolicy/simple_mdrangepolicy.cpp +++ b/lib/kokkos/example/tutorial/06_simple_mdrangepolicy/simple_mdrangepolicy.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/Advanced_Views/01_data_layouts/data_layouts.cpp b/lib/kokkos/example/tutorial/Advanced_Views/01_data_layouts/data_layouts.cpp index 8406c504c9678cbe86dd8bd84b0f9e00391e8737..247bb44ba197ac5d22855d08b91a837f39937e52 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/01_data_layouts/data_layouts.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/01_data_layouts/data_layouts.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -73,8 +73,8 @@ struct init_view { // access on a for optimal performance. I.e. a should be LayoutRight. // On GPUs threads should do coalesced loads and stores. That means // that i should be the stride one access for optimal performance. - for (typename ViewType::size_type j = 0; j < a.dimension_1 (); ++j) { - a(i,j) = 1.0*a.dimension_0()*i + 1.0*j; + for (typename ViewType::size_type j = 0; j < a.extent(1); ++j) { + a(i,j) = 1.0*a.extent(0)*i + 1.0*j; } } }; @@ -104,7 +104,7 @@ struct contraction { // LayoutLeft and v2 LayoutRight. KOKKOS_INLINE_FUNCTION void operator() (const view_type::size_type i) const { - for (view_type::size_type j = 0; j < v1.dimension_1 (); ++j) { + for (view_type::size_type j = 0; j < v1.extent(1); ++j) { a(i) = v1(i,j)*v2(j,i); } } diff --git a/lib/kokkos/example/tutorial/Advanced_Views/02_memory_traits/memory_traits.cpp b/lib/kokkos/example/tutorial/Advanced_Views/02_memory_traits/memory_traits.cpp index ddd28a97c3739bea326b7b71e09c06e42b05f9f9..75bfdd9cf5952606dd3143dc97899a0f040b8c67 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/02_memory_traits/memory_traits.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/02_memory_traits/memory_traits.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -87,10 +87,10 @@ struct localsum { KOKKOS_INLINE_FUNCTION void operator() (const int i) const { double tmp = 0.0; - for (int j = 0; j < (int) idx.dimension_1 (); ++j) { + for (int j = 0; j < (int) idx.extent(1); ++j) { // This is an indirect access on src const double val = src(idx(i,j)); - tmp += val*val + 0.5*(idx.dimension_0()*val -idx.dimension_1()*val); + tmp += val*val + 0.5*(idx.extent(0)*val -idx.extent(1)*val); } dest(i) = tmp; } @@ -110,7 +110,7 @@ int main(int narg, char* arg[]) { srand(134231); for (int i = 0; i < size; i++) { - for (view_type::size_type j = 0; j < h_idx.dimension_1 (); ++j) { + for (view_type::size_type j = 0; j < h_idx.extent(1); ++j) { h_idx(i,j) = (size + i + (rand () % 500 - 250)) % size; } } diff --git a/lib/kokkos/example/tutorial/Advanced_Views/03_subviews/subviews.cpp b/lib/kokkos/example/tutorial/Advanced_Views/03_subviews/subviews.cpp index c8001ebaa60664dcb7b644c8b55b5ac1d7a0ba76..5e833434903f7d89828449d041514ef0a66cc37d 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/03_subviews/subviews.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/03_subviews/subviews.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -81,7 +81,7 @@ struct set_boundary { KOKKOS_INLINE_FUNCTION void operator() (const typename ViewType::size_type i) const { - for (typename ViewType::size_type j = 0; j < a.dimension_1 (); ++j) { + for (typename ViewType::size_type j = 0; j < a.extent(1); ++j) { a(i,j) = value; } } @@ -102,8 +102,8 @@ struct set_inner { KOKKOS_INLINE_FUNCTION void operator () (const typename ViewType::size_type i) const { typedef typename ViewType::size_type size_type; - for (size_type j = 0; j < a.dimension_1 (); ++j) { - for (size_type k = 0; k < a.dimension_2 (); ++k) { + for (size_type j = 0; j < a.extent(1); ++j) { + for (size_type k = 0; k < a.extent(2); ++k) { a(i,j,k) = value; } } @@ -125,8 +125,8 @@ struct update { void operator() (typename ViewType::size_type i) const { typedef typename ViewType::size_type size_type; i++; - for (size_type j = 1; j < a.dimension_1()-1; j++) { - for (size_type k = 1; k < a.dimension_2()-1; k++) { + for (size_type j = 1; j < a.extent(1)-1; j++) { + for (size_type k = 1; k < a.extent(2)-1; k++) { a(i,j,k) += dt* (a(i,j,k+1) - a(i,j,k-1) + a(i,j+1,k) - a(i,j-1,k) + a(i+1,j,k) - a(i-1,j,k)); @@ -170,19 +170,19 @@ int main (int narg, char* arg[]) { yz_plane_type Xpos_halo = subview(A, 101, ALL (), ALL ()); // Set the boundaries to their initial conditions. - parallel_for (Zneg_halo.dimension_0 (), set_boundary<xy_plane_type> (Zneg_halo, 1)); - parallel_for (Zpos_halo.dimension_0 (), set_boundary<xy_plane_type> (Zpos_halo, -1)); - parallel_for (Yneg_halo.dimension_0 (), set_boundary<xz_plane_type> (Yneg_halo, 2)); - parallel_for (Ypos_halo.dimension_0 (), set_boundary<xz_plane_type> (Ypos_halo, -2)); - parallel_for (Xneg_halo.dimension_0 (), set_boundary<yz_plane_type> (Xneg_halo, 3)); - parallel_for (Xpos_halo.dimension_0 (), set_boundary<yz_plane_type> (Xpos_halo, -3)); + parallel_for (Zneg_halo.extent(0), set_boundary<xy_plane_type> (Zneg_halo, 1)); + parallel_for (Zpos_halo.extent(0), set_boundary<xy_plane_type> (Zpos_halo, -1)); + parallel_for (Yneg_halo.extent(0), set_boundary<xz_plane_type> (Yneg_halo, 2)); + parallel_for (Ypos_halo.extent(0), set_boundary<xz_plane_type> (Ypos_halo, -2)); + parallel_for (Xneg_halo.extent(0), set_boundary<yz_plane_type> (Xneg_halo, 3)); + parallel_for (Xpos_halo.extent(0), set_boundary<yz_plane_type> (Xpos_halo, -3)); // Set the interior of the mesh to its initial condition. - parallel_for (Ai.dimension_0 (), set_inner<inner_mesh_type> (Ai, 0)); + parallel_for (Ai.extent(0), set_inner<inner_mesh_type> (Ai, 0)); // Update the interior of the mesh. // This simulates one timestep with dt = 0.1. - parallel_for (Ai.dimension_0 (), update<mesh_type> (A, 0.1)); + parallel_for (Ai.extent(0), update<mesh_type> (A, 0.1)); printf ("Done\n"); Kokkos::finalize (); diff --git a/lib/kokkos/example/tutorial/Advanced_Views/04_dualviews/dual_view.cpp b/lib/kokkos/example/tutorial/Advanced_Views/04_dualviews/dual_view.cpp index 26b55eae7886f146699dd527a69a97a974d2dc6d..e0fa559587063337f70525e062d5d98c116c0310 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/04_dualviews/dual_view.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/04_dualviews/dual_view.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -127,9 +127,9 @@ struct localsum { KOKKOS_INLINE_FUNCTION void operator() (const int i) const { double tmp = 0.0; - for (int j = 0; j < (int) idx.dimension_1(); ++j) { + for (int j = 0; j < (int) idx.extent(1); ++j) { const double val = src(idx(i,j)); - tmp += val*val + 0.5*(idx.dimension_0()*val -idx.dimension_1()*val); + tmp += val*val + 0.5*(idx.extent(0)*val -idx.extent(1)*val); } dest(i) += tmp; } @@ -173,7 +173,7 @@ int main (int narg, char* arg[]) { // idx.view<idx_type::host_mirror_space>() ) idx_type::t_host h_idx = idx.h_view; for (int i = 0; i < size; ++i) { - for (view_type::size_type j = 0; j < h_idx.dimension_1 (); ++j) { + for (view_type::size_type j = 0; j < h_idx.extent(1); ++j) { h_idx(i,j) = (size + i + (rand () % 500 - 250)) % size; } } diff --git a/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp b/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp index 8cfb624b8daaf848988ed88633edd872b6d8d35d..b322dcad358f3c3a987f41d64f4eee65682a6c01 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -72,9 +72,9 @@ struct localsum { KOKKOS_INLINE_FUNCTION void operator() (int i) const { double tmp = 0.0; - for(int j = 0; j < int(idx.dimension_1()); j++) { + for(int j = 0; j < int(idx.extent(1)); j++) { const double val = src(idx(i,j)); - tmp += val*val + 0.5*(idx.dimension_0()*val -idx.dimension_1()*val); + tmp += val*val + 0.5*(idx.extent(0)*val -idx.extent(1)*val); } dest(i) += tmp; } @@ -96,7 +96,7 @@ int main(int narg, char* arg[]) { // When using UVM Cuda views can be accessed on the Host directly for(int i=0; i<size; i++) { - for(int j=0; j<int(idx.dimension_1()); j++) + for(int j=0; j<int(idx.extent(1)); j++) idx(i,j) = (size + i + (rand()%500 - 250))%size; } diff --git a/lib/kokkos/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/overlapping_deepcopy.cpp b/lib/kokkos/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/overlapping_deepcopy.cpp index 5da3bf76c98ebc1cfbf4c6d81d3e6fc7d3e13171..ad1503642bf348a8447dd6320e56ea26b11ed016 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/overlapping_deepcopy.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/overlapping_deepcopy.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/Algorithms/01_random_numbers/random_numbers.cpp b/lib/kokkos/example/tutorial/Algorithms/01_random_numbers/random_numbers.cpp index a5cf40cedc172f7cc6e94e01e3c1d7e4202a9bd8..48b0d86cb84d9f32d262efb7488fc01f43e52e6e 100644 --- a/lib/kokkos/example/tutorial/Algorithms/01_random_numbers/random_numbers.cpp +++ b/lib/kokkos/example/tutorial/Algorithms/01_random_numbers/random_numbers.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp index f2de0809a796128e76e44cdb32837f4c82c98022..ff3002e645d265765fa38b437fbe0711d5408d78 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp index 9ea5e8b70711942cb61ef29f38144b52f81137e0..d936699a5f9b165600283a193129894f4d6e8ba4 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp index 4357b4fa1a19b6b36fed42fe3f0a2b526b1fa8b4..721aab2d3e382fcb92f51f1845b9c7aaa21b0d5e 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp index b2e0ba5388ecd9feb3712b8ad3ba71a3f589d207..1c6491cafc3f264d22841e0d8385a04503381692 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER @@ -79,15 +79,15 @@ struct SomeCorrelation { int i = thread.league_rank(); // Allocate a shared array for the team. - shared_1d_int count(thread.team_shmem(),data.dimension_1()); + shared_1d_int count(thread.team_shmem(),data.extent(1)); // With each team run a parallel_for with its threads - Kokkos::parallel_for(Kokkos::TeamThreadRange(thread,data.dimension_1()), [=] (const int& j) { + Kokkos::parallel_for(Kokkos::TeamThreadRange(thread,data.extent(1)), [=] (const int& j) { int tsum; // Run a vector loop reduction over the inner dimension of data // Count how many values are multiples of 4 // Every vector lane gets the same reduction value (tsum) back, it is broadcast to all vector lanes - Kokkos::parallel_reduce(Kokkos::ThreadVectorRange(thread,data.dimension_2()), [=] (const int& k, int & vsum) { + Kokkos::parallel_reduce(Kokkos::ThreadVectorRange(thread,data.extent(2)), [=] (const int& k, int & vsum) { vsum+= (data(i,j,k) % 4 == 0)?1:0; },tsum); @@ -105,7 +105,7 @@ struct SomeCorrelation { // data segments have the same number of values divisible by 4 // The team reduction value is again broadcast to every team member (and every vector lane) int team_sum = 0; - Kokkos::parallel_reduce(Kokkos::TeamThreadRange(thread, data.dimension_1()-1), [=] (const int& j, int& thread_sum) { + Kokkos::parallel_reduce(Kokkos::TeamThreadRange(thread, data.extent(1)-1), [=] (const int& j, int& thread_sum) { // It is not valid to directly add to thread_sum // Use a single function with broadcast instead // team_sum will be used as input to the operator (i.e. it is used to initialize sum) @@ -123,7 +123,7 @@ struct SomeCorrelation { // The functor needs to define how much shared memory it requests given a team_size. size_t team_shmem_size( int team_size ) const { - return shared_1d_int::shmem_size(data.dimension_1()); + return shared_1d_int::shmem_size(data.extent(1)); } }; diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/04_team_scan/team_scan.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/04_team_scan/team_scan.cpp index ebc8578f0bce9f728670d594a968b5d289eb68da..951e09bd253540562bcf235149297e082f2fcdfe 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/04_team_scan/team_scan.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/04_team_scan/team_scan.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/example/tutorial/launch_bounds/launch_bounds_reduce.cpp b/lib/kokkos/example/tutorial/launch_bounds/launch_bounds_reduce.cpp index 9a26eda5073a248a1360c489bfe1d64c889857d3..5ff979e86e4bf5a930e353173df1a5f7681cc4b7 100644 --- a/lib/kokkos/example/tutorial/launch_bounds/launch_bounds_reduce.cpp +++ b/lib/kokkos/example/tutorial/launch_bounds/launch_bounds_reduce.cpp @@ -35,7 +35,7 @@ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // -// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) // // ************************************************************************ //@HEADER diff --git a/lib/kokkos/generate_makefile.bash b/lib/kokkos/generate_makefile.bash index 521a77d1af7de38357a22ac00e56fa6997c8a5cc..84b1eea8a84c5c625a6416a6e24bfa10c78ed2c7 100755 --- a/lib/kokkos/generate_makefile.bash +++ b/lib/kokkos/generate_makefile.bash @@ -117,35 +117,38 @@ do echo "" echo "--arch=[OPT]: Set target architectures. Options are:" echo " [AMD]" - echo " AMDAVX = AMD CPU" + echo " AMDAVX = AMD CPU" echo " [ARM]" - echo " ARMv80 = ARMv8.0 Compatible CPU" - echo " ARMv81 = ARMv8.1 Compatible CPU" - echo " ARMv8-ThunderX = ARMv8 Cavium ThunderX CPU" + echo " ARMv80 = ARMv8.0 Compatible CPU" + echo " ARMv81 = ARMv8.1 Compatible CPU" + echo " ARMv8-ThunderX = ARMv8 Cavium ThunderX CPU" + echo " ARMv8-TX2 = ARMv8 Cavium ThunderX2 CPU" echo " [IBM]" - echo " BGQ = IBM Blue Gene Q" - echo " Power7 = IBM POWER7 and POWER7+ CPUs" - echo " Power8 = IBM POWER8 CPUs" - echo " Power9 = IBM POWER9 CPUs" + echo " BGQ = IBM Blue Gene Q" + echo " Power7 = IBM POWER7 and POWER7+ CPUs" + echo " Power8 = IBM POWER8 CPUs" + echo " Power9 = IBM POWER9 CPUs" echo " [Intel]" - echo " WSM = Intel Westmere CPUs" - echo " SNB = Intel Sandy/Ivy Bridge CPUs" - echo " HSW = Intel Haswell CPUs" - echo " BDW = Intel Broadwell Xeon E-class CPUs" - echo " SKX = Intel Sky Lake Xeon E-class HPC CPUs (AVX512)" + echo " WSM = Intel Westmere CPUs" + echo " SNB = Intel Sandy/Ivy Bridge CPUs" + echo " HSW = Intel Haswell CPUs" + echo " BDW = Intel Broadwell Xeon E-class CPUs" + echo " SKX = Intel Sky Lake Xeon E-class HPC CPUs (AVX512)" echo " [Intel Xeon Phi]" - echo " KNC = Intel Knights Corner Xeon Phi" - echo " KNL = Intel Knights Landing Xeon Phi" + echo " KNC = Intel Knights Corner Xeon Phi" + echo " KNL = Intel Knights Landing Xeon Phi" echo " [NVIDIA]" - echo " Kepler30 = NVIDIA Kepler generation CC 3.0" - echo " Kepler32 = NVIDIA Kepler generation CC 3.2" - echo " Kepler35 = NVIDIA Kepler generation CC 3.5" - echo " Kepler37 = NVIDIA Kepler generation CC 3.7" - echo " Maxwell50 = NVIDIA Maxwell generation CC 5.0" - echo " Maxwell52 = NVIDIA Maxwell generation CC 5.2" - echo " Maxwell53 = NVIDIA Maxwell generation CC 5.3" - echo " Pascal60 = NVIDIA Pascal generation CC 6.0" - echo " Pascal61 = NVIDIA Pascal generation CC 6.1" + echo " Kepler30 = NVIDIA Kepler generation CC 3.0" + echo " Kepler32 = NVIDIA Kepler generation CC 3.2" + echo " Kepler35 = NVIDIA Kepler generation CC 3.5" + echo " Kepler37 = NVIDIA Kepler generation CC 3.7" + echo " Maxwell50 = NVIDIA Maxwell generation CC 5.0" + echo " Maxwell52 = NVIDIA Maxwell generation CC 5.2" + echo " Maxwell53 = NVIDIA Maxwell generation CC 5.3" + echo " Pascal60 = NVIDIA Pascal generation CC 6.0" + echo " Pascal61 = NVIDIA Pascal generation CC 6.1" + echo " Volta70 = NVIDIA Volta generation CC 7.0" + echo " Volta72 = NVIDIA Volta generation CC 7.2" echo "" echo "--compiler=/Path/To/Compiler Set the compiler." echo "--debug,-dbg: Enable Debugging." diff --git a/lib/kokkos/config/master_history.txt b/lib/kokkos/master_history.txt similarity index 87% rename from lib/kokkos/config/master_history.txt rename to lib/kokkos/master_history.txt index 06c3f95a80e3fa3aa1918c83b98b7d269b928cda..f47017b2fb834c9738d60e195dac1139a980eb3d 100644 --- a/lib/kokkos/config/master_history.txt +++ b/lib/kokkos/master_history.txt @@ -11,4 +11,5 @@ tag: 2.03.13 date: 07:27:2017 master: da314444 develop: 29ccb58a tag: 2.04.00 date: 08:16:2017 master: 54eb75c0 develop: 32fb8ee1 tag: 2.04.04 date: 09:11:2017 master: 2b7e9c20 develop: 51e7b25a tag: 2.04.11 date: 10:28:2017 master: 54a1330a develop: ed36c017 -tag: 2.5.11 date: 12:15:2017 master: dfe685f4 develop: ec7ad6d8 +tag: 2.5.00 date: 12:15:2017 master: dfe685f4 develop: ec7ad6d8 +tag: 2.6.00 date: 03:07:2018 master: 62e760fa develop: d1ba7d71 diff --git a/lib/kokkos/config/snapshot.py b/lib/kokkos/scripts/snapshot.py similarity index 100% rename from lib/kokkos/config/snapshot.py rename to lib/kokkos/scripts/snapshot.py diff --git a/lib/kokkos/config/testing_scripts/README b/lib/kokkos/scripts/testing_scripts/README similarity index 100% rename from lib/kokkos/config/testing_scripts/README rename to lib/kokkos/scripts/testing_scripts/README diff --git a/lib/kokkos/config/testing_scripts/jenkins_test_driver b/lib/kokkos/scripts/testing_scripts/jenkins_test_driver similarity index 100% rename from lib/kokkos/config/testing_scripts/jenkins_test_driver rename to lib/kokkos/scripts/testing_scripts/jenkins_test_driver diff --git a/lib/kokkos/config/testing_scripts/obj_size_opt_check b/lib/kokkos/scripts/testing_scripts/obj_size_opt_check similarity index 100% rename from lib/kokkos/config/testing_scripts/obj_size_opt_check rename to lib/kokkos/scripts/testing_scripts/obj_size_opt_check diff --git a/lib/kokkos/config/test_kokkos_master_develop_promotion.sh b/lib/kokkos/scripts/testing_scripts/test_kokkos_master_develop_promotion.sh similarity index 100% rename from lib/kokkos/config/test_kokkos_master_develop_promotion.sh rename to lib/kokkos/scripts/testing_scripts/test_kokkos_master_develop_promotion.sh diff --git a/lib/kokkos/config/trilinos-integration/checkin-test b/lib/kokkos/scripts/trilinos-integration/checkin-test similarity index 100% rename from lib/kokkos/config/trilinos-integration/checkin-test rename to lib/kokkos/scripts/trilinos-integration/checkin-test diff --git a/lib/kokkos/config/trilinos-integration/prepare_trilinos_repos.sh b/lib/kokkos/scripts/trilinos-integration/prepare_trilinos_repos.sh similarity index 93% rename from lib/kokkos/config/trilinos-integration/prepare_trilinos_repos.sh rename to lib/kokkos/scripts/trilinos-integration/prepare_trilinos_repos.sh index b81a3b1566f103ac5284b78d17378467de691f39..31b2ad21bdc1b8daea4d67ab7b203f47c614dc42 100755 --- a/lib/kokkos/config/trilinos-integration/prepare_trilinos_repos.sh +++ b/lib/kokkos/scripts/trilinos-integration/prepare_trilinos_repos.sh @@ -34,7 +34,7 @@ git reset --hard origin/$TRILINOS_UPDATE_BRANCH git pull cd .. -python kokkos/config/snapshot.py ${KOKKOS_PATH} ${TRILINOS_UPDATED_PATH}/packages +python kokkos/scripts/snapshot.py ${KOKKOS_PATH} ${TRILINOS_UPDATED_PATH}/packages cd ${TRILINOS_UPDATED_PATH} echo "" diff --git a/lib/kokkos/config/trilinos-integration/shepard_jenkins_run_script_pthread_intel b/lib/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_pthread_intel similarity index 91% rename from lib/kokkos/config/trilinos-integration/shepard_jenkins_run_script_pthread_intel rename to lib/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_pthread_intel index f122a1b36f58f6cb31ba533b73213e533994074e..3b2c7255177c3b004b54cef3629a56aed46d9798 100755 --- a/lib/kokkos/config/trilinos-integration/shepard_jenkins_run_script_pthread_intel +++ b/lib/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_pthread_intel @@ -55,6 +55,6 @@ git checkout $KOKKOS_BRANCH git pull cd .. -source ${KOKKOS_PATH}/config/trilinos-integration/prepare_trilinos_repos.sh $TRILINOS_UPDATE_BRANCH $TRILINOS_PRISTINE_BRANCH +source ${KOKKOS_PATH}/scripts/trilinos-integration/prepare_trilinos_repos.sh $TRILINOS_UPDATE_BRANCH $TRILINOS_PRISTINE_BRANCH ${TRILINOS_UPDATED_PATH}/sampleScripts/Sandia-SEMS/run_repo_comparison_slurm ${TRILINOS_UPDATED_PATH} ${TRILINOS_PRISTINE_PATH} ${TRILINOS_UPDATED_PATH}/sampleScripts/Sandia-SEMS/configure-testbeds-jenkins-all TestCompare ${QUEUE} diff --git a/lib/kokkos/config/trilinos-integration/shepard_jenkins_run_script_serial_intel b/lib/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_serial_intel similarity index 91% rename from lib/kokkos/config/trilinos-integration/shepard_jenkins_run_script_serial_intel rename to lib/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_serial_intel index f9b2200a4345dc06d3c8ac8207ad249bacf9bc28..9ce936ae2634b1b8b7375f70d241c74189c3ae40 100755 --- a/lib/kokkos/config/trilinos-integration/shepard_jenkins_run_script_serial_intel +++ b/lib/kokkos/scripts/trilinos-integration/shepard_jenkins_run_script_serial_intel @@ -55,6 +55,6 @@ git checkout $KOKKOS_BRANCH git pull cd .. -source ${KOKKOS_PATH}/config/trilinos-integration/prepare_trilinos_repos.sh $TRILINOS_UPDATE_BRANCH $TRILINOS_PRISTINE_BRANCH +source ${KOKKOS_PATH}/scripts/trilinos-integration/prepare_trilinos_repos.sh $TRILINOS_UPDATE_BRANCH $TRILINOS_PRISTINE_BRANCH ${TRILINOS_UPDATED_PATH}/sampleScripts/Sandia-SEMS/run_repo_comparison_slurm ${TRILINOS_UPDATED_PATH} ${TRILINOS_PRISTINE_PATH} ${TRILINOS_UPDATED_PATH}/sampleScripts/Sandia-SEMS/configure-testbeds-jenkins-all TestCompare ${QUEUE} diff --git a/lib/kokkos/config/trilinos-integration/white_run_jenkins_script_cuda b/lib/kokkos/scripts/trilinos-integration/white_run_jenkins_script_cuda similarity index 91% rename from lib/kokkos/config/trilinos-integration/white_run_jenkins_script_cuda rename to lib/kokkos/scripts/trilinos-integration/white_run_jenkins_script_cuda index 52af024858de4c59796773d00d47bc9641e6ab85..2716767fe5dd7ed479843040a32e591fa4439bf3 100755 --- a/lib/kokkos/config/trilinos-integration/white_run_jenkins_script_cuda +++ b/lib/kokkos/scripts/trilinos-integration/white_run_jenkins_script_cuda @@ -57,7 +57,7 @@ cd .. export CUDA_LAUNCH_BLOCKING=1 export CUDA_MANAGED_FORCE_DEVICE_ALLOC=1 -source ${KOKKOS_PATH}/config/trilinos-integration/prepare_trilinos_repos.sh $TRILINOS_UPDATE_BRANCH $TRILINOS_PRISTINE_BRANCH +source ${KOKKOS_PATH}/scripts/trilinos-integration/prepare_trilinos_repos.sh $TRILINOS_UPDATE_BRANCH $TRILINOS_PRISTINE_BRANCH ${TRILINOS_UPDATED_PATH}/sampleScripts/Sandia-SEMS/run_repo_comparison_lsf ${TRILINOS_UPDATED_PATH} ${TRILINOS_PRISTINE_PATH} ${TRILINOS_UPDATED_PATH}/sampleScripts/Sandia-SEMS/configure-testbeds-jenkins-all TestCompare ${QUEUE} diff --git a/lib/kokkos/config/trilinos-integration/white_run_jenkins_script_omp b/lib/kokkos/scripts/trilinos-integration/white_run_jenkins_script_omp similarity index 91% rename from lib/kokkos/config/trilinos-integration/white_run_jenkins_script_omp rename to lib/kokkos/scripts/trilinos-integration/white_run_jenkins_script_omp index 452165eef2e869601693d94711a134c7b04f9927..ff1086507ce50d21d17292f29cb462f24e24def1 100755 --- a/lib/kokkos/config/trilinos-integration/white_run_jenkins_script_omp +++ b/lib/kokkos/scripts/trilinos-integration/white_run_jenkins_script_omp @@ -52,7 +52,7 @@ git checkout $KOKKOS_BRANCH git pull cd .. -source ${KOKKOS_PATH}/config/trilinos-integration/prepare_trilinos_repos.sh $TRILINOS_UPDATE_BRANCH $TRILINOS_PRISTINE_BRANCH +source ${KOKKOS_PATH}/scripts/trilinos-integration/prepare_trilinos_repos.sh $TRILINOS_UPDATE_BRANCH $TRILINOS_PRISTINE_BRANCH ${TRILINOS_UPDATED_PATH}/sampleScripts/Sandia-SEMS/run_repo_comparison_lsf ${TRILINOS_UPDATED_PATH} ${TRILINOS_PRISTINE_PATH} ${TRILINOS_UPDATED_PATH}/sampleScripts/Sandia-SEMS/configure-testbeds-jenkins-all TestCompare ${QUEUE}