From 39786b17407dd03a501f8582df53bd56a25d16f7 Mon Sep 17 00:00:00 2001 From: Stan Moore <stamoor@sandia.gov> Date: Thu, 8 Mar 2018 10:57:08 -0700 Subject: [PATCH] Update Kokkos library to r2.6.00 --- lib/kokkos/CHANGELOG.md | 44 + lib/kokkos/CMakeLists.txt | 14 +- lib/kokkos/Copyright.txt | 2 +- lib/kokkos/HOW_TO_SNAPSHOT | 2 +- lib/kokkos/LICENSE | 2 +- lib/kokkos/Makefile.kokkos | 116 +- lib/kokkos/README | 213 +- lib/kokkos/algorithms/src/Kokkos_Random.hpp | 150 +- lib/kokkos/algorithms/src/Kokkos_Sort.hpp | 48 +- lib/kokkos/algorithms/unit_tests/TestCuda.cpp | 7 +- .../algorithms/unit_tests/TestOpenMP.cpp | 17 +- lib/kokkos/algorithms/unit_tests/TestROCm.cpp | 6 +- .../algorithms/unit_tests/TestRandom.hpp | 2 +- .../algorithms/unit_tests/TestSerial.cpp | 5 +- lib/kokkos/algorithms/unit_tests/TestSort.hpp | 104 +- .../algorithms/unit_tests/TestThreads.cpp | 17 +- .../algorithms/unit_tests/UnitTestMain.cpp | 8 +- lib/kokkos/benchmarks/atomic/Makefile | 2 +- .../benchmark_suite/scripts/run_tests.bash | 4 +- .../benchmarks/bytes_and_flops/bench.hpp | 2 +- .../bytes_and_flops/bench_stride.hpp | 2 +- .../bytes_and_flops/bench_unroll_stride.hpp | 2 +- .../benchmarks/bytes_and_flops/main.cpp | 2 +- lib/kokkos/benchmarks/gather/gather.hpp | 2 +- .../benchmarks/gather/gather_unroll.hpp | 2 +- lib/kokkos/benchmarks/gather/main.cpp | 2 +- .../benchmarks/policy_performance/main.cpp | 2 +- .../policy_performance/policy_perf_test.hpp | 2 +- lib/kokkos/cmake/Modules/FindHWLOC.cmake | 6 +- lib/kokkos/cmake/kokkos_build.cmake | 36 +- lib/kokkos/cmake/kokkos_options.cmake | 6 +- lib/kokkos/cmake/kokkos_settings.cmake | 87 +- lib/kokkos/cmake/tribits.cmake | 7 +- lib/kokkos/config/configure_compton_cpu.sh | 190 -- lib/kokkos/config/configure_compton_mic.sh | 186 -- lib/kokkos/config/configure_kokkos.sh | 293 -- lib/kokkos/config/configure_kokkos_bgq.sh | 88 - lib/kokkos/config/configure_kokkos_dev.sh | 216 -- lib/kokkos/config/configure_kokkos_nvidia.sh | 204 -- lib/kokkos/config/configure_shannon.sh | 190 -- ...nfigure_tpetra_kokkos_cuda_nvcc_wrapper.sh | 140 - .../kokkos-trilinos-integration-procedure.txt | 148 - .../config/kokkos_dev/config-core-all.sh | 110 - .../kokkos_dev/config-core-cuda-omp-hwloc.sh | 104 - .../config/kokkos_dev/config-core-cuda.sh | 88 - .../kokkos_dev/config-core-cxx11-omp.sh | 84 - .../config/kokkos_dev/config-core-dbg-none.sh | 78 - .../kokkos_dev/config-core-intel-cuda-omp.sh | 89 - .../kokkos_dev/config-core-intel-omp.sh | 84 - .../config/kokkos_dev/config-core-omp.sh | 77 - .../kokkos_dev/config-core-threads-hwloc.sh | 87 - lib/kokkos/config/nvcc_wrapper | 340 -- lib/kokkos/config/test_all_sandia | 106 +- .../containers/performance_tests/TestCuda.cpp | 2 +- .../performance_tests/TestDynRankView.hpp | 26 +- .../performance_tests/TestGlobal2LocalIds.hpp | 8 +- .../containers/performance_tests/TestMain.cpp | 2 +- .../performance_tests/TestOpenMP.cpp | 2 +- .../containers/performance_tests/TestROCm.cpp | 2 +- .../performance_tests/TestScatterView.hpp | 2 +- .../performance_tests/TestThreads.cpp | 2 +- .../TestUnorderedMapPerformance.hpp | 2 +- lib/kokkos/containers/src/Kokkos_Bitset.hpp | 22 +- lib/kokkos/containers/src/Kokkos_DualView.hpp | 60 +- .../containers/src/Kokkos_DynRankView.hpp | 333 +- .../containers/src/Kokkos_DynamicView.hpp | 387 ++- .../containers/src/Kokkos_ErrorReporter.hpp | 10 +- .../containers/src/Kokkos_Functional.hpp | 2 +- .../containers/src/Kokkos_ScatterView.hpp | 11 +- .../containers/src/Kokkos_StaticCrsGraph.hpp | 12 +- .../containers/src/Kokkos_UnorderedMap.hpp | 36 +- lib/kokkos/containers/src/Kokkos_Vector.hpp | 2 +- .../src/impl/Kokkos_Bitset_impl.hpp | 4 +- .../src/impl/Kokkos_Functional_impl.hpp | 2 +- .../impl/Kokkos_StaticCrsGraph_factory.hpp | 2 +- .../src/impl/Kokkos_UnorderedMap_impl.cpp | 2 +- .../src/impl/Kokkos_UnorderedMap_impl.hpp | 14 +- .../containers/unit_tests/TestBitset.hpp | 2 +- lib/kokkos/containers/unit_tests/TestCuda.cpp | 6 +- .../containers/unit_tests/TestDualView.hpp | 8 +- .../containers/unit_tests/TestDynViewAPI.hpp | 565 ++-- .../containers/unit_tests/TestDynamicView.hpp | 273 +- .../unit_tests/TestErrorReporter.hpp | 2 +- .../containers/unit_tests/TestOpenMP.cpp | 5 +- lib/kokkos/containers/unit_tests/TestROCm.cpp | 2 +- .../containers/unit_tests/TestScatterView.hpp | 4 +- .../containers/unit_tests/TestSerial.cpp | 4 +- .../unit_tests/TestStaticCrsGraph.hpp | 24 +- .../containers/unit_tests/TestThreads.cpp | 17 +- .../unit_tests/TestUnorderedMap.hpp | 2 +- .../containers/unit_tests/TestVector.hpp | 2 +- .../TestViewCtorPropEmbeddedDim.hpp | 2 +- .../containers/unit_tests/UnitTestMain.cpp | 9 +- lib/kokkos/core/perf_test/Makefile | 1 + .../core/perf_test/PerfTestBlasKernels.hpp | 10 +- lib/kokkos/core/perf_test/PerfTestDriver.hpp | 2 +- .../core/perf_test/PerfTestGramSchmidt.cpp | 8 +- lib/kokkos/core/perf_test/PerfTestHexGrad.cpp | 2 +- lib/kokkos/core/perf_test/PerfTestMDRange.hpp | 2 +- lib/kokkos/core/perf_test/PerfTestMain.cpp | 2 +- .../core/perf_test/PerfTest_Category.hpp | 2 +- .../perf_test/PerfTest_CustomReduction.cpp | 2 +- .../core/perf_test/PerfTest_ViewCopy.cpp | 445 +++ lib/kokkos/core/perf_test/test_atomic.cpp | 2 +- lib/kokkos/core/perf_test/test_mempool.cpp | 2 +- lib/kokkos/core/perf_test/test_taskdag.cpp | 2 +- .../src/Cuda/KokkosExp_Cuda_IterateTile.hpp | 2 +- .../KokkosExp_Cuda_IterateTile_Refactor.hpp | 2 +- lib/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp | 2 +- lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp | 8 +- .../core/src/Cuda/Kokkos_Cuda_Alloc.hpp | 2 +- .../core/src/Cuda/Kokkos_Cuda_Error.hpp | 2 +- lib/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp | 29 +- .../core/src/Cuda/Kokkos_Cuda_Internal.hpp | 2 +- .../core/src/Cuda/Kokkos_Cuda_Locks.cpp | 2 +- .../core/src/Cuda/Kokkos_Cuda_Locks.hpp | 19 +- .../core/src/Cuda/Kokkos_Cuda_Parallel.hpp | 158 +- .../core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp | 35 +- lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp | 88 +- lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp | 292 +- lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp | 18 +- .../core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp | 2 +- .../src/Cuda/Kokkos_Cuda_Vectorization.hpp | 2 +- .../Kokkos_Cuda_Version_9_8_Compatibility.hpp | 58 + lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp | 10 +- .../src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp | 2 +- .../core/src/Cuda/Kokkos_Cuda_abort.hpp | 2 +- .../core/src/KokkosExp_MDRangePolicy.hpp | 98 +- lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp | 127 + lib/kokkos/core/src/Kokkos_Array.hpp | 2 +- lib/kokkos/core/src/Kokkos_Atomic.hpp | 15 +- lib/kokkos/core/src/Kokkos_Complex.hpp | 4 +- lib/kokkos/core/src/Kokkos_Concepts.hpp | 2 +- lib/kokkos/core/src/Kokkos_CopyViews.hpp | 1720 +++++++++++ lib/kokkos/core/src/Kokkos_Core.hpp | 27 +- lib/kokkos/core/src/Kokkos_Core_fwd.hpp | 9 +- lib/kokkos/core/src/Kokkos_Crs.hpp | 10 +- lib/kokkos/core/src/Kokkos_Cuda.hpp | 2 +- lib/kokkos/core/src/Kokkos_CudaSpace.hpp | 2 +- lib/kokkos/core/src/Kokkos_ExecPolicy.hpp | 234 +- lib/kokkos/core/src/Kokkos_HBWSpace.hpp | 2 +- lib/kokkos/core/src/Kokkos_HostSpace.hpp | 2 +- lib/kokkos/core/src/Kokkos_Layout.hpp | 2 +- lib/kokkos/core/src/Kokkos_Macros.hpp | 15 +- lib/kokkos/core/src/Kokkos_MasterLock.hpp | 2 +- lib/kokkos/core/src/Kokkos_MemoryPool.hpp | 12 +- lib/kokkos/core/src/Kokkos_MemoryTraits.hpp | 2 +- lib/kokkos/core/src/Kokkos_NumericTraits.hpp | 2 +- lib/kokkos/core/src/Kokkos_OpenMP.hpp | 4 +- lib/kokkos/core/src/Kokkos_OpenMPTarget.hpp | 2 +- .../core/src/Kokkos_OpenMPTargetSpace.hpp | 2 +- lib/kokkos/core/src/Kokkos_Pair.hpp | 2 +- lib/kokkos/core/src/Kokkos_Parallel.hpp | 2 +- .../core/src/Kokkos_Parallel_Reduce.hpp | 237 +- .../src/Kokkos_Profiling_ProfileSection.hpp | 2 +- lib/kokkos/core/src/Kokkos_Qthreads.hpp | 2 +- lib/kokkos/core/src/Kokkos_ROCm.hpp | 12 +- lib/kokkos/core/src/Kokkos_ROCmSpace.hpp | 2 +- lib/kokkos/core/src/Kokkos_ScratchSpace.hpp | 2 +- lib/kokkos/core/src/Kokkos_Serial.hpp | 41 +- lib/kokkos/core/src/Kokkos_TaskPolicy.hpp | 2 +- lib/kokkos/core/src/Kokkos_TaskScheduler.hpp | 14 +- lib/kokkos/core/src/Kokkos_Threads.hpp | 2 +- lib/kokkos/core/src/Kokkos_Timer.hpp | 2 +- lib/kokkos/core/src/Kokkos_UniqueToken.hpp | 2 +- lib/kokkos/core/src/Kokkos_Vectorization.hpp | 2 +- lib/kokkos/core/src/Kokkos_View.hpp | 1772 +++++------ .../core/src/Kokkos_WorkGraphPolicy.hpp | 4 +- lib/kokkos/core/src/Kokkos_hwloc.hpp | 2 +- .../core/src/Makefile.generate_build_files | 23 +- .../core/src/OpenMP/Kokkos_OpenMP_Exec.cpp | 7 +- .../core/src/OpenMP/Kokkos_OpenMP_Exec.hpp | 8 +- .../src/OpenMP/Kokkos_OpenMP_Parallel.hpp | 15 +- .../core/src/OpenMP/Kokkos_OpenMP_Task.cpp | 2 +- .../core/src/OpenMP/Kokkos_OpenMP_Task.hpp | 2 +- .../core/src/OpenMP/Kokkos_OpenMP_Team.hpp | 28 +- .../OpenMP/Kokkos_OpenMP_WorkGraphPolicy.hpp | 2 +- .../OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp | 2 +- .../OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp | 2 +- .../OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp | 28 +- .../Kokkos_OpenMPTarget_Parallel.hpp | 2 +- .../OpenMPTarget/Kokkos_OpenMPTarget_Task.cpp | 2 +- .../OpenMPTarget/Kokkos_OpenMPTarget_Task.hpp | 2 +- .../core/src/Qthreads/Kokkos_QthreadsExec.cpp | 2 +- .../core/src/Qthreads/Kokkos_QthreadsExec.hpp | 2 +- .../src/Qthreads/Kokkos_Qthreads_Parallel.hpp | 2 +- .../src/Qthreads/Kokkos_Qthreads_Task.cpp | 2 +- .../src/Qthreads/Kokkos_Qthreads_Task.hpp | 2 +- .../Qthreads/Kokkos_Qthreads_TaskQueue.hpp | 2 +- .../Kokkos_Qthreads_TaskQueue_impl.hpp | 2 +- .../KokkosExp_ROCm_IterateTile_Refactor.hpp | 2750 +++++++++++++++++ .../core/src/ROCm/Kokkos_ROCm_Atomic.hpp | 42 +- .../core/src/ROCm/Kokkos_ROCm_Config.hpp | 2 +- lib/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.cpp | 2 +- lib/kokkos/core/src/ROCm/Kokkos_ROCm_Exec.hpp | 125 +- lib/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp | 10 +- .../core/src/ROCm/Kokkos_ROCm_Invoke.hpp | 2 +- lib/kokkos/core/src/ROCm/Kokkos_ROCm_Join.hpp | 2 +- .../core/src/ROCm/Kokkos_ROCm_Parallel.hpp | 129 +- .../core/src/ROCm/Kokkos_ROCm_Reduce.hpp | 2 +- .../core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp | 2 +- lib/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp | 2 +- .../core/src/ROCm/Kokkos_ROCm_Space.cpp | 2 +- lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.cpp | 2 +- lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.hpp | 2 +- lib/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp | 2 +- .../src/ROCm/Kokkos_ROCm_Vectorization.hpp | 2 +- .../core/src/Threads/Kokkos_ThreadsExec.cpp | 6 +- .../core/src/Threads/Kokkos_ThreadsExec.hpp | 2 +- .../src/Threads/Kokkos_ThreadsExec_base.cpp | 2 +- .../core/src/Threads/Kokkos_ThreadsTeam.hpp | 28 +- .../src/Threads/Kokkos_Threads_Parallel.hpp | 7 +- .../Kokkos_Threads_WorkGraphPolicy.hpp | 2 +- .../src/impl/KokkosExp_Host_IterateTile.hpp | 2 +- .../core/src/impl/KokkosExp_ViewMapping.hpp | 2 +- .../core/src/impl/Kokkos_AnalyzePolicy.hpp | 2 +- .../core/src/impl/Kokkos_Atomic_Assembly.hpp | 2 +- .../Kokkos_Atomic_Compare_Exchange_Strong.hpp | 14 +- .../core/src/impl/Kokkos_Atomic_Decrement.hpp | 33 +- .../core/src/impl/Kokkos_Atomic_Exchange.hpp | 22 +- .../core/src/impl/Kokkos_Atomic_Fetch_Add.hpp | 13 +- .../core/src/impl/Kokkos_Atomic_Fetch_And.hpp | 13 +- .../core/src/impl/Kokkos_Atomic_Fetch_Or.hpp | 13 +- .../core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp | 13 +- .../core/src/impl/Kokkos_Atomic_Generic.hpp | 6 +- .../core/src/impl/Kokkos_Atomic_Increment.hpp | 30 +- .../core/src/impl/Kokkos_Atomic_View.hpp | 14 +- .../core/src/impl/Kokkos_Atomic_Windows.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_BitOps.hpp | 6 +- .../core/src/impl/Kokkos_CPUDiscovery.cpp | 2 +- .../core/src/impl/Kokkos_CPUDiscovery.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_ClockTic.hpp | 2 +- .../core/src/impl/Kokkos_ConcurrentBitset.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_Core.cpp | 36 +- lib/kokkos/core/src/impl/Kokkos_Error.cpp | 2 +- lib/kokkos/core/src/impl/Kokkos_Error.hpp | 2 +- .../core/src/impl/Kokkos_ExecPolicy.cpp | 2 +- .../core/src/impl/Kokkos_FunctorAdapter.hpp | 584 +++- .../core/src/impl/Kokkos_FunctorAnalysis.hpp | 87 +- lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp | 2 +- .../core/src/impl/Kokkos_HostBarrier.cpp | 16 +- .../core/src/impl/Kokkos_HostBarrier.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp | 2 +- .../core/src/impl/Kokkos_HostThreadTeam.cpp | 2 +- .../core/src/impl/Kokkos_HostThreadTeam.hpp | 15 +- .../core/src/impl/Kokkos_MemoryPool.cpp | 2 +- .../core/src/impl/Kokkos_Memory_Fence.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp | 2 +- .../core/src/impl/Kokkos_PhysicalLayout.hpp | 6 +- .../src/impl/Kokkos_Profiling_DeviceInfo.hpp | 2 +- .../src/impl/Kokkos_Profiling_Interface.cpp | 46 +- .../src/impl/Kokkos_Profiling_Interface.hpp | 58 +- lib/kokkos/core/src/impl/Kokkos_Serial.cpp | 2 +- .../core/src/impl/Kokkos_Serial_Task.cpp | 2 +- .../core/src/impl/Kokkos_Serial_Task.hpp | 2 +- .../impl/Kokkos_Serial_WorkGraphPolicy.hpp | 2 +- .../core/src/impl/Kokkos_SharedAlloc.cpp | 23 +- .../core/src/impl/Kokkos_SharedAlloc.hpp | 43 +- lib/kokkos/core/src/impl/Kokkos_Spinwait.cpp | 75 +- lib/kokkos/core/src/impl/Kokkos_Spinwait.hpp | 52 +- .../core/src/impl/Kokkos_StaticAssert.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_Tags.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_TaskQueue.hpp | 19 +- .../core/src/impl/Kokkos_TaskQueue_impl.hpp | 4 +- lib/kokkos/core/src/impl/Kokkos_Timer.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_Traits.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_Utilities.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_ViewArray.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_ViewCtor.hpp | 2 +- .../core/src/impl/Kokkos_ViewMapping.hpp | 42 +- lib/kokkos/core/src/impl/Kokkos_ViewTile.hpp | 2 +- .../core/src/impl/Kokkos_Volatile_Load.hpp | 2 +- lib/kokkos/core/src/impl/Kokkos_hwloc.cpp | 2 +- lib/kokkos/core/unit_test/CMakeLists.txt | 49 + lib/kokkos/core/unit_test/Makefile | 56 +- lib/kokkos/core/unit_test/TestAggregate.hpp | 2 +- lib/kokkos/core/unit_test/TestAtomic.hpp | 2 +- .../core/unit_test/TestAtomicOperations.hpp | 2 +- lib/kokkos/core/unit_test/TestAtomicViews.hpp | 33 +- lib/kokkos/core/unit_test/TestCXX11.hpp | 2 +- .../core/unit_test/TestCXX11Deduction.hpp | 2 +- .../core/unit_test/TestCompilerMacros.hpp | 4 +- lib/kokkos/core/unit_test/TestComplex.hpp | 2 +- .../core/unit_test/TestConcurrentBitset.hpp | 2 +- lib/kokkos/core/unit_test/TestCrs.hpp | 2 +- .../unit_test/TestDefaultDeviceTypeInit.hpp | 2 +- .../core/unit_test/TestFunctorAnalysis.hpp | 2 +- lib/kokkos/core/unit_test/TestHWLOC.cpp | 2 +- lib/kokkos/core/unit_test/TestInit.hpp | 2 +- lib/kokkos/core/unit_test/TestMDRange.hpp | 502 ++- lib/kokkos/core/unit_test/TestMemoryPool.hpp | 2 +- .../core/unit_test/TestPolicyConstruction.hpp | 159 +- lib/kokkos/core/unit_test/TestRange.hpp | 2 +- lib/kokkos/core/unit_test/TestReduce.hpp | 6 +- .../unit_test/TestReduceCombinatorical.hpp | 2 +- lib/kokkos/core/unit_test/TestResize.hpp | 2 +- lib/kokkos/core/unit_test/TestScan.hpp | 2 +- lib/kokkos/core/unit_test/TestSharedAlloc.hpp | 2 +- .../core/unit_test/TestTaskScheduler.hpp | 2 +- lib/kokkos/core/unit_test/TestTeam.hpp | 47 +- lib/kokkos/core/unit_test/TestTeamVector.hpp | 9 +- .../unit_test/TestTemplateMetaFunctions.hpp | 2 +- lib/kokkos/core/unit_test/TestTile.hpp | 14 +- lib/kokkos/core/unit_test/TestUniqueToken.hpp | 2 +- lib/kokkos/core/unit_test/TestUtilities.hpp | 2 +- lib/kokkos/core/unit_test/TestViewAPI.hpp | 430 ++- .../unit_test/TestViewCtorPropEmbeddedDim.hpp | 2 +- .../core/unit_test/TestViewMapping_a.hpp | 134 +- .../core/unit_test/TestViewMapping_b.hpp | 2 +- .../unit_test/TestViewMapping_subview.hpp | 68 +- lib/kokkos/core/unit_test/TestViewOfClass.hpp | 6 +- .../core/unit_test/TestViewSpaceAssign.hpp | 2 +- lib/kokkos/core/unit_test/TestViewSubview.hpp | 218 +- lib/kokkos/core/unit_test/TestWorkGraph.hpp | 2 +- lib/kokkos/core/unit_test/UnitTestMain.cpp | 2 +- .../core/unit_test/UnitTestMainInit.cpp | 2 +- .../unit_test/UnitTest_PushFinalizeHook.cpp | 139 + .../UnitTest_PushFinalizeHook_terminate.cpp | 86 + .../cuda/TestCudaHostPinned_Category.hpp | 2 +- .../cuda/TestCudaHostPinned_SharedAlloc.cpp | 2 +- .../cuda/TestCudaHostPinned_ViewAPI.cpp | 2 +- .../cuda/TestCudaHostPinned_ViewMapping_a.cpp | 2 +- .../cuda/TestCudaHostPinned_ViewMapping_b.cpp | 2 +- ...TestCudaHostPinned_ViewMapping_subview.cpp | 2 +- .../unit_test/cuda/TestCudaUVM_Category.hpp | 2 +- .../cuda/TestCudaUVM_SharedAlloc.cpp | 2 +- .../unit_test/cuda/TestCudaUVM_ViewAPI.cpp | 2 +- .../cuda/TestCudaUVM_ViewMapping_a.cpp | 2 +- .../cuda/TestCudaUVM_ViewMapping_b.cpp | 2 +- .../cuda/TestCudaUVM_ViewMapping_subview.cpp | 2 +- .../cuda/TestCuda_AtomicOperations.cpp | 2 +- .../unit_test/cuda/TestCuda_AtomicViews.cpp | 2 +- .../core/unit_test/cuda/TestCuda_Atomics.cpp | 2 +- .../core/unit_test/cuda/TestCuda_Category.hpp | 2 +- .../core/unit_test/cuda/TestCuda_Complex.cpp | 2 +- .../core/unit_test/cuda/TestCuda_Crs.cpp | 2 +- .../core/unit_test/cuda/TestCuda_Init.cpp | 2 +- .../core/unit_test/cuda/TestCuda_InterOp.cpp | 85 + .../core/unit_test/cuda/TestCuda_MDRange.cpp | 2 +- .../core/unit_test/cuda/TestCuda_Other.cpp | 2 +- .../unit_test/cuda/TestCuda_RangePolicy.cpp | 2 +- .../unit_test/cuda/TestCuda_Reductions.cpp | 2 +- .../core/unit_test/cuda/TestCuda_Scan.cpp | 2 +- .../unit_test/cuda/TestCuda_SharedAlloc.cpp | 2 +- .../core/unit_test/cuda/TestCuda_Spaces.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_a.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_b.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c01.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c02.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c03.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c04.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c05.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c06.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c07.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c08.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c09.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c10.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c11.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c12.cpp | 2 +- .../unit_test/cuda/TestCuda_SubView_c13.cpp | 2 +- .../core/unit_test/cuda/TestCuda_Task.cpp | 2 +- .../core/unit_test/cuda/TestCuda_Team.cpp | 2 +- .../cuda/TestCuda_TeamReductionScan.cpp | 2 +- .../unit_test/cuda/TestCuda_TeamScratch.cpp | 2 +- .../unit_test/cuda/TestCuda_UniqueToken.cpp | 2 +- .../unit_test/cuda/TestCuda_ViewAPI_b.cpp | 2 +- .../unit_test/cuda/TestCuda_ViewMapping_a.cpp | 2 +- .../unit_test/cuda/TestCuda_ViewMapping_b.cpp | 2 +- .../cuda/TestCuda_ViewMapping_subview.cpp | 2 +- .../unit_test/cuda/TestCuda_ViewOfClass.cpp | 2 +- .../unit_test/cuda/TestCuda_WorkGraph.cpp | 2 +- .../default/TestDefaultDeviceType.cpp | 2 +- .../default/TestDefaultDeviceTypeResize.cpp | 2 +- .../TestDefaultDeviceType_Category.hpp | 2 +- .../default/TestDefaultDeviceType_a.cpp | 2 +- .../default/TestDefaultDeviceType_b.cpp | 2 +- .../default/TestDefaultDeviceType_c.cpp | 2 +- .../default/TestDefaultDeviceType_d.cpp | 2 +- .../core/unit_test/openmp/TestOpenMP.hpp | 2 +- .../openmp/TestOpenMP_AtomicOperations.cpp | 2 +- .../openmp/TestOpenMP_AtomicViews.cpp | 2 +- .../unit_test/openmp/TestOpenMP_Atomics.cpp | 2 +- .../unit_test/openmp/TestOpenMP_Category.hpp | 2 +- .../unit_test/openmp/TestOpenMP_Complex.cpp | 2 +- .../core/unit_test/openmp/TestOpenMP_Crs.cpp | 2 +- .../core/unit_test/openmp/TestOpenMP_Init.cpp | 2 +- .../unit_test/openmp/TestOpenMP_InterOp.cpp | 90 + .../unit_test/openmp/TestOpenMP_MDRange.cpp | 2 +- .../unit_test/openmp/TestOpenMP_Other.cpp | 2 +- .../openmp/TestOpenMP_RangePolicy.cpp | 2 +- .../openmp/TestOpenMP_Reductions.cpp | 2 +- .../core/unit_test/openmp/TestOpenMP_Scan.cpp | 2 +- .../openmp/TestOpenMP_SharedAlloc.cpp | 2 +- .../unit_test/openmp/TestOpenMP_SubView_a.cpp | 2 +- .../unit_test/openmp/TestOpenMP_SubView_b.cpp | 2 +- .../openmp/TestOpenMP_SubView_c01.cpp | 2 +- .../openmp/TestOpenMP_SubView_c02.cpp | 2 +- .../openmp/TestOpenMP_SubView_c03.cpp | 2 +- .../openmp/TestOpenMP_SubView_c04.cpp | 2 +- .../openmp/TestOpenMP_SubView_c05.cpp | 2 +- .../openmp/TestOpenMP_SubView_c06.cpp | 2 +- .../openmp/TestOpenMP_SubView_c07.cpp | 2 +- .../openmp/TestOpenMP_SubView_c08.cpp | 2 +- .../openmp/TestOpenMP_SubView_c09.cpp | 2 +- .../openmp/TestOpenMP_SubView_c10.cpp | 2 +- .../openmp/TestOpenMP_SubView_c11.cpp | 2 +- .../openmp/TestOpenMP_SubView_c12.cpp | 2 +- .../openmp/TestOpenMP_SubView_c13.cpp | 2 +- .../core/unit_test/openmp/TestOpenMP_Task.cpp | 2 +- .../core/unit_test/openmp/TestOpenMP_Team.cpp | 2 +- .../openmp/TestOpenMP_TeamReductionScan.cpp | 2 +- .../openmp/TestOpenMP_TeamScratch.cpp | 2 +- .../openmp/TestOpenMP_UniqueToken.cpp | 2 +- .../unit_test/openmp/TestOpenMP_ViewAPI_b.cpp | 2 +- .../openmp/TestOpenMP_ViewMapping_a.cpp | 2 +- .../openmp/TestOpenMP_ViewMapping_b.cpp | 2 +- .../openmp/TestOpenMP_ViewMapping_subview.cpp | 2 +- .../openmp/TestOpenMP_ViewOfClass.cpp | 2 +- .../unit_test/openmp/TestOpenMP_WorkGraph.cpp | 2 +- .../openmptarget/TestOpenMPTarget.hpp | 2 +- .../TestOpenMPTarget_AtomicOperations.cpp | 2 +- .../TestOpenMPTarget_AtomicViews.cpp | 2 +- .../openmptarget/TestOpenMPTarget_Atomics.cpp | 2 +- .../TestOpenMPTarget_Category.hpp | 2 +- .../openmptarget/TestOpenMPTarget_Complex.cpp | 2 +- .../openmptarget/TestOpenMPTarget_Init.cpp | 2 +- .../openmptarget/TestOpenMPTarget_MDRange.cpp | 2 +- .../openmptarget/TestOpenMPTarget_Other.cpp | 2 +- .../TestOpenMPTarget_RangePolicy.cpp | 2 +- .../TestOpenMPTarget_Reductions.cpp | 2 +- .../openmptarget/TestOpenMPTarget_Scan.cpp | 2 +- .../TestOpenMPTarget_SharedAlloc.cpp | 2 +- .../TestOpenMPTarget_SubView_a.cpp | 2 +- .../TestOpenMPTarget_SubView_b.cpp | 2 +- .../TestOpenMPTarget_SubView_c01.cpp | 2 +- .../TestOpenMPTarget_SubView_c02.cpp | 2 +- .../TestOpenMPTarget_SubView_c03.cpp | 2 +- .../TestOpenMPTarget_SubView_c04.cpp | 2 +- .../TestOpenMPTarget_SubView_c05.cpp | 2 +- .../TestOpenMPTarget_SubView_c06.cpp | 2 +- .../TestOpenMPTarget_SubView_c07.cpp | 2 +- .../TestOpenMPTarget_SubView_c08.cpp | 2 +- .../TestOpenMPTarget_SubView_c09.cpp | 2 +- .../TestOpenMPTarget_SubView_c10.cpp | 2 +- .../TestOpenMPTarget_SubView_c11.cpp | 2 +- .../TestOpenMPTarget_SubView_c12.cpp | 2 +- .../openmptarget/TestOpenMPTarget_Team.cpp | 2 +- .../TestOpenMPTarget_TeamReductionScan.cpp | 2 +- .../TestOpenMPTarget_TeamScratch.cpp | 2 +- .../TestOpenMPTarget_ViewAPI_b.cpp | 2 +- .../TestOpenMPTarget_ViewMapping_a.cpp | 2 +- .../TestOpenMPTarget_ViewMapping_b.cpp | 2 +- .../TestOpenMPTarget_ViewMapping_subview.cpp | 2 +- .../TestOpenMPTarget_ViewOfClass.cpp | 2 +- .../core/unit_test/qthreads/TestQthreads.hpp | 2 +- .../qthreads/TestQthreads_Atomics.cpp | 2 +- .../qthreads/TestQthreads_Category.hpp | 2 +- .../unit_test/qthreads/TestQthreads_Other.cpp | 2 +- .../qthreads/TestQthreads_Reductions.cpp | 2 +- .../qthreads/TestQthreads_SubView_a.cpp | 2 +- .../qthreads/TestQthreads_SubView_b.cpp | 2 +- .../qthreads/TestQthreads_SubView_c01.cpp | 2 +- .../qthreads/TestQthreads_SubView_c02.cpp | 2 +- .../qthreads/TestQthreads_SubView_c03.cpp | 2 +- .../qthreads/TestQthreads_SubView_c04.cpp | 2 +- .../qthreads/TestQthreads_SubView_c05.cpp | 2 +- .../qthreads/TestQthreads_SubView_c06.cpp | 2 +- .../qthreads/TestQthreads_SubView_c07.cpp | 2 +- .../qthreads/TestQthreads_SubView_c08.cpp | 2 +- .../qthreads/TestQthreads_SubView_c09.cpp | 2 +- .../qthreads/TestQthreads_SubView_c10.cpp | 2 +- .../qthreads/TestQthreads_SubView_c11.cpp | 2 +- .../qthreads/TestQthreads_SubView_c12.cpp | 2 +- .../qthreads/TestQthreads_SubView_c13.cpp | 2 +- .../unit_test/qthreads/TestQthreads_Team.cpp | 2 +- .../qthreads/TestQthreads_ViewAPI_a.cpp | 2 +- .../qthreads/TestQthreads_ViewAPI_b.cpp | 2 +- .../rocm/TestROCmHostPinned_Category.hpp | 2 +- .../rocm/TestROCmHostPinned_SharedAlloc.cpp | 2 +- .../rocm/TestROCmHostPinned_ViewAPI.cpp | 2 +- .../rocm/TestROCmHostPinned_ViewMapping_a.cpp | 2 +- .../rocm/TestROCmHostPinned_ViewMapping_b.cpp | 2 +- ...TestROCmHostPinned_ViewMapping_subview.cpp | 2 +- .../rocm/TestROCm_AtomicOperations.cpp | 2 +- .../unit_test/rocm/TestROCm_AtomicViews.cpp | 2 +- .../core/unit_test/rocm/TestROCm_Atomics.cpp | 2 +- .../core/unit_test/rocm/TestROCm_Category.hpp | 2 +- .../core/unit_test/rocm/TestROCm_Complex.cpp | 2 +- .../core/unit_test/rocm/TestROCm_Init.cpp | 2 +- .../core/unit_test/rocm/TestROCm_MDRange.cpp | 47 + .../core/unit_test/rocm/TestROCm_Other.cpp | 2 +- .../unit_test/rocm/TestROCm_RangePolicy.cpp | 2 +- .../unit_test/rocm/TestROCm_Reductions.cpp | 2 +- .../core/unit_test/rocm/TestROCm_Scan.cpp | 2 +- .../unit_test/rocm/TestROCm_SharedAlloc.cpp | 2 +- .../core/unit_test/rocm/TestROCm_Spaces.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_a.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_b.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c01.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c02.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c03.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c04.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c05.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c06.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c07.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c08.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c09.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c10.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c11.cpp | 2 +- .../unit_test/rocm/TestROCm_SubView_c12.cpp | 2 +- .../core/unit_test/rocm/TestROCm_Team.cpp | 2 +- .../rocm/TestROCm_TeamReductionScan.cpp | 2 +- .../unit_test/rocm/TestROCm_TeamScratch.cpp | 2 +- .../unit_test/rocm/TestROCm_ViewAPI_b.cpp | 2 +- .../unit_test/rocm/TestROCm_ViewMapping_a.cpp | 2 +- .../unit_test/rocm/TestROCm_ViewMapping_b.cpp | 2 +- .../rocm/TestROCm_ViewMapping_subview.cpp | 2 +- .../unit_test/rocm/TestROCm_ViewOfClass.cpp | 2 +- .../serial/TestSerial_AtomicOperations.cpp | 2 +- .../serial/TestSerial_AtomicViews.cpp | 2 +- .../unit_test/serial/TestSerial_Atomics.cpp | 2 +- .../unit_test/serial/TestSerial_Category.hpp | 2 +- .../unit_test/serial/TestSerial_Complex.cpp | 2 +- .../core/unit_test/serial/TestSerial_Crs.cpp | 2 +- .../core/unit_test/serial/TestSerial_Init.cpp | 2 +- .../unit_test/serial/TestSerial_MDRange.cpp | 2 +- .../unit_test/serial/TestSerial_Other.cpp | 2 +- .../serial/TestSerial_RangePolicy.cpp | 2 +- .../serial/TestSerial_Reductions.cpp | 2 +- .../core/unit_test/serial/TestSerial_Scan.cpp | 2 +- .../serial/TestSerial_SharedAlloc.cpp | 2 +- .../unit_test/serial/TestSerial_SubView_a.cpp | 2 +- .../unit_test/serial/TestSerial_SubView_b.cpp | 2 +- .../serial/TestSerial_SubView_c01.cpp | 2 +- .../serial/TestSerial_SubView_c02.cpp | 2 +- .../serial/TestSerial_SubView_c03.cpp | 2 +- .../serial/TestSerial_SubView_c04.cpp | 2 +- .../serial/TestSerial_SubView_c05.cpp | 2 +- .../serial/TestSerial_SubView_c06.cpp | 2 +- .../serial/TestSerial_SubView_c07.cpp | 2 +- .../serial/TestSerial_SubView_c08.cpp | 2 +- .../serial/TestSerial_SubView_c09.cpp | 2 +- .../serial/TestSerial_SubView_c10.cpp | 2 +- .../serial/TestSerial_SubView_c11.cpp | 2 +- .../serial/TestSerial_SubView_c12.cpp | 2 +- .../serial/TestSerial_SubView_c13.cpp | 2 +- .../core/unit_test/serial/TestSerial_Task.cpp | 2 +- .../core/unit_test/serial/TestSerial_Team.cpp | 2 +- .../serial/TestSerial_TeamReductionScan.cpp | 2 +- .../serial/TestSerial_TeamScratch.cpp | 2 +- .../unit_test/serial/TestSerial_ViewAPI_b.cpp | 2 +- .../serial/TestSerial_ViewMapping_a.cpp | 2 +- .../serial/TestSerial_ViewMapping_b.cpp | 2 +- .../serial/TestSerial_ViewMapping_subview.cpp | 2 +- .../serial/TestSerial_ViewOfClass.cpp | 2 +- .../unit_test/serial/TestSerial_WorkGraph.cpp | 2 +- .../core/unit_test/threads/TestThreads.hpp | 2 +- .../threads/TestThreads_AtomicOperations.cpp | 2 +- .../threads/TestThreads_AtomicViews.cpp | 2 +- .../unit_test/threads/TestThreads_Atomics.cpp | 2 +- .../threads/TestThreads_Category.hpp | 2 +- .../unit_test/threads/TestThreads_Complex.cpp | 2 +- .../unit_test/threads/TestThreads_Crs.cpp | 2 +- .../unit_test/threads/TestThreads_Init.cpp | 2 +- .../unit_test/threads/TestThreads_MDRange.cpp | 2 +- .../unit_test/threads/TestThreads_Other.cpp | 2 +- .../threads/TestThreads_RangePolicy.cpp | 2 +- .../threads/TestThreads_Reductions.cpp | 2 +- .../unit_test/threads/TestThreads_Scan.cpp | 2 +- .../threads/TestThreads_SharedAlloc.cpp | 2 +- .../threads/TestThreads_SubView_a.cpp | 2 +- .../threads/TestThreads_SubView_b.cpp | 2 +- .../threads/TestThreads_SubView_c01.cpp | 2 +- .../threads/TestThreads_SubView_c02.cpp | 2 +- .../threads/TestThreads_SubView_c03.cpp | 2 +- .../threads/TestThreads_SubView_c04.cpp | 2 +- .../threads/TestThreads_SubView_c05.cpp | 2 +- .../threads/TestThreads_SubView_c06.cpp | 2 +- .../threads/TestThreads_SubView_c07.cpp | 2 +- .../threads/TestThreads_SubView_c08.cpp | 2 +- .../threads/TestThreads_SubView_c09.cpp | 2 +- .../threads/TestThreads_SubView_c10.cpp | 2 +- .../threads/TestThreads_SubView_c11.cpp | 2 +- .../threads/TestThreads_SubView_c12.cpp | 2 +- .../threads/TestThreads_SubView_c13.cpp | 2 +- .../unit_test/threads/TestThreads_Team.cpp | 2 +- .../threads/TestThreads_TeamReductionScan.cpp | 2 +- .../threads/TestThreads_TeamScratch.cpp | 2 +- .../threads/TestThreads_ViewAPI_b.cpp | 2 +- .../threads/TestThreads_ViewMapping_a.cpp | 2 +- .../threads/TestThreads_ViewMapping_b.cpp | 2 +- .../TestThreads_ViewMapping_subview.cpp | 2 +- .../threads/TestThreads_ViewOfClass.cpp | 2 +- .../threads/TestThreads_WorkGraph.cpp | 2 +- .../query_cuda_arch.cpp | 0 .../{config => doc}/kokkos-promotion.txt | 16 +- .../example/cmake_build/cmake_example.cpp | 2 +- lib/kokkos/example/common/VectorImport.hpp | 2 +- lib/kokkos/example/common/WrapMPI.hpp | 2 +- lib/kokkos/example/feint/ElemFunctor.hpp | 14 +- lib/kokkos/example/feint/feint.hpp | 2 +- lib/kokkos/example/feint/feint_cuda.cpp | 2 +- lib/kokkos/example/feint/feint_fwd.hpp | 2 +- lib/kokkos/example/feint/feint_openmp.cpp | 2 +- lib/kokkos/example/feint/feint_rocm.cpp | 2 +- lib/kokkos/example/feint/feint_threads.cpp | 2 +- lib/kokkos/example/feint/main.cpp | 2 +- lib/kokkos/example/fenl/CGSolve.hpp | 4 +- lib/kokkos/example/fenl/fenl.cpp | 2 +- lib/kokkos/example/fenl/fenl.hpp | 2 +- lib/kokkos/example/fenl/fenl_functors.hpp | 60 +- lib/kokkos/example/fenl/fenl_impl.hpp | 8 +- lib/kokkos/example/fenl/main.cpp | 2 +- lib/kokkos/example/fixture/BoxElemFixture.hpp | 26 +- lib/kokkos/example/fixture/BoxElemPart.cpp | 2 +- lib/kokkos/example/fixture/BoxElemPart.hpp | 2 +- lib/kokkos/example/fixture/HexElement.hpp | 2 +- lib/kokkos/example/fixture/Main.cpp | 2 +- lib/kokkos/example/fixture/TestFixture.cpp | 2 +- lib/kokkos/example/fixture/TestFixture.hpp | 4 +- lib/kokkos/example/global_2_local_ids/G2L.hpp | 2 +- .../example/global_2_local_ids/G2L_Main.cpp | 2 +- lib/kokkos/example/grow_array/grow_array.hpp | 2 +- lib/kokkos/example/grow_array/main.cpp | 2 +- lib/kokkos/example/md_skeleton/force.cpp | 2 +- lib/kokkos/example/md_skeleton/main.cpp | 2 +- lib/kokkos/example/md_skeleton/neighbor.cpp | 2 +- lib/kokkos/example/md_skeleton/setup.cpp | 2 +- lib/kokkos/example/md_skeleton/system.h | 2 +- lib/kokkos/example/md_skeleton/types.h | 2 +- .../example/multi_fem/BoxMeshFixture.hpp | 2 +- .../example/multi_fem/BoxMeshPartition.cpp | 2 +- .../example/multi_fem/BoxMeshPartition.hpp | 2 +- lib/kokkos/example/multi_fem/Explicit.hpp | 2 +- .../example/multi_fem/ExplicitFunctors.hpp | 2 +- lib/kokkos/example/multi_fem/FEMesh.hpp | 2 +- lib/kokkos/example/multi_fem/HexElement.hpp | 2 +- .../multi_fem/HexExplicitFunctions.hpp | 2 +- lib/kokkos/example/multi_fem/Implicit.hpp | 2 +- .../example/multi_fem/ImplicitFunctors.hpp | 2 +- lib/kokkos/example/multi_fem/LinAlgBLAS.hpp | 2 +- lib/kokkos/example/multi_fem/Nonlinear.hpp | 2 +- .../multi_fem/NonlinearElement_Cuda.hpp | 2 +- .../example/multi_fem/NonlinearFunctors.hpp | 2 +- lib/kokkos/example/multi_fem/ParallelComm.hpp | 2 +- .../example/multi_fem/ParallelDataMap.hpp | 2 +- .../example/multi_fem/ParallelMachine.cpp | 2 +- .../example/multi_fem/ParallelMachine.hpp | 2 +- .../example/multi_fem/SparseLinearSystem.hpp | 2 +- .../multi_fem/SparseLinearSystemFill.hpp | 2 +- .../multi_fem/SparseLinearSystem_Cuda.hpp | 2 +- .../example/multi_fem/TestBoxMeshFixture.hpp | 2 +- .../multi_fem/TestBoxMeshPartition.cpp | 2 +- lib/kokkos/example/multi_fem/TestCuda.cpp | 2 +- lib/kokkos/example/multi_fem/TestHost.cpp | 2 +- .../example/multi_fem/TestHybridFEM.cpp | 2 +- .../example/query_device/query_device.cpp | 2 +- lib/kokkos/example/sort_array/main.cpp | 2 +- lib/kokkos/example/sort_array/sort_array.hpp | 2 +- .../tutorial/01_hello_world/hello_world.cpp | 2 +- .../hello_world_lambda.cpp | 2 +- .../02_simple_reduce/simple_reduce.cpp | 2 +- .../simple_reduce_lambda.cpp | 2 +- .../tutorial/03_simple_view/simple_view.cpp | 2 +- .../simple_view_lambda.cpp | 2 +- .../simple_memoryspaces.cpp | 2 +- .../05_simple_atomics/simple_atomics.cpp | 6 +- .../simple_mdrangepolicy.cpp | 2 +- .../01_data_layouts/data_layouts.cpp | 8 +- .../02_memory_traits/memory_traits.cpp | 8 +- .../Advanced_Views/03_subviews/subviews.cpp | 28 +- .../Advanced_Views/04_dualviews/dual_view.cpp | 8 +- .../05_NVIDIA_UVM/uvm_example.cpp | 8 +- .../overlapping_deepcopy.cpp | 2 +- .../01_random_numbers/random_numbers.cpp | 2 +- .../01_thread_teams/thread_teams.cpp | 2 +- .../thread_teams_lambda.cpp | 2 +- .../nested_parallel_for.cpp | 2 +- .../03_vectorization/vectorization.cpp | 12 +- .../04_team_scan/team_scan.cpp | 2 +- .../launch_bounds/launch_bounds_reduce.cpp | 2 +- lib/kokkos/generate_makefile.bash | 51 +- lib/kokkos/{config => }/master_history.txt | 3 +- lib/kokkos/{config => scripts}/snapshot.py | 0 .../testing_scripts/README | 0 .../testing_scripts/jenkins_test_driver | 0 .../testing_scripts/obj_size_opt_check | 0 .../test_kokkos_master_develop_promotion.sh | 0 .../trilinos-integration/checkin-test | 0 .../prepare_trilinos_repos.sh | 2 +- .../shepard_jenkins_run_script_pthread_intel | 2 +- .../shepard_jenkins_run_script_serial_intel | 2 +- .../white_run_jenkins_script_cuda | 2 +- .../white_run_jenkins_script_omp | 2 +- 694 files changed, 12328 insertions(+), 6812 deletions(-) delete mode 100644 lib/kokkos/config/configure_compton_cpu.sh delete mode 100644 lib/kokkos/config/configure_compton_mic.sh delete mode 100644 lib/kokkos/config/configure_kokkos.sh delete mode 100755 lib/kokkos/config/configure_kokkos_bgq.sh delete mode 100755 lib/kokkos/config/configure_kokkos_dev.sh delete mode 100644 lib/kokkos/config/configure_kokkos_nvidia.sh delete mode 100644 lib/kokkos/config/configure_shannon.sh delete mode 100755 lib/kokkos/config/configure_tpetra_kokkos_cuda_nvcc_wrapper.sh delete mode 100644 lib/kokkos/config/kokkos-trilinos-integration-procedure.txt delete mode 100755 lib/kokkos/config/kokkos_dev/config-core-all.sh delete mode 100755 lib/kokkos/config/kokkos_dev/config-core-cuda-omp-hwloc.sh delete mode 100755 lib/kokkos/config/kokkos_dev/config-core-cuda.sh delete mode 100755 lib/kokkos/config/kokkos_dev/config-core-cxx11-omp.sh delete mode 100755 lib/kokkos/config/kokkos_dev/config-core-dbg-none.sh delete mode 100755 lib/kokkos/config/kokkos_dev/config-core-intel-cuda-omp.sh delete mode 100755 lib/kokkos/config/kokkos_dev/config-core-intel-omp.sh delete mode 100755 lib/kokkos/config/kokkos_dev/config-core-omp.sh delete mode 100755 lib/kokkos/config/kokkos_dev/config-core-threads-hwloc.sh delete mode 100755 lib/kokkos/config/nvcc_wrapper create mode 100644 lib/kokkos/core/perf_test/PerfTest_ViewCopy.cpp create mode 100644 lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp create mode 100644 lib/kokkos/core/src/Kokkos_CopyViews.hpp create mode 100644 lib/kokkos/core/src/ROCm/KokkosExp_ROCm_IterateTile_Refactor.hpp create mode 100644 lib/kokkos/core/unit_test/UnitTest_PushFinalizeHook.cpp create mode 100644 lib/kokkos/core/unit_test/UnitTest_PushFinalizeHook_terminate.cpp create mode 100644 lib/kokkos/core/unit_test/cuda/TestCuda_InterOp.cpp create mode 100644 lib/kokkos/core/unit_test/openmp/TestOpenMP_InterOp.cpp create mode 100644 lib/kokkos/core/unit_test/rocm/TestROCm_MDRange.cpp rename lib/kokkos/{config => doc/hardware_identification}/query_cuda_arch.cpp (100%) rename lib/kokkos/{config => doc}/kokkos-promotion.txt (86%) rename lib/kokkos/{config => }/master_history.txt (87%) rename lib/kokkos/{config => scripts}/snapshot.py (100%) rename lib/kokkos/{config => scripts}/testing_scripts/README (100%) rename lib/kokkos/{config => scripts}/testing_scripts/jenkins_test_driver (100%) rename lib/kokkos/{config => scripts}/testing_scripts/obj_size_opt_check (100%) rename lib/kokkos/{config => scripts/testing_scripts}/test_kokkos_master_develop_promotion.sh (100%) rename lib/kokkos/{config => scripts}/trilinos-integration/checkin-test (100%) rename lib/kokkos/{config => scripts}/trilinos-integration/prepare_trilinos_repos.sh (93%) rename lib/kokkos/{config => scripts}/trilinos-integration/shepard_jenkins_run_script_pthread_intel (91%) rename lib/kokkos/{config => scripts}/trilinos-integration/shepard_jenkins_run_script_serial_intel (91%) rename lib/kokkos/{config => scripts}/trilinos-integration/white_run_jenkins_script_cuda (91%) rename lib/kokkos/{config => scripts}/trilinos-integration/white_run_jenkins_script_omp (91%) diff --git a/lib/kokkos/CHANGELOG.md b/lib/kokkos/CHANGELOG.md index e3de6b048d..feb2bd547f 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 9c708ded4a..cd1f4ea981 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 05980758fa..50b76995af 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 46bfb4167f..ad3f78efb4 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 7341a699d6..c68a8a2a9f 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 4315b009d5..a7bb63f190 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 d6c66634dd..31d134bf0a 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 3db9a145d7..1c659e44a4 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 237de751fe..888476045b 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 710eeb8ada..86fdccd0e7 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 c2c118ce1a..c4ddde7b7f 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 720b377ed2..15179509bb 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 2771f1793d..73bd416f2a 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 a1df93e07b..9cf998f773 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 2cb0b89712..e0c646c199 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 08749779ff..99cdb7da92 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 9e75b580bc..8feb08332f 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 41875ee5e4..64b43917de 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 63aaca9e40..9dded535e8 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 e3fe42a652..59b4d50c44 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 b60ec84994..6509c654e7 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 0992c5b54b..c6651da1e7 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 8db5ce0eb5..4f46b38717 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 406bd28983..bbbd65850f 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 1d01b26ca7..1d9c99adf9 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 88eb0493c1..ca5238e7fd 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 b0ed9bb512..2f5395734a 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 11576413e2..1ab437928d 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 273dcb5c8a..60df8084d8 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 f31680d6e2..76d0655adb 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 f17710a4ce..25eb8e86ce 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 850a74a670..579fab0c95 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 321704a1c8..1b5a7b2adb 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 17287fb848..0000000000 --- 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 7f9aee13f9..0000000000 --- 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 592e7f5936..0000000000 --- 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 73236937ea..0000000000 --- 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 ac61dec602..0000000000 --- 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 f78b7dce78..0000000000 --- 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 8bd175b031..0000000000 --- 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 0baa83aefe..0000000000 --- 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 0f24487814..0000000000 --- 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 1867de7204..0000000000 --- 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 5a6cc1493e..0000000000 --- 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 606755da81..0000000000 --- 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 b83a535416..0000000000 --- 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 d2e06a4ebd..0000000000 --- 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 e2ab1f1c00..0000000000 --- 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 fd56d41161..0000000000 --- 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 f91ecd5254..0000000000 --- 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 19ab969023..0000000000 --- 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 d339da4fcd..0000000000 --- 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 660ab91ff5..28b4a64b10 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 208387425f..682f3f52f7 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 ced74c6f51..0d2fae32a3 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 66f1fbf092..dcaca776be 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 1224af7cdb..217b01a57a 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 012f45bab7..66d497552e 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 6647d23065..3cf9f3bd14 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 4fd69173c0..03129d2b09 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 a8910a3c72..a951a5ca56 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 93a206c996..e8734b259d 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 7714506e92..c48058d75d 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 35cc8ec753..74fe4418f8 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 d22d6b865d..ccf53b3d50 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 86275ce7c9..4c1e0ef721 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 8b9e75d854..e05ea1a9d5 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 ebb5debaf1..4d256cce27 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 48c4709480..6c3365408a 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 996b6b5610..500bf8f424 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 059587a67c..64601e6b59 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 03bbefab10..08eee5b17a 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 3e910f5eef..7ea2e102ce 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 43874e97ff..8b17dcce4b 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 5072180876..91fbaaf011 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 843fd3a808..88ca200daf 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 f57ee66a1d..f97c1fc046 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 76fb30edcb..bd83835250 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 ddd6bdae6d..83498daef5 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 16891d4b1d..613a096b65 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 125b9b3287..e0a89a0abd 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 860c75b1ac..852e3cc232 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 17aa230d53..2b2cfdfc9a 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 6b2223f418..d25a3da44b 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 b910e881e8..aaf7a89560 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 42e6c09307..ec7e8f4303 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 c9b7392d48..8f9b201119 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 aee6ef79b6..95a2f3a257 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 aca0b57d65..1086e235fb 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 becaac198c..c964bbc1cf 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 2abf20f639..ddde3df18a 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 1efd1ddc51..9451e3551b 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 2b73535c83..508b43efd8 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 cdb8e03c1e..a1ec61ba79 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 aa4046cbf0..bb2fb5fce5 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 190fdb9142..9cd779edf4 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 56d90ed890..b169b02903 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 7d5067a22c..b228dd2e2e 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 d910b513c6..d60539e279 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 832f650b9a..f1f8a50f1b 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 02cee93ce9..9126457bb0 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 dbce1ec537..72aea39f51 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 0000000000..e7c53b8498 --- /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 ab73f2505e..6bb22e4e30 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 7759c28275..9fd58eda91 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 221182c50b..00615cd3ab 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 1a5626b04e..04c5cdccbf 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 d59c5c6726..636e05c8ac 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 f55191e98c..ada3f64fe1 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 33f77ea835..bf1033c091 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 391a881e2d..5726e02180 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 bc54954418..55c7c782fe 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 a63fb0cda4..052c1d2482 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 148d9f44ee..31f405dd84 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 237022ad23..f1828ea2de 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 d01f06fb4f..80192bf338 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 5fd442ffc9..e417544fd8 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 a478396910..cd4d6303f6 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 5f08800c40..ee949583f1 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 4a52985d29..a8b96ea6fe 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 3f3d85ecd1..4fd5e78341 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 1ff4ff3540..82fa4e6b89 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 264f77b3bc..c41cfc38d8 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 b29ba9d8ba..2954223f98 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 32ee7d0e59..49b11f3ae0 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 9f5ab1b1f2..94e293d7c7 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 df4e3d37f6..9f5415b511 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 9486f8d26a..c7f7f7981d 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 0000000000..c345158996 --- /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 43e6386b54..2708c4ffdb 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 54a97a16c1..b9f26ce228 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 f8355f0d06..7ca85a3041 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 f9366a9594..2e2507b27d 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 0000000000..23789eb85c --- /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 b1531a0a1b..b4d664c8ea 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 29001e19ed..b0d4d8a49a 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 7bbc938010..09b0d666a1 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 197831dee5..c2db88fdc2 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 fb5985e164..f537dad2c4 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 6f6343713c..6c9cc4b510 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 b811751a2c..b7c65f36a3 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 431635047a..c84146ecf5 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 87c705153e..b0f92d8cf1 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 b51f38efb2..696bdcd520 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 81564b8eac..2db22d2fdd 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 9199725767..cf80004c22 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 36170e4a8e..eebc83cf3d 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 7264ba7f38..baac782545 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 d5de01cf2f..769252e8b9 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 4f50de0325..e2dd249ff7 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 710a86e2d8..f2491900ff 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 b6b1596883..eaa85122f7 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 0ceae866c4..783cc7fde4 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 c392fc5b9a..d122d5bdca 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 b5e58507d6..b3fd3af70b 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 0323d32d87..16702f8647 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 6effbb6090..469d6b2787 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 dce6a3cb3f..0b98ab1b74 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 c65822c72e..4527dd4c14 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 e713461f8d..065b5a0c5e 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 05ed5103b8..00bceec2b5 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 079f80f556..c3185853dc 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 d4069a1f59..b135022deb 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 ec71386cbb..f6ec4a079a 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 1ffb07a6db..d89542631d 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 00526cb398..f5b6cad4b7 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 d4940b3412..d8e6321f34 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 f9521a7e38..352d6316b4 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 ff713c9523..064e5816a5 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 d55967f84f..56d9596b04 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 ed19a248a6..8b04afe418 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 de84f6e59f..870c84d56c 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 70115b4728..21416108a3 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 77363876b0..4ebeec44a5 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 dfa1635e08..b99c149b06 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 743e6b6e62..775043b23e 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 540b91a52a..cd95a54b36 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 57d39c3160..79f2e18547 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 447245ea9a..8991c63947 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 258a9d2ff7..147916395e 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 035ee2e7a6..33b0749e3f 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 9c8b906377..dfd45486ef 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 91c9d67767..fe9ac4abb4 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 b91b617147..b37a4c63b9 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 abf390b176..b2a3ebe414 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 6c94319004..00580a4933 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 3a1493a848..52f57f5e45 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 4d393a6ed3..35fc659977 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 f832e70879..96d88af79f 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 3341177544..152546fadc 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 0000000000..0d66d016cb --- /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 3c7586e264..9d220cfd41 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 83b5792a64..71643458b4 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 e919d35903..b4be18d03b 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 48a27eb11d..c0d5b9004c 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 ffb129cb86..3ae312647e 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 481e7df3a4..b18e5f61f1 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 d3d150703e..eccba5119a 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 04f4754db2..7ca9b149a6 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 4e96aa6eaf..293fca2ad7 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 309b38d69f..3f67089b92 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 c2e85ad112..9890598bc9 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 e2b6738076..ed6c517e9b 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 317995c4f4..894d324834 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 16badcc1d4..379279441e 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 e1a89e3794..12fe721166 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 ac166f9ad8..36f886109c 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 977ada214e..4d0514f471 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 71189cf7cc..6f5c461f3e 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 288dab2bac..bac6022cd4 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 7a51b41bfb..a496d911d2 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 be9f5a6f87..731c692968 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 203e5b2b99..934d2db2ca 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 e851a1e217..258fd07872 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 d5d27cc836..0bfc5841df 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 3fb15c8d1e..d27c2e1306 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 ea2c90a9e3..c943091622 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 bc0d969699..ad115dd8ff 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 2a13a4865c..0f3dc52fce 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 2f5bfd44e8..801a8091dd 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 dfdd133a3c..55521e0c53 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 6ecb65336c..044cbdf79a 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 ed3b438f89..0b8cbb1d8c 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 fc8955d909..28aca0aeed 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 3a2a9e1f80..6140d45896 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 e7626603fc..a1a8357b61 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 5b555e51a3..7f63f93060 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 ea6807a2e9..eeec2d1f4b 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 18c61a209c..8f461baea9 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 79c348515b..7b16a8a998 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 af474bc406..2b200b057d 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 c59c59d497..68ca3b48f6 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 8f52087caa..ca76c2ff72 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 2d03cd2f72..a0ef8dcacb 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 3e9eebbc4c..33b0ba918d 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 b4390f14a1..f15c20fa70 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 5a004193d0..72ba515613 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 87f153cd65..7d4ffb85c1 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 aabc291a98..cc4b2af1a2 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 cd0553218d..160ac5a851 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 e382acae32..987da1c6b3 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 733b69e79f..ad527e5aee 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 4cec5ebad9..96bced0bb7 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 c2c6e45ef8..8f28f39632 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 dc3b89c7c7..78770f2d5e 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 d7fe74a6d8..0394ccb5ad 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 abd9fe6724..b74e8a7ac0 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 a408199088..6144b5b70b 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 37503ec38d..919f676945 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 20eaf99136..7f2f2bc394 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 a90bd507d5..51c9478150 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 f348239e08..b245db09a7 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 f3b048d58c..c3fcf778a6 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 0b6fbd9af0..7b85909ed5 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 39deebbbf1..2fec5dfb89 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 6f247608d9..07a207b556 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 87228ea784..4452bb4273 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 73fabe0e0a..27e3c35ec1 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 f151071a9f..a647e89e34 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 8846f1ca51..5cad7e48cc 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 7bbe0fea95..d001e0a88c 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 e23c8b749c..0cd84108ba 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 5f8699302d..c7c8890cb9 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 0cce45b2e7..5bcf672ff6 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 293e395b88..9897225c38 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 b59548ea1d..475a696719 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 580d152dc7..868b31861a 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 ed1a71bea7..f23db87a98 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 70522d4067..f5b19f915f 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 413b55298c..39c6048958 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 54d061a503..19f7127d57 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 8a17623c3e..f36ffc8add 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 b8de8674d4..7dc8a53566 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 83d617b9a6..74033e27db 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 ace6181ddf..42d604548e 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 87440c36be..83813b5b1b 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 fffe6b4699..915e1e8d97 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 89b2ee7047..2b90ac3cd1 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 1ebb3fd43f..38b49730d4 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 7e6a0b79d7..b6c34d2d4b 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 3ee1c02c5e..220732918d 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 f0391134ba..e6b5c48d3d 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 b5f7e2b6ec..240e16d467 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 404566cc6f..f479998ede 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 50811fb8a9..77ea508b89 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 68864c8d66..7fc879fbf4 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 5bd196d924..e1dcbbdb4d 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 d03d9b816f..40a4a441eb 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 0b4246a2bf..1f3aef7141 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 b84b13be7c..48d8c290b5 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 8034ae4ca0..9fb1d900f7 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 9d5fc64641..8329cbd395 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 e6857a4d2f..85c270887d 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 56d6259b5a..cf8c4d5d0d 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 2651df9231..3b5fe712cc 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 aaf0422b19..d62bc68b31 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 823f0c99a8..7a0948e7ac 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 6eca6bb38d..1dc52f0fd1 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 2ababe6a49..f080c0d3be 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 a9d733e5ef..51f70737ed 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 be048b19e4..51884a625a 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 6501f16ca5..ac32aeb0be 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 f15667322f..704c7f9940 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 28add61a8a..5c8324c63d 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 be4a93b894..f3deabad03 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 0f5650d284..8f624fab93 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 61b43a588a..0b88052129 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 f963875ae1..ff3f3cd428 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 d0cbfe9e7d..7c7807f60d 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 d6db548665..2414276161 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 8576d3042e..7198b4c140 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 21ae92e93c..ecec47d7ba 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 e4ea090e80..207fbb148d 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 37483a5460..b7bbb2759f 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 a7dc7c4973..5f9091eced 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 62a01e9033..82c8ee8995 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 0000000000..97a7f9df26 --- /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 0000000000..50b7a3f285 --- /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 8c69933e2b..98191be7be 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 6e2f7dd597..8a8a758e67 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 cae49fd3ef..2515794de7 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 0af34336b8..21ed986b7f 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 cf8d3c2b97..3024cf6e41 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 207d162d7e..56c1ee013d 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 15203588d1..34b528d04e 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 9aab558042..57a0848527 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 a4e5528a15..e3a632619e 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 035a8a3d3b..5be4404c9e 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 776a3acfca..2664c472e6 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 969d9a4217..c08e00ba49 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 0922c79915..e20683aa82 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 999dab9a06..debbc10ea7 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 9e05a0f676..1875143f32 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 a52438a9c8..45ea9dcf94 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 ff4b2e1d85..7c92f111fc 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 a90e88933e..98f5e3793a 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 d5e89625ed..97e2867ddc 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 0000000000..963a7194b3 --- /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 a246fcce49..90a7b33f96 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 fa6722615c..f63409da29 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 b39e959f72..b671929d84 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 911cbdf420..0720af0fda 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 44c8ae70fb..57f9857a87 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 05fdca355b..fc0b02505d 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 aa19fc88ea..f7bfdc6787 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 e4a622aec6..805da988c6 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 d655c71319..a2018fc5c8 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 ae4339448d..946de0e111 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 fd1f8eae1d..7a1c895583 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 8b508a3253..8c27d66a83 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 562be4cee4..704bab5a0d 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 6689c8724d..7510ba2afc 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 2d665f167b..0b580f7dcd 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 5d30bf7c6a..5d8484c352 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 a72e37acad..e896470e85 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 0c8b700842..61c8e0ff73 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 38b9dbad02..9ce886295f 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 cc3639f438..8b49f36946 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 0805f2be01..8132cb3469 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 2c38bb0d91..f397eb6b7b 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 a5510e2406..3d93266981 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 dae6eda447..c633585096 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 27a689a53e..4f84c964f8 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 8e8fa9ac2a..879633b0c8 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 8424ae10d6..a04ee57a96 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 aa1fc28af6..8b77ab399d 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 b13ab93da3..e8e3d18fc0 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 367922a3e2..0a3b6c0beb 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 22f78ebe74..caddacb07b 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 bc989ccaa4..c457098ed5 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 663ca1d560..c51f95810a 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 e52df4df74..515cd54129 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 c02905535b..fd8224ce34 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 8b9c14b76f..e981dcb799 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 b50ef3446b..c8d21f3802 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 c947e935dd..131e79271a 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 4500392b27..2af50101f4 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 8b98a35384..21a4df25ec 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 c12574a65a..9fdf627001 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 f900242198..0d0f99ba03 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 6ba4d29baf..6e7355ff59 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 497153e07e..ea062b4c0a 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 6fcc117a8c..76391a6d96 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 c7e13b1a97..9040ea5636 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 54b283f539..1f97bb95d1 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 e5c9bb1353..48c033a735 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 0000000000..148366bc0d --- /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 cfc46977d1..979a6a4476 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 33e7402ce6..989f971c09 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 a5a9d7e99b..4fd097c84d 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 820e063614..8ff39c01db 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 d8427e2848..04a38163a4 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 ee9ab45edf..82e9cf6e33 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 bbb12c2ddb..524836d20b 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 591129916d..3bf63b641a 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 c8bf28e777..676ef18a38 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 64bccc297d..f1af02c73a 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 668f583de7..b5dc8b4f84 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 9cad90a10a..7c008a6bb2 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 a292fb85e2..4f43cbc877 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 37aa23406e..fbb55ee7c7 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 33391fcfa2..503997cfca 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 c9958e7bcb..34133feb1b 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 e482c6e87e..d70cb0bd25 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 348eb2a795..72bbb2c36b 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 1341d65e6f..f715f70e77 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 da38096bca..c93581112a 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 937bf69f19..594c62d145 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 90692648c1..95a6cbdf9b 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 a937ea41ab..790ea9e6da 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 3e4183be8b..482005c883 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 b9bf7ac439..f57da139a6 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 143a6d9910..473ec73a2f 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 d53bc77684..5e7a05590e 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 f6e7ed9798..781dabeeed 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 793c4620c1..910d043fb3 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 09a28d95a1..900e760979 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 4daad9eddc..87a49902f4 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 ec6fa1653c..916257e203 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 9a5f4afad0..b08320c07f 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 df9d6b5530..e2d2e95e40 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 8dd7385e43..a9232540e8 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 7d2d721d44..8285bc97f7 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 e3ac705faf..9b9d943944 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 d2a5d233ef..5d0525f1b0 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 ff153b6c47..957bfe359a 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 ef67dfe1c5..e8b5febbf7 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 d53c1d01c9..fce37dd719 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 8f9ade4e83..4fea6a32b4 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 b9758300bc..1052fea301 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 9f6c0a57f1..56fc1a00a5 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 4e08046aa9..e3e8ac2814 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 4aafb9a408..df809ae2a9 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 d9bc921cc3..5b84bc623f 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 009554ea2a..8b8d3fd5e7 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 9993ec888e..bb1d024367 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 dfa1aac6ba..ec31b3688e 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 9f2bafb72a..c1db2cf0ec 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 ca6b613f9f..a4d30f68b8 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 c4e3b1f6cf..34b4dfb409 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 d1cd0a7336..50ac0b06ac 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 15bc73c1de..5da4797472 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 447437528a..9041e5121d 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 60c94db90d..3887d2b708 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 4b486c72ec..4e36841887 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 32cf5a0e16..dc33f1e0a9 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 e3c91b286a..4eef325ea1 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 b6d6c0237c..b8ea6ce7ae 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 9442782749..f13bfd2dcb 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 3e5151b681..fc39a6135e 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 8e32fa10ee..b9a84fdc1f 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 cd629d7083..a749270ed1 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 9a3457bcff..5dc6517529 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 d0a38c873c..9d7c49ee46 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 907fe23ea5..989ea48ce6 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 e64c3305db..199dbdcb9c 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 eb2a4de4c7..4500863cb4 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 4e53fecf44..a4c1ec2278 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 a2470ac15c..f2e2c2339d 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 ab873359a7..8fdee75d86 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 199c5c7955..e32a42461b 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 f44909f3da..a0ada2859d 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 7bb936f8dd..1b0e098113 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 27073dfa81..2062fbeaf0 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 1b3cf48852..07b84de90e 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 34dda63e64..4d5d2a9915 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 5a4ee50fb2..4330f00a62 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 fe386e34a8..154f5de694 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 a3e0ab2529..66832558de 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 df1f570e9d..5305ce1def 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 cc3c80d10d..039414a681 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 14b331a458..05dcde77e2 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 571382e66f..58d79d609d 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 54897c922d..347c4a5b86 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 e7b81283fb..2b0d397804 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 cd876a36bf..a68049e79d 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 adf048b613..3bfd1763b8 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 94e778b3bc..7f77d83e81 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 2f8f379db0..de058aaead 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 32ecbbb48f..93ddf8cc85 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 5523fac7fc..1e44f51778 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 5e29612d72..a5d68a0c61 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 6a6194b38f..ef9b8e3702 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 e6b7a25316..50ed7ac442 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 d5f82826b0..385fbe8bbb 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 5944830c43..a7cbc3de2f 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 a34068f533..d520bbc5a7 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 2b72cdee88..5488925a5d 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 dafe9fb529..a1d47810bf 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 0000000000..765d0adfc2 --- /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 3e182dacba..3396265b0f 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 ef7dad95a3..dd390a0a3d 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 33c4d960f8..611bb34fd3 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 ae0a016af3..f13a983311 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 7a038edf4b..c2c68d021c 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 d44e7afec3..04a7378ec9 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 ea39a25b5c..dd88d3d5ec 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 00a3a341bb..5b64dbf214 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 c17b0722e9..29eea90807 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 e723b43323..ba4d224e66 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 b1170a70f5..d8816cc8ce 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 0788a82ba4..6ec5dcd47f 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 8d075a37c0..5928200f78 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 b9dc782571..0954c53dca 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 54c46095aa..965d99f5dd 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 369e16a795..e02158a2c0 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 b97926f98e..3c6e67b1d1 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 a1d47e0fbd..2bd27835cf 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 5be70dc22e..3a537ddc20 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 8135476662..d6a48f822c 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 054bbd83c8..4f35ab77d3 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 ba0eb0e1bd..e1025f1baa 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 351dfee2b5..1968ab31ea 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 3e6f559438..b307d9c810 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 a7b2b9695d..1d79e6a63d 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 fa5b209f1b..15bf92affe 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 0af114c7ea..7e35355215 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 f0b95c0e00..c03385b64e 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 c6cc6a8b45..9e8345f065 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 9bcb8f2655..a03c74a008 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 ed338875d0..398ab10ccf 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 025437f15b..f052a2e775 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 01b1fcd521..fa9eacd2b3 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 5799ab816c..367c1028a8 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 752e61b6d9..ccadb041ce 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 5dcdac8470..6be3a8aa20 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 bc39b1e160..0c3bae3774 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 ed9242925f..5740eb74fc 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 db41a19ee6..7b5f9b0dfa 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 a368a80894..23ca25d48c 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 1b9786191f..348ce65428 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 3fffcc7414..b9041ae441 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 d49a2ba9c5..b6869f95f1 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 173fb7f68c..395880493f 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 88594c70d3..5bb21aba7b 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 5c754ecdee..7f112ea326 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 6b5ab72d90..fdcc3b90fa 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 27cb44dcc7..4df5e8508b 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 ce15de135c..1e715eccf6 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 68694038e5..a5189fc7d8 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 5cdfd892ce..96ae5d7374 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 4d08803fc2..f4d716540a 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 938d1e1dcc..e393e5d4d3 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 6166d3a684..e9ea9a6010 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 6bdb0e943b..01b57903cf 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 b716dc8254..f50d28b251 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 a943334cd5..d2d748d942 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 fc05207210..619cb727ac 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 5076b380bd..e626beaeb6 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 8fa8239201..963908c92d 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 6f657d1da8..c80b897ab6 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 f5058d88fd..f9f89d714c 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 6d5af0c975..69024441ac 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 e9ae239942..d7fb364291 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 c5eeafaf3b..d3e10238df 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 de1638de5e..80925cb9df 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 2b4c7c1518..42279ee1cf 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 aaa568717f..0d9804cb90 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 864ba89d70..d71baf8fc2 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 c7fc35a269..350a8d90fd 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 01a990b654..c4d0ed6da2 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 e2cd66a33c..a19aaea9ea 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 25243273fe..f5a1de15fa 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 0abd641328..39ded8fae0 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 46d7126093..79a134d5dd 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 160b37a2c8..a0c8b41597 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 9eed794dec..7404cae786 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 c4b3850120..33788b9ca5 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 11e99a7893..9d9583e965 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 75a824d5da..a028728ecb 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 c78714feba..cccf334fc4 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 6cea72c31b..ab1aa3df4f 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 4ff2f871bc..3000d4c717 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 e522def614..84f1907576 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 bb3f9a6106..8076ecf1f9 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 8cc26b5ce7..bd354fa1f2 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 9d5824ba98..88286df275 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 9e6426d48e..12c3bbcbde 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 9671df9dda..17a0804dd6 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 96f6a808d3..76b9dc3994 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 d837cc086b..efa1f516cb 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 84b90c76e5..90f56d2573 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 aafbfd01d3..35f4994ba2 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 2b855258a6..05b5dc2cc5 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 1f9679d3ae..50cd7cecd9 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 1da6fb8fe6..b87c1f77d3 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 8f4f3a515c..1df976f10d 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 dcf7c74634..c07fae77c3 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 cd3d73dfd0..a8d5a6f5ff 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 d37938a3a3..d67f376fc6 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 43cc97aa22..49c7f6d3d7 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 931bef0127..6c4f14873e 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 c2d371283a..d9a9c17fea 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 6b7dbb26db..e7801d1179 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 d56298b416..5f245fa0f1 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 bba4b7bd01..a73b65abf0 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 4623272923..566f03a293 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 f6c5b7ff3e..cad2bb5cdf 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 581faf46a4..eebe777d98 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 4b7196c4c7..1be8762a85 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 06f9c8b913..c2f4a68e42 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 f02e547cfc..cc969ae572 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 c80725f4a8..8c7e0b6a08 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 2bb9e0ee15..65debe44d1 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 44016caada..560dbf8874 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 57a8f8fafb..8e8b57cca9 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 9533db312e..c3d3b0bc6f 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 62a614019c..1178ec6b9c 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 a23585fe7f..f97a4c76b3 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 d23c934bd2..d0b484b5fb 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 6b2326c102..1996a79729 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 0df5a60b89..086bd4d13f 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 d659bf8034..be2f03a27d 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 fe89246689..7b85936da7 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 98f44e7d9d..6cd91c6f6f 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 cb39358f9d..72bc45fd21 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 1f17531bd0..76e9214bd7 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 d47621b3cd..b83d40588f 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 dbf5ca56f5..12297a2aaa 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 9023ae0426..9d40bd7628 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 b6b8b2f5e0..c8318be9fc 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 f9c94ea2ed..f5d0698d82 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 3f1d534d93..598729459a 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 4115bafad4..53a48f3fef 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 8d67425f94..fe783b39cb 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 2a77932946..25cabb3302 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 7815a89101..52defbc469 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 0184a119ff..4a0708ed34 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 c9689188a1..71d8c9bca0 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 195bb4a6ae..6fbf1d5a0a 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 17a6696fb9..99c93e5eb1 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 f2aa6f57cc..b8f43d2a22 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 9566aeff02..723cab861a 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 889f0caa0d..43d21c6022 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 33468e2fbd..e836cac43f 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 7dec087cbd..c1c045a29b 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 5de8a51fe8..48f535f35b 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 53f602f11a..bc8659942e 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 9d9aa77163..4855939bb8 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 73aaaf5d95..fa03e20080 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 58b9661170..7e91529e1c 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 295a971e9d..2f6e945204 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 9628236181..ef831a5698 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 0b3ceb4c3e..37fa6243c9 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 8373c94d7d..12d7add5a5 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 f9a05754b6..49545e6a57 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 97b21e0c3d..14894f3213 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 e50b088a8c..5180e57b93 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 78680cfb6a..980f14ac1b 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 3b22d4c5d0..8dfae4758d 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 d01aceb288..9903c998fe 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 ffaeeb6af5..93778c8584 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 fafa077a99..4b6b739050 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 facdd0f28a..d12ac837ca 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 62980f8302..0be4e69973 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 f35ddadfb4..7dd2e0c7eb 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 b091a55d70..331b2ef62d 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 fc607b81db..ae045b61af 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 459b9b094f..3092b5a574 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 249d44ab55..a304a0f3ab 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 236618f7be..04a3cfb9a0 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 f7f467ad2d..8ed5d8f62d 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 dbbb9d867d..b6930dc624 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 3450ad1bb4..c9d76cedfb 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 c6a4bebfa5..13df7cf450 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 8acd2464c7..585ba29fa7 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 3712d6c5e2..38cf00dd19 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 8406c504c9..247bb44ba1 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 ddd28a97c3..75bfdd9cf5 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 c8001ebaa6..5e83343490 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 26b55eae78..e0fa559587 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 8cfb624b8d..b322dcad35 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 5da3bf76c9..ad1503642b 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 a5cf40cedc..48b0d86cb8 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 f2de0809a7..ff3002e645 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 9ea5e8b707..d936699a5f 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 4357b4fa1a..721aab2d3e 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 b2e0ba5388..1c6491cafc 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 ebc8578f0b..951e09bd25 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 9a26eda507..5ff979e86e 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 521a77d1af..84b1eea8a8 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 06c3f95a80..f47017b2fb 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 b81a3b1566..31b2ad21bd 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 f122a1b36f..3b2c725517 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 f9b2200a43..9ce936ae26 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 52af024858..2716767fe5 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 452165eef2..ff1086507c 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} -- GitLab