From c07f5e83398651cf8d0dccb036705b9eb69d8646 Mon Sep 17 00:00:00 2001 From: Karl Hammond Date: Wed, 19 Oct 2022 10:29:18 -0500 Subject: [PATCH 001/266] Temporary(?) fix for highlighting overflow in labelmap.rst --- doc/src/labelmap.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/labelmap.rst b/doc/src/labelmap.rst index 57e4926611..a11ab653f8 100644 --- a/doc/src/labelmap.rst +++ b/doc/src/labelmap.rst @@ -25,7 +25,7 @@ Examples .. code-block:: LAMMPS labelmap atom 3 carbon 4 'c3"' 5 "c1'" 6 "c#" - labelmap bond 1 carbonyl 2 nitrile 3 """ c1'-c2" """ + labelmap bond 1 carbonyl 2 nitrile 3 """ c1'-c2" """ #" labelmap atom $(label2type(atom,carbon)) C # change type label from 'carbon' to 'C' labelmap clear labelmap write mymap.include From 14cb8576f42f1d3daa09883bd2e4bb5e14631105 Mon Sep 17 00:00:00 2001 From: Stan Gerald Moore Date: Fri, 3 Mar 2023 09:22:33 -0700 Subject: [PATCH 002/266] Update Kokkos library in LAMMPS to v4.0 --- lib/kokkos/BUILD.md | 10 +- lib/kokkos/CHANGELOG.md | 103 + lib/kokkos/CMakeLists.txt | 44 +- lib/kokkos/LICENSE | 281 ++- lib/kokkos/LICENSE_FILE_HEADER | 15 + lib/kokkos/Makefile.kokkos | 522 ++--- lib/kokkos/Makefile.targets | 17 + lib/kokkos/algorithms/CMakeLists.txt | 3 +- lib/kokkos/algorithms/src/CMakeLists.txt | 2 +- .../algorithms/src/KokkosAlgorithms_dummy.cpp | 16 + .../algorithms/src/Kokkos_NestedSort.hpp | 188 ++ lib/kokkos/algorithms/src/Kokkos_Random.hpp | 130 +- lib/kokkos/algorithms/src/Kokkos_Sort.hpp | 152 +- .../algorithms/src/Kokkos_StdAlgorithms.hpp | 38 +- .../Kokkos_AdjacentDifference.hpp | 38 +- .../std_algorithms/Kokkos_AdjacentFind.hpp | 38 +- .../src/std_algorithms/Kokkos_AllOf.hpp | 38 +- .../src/std_algorithms/Kokkos_AnyOf.hpp | 38 +- .../src/std_algorithms/Kokkos_BeginEnd.hpp | 38 +- .../src/std_algorithms/Kokkos_Copy.hpp | 38 +- .../std_algorithms/Kokkos_CopyBackward.hpp | 38 +- .../src/std_algorithms/Kokkos_CopyIf.hpp | 38 +- .../src/std_algorithms/Kokkos_CopyN.hpp | 38 +- .../src/std_algorithms/Kokkos_Count.hpp | 38 +- .../src/std_algorithms/Kokkos_CountIf.hpp | 38 +- .../src/std_algorithms/Kokkos_Distance.hpp | 38 +- .../src/std_algorithms/Kokkos_Equal.hpp | 38 +- .../std_algorithms/Kokkos_ExclusiveScan.hpp | 38 +- .../src/std_algorithms/Kokkos_Fill.hpp | 38 +- .../src/std_algorithms/Kokkos_FillN.hpp | 38 +- .../src/std_algorithms/Kokkos_Find.hpp | 38 +- .../src/std_algorithms/Kokkos_FindEnd.hpp | 38 +- .../src/std_algorithms/Kokkos_FindFirstOf.hpp | 38 +- .../src/std_algorithms/Kokkos_FindIf.hpp | 38 +- .../src/std_algorithms/Kokkos_FindIfNot.hpp | 38 +- .../src/std_algorithms/Kokkos_ForEach.hpp | 38 +- .../src/std_algorithms/Kokkos_ForEachN.hpp | 38 +- .../src/std_algorithms/Kokkos_Generate.hpp | 38 +- .../src/std_algorithms/Kokkos_GenerateN.hpp | 38 +- .../std_algorithms/Kokkos_InclusiveScan.hpp | 38 +- .../std_algorithms/Kokkos_IsPartitioned.hpp | 38 +- .../src/std_algorithms/Kokkos_IsSorted.hpp | 38 +- .../std_algorithms/Kokkos_IsSortedUntil.hpp | 38 +- .../src/std_algorithms/Kokkos_IterSwap.hpp | 38 +- .../Kokkos_LexicographicalCompare.hpp | 38 +- .../src/std_algorithms/Kokkos_MaxElement.hpp | 38 +- .../src/std_algorithms/Kokkos_MinElement.hpp | 38 +- .../std_algorithms/Kokkos_MinMaxElement.hpp | 38 +- .../src/std_algorithms/Kokkos_Mismatch.hpp | 38 +- .../src/std_algorithms/Kokkos_Move.hpp | 38 +- .../std_algorithms/Kokkos_MoveBackward.hpp | 38 +- .../src/std_algorithms/Kokkos_NoneOf.hpp | 38 +- .../std_algorithms/Kokkos_PartitionCopy.hpp | 38 +- .../std_algorithms/Kokkos_PartitionPoint.hpp | 38 +- .../src/std_algorithms/Kokkos_Reduce.hpp | 38 +- .../src/std_algorithms/Kokkos_Remove.hpp | 38 +- .../src/std_algorithms/Kokkos_RemoveCopy.hpp | 38 +- .../std_algorithms/Kokkos_RemoveCopyIf.hpp | 38 +- .../src/std_algorithms/Kokkos_RemoveIf.hpp | 38 +- .../src/std_algorithms/Kokkos_Replace.hpp | 38 +- .../src/std_algorithms/Kokkos_ReplaceCopy.hpp | 38 +- .../std_algorithms/Kokkos_ReplaceCopyIf.hpp | 38 +- .../src/std_algorithms/Kokkos_ReplaceIf.hpp | 38 +- .../src/std_algorithms/Kokkos_Reverse.hpp | 38 +- .../src/std_algorithms/Kokkos_ReverseCopy.hpp | 38 +- .../src/std_algorithms/Kokkos_Rotate.hpp | 38 +- .../src/std_algorithms/Kokkos_RotateCopy.hpp | 38 +- .../src/std_algorithms/Kokkos_Search.hpp | 38 +- .../src/std_algorithms/Kokkos_SearchN.hpp | 38 +- .../src/std_algorithms/Kokkos_ShiftLeft.hpp | 38 +- .../src/std_algorithms/Kokkos_ShiftRight.hpp | 38 +- .../src/std_algorithms/Kokkos_Swap.hpp | 38 +- .../src/std_algorithms/Kokkos_SwapRanges.hpp | 38 +- .../src/std_algorithms/Kokkos_Transform.hpp | 38 +- .../Kokkos_TransformExclusiveScan.hpp | 38 +- .../Kokkos_TransformInclusiveScan.hpp | 38 +- .../std_algorithms/Kokkos_TransformReduce.hpp | 38 +- .../src/std_algorithms/Kokkos_Unique.hpp | 38 +- .../src/std_algorithms/Kokkos_UniqueCopy.hpp | 38 +- .../impl/Kokkos_AdjacentDifference.hpp | 38 +- .../impl/Kokkos_AdjacentFind.hpp | 38 +- .../impl/Kokkos_AllOfAnyOfNoneOf.hpp | 38 +- .../impl/Kokkos_Constraints.hpp | 38 +- .../impl/Kokkos_CopyBackward.hpp | 38 +- .../std_algorithms/impl/Kokkos_CopyCopyN.hpp | 38 +- .../src/std_algorithms/impl/Kokkos_CopyIf.hpp | 38 +- .../impl/Kokkos_CountCountIf.hpp | 38 +- .../src/std_algorithms/impl/Kokkos_Equal.hpp | 38 +- .../impl/Kokkos_ExclusiveScan.hpp | 38 +- .../std_algorithms/impl/Kokkos_FillFillN.hpp | 38 +- .../std_algorithms/impl/Kokkos_FindEnd.hpp | 38 +- .../impl/Kokkos_FindFirstOf.hpp | 38 +- .../impl/Kokkos_FindIfOrNot.hpp | 38 +- .../impl/Kokkos_ForEachForEachN.hpp | 38 +- .../impl/Kokkos_GenerateGenerateN.hpp | 38 +- .../impl/Kokkos_HelperPredicates.hpp | 38 +- .../Kokkos_IdentityReferenceUnaryFunctor.hpp | 38 +- .../impl/Kokkos_InclusiveScan.hpp | 38 +- .../impl/Kokkos_IsPartitioned.hpp | 38 +- .../std_algorithms/impl/Kokkos_IsSorted.hpp | 38 +- .../impl/Kokkos_IsSortedUntil.hpp | 38 +- .../impl/Kokkos_LexicographicalCompare.hpp | 38 +- .../impl/Kokkos_MinMaxMinmaxElement.hpp | 38 +- .../std_algorithms/impl/Kokkos_Mismatch.hpp | 38 +- .../src/std_algorithms/impl/Kokkos_Move.hpp | 38 +- .../impl/Kokkos_MoveBackward.hpp | 38 +- .../impl/Kokkos_PartitionCopy.hpp | 38 +- .../impl/Kokkos_PartitionPoint.hpp | 38 +- .../impl/Kokkos_RandomAccessIterator.hpp | 38 +- .../src/std_algorithms/impl/Kokkos_Reduce.hpp | 38 +- ...cerWithArbitraryJoinerNoNeutralElement.hpp | 38 +- .../impl/Kokkos_RemoveAllVariants.hpp | 38 +- .../std_algorithms/impl/Kokkos_Replace.hpp | 38 +- .../impl/Kokkos_ReplaceCopy.hpp | 38 +- .../impl/Kokkos_ReplaceCopyIf.hpp | 38 +- .../std_algorithms/impl/Kokkos_ReplaceIf.hpp | 38 +- .../std_algorithms/impl/Kokkos_Reverse.hpp | 38 +- .../impl/Kokkos_ReverseCopy.hpp | 38 +- .../src/std_algorithms/impl/Kokkos_Rotate.hpp | 38 +- .../std_algorithms/impl/Kokkos_RotateCopy.hpp | 38 +- .../src/std_algorithms/impl/Kokkos_Search.hpp | 38 +- .../std_algorithms/impl/Kokkos_SearchN.hpp | 38 +- .../std_algorithms/impl/Kokkos_ShiftLeft.hpp | 38 +- .../std_algorithms/impl/Kokkos_ShiftRight.hpp | 38 +- .../std_algorithms/impl/Kokkos_SwapRanges.hpp | 38 +- .../std_algorithms/impl/Kokkos_Transform.hpp | 38 +- .../impl/Kokkos_TransformExclusiveScan.hpp | 38 +- .../impl/Kokkos_TransformInclusiveScan.hpp | 38 +- .../impl/Kokkos_TransformReduce.hpp | 38 +- .../src/std_algorithms/impl/Kokkos_Unique.hpp | 38 +- .../std_algorithms/impl/Kokkos_UniqueCopy.hpp | 38 +- ...Kokkos_ValueWrapperForNoNeutralElement.hpp | 38 +- .../algorithms/unit_tests/CMakeLists.txt | 71 +- .../algorithms/unit_tests/TestNestedSort.hpp | 408 ++++ .../unit_tests/TestOpenMP_Sort1D.cpp | 38 +- .../unit_tests/TestOpenMP_Sort3D.cpp | 38 +- .../unit_tests/TestOpenMP_SortDynamicView.cpp | 38 +- .../algorithms/unit_tests/TestRandom.hpp | 76 +- .../unit_tests/TestRandomAccessIterator.cpp | 38 +- .../unit_tests/TestRandomCommon.hpp | 38 +- lib/kokkos/algorithms/unit_tests/TestSort.hpp | 64 +- .../algorithms/unit_tests/TestSortCommon.hpp | 38 +- .../TestStdAlgorithmsAdjacentDifference.cpp | 38 +- .../TestStdAlgorithmsAdjacentFind.cpp | 44 +- .../TestStdAlgorithmsAllAnyNoneOf.cpp | 44 +- .../unit_tests/TestStdAlgorithmsCommon.cpp | 38 +- .../unit_tests/TestStdAlgorithmsCommon.hpp | 38 +- .../TestStdAlgorithmsCompileOnly.cpp | 468 ++-- .../TestStdAlgorithmsConstraints.cpp | 38 +- .../unit_tests/TestStdAlgorithmsCopyIf.cpp | 38 +- .../unit_tests/TestStdAlgorithmsCount.cpp | 38 +- .../unit_tests/TestStdAlgorithmsEqual.cpp | 38 +- .../TestStdAlgorithmsExclusiveScan.cpp | 38 +- .../unit_tests/TestStdAlgorithmsFind.cpp | 44 +- .../unit_tests/TestStdAlgorithmsFindEnd.cpp | 44 +- .../TestStdAlgorithmsFindFirstOf.cpp | 44 +- .../unit_tests/TestStdAlgorithmsForEach.cpp | 38 +- .../TestStdAlgorithmsHelperFunctors.hpp | 38 +- .../TestStdAlgorithmsInclusiveScan.cpp | 38 +- .../unit_tests/TestStdAlgorithmsIsSorted.cpp | 38 +- .../TestStdAlgorithmsIsSortedUntil.cpp | 44 +- ...estStdAlgorithmsLexicographicalCompare.cpp | 44 +- .../TestStdAlgorithmsMinMaxElementOps.cpp | 38 +- .../unit_tests/TestStdAlgorithmsMismatch.cpp | 44 +- .../unit_tests/TestStdAlgorithmsModOps.cpp | 38 +- .../unit_tests/TestStdAlgorithmsModSeqOps.cpp | 38 +- .../TestStdAlgorithmsMoveBackward.cpp | 38 +- .../unit_tests/TestStdAlgorithmsNumerics.cpp | 38 +- .../TestStdAlgorithmsPartitionCopy.cpp | 38 +- .../TestStdAlgorithmsPartitioningOps.cpp | 62 +- .../unit_tests/TestStdAlgorithmsRemove.cpp | 38 +- .../TestStdAlgorithmsRemoveCopy.cpp | 38 +- .../TestStdAlgorithmsRemoveCopyIf.cpp | 38 +- .../unit_tests/TestStdAlgorithmsRemoveIf.cpp | 38 +- .../unit_tests/TestStdAlgorithmsReplace.cpp | 38 +- .../TestStdAlgorithmsReplaceCopy.cpp | 38 +- .../TestStdAlgorithmsReplaceCopyIf.cpp | 38 +- .../unit_tests/TestStdAlgorithmsReplaceIf.cpp | 38 +- .../unit_tests/TestStdAlgorithmsReverse.cpp | 38 +- .../unit_tests/TestStdAlgorithmsRotate.cpp | 38 +- .../TestStdAlgorithmsRotateCopy.cpp | 38 +- .../unit_tests/TestStdAlgorithmsSearch.cpp | 44 +- .../unit_tests/TestStdAlgorithmsSearch_n.cpp | 44 +- .../unit_tests/TestStdAlgorithmsShiftLeft.cpp | 38 +- .../TestStdAlgorithmsShiftRight.cpp | 38 +- ...estStdAlgorithmsTransformExclusiveScan.cpp | 38 +- ...estStdAlgorithmsTransformInclusiveScan.cpp | 38 +- .../TestStdAlgorithmsTransformUnaryOp.cpp | 38 +- .../unit_tests/TestStdAlgorithmsUnique.cpp | 38 +- .../TestStdAlgorithmsUniqueCopy.cpp | 38 +- .../algorithms/unit_tests/TestStdReducers.cpp | 38 +- .../algorithms/unit_tests/UnitTestMain.cpp | 38 +- lib/kokkos/appveyor.yml | 2 +- lib/kokkos/benchmarks/atomic/main.cpp | 16 + .../benchmarks/bytes_and_flops/bench.hpp | 38 +- .../bytes_and_flops/bench_double.cpp | 38 +- .../bytes_and_flops/bench_float.cpp | 38 +- .../bytes_and_flops/bench_int32_t.cpp | 38 +- .../bytes_and_flops/bench_int64_t.cpp | 38 +- .../bytes_and_flops/bench_stride.hpp | 38 +- .../bytes_and_flops/bench_unroll_stride.hpp | 52 +- .../benchmarks/bytes_and_flops/main.cpp | 38 +- lib/kokkos/benchmarks/gather/gather.hpp | 38 +- .../benchmarks/gather/gather_unroll.hpp | 38 +- lib/kokkos/benchmarks/gather/main.cpp | 38 +- lib/kokkos/benchmarks/gups/gups-kokkos.cpp | 36 +- .../benchmarks/policy_performance/main.cpp | 38 +- .../policy_performance/policy_perf_test.hpp | 38 +- .../benchmarks/stream/stream-kokkos.cpp | 36 +- lib/kokkos/bin/hpcbind | 4 - lib/kokkos/bin/nvcc_wrapper | 4 +- lib/kokkos/cmake/Dependencies.cmake | 13 +- lib/kokkos/cmake/KokkosConfigCommon.cmake.in | 4 - .../cmake/KokkosCore_Config_HeaderSet.in | 35 +- lib/kokkos/cmake/KokkosCore_config.h.in | 17 +- lib/kokkos/cmake/Kokkos_Version_Info.cpp.in | 30 + lib/kokkos/cmake/Kokkos_Version_Info.hpp | 34 + .../cmake/Modules/FindTPLLIBQUADMATH.cmake | 19 +- lib/kokkos/cmake/Modules/FindTPLROCM.cmake | 14 +- lib/kokkos/cmake/Modules/FindTPLTHREADS.cmake | 4 +- lib/kokkos/cmake/build_env_info.cmake | 121 + lib/kokkos/cmake/compile_tests/clang_omp.cpp | 16 + .../cmake/compile_tests/cplusplus14.cpp | 8 - .../cmake/compile_tests/cplusplus17.cpp | 25 + .../compile_tests/cuda_compute_capability.cc | 38 +- lib/kokkos/cmake/compile_tests/pthread.cpp | 14 - lib/kokkos/cmake/deps/CUDA.cmake | 35 +- lib/kokkos/cmake/deps/CUSPARSE.cmake | 35 +- lib/kokkos/cmake/deps/HWLOC.cmake | 35 +- lib/kokkos/cmake/deps/Pthread.cmake | 35 +- lib/kokkos/cmake/deps/quadmath.cmake | 35 +- lib/kokkos/cmake/fake_tribits.cmake | 2 +- lib/kokkos/cmake/kokkos_arch.cmake | 219 +- lib/kokkos/cmake/kokkos_compiler_id.cmake | 61 +- lib/kokkos/cmake/kokkos_corner_cases.cmake | 62 +- lib/kokkos/cmake/kokkos_enable_devices.cmake | 48 - lib/kokkos/cmake/kokkos_enable_options.cmake | 40 +- lib/kokkos/cmake/kokkos_functions.cmake | 8 +- lib/kokkos/cmake/kokkos_install.cmake | 2 +- lib/kokkos/cmake/kokkos_pick_cxx_std.cmake | 41 +- lib/kokkos/cmake/kokkos_test_cxx_std.cmake | 48 +- lib/kokkos/cmake/kokkos_tpls.cmake | 23 +- lib/kokkos/cmake/kokkos_tribits.cmake | 20 +- lib/kokkos/cmake/tpls/FindTPLCUSPARSE.cmake | 38 +- lib/kokkos/cmake/tpls/FindTPLHWLOC.cmake | 35 +- lib/kokkos/cmake/tpls/FindTPLPthread.cmake | 36 +- lib/kokkos/cmake/tpls/FindTPLquadmath.cmake | 35 +- lib/kokkos/containers/CMakeLists.txt | 3 + .../containers/performance_tests/TestCuda.cpp | 42 +- .../performance_tests/TestDynRankView.hpp | 37 +- .../performance_tests/TestGlobal2LocalIds.hpp | 36 +- .../containers/performance_tests/TestHIP.cpp | 46 +- .../containers/performance_tests/TestHPX.cpp | 38 +- .../containers/performance_tests/TestMain.cpp | 38 +- .../performance_tests/TestOpenMP.cpp | 38 +- .../performance_tests/TestScatterView.hpp | 38 +- .../performance_tests/TestThreads.cpp | 38 +- .../TestUnorderedMapPerformance.hpp | 36 +- lib/kokkos/containers/src/Kokkos_Bitset.hpp | 38 +- lib/kokkos/containers/src/Kokkos_DualView.hpp | 97 +- .../containers/src/Kokkos_DynRankView.hpp | 123 +- .../containers/src/Kokkos_DynamicView.hpp | 100 +- .../containers/src/Kokkos_ErrorReporter.hpp | 38 +- .../containers/src/Kokkos_Functional.hpp | 91 +- .../containers/src/Kokkos_OffsetView.hpp | 233 +- .../containers/src/Kokkos_ScatterView.hpp | 62 +- .../containers/src/Kokkos_StaticCrsGraph.hpp | 38 +- .../containers/src/Kokkos_UnorderedMap.hpp | 74 +- lib/kokkos/containers/src/Kokkos_Vector.hpp | 42 +- .../src/impl/Kokkos_Bitset_impl.hpp | 38 +- .../src/impl/Kokkos_Functional_impl.hpp | 40 +- .../impl/Kokkos_StaticCrsGraph_factory.hpp | 38 +- .../src/impl/Kokkos_UnorderedMap_impl.cpp | 38 +- .../src/impl/Kokkos_UnorderedMap_impl.hpp | 55 +- .../containers/unit_tests/TestBitset.hpp | 47 +- .../containers/unit_tests/TestCompileMain.cpp | 16 + .../unit_tests/TestCreateMirror.cpp | 69 +- .../containers/unit_tests/TestDualView.hpp | 42 +- .../containers/unit_tests/TestDynViewAPI.hpp | 38 +- .../unit_tests/TestDynViewAPI_generic.hpp | 38 +- .../unit_tests/TestDynViewAPI_rank12345.hpp | 38 +- .../unit_tests/TestDynViewAPI_rank67.hpp | 38 +- .../containers/unit_tests/TestDynamicView.hpp | 115 +- .../unit_tests/TestErrorReporter.hpp | 55 +- .../containers/unit_tests/TestOffsetView.hpp | 41 +- .../containers/unit_tests/TestScatterView.hpp | 84 +- .../unit_tests/TestStaticCrsGraph.hpp | 38 +- .../unit_tests/TestUnorderedMap.hpp | 48 +- .../containers/unit_tests/TestVector.hpp | 36 +- .../TestViewCtorPropEmbeddedDim.hpp | 38 +- .../unit_tests/TestWithoutInitializing.hpp | 90 +- .../containers/unit_tests/UnitTestMain.cpp | 38 +- lib/kokkos/core/CMakeLists.txt | 5 +- lib/kokkos/core/perf_test/BenchmarkMain.cpp | 33 + .../core/perf_test/Benchmark_Context.hpp | 89 + lib/kokkos/core/perf_test/CMakeLists.txt | 145 +- lib/kokkos/core/perf_test/Makefile | 5 - .../core/perf_test/PerfTestBlasKernels.hpp | 38 +- lib/kokkos/core/perf_test/PerfTestDriver.hpp | 38 +- .../core/perf_test/PerfTestGramSchmidt.cpp | 38 +- lib/kokkos/core/perf_test/PerfTestHexGrad.cpp | 38 +- lib/kokkos/core/perf_test/PerfTestMDRange.hpp | 38 +- lib/kokkos/core/perf_test/PerfTestMain.cpp | 38 +- .../core/perf_test/PerfTest_Category.hpp | 38 +- .../perf_test/PerfTest_CustomReduction.cpp | 42 +- .../PerfTest_ExecSpacePartitioning.cpp | 19 +- .../core/perf_test/PerfTest_ViewAllocate.cpp | 38 +- .../core/perf_test/PerfTest_ViewCopy.hpp | 331 +-- .../core/perf_test/PerfTest_ViewCopy_Raw.cpp | 43 + .../core/perf_test/PerfTest_ViewCopy_a123.cpp | 59 +- .../core/perf_test/PerfTest_ViewCopy_a45.cpp | 54 +- .../core/perf_test/PerfTest_ViewCopy_a6.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_a7.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_a8.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_b123.cpp | 59 +- .../core/perf_test/PerfTest_ViewCopy_b45.cpp | 54 +- .../core/perf_test/PerfTest_ViewCopy_b6.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_b7.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_b8.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_c123.cpp | 59 +- .../core/perf_test/PerfTest_ViewCopy_c45.cpp | 54 +- .../core/perf_test/PerfTest_ViewCopy_c6.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_c7.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_c8.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_d123.cpp | 59 +- .../core/perf_test/PerfTest_ViewCopy_d45.cpp | 54 +- .../core/perf_test/PerfTest_ViewCopy_d6.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_d7.cpp | 49 +- .../core/perf_test/PerfTest_ViewCopy_d8.cpp | 49 +- .../core/perf_test/PerfTest_ViewFill.hpp | 38 +- .../core/perf_test/PerfTest_ViewFill_123.cpp | 38 +- .../core/perf_test/PerfTest_ViewFill_45.cpp | 38 +- .../core/perf_test/PerfTest_ViewFill_6.cpp | 38 +- .../core/perf_test/PerfTest_ViewFill_7.cpp | 38 +- .../core/perf_test/PerfTest_ViewFill_8.cpp | 38 +- .../core/perf_test/PerfTest_ViewResize.hpp | 38 +- .../perf_test/PerfTest_ViewResize_123.cpp | 38 +- .../core/perf_test/PerfTest_ViewResize_45.cpp | 38 +- .../core/perf_test/PerfTest_ViewResize_6.cpp | 38 +- .../core/perf_test/PerfTest_ViewResize_7.cpp | 38 +- .../core/perf_test/PerfTest_ViewResize_8.cpp | 38 +- lib/kokkos/core/perf_test/test_atomic.cpp | 40 +- .../perf_test/test_atomic_minmax_simple.cpp | 16 + lib/kokkos/core/perf_test/test_mempool.cpp | 38 +- .../core/perf_test/test_sharedSpace.cpp | 311 +++ lib/kokkos/core/perf_test/test_taskdag.cpp | 38 +- lib/kokkos/core/src/CMakeLists.txt | 72 +- lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp | 74 +- .../core/src/Cuda/Kokkos_Cuda_Alloc.hpp | 153 -- .../Cuda/Kokkos_Cuda_Atomic_Intrinsics.hpp | 34 +- ...uda_Atomic_Intrinsics_Restore_Builtins.hpp | 39 +- .../Cuda/Kokkos_Cuda_BlockSize_Deduction.hpp | 61 +- .../core/src/Cuda/Kokkos_Cuda_Error.hpp | 53 +- .../src/Cuda/Kokkos_Cuda_GraphNodeKernel.hpp | 53 +- .../src/Cuda/Kokkos_Cuda_GraphNode_Impl.hpp | 40 +- .../core/src/Cuda/Kokkos_Cuda_Graph_Impl.hpp | 40 +- .../src/Cuda/Kokkos_Cuda_Half_Conversion.hpp | 40 +- .../src/Cuda/Kokkos_Cuda_Half_Impl_Type.hpp | 38 +- .../core/src/Cuda/Kokkos_Cuda_Instance.cpp | 426 ++-- .../core/src/Cuda/Kokkos_Cuda_Instance.hpp | 80 +- .../src/Cuda/Kokkos_Cuda_KernelLaunch.hpp | 90 +- .../core/src/Cuda/Kokkos_Cuda_Locks.cpp | 47 +- .../core/src/Cuda/Kokkos_Cuda_Locks.hpp | 98 +- .../src/Cuda/Kokkos_Cuda_MDRangePolicy.hpp | 21 + .../src/Cuda/Kokkos_Cuda_Parallel_MDRange.hpp | 42 +- .../src/Cuda/Kokkos_Cuda_Parallel_Range.hpp | 81 +- .../src/Cuda/Kokkos_Cuda_Parallel_Team.hpp | 182 +- .../core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp | 58 +- lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp | 38 +- lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp | 38 +- lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp | 39 +- .../core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp | 38 +- .../src/Cuda/Kokkos_Cuda_Vectorization.hpp | 38 +- lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp | 202 +- .../src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp | 50 +- .../core/src/Cuda/Kokkos_Cuda_abort.hpp | 44 +- lib/kokkos/core/src/HIP/Kokkos_HIP.cpp | 165 ++ lib/kokkos/core/src/HIP/Kokkos_HIP.hpp | 162 ++ lib/kokkos/core/src/HIP/Kokkos_HIP_Abort.hpp | 52 +- lib/kokkos/core/src/HIP/Kokkos_HIP_Atomic.hpp | 38 +- .../HIP/Kokkos_HIP_BlockSize_Deduction.hpp | 64 +- .../core/src/HIP/Kokkos_HIP_DeepCopy.cpp | 58 + .../core/src/HIP/Kokkos_HIP_DeepCopy.hpp | 134 ++ lib/kokkos/core/src/HIP/Kokkos_HIP_Error.hpp | 56 +- .../src/HIP/Kokkos_HIP_Half_Conversion.hpp | 40 +- .../src/HIP/Kokkos_HIP_Half_Impl_Type.hpp | 38 +- .../core/src/HIP/Kokkos_HIP_Instance.cpp | 476 ++-- .../core/src/HIP/Kokkos_HIP_Instance.hpp | 143 +- .../core/src/HIP/Kokkos_HIP_KernelLaunch.hpp | 113 +- lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.cpp | 43 +- lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.hpp | 38 +- .../core/src/HIP/Kokkos_HIP_MDRangePolicy.hpp | 31 +- .../src/HIP/Kokkos_HIP_Parallel_MDRange.hpp | 144 +- .../src/HIP/Kokkos_HIP_Parallel_Range.hpp | 229 +- .../core/src/HIP/Kokkos_HIP_Parallel_Team.hpp | 408 ++-- .../core/src/HIP/Kokkos_HIP_ReduceScan.hpp | 191 +- .../HIP/Kokkos_HIP_SharedAllocationRecord.cpp | 155 ++ .../HIP/Kokkos_HIP_SharedAllocationRecord.hpp | 137 ++ .../src/HIP/Kokkos_HIP_Shuffle_Reduce.hpp | 63 +- lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp | 417 +--- lib/kokkos/core/src/HIP/Kokkos_HIP_Space.hpp | 345 +++ lib/kokkos/core/src/HIP/Kokkos_HIP_Team.hpp | 62 +- .../core/src/HIP/Kokkos_HIP_UniqueToken.hpp | 50 +- .../core/src/HIP/Kokkos_HIP_Vectorization.hpp | 40 +- .../src/HIP/Kokkos_HIP_WorkGraphPolicy.hpp | 58 +- lib/kokkos/core/src/HPX/Kokkos_HPX.cpp | 46 +- .../core/src/HPX/Kokkos_HPX_MDRangePolicy.hpp | 33 + lib/kokkos/core/src/HPX/Kokkos_HPX_Task.cpp | 38 +- lib/kokkos/core/src/HPX/Kokkos_HPX_Task.hpp | 38 +- .../src/HPX/Kokkos_HPX_WorkGraphPolicy.hpp | 38 +- lib/kokkos/core/src/KokkosExp_InterOp.hpp | 38 +- .../core/src/KokkosExp_MDRangePolicy.hpp | 57 +- .../src/Kokkos_AcquireUniqueTokenImpl.hpp | 42 +- lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp | 42 +- lib/kokkos/core/src/Kokkos_Array.hpp | 49 +- lib/kokkos/core/src/Kokkos_Atomic.hpp | 52 +- .../core/src/Kokkos_Atomics_Desul_Config.hpp | 46 +- .../Kokkos_Atomics_Desul_Volatile_Wrapper.hpp | 39 +- .../core/src/Kokkos_Atomics_Desul_Wrapper.hpp | 39 +- lib/kokkos/core/src/Kokkos_Complex.hpp | 97 +- lib/kokkos/core/src/Kokkos_Concepts.hpp | 123 +- lib/kokkos/core/src/Kokkos_CopyViews.hpp | 281 +-- lib/kokkos/core/src/Kokkos_Core.hpp | 180 +- lib/kokkos/core/src/Kokkos_Core_fwd.hpp | 133 +- lib/kokkos/core/src/Kokkos_Crs.hpp | 82 +- lib/kokkos/core/src/Kokkos_Cuda.hpp | 53 +- lib/kokkos/core/src/Kokkos_CudaSpace.hpp | 57 +- lib/kokkos/core/src/Kokkos_DetectionIdiom.hpp | 46 +- lib/kokkos/core/src/Kokkos_ExecPolicy.hpp | 253 ++- lib/kokkos/core/src/Kokkos_Extents.hpp | 43 +- lib/kokkos/core/src/Kokkos_Future.hpp | 47 +- lib/kokkos/core/src/Kokkos_Graph.hpp | 45 +- lib/kokkos/core/src/Kokkos_GraphNode.hpp | 45 +- lib/kokkos/core/src/Kokkos_Graph_fwd.hpp | 38 +- lib/kokkos/core/src/Kokkos_HBWSpace.hpp | 49 +- lib/kokkos/core/src/Kokkos_HIP_Space.hpp | 806 ------- lib/kokkos/core/src/Kokkos_HPX.hpp | 140 +- lib/kokkos/core/src/Kokkos_Half.hpp | 38 +- lib/kokkos/core/src/Kokkos_HostSpace.hpp | 49 +- lib/kokkos/core/src/Kokkos_Layout.hpp | 42 +- lib/kokkos/core/src/Kokkos_LogicalSpaces.hpp | 42 +- lib/kokkos/core/src/Kokkos_Macros.hpp | 205 +- lib/kokkos/core/src/Kokkos_MasterLock.hpp | 42 +- .../core/src/Kokkos_MathematicalConstants.hpp | 79 +- .../core/src/Kokkos_MathematicalFunctions.hpp | 382 ++-- .../Kokkos_MathematicalSpecialFunctions.hpp | 145 +- lib/kokkos/core/src/Kokkos_MemoryPool.hpp | 42 +- lib/kokkos/core/src/Kokkos_MemoryTraits.hpp | 42 +- lib/kokkos/core/src/Kokkos_MinMaxClamp.hpp | 42 +- lib/kokkos/core/src/Kokkos_NumericTraits.hpp | 444 +--- lib/kokkos/core/src/Kokkos_OpenMP.hpp | 82 +- lib/kokkos/core/src/Kokkos_OpenMPTarget.hpp | 53 +- .../core/src/Kokkos_OpenMPTargetSpace.hpp | 78 +- lib/kokkos/core/src/Kokkos_Pair.hpp | 45 +- lib/kokkos/core/src/Kokkos_Parallel.hpp | 133 +- .../core/src/Kokkos_Parallel_Reduce.hpp | 181 +- .../core/src/Kokkos_PointerOwnership.hpp | 42 +- .../src/Kokkos_Profiling_ProfileSection.hpp | 71 +- lib/kokkos/core/src/Kokkos_Rank.hpp | 44 +- .../core/src/Kokkos_ReductionIdentity.hpp | 398 ++++ lib/kokkos/core/src/Kokkos_SYCL.hpp | 65 +- lib/kokkos/core/src/Kokkos_SYCL_Space.hpp | 42 +- lib/kokkos/core/src/Kokkos_ScratchSpace.hpp | 107 +- lib/kokkos/core/src/Kokkos_Serial.hpp | 61 +- lib/kokkos/core/src/Kokkos_TaskScheduler.hpp | 42 +- .../core/src/Kokkos_TaskScheduler_fwd.hpp | 42 +- lib/kokkos/core/src/Kokkos_Threads.hpp | 49 +- lib/kokkos/core/src/Kokkos_Timer.hpp | 38 +- lib/kokkos/core/src/Kokkos_Tuners.hpp | 42 +- lib/kokkos/core/src/Kokkos_UniqueToken.hpp | 48 +- lib/kokkos/core/src/Kokkos_Vectorization.hpp | 42 +- lib/kokkos/core/src/Kokkos_View.hpp | 177 +- .../core/src/Kokkos_WorkGraphPolicy.hpp | 42 +- lib/kokkos/core/src/Kokkos_hwloc.hpp | 42 +- .../core/src/OpenACC/Kokkos_OpenACC.cpp | 103 +- .../core/src/OpenACC/Kokkos_OpenACC.hpp | 79 +- .../core/src/OpenACC/Kokkos_OpenACCSpace.cpp | 133 +- .../core/src/OpenACC/Kokkos_OpenACCSpace.hpp | 149 +- .../src/OpenACC/Kokkos_OpenACC_DeepCopy.hpp | 135 ++ .../OpenACC/Kokkos_OpenACC_FunctorAdapter.hpp | 44 + .../src/OpenACC/Kokkos_OpenACC_Instance.cpp | 95 +- .../src/OpenACC/Kokkos_OpenACC_Instance.hpp | 52 +- .../OpenACC/Kokkos_OpenACC_MDRangePolicy.hpp | 45 + .../src/OpenACC/Kokkos_OpenACC_Macros.hpp | 23 + .../Kokkos_OpenACC_ParallelFor_MDRange.hpp | 695 ++++++ .../Kokkos_OpenACC_ParallelFor_Range.hpp | 105 + .../Kokkos_OpenACC_ParallelFor_Team.hpp | 206 ++ .../Kokkos_OpenACC_ParallelReduce_Range.hpp | 209 ++ .../OpenACC/Kokkos_OpenACC_ScheduleType.hpp | 41 + .../Kokkos_OpenACC_SharedAllocationRecord.cpp | 107 + .../Kokkos_OpenACC_SharedAllocationRecord.hpp | 74 + .../core/src/OpenACC/Kokkos_OpenACC_Team.hpp | 578 +++++ .../src/OpenACC/Kokkos_OpenACC_Traits.hpp | 38 +- .../src/OpenMP/Kokkos_OpenMP_Instance.cpp | 155 +- .../src/OpenMP/Kokkos_OpenMP_Instance.hpp | 167 +- .../OpenMP/Kokkos_OpenMP_MDRangePolicy.hpp | 32 + .../src/OpenMP/Kokkos_OpenMP_Parallel.hpp | 335 ++- .../core/src/OpenMP/Kokkos_OpenMP_Task.cpp | 38 +- .../core/src/OpenMP/Kokkos_OpenMP_Task.hpp | 50 +- .../core/src/OpenMP/Kokkos_OpenMP_Team.hpp | 98 +- .../OpenMP/Kokkos_OpenMP_WorkGraphPolicy.hpp | 44 +- .../OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp | 38 +- .../Kokkos_OpenMPTarget_Abort.hpp | 38 +- .../Kokkos_OpenMPTarget_Error.hpp | 40 +- .../OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp | 44 +- .../OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp | 59 +- .../Kokkos_OpenMPTarget_Instance.cpp | 52 +- .../Kokkos_OpenMPTarget_Instance.hpp | 38 +- .../Kokkos_OpenMPTarget_MDRangePolicy.hpp | 33 + .../Kokkos_OpenMPTarget_Parallel.hpp | 95 +- .../Kokkos_OpenMPTarget_Parallel_MDRange.hpp | 45 +- .../OpenMPTarget/Kokkos_OpenMPTarget_Task.cpp | 38 +- .../OpenMPTarget/Kokkos_OpenMPTarget_Task.hpp | 38 +- .../Kokkos_OpenMPTarget_UniqueToken.hpp | 38 +- lib/kokkos/core/src/SYCL/Kokkos_SYCL.cpp | 52 +- .../core/src/SYCL/Kokkos_SYCL_Abort.hpp | 43 +- .../core/src/SYCL/Kokkos_SYCL_DeepCopy.hpp | 38 +- .../src/SYCL/Kokkos_SYCL_Half_Conversion.hpp | 38 +- .../src/SYCL/Kokkos_SYCL_Half_Impl_Type.hpp | 41 +- .../core/src/SYCL/Kokkos_SYCL_Instance.cpp | 54 +- .../core/src/SYCL/Kokkos_SYCL_Instance.hpp | 45 +- .../src/SYCL/Kokkos_SYCL_MDRangePolicy.hpp | 24 +- .../src/SYCL/Kokkos_SYCL_Parallel_Range.hpp | 94 +- .../src/SYCL/Kokkos_SYCL_Parallel_Reduce.hpp | 148 +- .../src/SYCL/Kokkos_SYCL_Parallel_Scan.hpp | 74 +- .../src/SYCL/Kokkos_SYCL_Parallel_Team.hpp | 43 +- .../core/src/SYCL/Kokkos_SYCL_Space.cpp | 38 +- lib/kokkos/core/src/SYCL/Kokkos_SYCL_Team.hpp | 39 +- .../core/src/SYCL/Kokkos_SYCL_UniqueToken.hpp | 38 +- lib/kokkos/core/src/Serial/Kokkos_Serial.cpp | 54 +- .../Serial/Kokkos_Serial_MDRangePolicy.hpp | 32 + .../Serial/Kokkos_Serial_Parallel_MDRange.hpp | 80 +- .../Serial/Kokkos_Serial_Parallel_Range.hpp | 58 +- .../Serial/Kokkos_Serial_Parallel_Team.hpp | 38 +- .../core/src/Serial/Kokkos_Serial_Task.cpp | 38 +- .../core/src/Serial/Kokkos_Serial_Task.hpp | 38 +- .../src/Serial/Kokkos_Serial_UniqueToken.hpp | 38 +- .../Serial/Kokkos_Serial_WorkGraphPolicy.hpp | 38 +- .../core/src/Threads/Kokkos_ThreadsExec.cpp | 62 +- .../core/src/Threads/Kokkos_ThreadsExec.hpp | 40 +- .../core/src/Threads/Kokkos_ThreadsTeam.hpp | 41 +- .../Threads/Kokkos_Threads_MDRangePolicy.hpp | 32 + .../Kokkos_Threads_Parallel_MDRange.hpp | 143 +- .../Threads/Kokkos_Threads_Parallel_Range.hpp | 54 +- .../Threads/Kokkos_Threads_Parallel_Team.hpp | 38 +- .../Threads/Kokkos_Threads_UniqueToken.hpp | 38 +- .../Kokkos_Threads_WorkGraphPolicy.hpp | 38 +- .../core/src/View/Hooks/Kokkos_ViewHooks.hpp | 38 +- .../src/View/MDSpan/Kokkos_MDSpan_Extents.hpp | 111 + .../src/View/MDSpan/Kokkos_MDSpan_Header.hpp | 34 + .../core/src/decl/Kokkos_Declare_CUDA.hpp | 38 +- .../core/src/decl/Kokkos_Declare_HBWSpace.hpp | 38 +- .../core/src/decl/Kokkos_Declare_HIP.hpp | 60 +- .../core/src/decl/Kokkos_Declare_HPX.hpp | 39 +- .../core/src/decl/Kokkos_Declare_OPENACC.hpp | 46 +- .../core/src/decl/Kokkos_Declare_OPENMP.hpp | 39 +- .../src/decl/Kokkos_Declare_OPENMPTARGET.hpp | 39 +- .../core/src/decl/Kokkos_Declare_SERIAL.hpp | 39 +- .../core/src/decl/Kokkos_Declare_SYCL.hpp | 38 +- .../core/src/decl/Kokkos_Declare_THREADS.hpp | 39 +- lib/kokkos/core/src/dummy.cpp | 16 +- lib/kokkos/core/src/fwd/Kokkos_Fwd_CUDA.hpp | 38 +- .../core/src/fwd/Kokkos_Fwd_HBWSpace.hpp | 38 +- lib/kokkos/core/src/fwd/Kokkos_Fwd_HIP.hpp | 40 +- lib/kokkos/core/src/fwd/Kokkos_Fwd_HPX.hpp | 38 +- .../core/src/fwd/Kokkos_Fwd_OPENACC.hpp | 38 +- lib/kokkos/core/src/fwd/Kokkos_Fwd_OPENMP.hpp | 38 +- .../core/src/fwd/Kokkos_Fwd_OPENMPTARGET.hpp | 38 +- lib/kokkos/core/src/fwd/Kokkos_Fwd_SERIAL.hpp | 38 +- lib/kokkos/core/src/fwd/Kokkos_Fwd_SYCL.hpp | 38 +- .../core/src/fwd/Kokkos_Fwd_THREADS.hpp | 38 +- .../src/impl/KokkosExp_Host_IterateTile.hpp | 82 +- .../src/impl/KokkosExp_IterateTileGPU.hpp | 38 +- .../core/src/impl/KokkosExp_ViewMapping.hpp | 38 +- .../core/src/impl/Kokkos_AnalyzePolicy.hpp | 52 +- .../core/src/impl/Kokkos_Atomic_Assembly.hpp | 38 +- .../Kokkos_Atomic_Compare_Exchange_Strong.hpp | 44 +- .../Kokkos_Atomic_Compare_Exchange_Weak.hpp | 38 +- .../core/src/impl/Kokkos_Atomic_Decrement.hpp | 38 +- .../core/src/impl/Kokkos_Atomic_Exchange.hpp | 46 +- .../core/src/impl/Kokkos_Atomic_Fetch_Add.hpp | 43 +- .../core/src/impl/Kokkos_Atomic_Fetch_And.hpp | 40 +- .../core/src/impl/Kokkos_Atomic_Fetch_Or.hpp | 40 +- .../core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp | 40 +- .../core/src/impl/Kokkos_Atomic_Generic.hpp | 38 +- .../impl/Kokkos_Atomic_Generic_Secondary.hpp | 38 +- .../core/src/impl/Kokkos_Atomic_Increment.hpp | 38 +- .../core/src/impl/Kokkos_Atomic_Load.hpp | 39 +- .../src/impl/Kokkos_Atomic_Memory_Order.hpp | 39 +- .../core/src/impl/Kokkos_Atomic_MinMax.hpp | 38 +- .../core/src/impl/Kokkos_Atomic_Store.hpp | 39 +- .../core/src/impl/Kokkos_Atomic_View.hpp | 176 +- .../core/src/impl/Kokkos_Atomic_Windows.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_BitOps.hpp | 38 +- .../core/src/impl/Kokkos_CPUDiscovery.cpp | 134 +- .../core/src/impl/Kokkos_CPUDiscovery.hpp | 39 +- lib/kokkos/core/src/impl/Kokkos_ChaseLev.hpp | 40 +- lib/kokkos/core/src/impl/Kokkos_ClockTic.hpp | 38 +- .../core/src/impl/Kokkos_Combined_Reducer.hpp | 73 +- .../src/impl/Kokkos_Command_Line_Parsing.cpp | 38 +- .../src/impl/Kokkos_Command_Line_Parsing.hpp | 38 +- .../core/src/impl/Kokkos_ConcurrentBitset.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_Core.cpp | 280 ++- .../impl/Kokkos_Default_GraphNodeKernel.hpp | 38 +- .../impl/Kokkos_Default_GraphNode_Impl.hpp | 38 +- .../src/impl/Kokkos_Default_Graph_Impl.hpp | 38 +- .../src/impl/Kokkos_Default_Graph_fwd.hpp | 38 +- .../core/src/impl/Kokkos_DeviceManagement.hpp | 40 +- lib/kokkos/core/src/impl/Kokkos_EBO.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_Error.cpp | 38 +- lib/kokkos/core/src/impl/Kokkos_Error.hpp | 85 +- .../core/src/impl/Kokkos_ExecPolicy.cpp | 38 +- .../core/src/impl/Kokkos_ExecSpaceManager.hpp | 134 +- .../src/impl/Kokkos_FixedBufferMemoryPool.hpp | 39 +- .../core/src/impl/Kokkos_FunctorAnalysis.hpp | 48 +- lib/kokkos/core/src/impl/Kokkos_GraphImpl.hpp | 38 +- .../src/impl/Kokkos_GraphImpl_Utilities.hpp | 45 +- .../core/src/impl/Kokkos_GraphImpl_fwd.hpp | 38 +- .../impl/Kokkos_GraphNodeCustomization.hpp | 38 +- .../core/src/impl/Kokkos_GraphNodeImpl.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp | 46 +- .../core/src/impl/Kokkos_HostBarrier.cpp | 38 +- .../core/src/impl/Kokkos_HostBarrier.hpp | 38 +- .../core/src/impl/Kokkos_HostSharedPtr.hpp | 40 +- lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp | 45 +- .../src/impl/Kokkos_HostSpace_deepcopy.cpp | 38 +- .../src/impl/Kokkos_HostSpace_deepcopy.hpp | 38 +- .../core/src/impl/Kokkos_HostThreadTeam.cpp | 38 +- .../core/src/impl/Kokkos_HostThreadTeam.hpp | 57 +- .../impl/Kokkos_InitializationSettings.hpp | 107 +- lib/kokkos/core/src/impl/Kokkos_LIFO.hpp | 38 +- .../core/src/impl/Kokkos_LinkedListNode.hpp | 38 +- .../core/src/impl/Kokkos_MemoryPool.cpp | 39 +- .../src/impl/Kokkos_MemoryPoolAllocator.hpp | 38 +- .../core/src/impl/Kokkos_MemorySpace.cpp | 39 +- .../core/src/impl/Kokkos_MemorySpace.hpp | 39 +- .../core/src/impl/Kokkos_Memory_Fence.hpp | 38 +- .../src/impl/Kokkos_MultipleTaskQueue.hpp | 38 +- .../core/src/impl/Kokkos_NumericTraits.cpp | 82 - .../core/src/impl/Kokkos_OptionalRef.hpp | 38 +- ...ndLineArgumentsAndEnvironmentVariables.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_Profiling.cpp | 44 +- lib/kokkos/core/src/impl/Kokkos_Profiling.hpp | 38 +- .../src/impl/Kokkos_Profiling_C_Interface.h | 34 +- .../src/impl/Kokkos_Profiling_DeviceInfo.hpp | 56 +- .../src/impl/Kokkos_Profiling_Interface.hpp | 56 +- .../src/impl/Kokkos_QuadPrecisionMath.hpp | 64 +- .../core/src/impl/Kokkos_SharedAlloc.cpp | 76 +- .../core/src/impl/Kokkos_SharedAlloc.hpp | 44 +- .../src/impl/Kokkos_SharedAlloc_timpl.hpp | 38 +- .../src/impl/Kokkos_SimpleTaskScheduler.hpp | 38 +- .../core/src/impl/Kokkos_SingleTaskQueue.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_Spinwait.cpp | 38 +- lib/kokkos/core/src/impl/Kokkos_Spinwait.hpp | 38 +- .../core/src/impl/Kokkos_Stacktrace.cpp | 15 + .../core/src/impl/Kokkos_Stacktrace.hpp | 16 + .../src/impl/Kokkos_StringManipulation.hpp | 44 +- lib/kokkos/core/src/impl/Kokkos_TaskBase.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_TaskNode.hpp | 38 +- .../core/src/impl/Kokkos_TaskPolicyData.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_TaskQueue.hpp | 38 +- .../core/src/impl/Kokkos_TaskQueueCommon.hpp | 38 +- .../impl/Kokkos_TaskQueueMemoryManager.hpp | 38 +- .../src/impl/Kokkos_TaskQueueMultiple.hpp | 38 +- .../impl/Kokkos_TaskQueueMultiple_impl.hpp | 44 +- .../core/src/impl/Kokkos_TaskQueue_impl.hpp | 38 +- .../core/src/impl/Kokkos_TaskResult.hpp | 38 +- .../core/src/impl/Kokkos_TaskTeamMember.hpp | 38 +- .../core/src/impl/Kokkos_TeamMDPolicy.hpp | 278 +++ lib/kokkos/core/src/impl/Kokkos_Tools.hpp | 38 +- .../core/src/impl/Kokkos_Tools_Generic.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_Traits.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_Utilities.hpp | 113 +- .../core/src/impl/Kokkos_VLAEmulation.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_ViewArray.hpp | 91 +- lib/kokkos/core/src/impl/Kokkos_ViewCtor.hpp | 212 +- .../core/src/impl/Kokkos_ViewLayoutTiled.hpp | 44 +- .../core/src/impl/Kokkos_ViewMapping.hpp | 168 +- .../core/src/impl/Kokkos_ViewTracker.hpp | 38 +- .../core/src/impl/Kokkos_ViewUniformType.hpp | 38 +- .../core/src/impl/Kokkos_Volatile_Load.hpp | 38 +- lib/kokkos/core/src/impl/Kokkos_hwloc.cpp | 38 +- .../core/src/setup/Kokkos_Setup_Cuda.hpp | 58 +- .../core/src/setup/Kokkos_Setup_HIP.hpp | 43 +- .../core/src/setup/Kokkos_Setup_SYCL.hpp | 43 +- .../src/traits/Kokkos_ExecutionSpaceTrait.hpp | 38 +- .../src/traits/Kokkos_GraphKernelTrait.hpp | 38 +- .../core/src/traits/Kokkos_IndexTypeTrait.hpp | 38 +- .../traits/Kokkos_IterationPatternTrait.hpp | 38 +- .../src/traits/Kokkos_LaunchBoundsTrait.hpp | 38 +- .../traits/Kokkos_OccupancyControlTrait.hpp | 43 +- .../src/traits/Kokkos_PolicyTraitAdaptor.hpp | 38 +- .../src/traits/Kokkos_PolicyTraitMatcher.hpp | 38 +- .../core/src/traits/Kokkos_ScheduleTrait.hpp | 38 +- .../core/src/traits/Kokkos_Traits_fwd.hpp | 38 +- .../traits/Kokkos_WorkItemPropertyTrait.hpp | 38 +- .../core/src/traits/Kokkos_WorkTagTrait.hpp | 49 +- lib/kokkos/core/unit_test/CMakeLists.txt | 292 ++- .../core/unit_test/IncrementalTest.cpp.in | 36 +- lib/kokkos/core/unit_test/Makefile | 17 - lib/kokkos/core/unit_test/TestAbort.hpp | 45 +- lib/kokkos/core/unit_test/TestAggregate.hpp | 38 +- lib/kokkos/core/unit_test/TestArray.cpp | 56 +- .../core/unit_test/TestAtomicOperations.hpp | 38 +- .../TestAtomicOperations_complexdouble.hpp | 38 +- .../TestAtomicOperations_complexfloat.hpp | 38 +- .../unit_test/TestAtomicOperations_double.hpp | 38 +- .../unit_test/TestAtomicOperations_float.hpp | 38 +- .../unit_test/TestAtomicOperations_int.hpp | 38 +- .../TestAtomicOperations_longint.hpp | 38 +- .../TestAtomicOperations_longlongint.hpp | 38 +- .../unit_test/TestAtomicOperations_shared.hpp | 38 +- .../TestAtomicOperations_unsignedint.hpp | 38 +- .../TestAtomicOperations_unsignedlongint.hpp | 38 +- lib/kokkos/core/unit_test/TestAtomicViews.hpp | 38 +- lib/kokkos/core/unit_test/TestAtomics.hpp | 38 +- .../core/unit_test/TestBlockSizeDeduction.hpp | 40 +- lib/kokkos/core/unit_test/TestCTestDevice.cpp | 50 +- lib/kokkos/core/unit_test/TestCXX11.hpp | 38 +- .../core/unit_test/TestCXX11Deduction.hpp | 38 +- .../TestCommonPolicyConstructors.hpp | 113 + .../unit_test/TestCommonPolicyInterface.hpp | 111 + lib/kokkos/core/unit_test/TestCompileMain.cpp | 16 + .../core/unit_test/TestCompilerMacros.hpp | 43 +- lib/kokkos/core/unit_test/TestComplex.hpp | 90 +- lib/kokkos/core/unit_test/TestConcepts.hpp | 193 +- .../core/unit_test/TestConcurrentBitset.hpp | 38 +- .../core/unit_test/TestCreateMirror.cpp | 57 +- lib/kokkos/core/unit_test/TestCrs.hpp | 38 +- .../core/unit_test/TestDeepCopyAlignment.hpp | 16 + .../unit_test/TestDefaultDeviceTypeInit.hpp | 62 +- .../core/unit_test/TestDetectionIdiom.cpp | 54 +- .../core/unit_test/TestDeviceAndThreads.py | 92 + .../unit_test/TestExecSpacePartitioning.hpp | 100 +- .../core/unit_test/TestExecutionSpace.hpp | 41 +- .../core/unit_test/TestFunctorAnalysis.hpp | 38 +- lib/kokkos/core/unit_test/TestGraph.hpp | 38 +- lib/kokkos/core/unit_test/TestHWLOC.cpp | 39 +- .../core/unit_test/TestHalfConversion.hpp | 39 +- .../core/unit_test/TestHalfOperators.hpp | 45 +- .../core/unit_test/TestHostSharedPtr.hpp | 38 +- .../TestHostSharedPtrAccessOnDevice.hpp | 56 +- lib/kokkos/core/unit_test/TestInit.hpp | 39 +- .../unit_test/TestInitializationSettings.cpp | 48 +- lib/kokkos/core/unit_test/TestInterOp.cpp | 38 +- .../core/unit_test/TestIrregularLayout.hpp | 38 +- .../TestJoinBackwardCompatibility.hpp | 69 +- .../unit_test/TestLegionInitialization.cpp | 65 + .../unit_test/TestLegionInteroperability.cpp | 159 -- .../core/unit_test/TestLocalDeepCopy.hpp | 38 +- lib/kokkos/core/unit_test/TestMDRange.hpp | 44 +- .../TestMDRangePolicyConstructors.hpp | 100 + lib/kokkos/core/unit_test/TestMDRange_a.hpp | 38 +- lib/kokkos/core/unit_test/TestMDRange_b.hpp | 38 +- lib/kokkos/core/unit_test/TestMDRange_c.hpp | 38 +- lib/kokkos/core/unit_test/TestMDRange_d.hpp | 38 +- lib/kokkos/core/unit_test/TestMDRange_e.hpp | 38 +- lib/kokkos/core/unit_test/TestMDRange_f.hpp | 38 +- lib/kokkos/core/unit_test/TestMDRange_g.hpp | 38 +- lib/kokkos/core/unit_test/TestMDSpan.hpp | 65 + .../unit_test/TestMathematicalConstants.hpp | 76 +- .../unit_test/TestMathematicalFunctions.hpp | 230 +- .../unit_test/TestMathematicalFunctions1.hpp | 38 +- .../unit_test/TestMathematicalFunctions2.hpp | 38 +- .../TestMathematicalSpecialFunctions.hpp | 72 +- lib/kokkos/core/unit_test/TestMemoryPool.hpp | 38 +- lib/kokkos/core/unit_test/TestMinMaxClamp.hpp | 75 +- .../unit_test/TestNonTrivialScalarTypes.hpp | 39 +- .../core/unit_test/TestNumericTraits.hpp | 73 +- lib/kokkos/core/unit_test/TestOther.hpp | 38 +- .../TestParseCmdLineArgsAndEnvVars.cpp | 38 +- .../core/unit_test/TestPolicyConstruction.hpp | 922 -------- .../core/unit_test/TestQuadPrecisionMath.hpp | 64 +- lib/kokkos/core/unit_test/TestRange.hpp | 57 +- lib/kokkos/core/unit_test/TestRangePolicy.hpp | 38 +- .../unit_test/TestRangePolicyConstructors.hpp | 73 + .../core/unit_test/TestRangePolicyRequire.hpp | 57 +- lib/kokkos/core/unit_test/TestRealloc.hpp | 38 +- lib/kokkos/core/unit_test/TestReduce.hpp | 54 +- .../unit_test/TestReduceCombinatorical.hpp | 54 +- .../core/unit_test/TestReducerCTADs.hpp | 421 ++++ lib/kokkos/core/unit_test/TestReducers.hpp | 38 +- lib/kokkos/core/unit_test/TestReducers_a.hpp | 38 +- lib/kokkos/core/unit_test/TestReducers_b.hpp | 38 +- lib/kokkos/core/unit_test/TestReducers_c.hpp | 38 +- lib/kokkos/core/unit_test/TestReducers_d.hpp | 46 +- lib/kokkos/core/unit_test/TestReducers_e.hpp | 38 +- lib/kokkos/core/unit_test/TestReductions.hpp | 38 +- .../unit_test/TestReductions_DeviceView.hpp | 16 + lib/kokkos/core/unit_test/TestResize.hpp | 38 +- lib/kokkos/core/unit_test/TestScan.hpp | 88 +- lib/kokkos/core/unit_test/TestSharedAlloc.hpp | 48 +- .../unit_test/TestSharedHostPinnedSpace.cpp | 105 + lib/kokkos/core/unit_test/TestSharedSpace.cpp | 218 ++ lib/kokkos/core/unit_test/TestStackTrace.cpp | 38 +- lib/kokkos/core/unit_test/TestStackTrace.hpp | 38 +- .../core/unit_test/TestStackTrace_f0.cpp | 38 +- .../core/unit_test/TestStackTrace_f1.cpp | 38 +- .../core/unit_test/TestStackTrace_f2.cpp | 38 +- .../core/unit_test/TestStackTrace_f3.cpp | 38 +- .../core/unit_test/TestStackTrace_f4.cpp | 38 +- .../core/unit_test/TestStringManipulation.cpp | 140 +- lib/kokkos/core/unit_test/TestSubView_a.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_b.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c01.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c02.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c03.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c04.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c05.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c06.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c07.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c08.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c09.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c10.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c11.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c12.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c13.hpp | 38 +- lib/kokkos/core/unit_test/TestSubView_c14.hpp | 38 +- .../core/unit_test/TestTaskScheduler.hpp | 38 +- .../unit_test/TestTaskScheduler_single.hpp | 38 +- lib/kokkos/core/unit_test/TestTeam.hpp | 163 +- lib/kokkos/core/unit_test/TestTeamBasic.hpp | 120 +- lib/kokkos/core/unit_test/TestTeamMDRange.hpp | 1969 +++++++++++++++++ .../unit_test/TestTeamPolicyConstructors.hpp | 141 ++ .../core/unit_test/TestTeamReductionScan.hpp | 38 +- lib/kokkos/core/unit_test/TestTeamScan.hpp | 38 +- lib/kokkos/core/unit_test/TestTeamScratch.hpp | 38 +- .../core/unit_test/TestTeamTeamSize.hpp | 38 +- lib/kokkos/core/unit_test/TestTeamVector.hpp | 59 +- .../core/unit_test/TestTeamVectorRange.hpp | 48 +- lib/kokkos/core/unit_test/TestTypeList.cpp | 38 +- lib/kokkos/core/unit_test/TestUniqueToken.hpp | 40 +- lib/kokkos/core/unit_test/TestUtilities.hpp | 56 +- lib/kokkos/core/unit_test/TestViewAPI.hpp | 38 +- lib/kokkos/core/unit_test/TestViewAPI_a.hpp | 38 +- lib/kokkos/core/unit_test/TestViewAPI_b.hpp | 38 +- lib/kokkos/core/unit_test/TestViewAPI_c.hpp | 38 +- lib/kokkos/core/unit_test/TestViewAPI_d.hpp | 41 +- lib/kokkos/core/unit_test/TestViewAPI_e.hpp | 45 +- lib/kokkos/core/unit_test/TestViewCopy_a.hpp | 39 +- lib/kokkos/core/unit_test/TestViewCopy_b.hpp | 38 +- .../core/unit_test/TestViewCtorDimMatch.hpp | 40 +- .../unit_test/TestViewCtorPropEmbeddedDim.hpp | 38 +- lib/kokkos/core/unit_test/TestViewHooks.hpp | 38 +- .../core/unit_test/TestViewIsAssignable.hpp | 31 +- .../TestViewLayoutStrideAssignment.hpp | 38 +- .../core/unit_test/TestViewLayoutTiled.hpp | 38 +- .../core/unit_test/TestViewMapping_a.hpp | 38 +- .../core/unit_test/TestViewMapping_b.hpp | 38 +- .../unit_test/TestViewMapping_subview.hpp | 38 +- .../TestViewMemoryAccessViolation.hpp | 43 +- lib/kokkos/core/unit_test/TestViewOfClass.hpp | 38 +- lib/kokkos/core/unit_test/TestViewResize.hpp | 38 +- .../core/unit_test/TestViewSpaceAssign.hpp | 38 +- lib/kokkos/core/unit_test/TestViewSubview.hpp | 65 +- .../core/unit_test/TestViewTypeTraits.cpp | 50 + lib/kokkos/core/unit_test/TestView_64bit.hpp | 38 +- .../core/unit_test/TestWindowsInclude.cpp | 21 + .../unit_test/TestWithoutInitializing.hpp | 54 +- lib/kokkos/core/unit_test/TestWorkGraph.hpp | 43 +- .../core/unit_test/Test_InterOp_Streams.hpp | 38 +- lib/kokkos/core/unit_test/UnitTestMain.cpp | 38 +- .../core/unit_test/UnitTestMainInit.cpp | 38 +- .../UnitTest_CMakePassCmdLineArgs.cpp | 16 + .../unit_test/UnitTest_DeviceAndThreads.cpp | 110 + .../unit_test/UnitTest_PushFinalizeHook.cpp | 38 +- .../UnitTest_PushFinalizeHook_terminate.cpp | 38 +- .../TestCudaHostPinned_Category.hpp | 38 +- .../category_files/TestCudaUVM_Category.hpp | 38 +- .../category_files/TestCuda_Category.hpp | 38 +- .../TestDefaultDeviceType_Category.hpp | 38 +- .../TestHIPHostPinned_Category.hpp | 40 +- .../TestHIPManaged_Category.hpp | 40 +- .../category_files/TestHIP_Category.hpp | 40 +- .../category_files/TestHPX_Category.hpp | 38 +- .../category_files/TestOpenACC_Category.hpp | 27 + .../TestOpenMPTarget_Category.hpp | 38 +- .../category_files/TestOpenMP_Category.hpp | 38 +- .../TestSYCLHostUSM_Category.hpp | 38 +- .../TestSYCLSharedUSM_Category.hpp | 38 +- .../category_files/TestSYCL_Category.hpp | 38 +- .../category_files/TestSerial_Category.hpp | 38 +- .../category_files/TestThreads_Category.hpp | 38 +- .../configuration/test-code/CMakeLists.txt | 4 +- .../configuration/test-code/main.cpp | 16 + .../cuda/TestCuda_DebugPinUVMSpace.cpp | 38 +- .../cuda/TestCuda_DebugSerialExecution.cpp | 38 +- .../core/unit_test/cuda/TestCuda_Graph.cpp | 39 +- .../unit_test/cuda/TestCuda_InterOp_Init.cpp | 42 +- .../cuda/TestCuda_InterOp_Streams.cpp | 42 +- .../cuda/TestCuda_ReducerViewSizeLimit.cpp | 38 +- .../core/unit_test/cuda/TestCuda_Spaces.cpp | 131 +- .../core/unit_test/cuda/TestCuda_Task.cpp | 39 +- .../cuda/TestCuda_TeamScratchStreams.cpp | 38 +- .../default/TestDefaultDeviceDevelop.cpp | 39 +- .../default/TestDefaultDeviceType.cpp | 38 +- .../default/TestDefaultDeviceTypeInit_1.cpp | 16 + .../default/TestDefaultDeviceTypeInit_10.cpp | 16 + .../default/TestDefaultDeviceTypeInit_11.cpp | 16 + .../default/TestDefaultDeviceTypeInit_12.cpp | 16 + .../default/TestDefaultDeviceTypeInit_13.cpp | 16 + .../default/TestDefaultDeviceTypeInit_14.cpp | 16 + .../default/TestDefaultDeviceTypeInit_15.cpp | 16 + .../default/TestDefaultDeviceTypeInit_16.cpp | 16 + .../default/TestDefaultDeviceTypeInit_17.cpp | 16 + .../default/TestDefaultDeviceTypeInit_18.cpp | 16 + .../default/TestDefaultDeviceTypeInit_2.cpp | 16 + .../default/TestDefaultDeviceTypeInit_3.cpp | 16 + .../default/TestDefaultDeviceTypeInit_4.cpp | 16 + .../default/TestDefaultDeviceTypeInit_5.cpp | 16 + .../default/TestDefaultDeviceTypeInit_6.cpp | 16 + .../default/TestDefaultDeviceTypeInit_7.cpp | 16 + .../default/TestDefaultDeviceTypeInit_8.cpp | 16 + .../default/TestDefaultDeviceTypeInit_9.cpp | 16 + .../default/TestDefaultDeviceTypeResize.cpp | 38 +- .../default/TestDefaultDeviceTypeViewAPI.cpp | 39 +- .../default/TestDefaultDeviceType_a1.cpp | 38 +- .../default/TestDefaultDeviceType_a2.cpp | 38 +- .../default/TestDefaultDeviceType_a3.cpp | 38 +- .../default/TestDefaultDeviceType_b1.cpp | 38 +- .../default/TestDefaultDeviceType_b2.cpp | 38 +- .../default/TestDefaultDeviceType_b3.cpp | 38 +- .../default/TestDefaultDeviceType_c1.cpp | 38 +- .../default/TestDefaultDeviceType_c2.cpp | 38 +- .../default/TestDefaultDeviceType_c3.cpp | 38 +- .../default/TestDefaultDeviceType_d.cpp | 38 +- .../headers_self_contained/tstHeader.cpp | 16 + .../unit_test/hip/TestHIP_AsyncLauncher.cpp | 45 +- .../hip/TestHIP_BlocksizeDeduction.cpp | 46 +- .../unit_test/hip/TestHIP_InterOp_Init.cpp | 42 +- .../unit_test/hip/TestHIP_InterOp_Streams.cpp | 42 +- .../hip/TestHIP_Memory_Requirements.cpp | 47 +- .../core/unit_test/hip/TestHIP_ScanUnit.cpp | 47 +- .../core/unit_test/hip/TestHIP_Spaces.cpp | 326 ++- .../hip/TestHIP_TeamScratchStreams.cpp | 74 +- .../hpx/TestHPX_IndependentInstances.cpp | 38 +- ...X_IndependentInstancesDelayedExecution.cpp | 38 +- ...estHPX_IndependentInstancesInstanceIds.cpp | 38 +- ...estHPX_IndependentInstancesRefCounting.cpp | 38 +- .../core/unit_test/hpx/TestHPX_InterOp.cpp | 38 +- .../core/unit_test/hpx/TestHPX_Task.cpp | 39 +- .../core/unit_test/incremental/README.md | 3 + .../incremental/Test01_execspace.hpp | 38 +- .../incremental/Test02_atomic_host.hpp | 38 +- .../Test03a_MemorySpace_malloc.hpp | 38 +- .../incremental/Test03b_MemorySpace_free.hpp | 38 +- .../Test04_ParallelFor_RangePolicy.hpp | 38 +- .../Test05_ParallelReduce_RangePolicy.hpp | 38 +- .../Test06_ParallelFor_MDRangePolicy.hpp | 38 +- .../incremental/Test08_deep_copy.hpp | 38 +- .../incremental/Test10_HierarchicalBasics.hpp | 41 +- .../Test11a_ParallelFor_TeamThreadRange.hpp | 38 +- .../Test11b_ParallelFor_TeamVectorRange.hpp | 38 +- .../Test11c_ParallelFor_ThreadVectorRange.hpp | 38 +- .../incremental/Test12a_ThreadScratch.hpp | 38 +- .../incremental/Test12b_TeamScratch.hpp | 38 +- .../Test13a_ParallelRed_TeamThreadRange.hpp | 38 +- .../Test13b_ParallelRed_TeamVectorRange.hpp | 38 +- .../Test13c_ParallelRed_ThreadVectorRange.hpp | 38 +- .../incremental/Test14_MDRangeReduce.hpp | 38 +- .../incremental/Test16_ParallelScan.hpp | 38 +- .../incremental/Test17_CompleteAtomic.hpp | 38 +- .../core/unit_test/openmp/TestOpenMP.hpp | 38 +- .../unit_test/openmp/TestOpenMP_Graph.cpp | 39 +- .../unit_test/openmp/TestOpenMP_InterOp.cpp | 40 +- .../openmp/TestOpenMP_PartitionMaster.cpp | 39 +- .../core/unit_test/openmp/TestOpenMP_Task.cpp | 39 +- .../openmptarget/TestOpenMPTarget.hpp | 38 +- .../unit_test/serial/TestSerial_Graph.cpp | 39 +- .../core/unit_test/serial/TestSerial_Task.cpp | 39 +- .../unit_test/standalone/UnitTestMainInit.cpp | 41 +- .../unit_test/sycl/TestSYCL_InterOp_Init.cpp | 40 +- .../sycl/TestSYCL_InterOp_Init_Context.cpp | 39 +- .../sycl/TestSYCL_InterOp_Streams.cpp | 46 +- .../core/unit_test/sycl/TestSYCL_Spaces.cpp | 38 +- .../core/unit_test/sycl/TestSYCL_Task.cpp | 39 +- .../sycl/TestSYCL_TeamScratchStreams.cpp | 38 +- .../core/unit_test/tools/TestAllCalls.cpp | 38 +- .../unit_test/tools/TestBuiltinTuners.cpp | 38 +- .../unit_test/tools/TestCategoricalTuner.cpp | 38 +- .../unit_test/tools/TestEventCorrectness.cpp | 38 +- .../unit_test/tools/TestEventCorrectness.hpp | 165 +- .../core/unit_test/tools/TestIndependence.cpp | 38 +- .../unit_test/tools/TestLogicalSpaces.cpp | 38 +- .../unit_test/tools/TestLogicalSpaces.hpp | 45 +- .../unit_test/tools/TestProfilingSection.cpp | 38 +- .../core/unit_test/tools/TestTuning.cpp | 38 +- .../tools/TestWithoutInitializing.cpp | 50 +- .../tools/include/ToolTestingUtilities.hpp | 71 +- .../core/unit_test/tools/printing-tool.cpp | 21 +- .../view/TestExtentsDatatypeConversion.cpp | 89 + .../build_cmake_in_tree/cmake_example.cpp | 38 +- .../build_cmake_installed/CMakeLists.txt | 3 + .../build_cmake_installed/cmake_example.cpp | 38 +- .../bar.cpp | 38 +- .../foo.cpp | 38 +- .../bar.cpp | 38 +- .../cmake_example.cpp | 38 +- lib/kokkos/example/make_buildlink/main.cpp | 16 + .../example/query_device/query_device.cpp | 38 +- .../tutorial/01_hello_world/hello_world.cpp | 38 +- .../hello_world_lambda.cpp | 38 +- .../02_simple_reduce/simple_reduce.cpp | 38 +- .../simple_reduce_lambda.cpp | 38 +- .../tutorial/03_simple_view/simple_view.cpp | 38 +- .../simple_view_lambda.cpp | 38 +- .../simple_memoryspaces.cpp | 38 +- .../05_simple_atomics/simple_atomics.cpp | 38 +- .../simple_mdrangepolicy.cpp | 38 +- .../01_data_layouts/data_layouts.cpp | 38 +- .../02_memory_traits/memory_traits.cpp | 38 +- .../Advanced_Views/03_subviews/subviews.cpp | 38 +- .../Advanced_Views/04_dualviews/dual_view.cpp | 38 +- .../05_NVIDIA_UVM/uvm_example.cpp | 38 +- .../overlapping_deepcopy.cpp | 38 +- .../01_random_numbers/random_numbers.cpp | 38 +- .../01_thread_teams/thread_teams.cpp | 38 +- .../thread_teams_lambda.cpp | 38 +- .../nested_parallel_for.cpp | 38 +- .../03_vectorization/vectorization.cpp | 38 +- .../04_team_scan/team_scan.cpp | 44 +- .../launch_bounds/launch_bounds_reduce.cpp | 38 +- .../example/virtual_functions/classes.cpp | 16 + .../example/virtual_functions/classes.hpp | 16 + lib/kokkos/example/virtual_functions/main.cpp | 16 + lib/kokkos/generate_makefile.bash | 12 +- lib/kokkos/gnu_generate_makefile.bash | 4 +- lib/kokkos/master_history.txt | 1 + lib/kokkos/simd/src/Kokkos_SIMD.hpp | 65 +- lib/kokkos/simd/src/Kokkos_SIMD_AVX2.hpp | 1020 +++++++++ lib/kokkos/simd/src/Kokkos_SIMD_AVX512.hpp | 38 +- lib/kokkos/simd/src/Kokkos_SIMD_Common.hpp | 113 +- lib/kokkos/simd/src/Kokkos_SIMD_NEON.hpp | 995 +++++++++ lib/kokkos/simd/src/Kokkos_SIMD_Scalar.hpp | 42 +- lib/kokkos/simd/src/Kokkos_SIMD_dummy.cpp | 16 + lib/kokkos/simd/unit_tests/TestSIMD.cpp | 180 +- lib/kokkos/simd/unit_tests/UnitTestMain.cpp | 38 +- lib/kokkos/tpls/desul/Config.hpp.cmake.in | 17 + .../desul/include/desul/atomics/Adapt_CXX.hpp | 49 + .../desul/include/desul/atomics/Adapt_GCC.hpp | 48 + .../{SYCLConversions.hpp => Adapt_SYCL.hpp} | 74 +- .../include/desul/atomics/Atomic_Ref.hpp | 7 +- .../tpls/desul/include/desul/atomics/CUDA.hpp | 664 ------ .../desul/include/desul/atomics/Common.hpp | 104 +- .../desul/atomics/Compare_Exchange.hpp | 21 +- .../desul/atomics/Compare_Exchange_CUDA.hpp | 380 ++-- .../desul/atomics/Compare_Exchange_GCC.hpp | 95 +- .../desul/atomics/Compare_Exchange_HIP.hpp | 183 +- .../desul/atomics/Compare_Exchange_MSVC.hpp | 212 +- .../desul/atomics/Compare_Exchange_OpenMP.hpp | 127 +- .../desul/atomics/Compare_Exchange_SYCL.hpp | 79 +- .../atomics/Compare_Exchange_ScopeCaller.hpp | 12 +- .../desul/atomics/Compare_Exchange_Serial.hpp | 43 - .../desul/include/desul/atomics/Fetch_Op.hpp | 35 + .../include/desul/atomics/Fetch_Op_CUDA.hpp | 132 ++ .../include/desul/atomics/Fetch_Op_GCC.hpp | 51 + .../desul/atomics/Fetch_Op_Generic.hpp | 167 ++ .../include/desul/atomics/Fetch_Op_HIP.hpp | 109 + .../include/desul/atomics/Fetch_Op_OpenMP.hpp | 132 ++ .../atomics/{SYCL.hpp => Fetch_Op_SYCL.hpp} | 38 +- .../desul/atomics/Fetch_Op_ScopeCaller.hpp | 55 + .../tpls/desul/include/desul/atomics/GCC.hpp | 135 -- .../desul/include/desul/atomics/Generic.hpp | 670 ++---- .../tpls/desul/include/desul/atomics/HIP.hpp | 222 -- .../include/desul/atomics/Lock_Array.hpp | 47 +- ...ock_Array_Cuda.hpp => Lock_Array_CUDA.hpp} | 57 +- .../include/desul/atomics/Lock_Array_HIP.hpp | 16 +- .../desul/atomics/Lock_Based_Fetch_Op.hpp | 26 + .../atomics/Lock_Based_Fetch_Op_CUDA.hpp | 91 + .../desul/atomics/Lock_Based_Fetch_Op_HIP.hpp | 88 + .../atomics/Lock_Based_Fetch_Op_Host.hpp | 71 + .../Lock_Based_Fetch_Op_Unimplemented.hpp | 55 + .../desul/atomics/Lock_Free_Fetch_Op.hpp | 99 + .../desul/include/desul/atomics/Macros.hpp | 110 +- .../desul/include/desul/atomics/OpenMP.hpp | 15 - .../atomics/Operator_Function_Objects.hpp | 175 ++ .../include/desul/atomics/Thread_Fence.hpp | 35 + .../desul/atomics/Thread_Fence_CUDA.hpp | 37 + .../desul/atomics/Thread_Fence_GCC.hpp | 25 + .../desul/atomics/Thread_Fence_HIP.hpp | 35 + .../desul/atomics/Thread_Fence_MSVC.hpp | 27 + .../desul/atomics/Thread_Fence_OpenMP.hpp | 79 + .../desul/atomics/Thread_Fence_SYCL.hpp | 35 + .../atomics/Thread_Fence_ScopeCaller.hpp | 26 + .../include/desul/atomics/cuda/CUDA_asm.hpp | 19 +- .../desul/atomics/cuda/CUDA_asm_exchange.hpp | 10 +- .../cuda/cuda_cc7_asm_atomic_fetch_op.inc | 10 - .../cuda_cc7_asm_atomic_fetch_op.inc_isglobal | 28 +- ...cuda_cc7_asm_atomic_fetch_op.inc_predicate | 28 +- .../atomics/cuda/cuda_cc7_asm_atomic_op.inc | 10 - .../cuda/cuda_cc7_asm_atomic_op.inc_isglobal | 12 +- .../cuda/cuda_cc7_asm_atomic_op.inc_predicate | 12 +- .../atomics/cuda/cuda_cc7_asm_exchange_op.inc | 8 +- .../desul/atomics/openmp/OpenMP_40.hpp | 92 +- .../desul/atomics/openmp/OpenMP_40_op.inc | 20 +- lib/kokkos/tpls/desul/src/Lock_Array_CUDA.cpp | 4 +- .../__p0009_bits/compressed_pair.hpp | 225 ++ .../experimental/__p0009_bits/config.hpp | 302 +++ .../__p0009_bits/default_accessor.hpp} | 75 +- .../__p0009_bits/dynamic_extent.hpp} | 64 +- .../experimental/__p0009_bits/extents.hpp | 543 +++++ .../__p0009_bits/full_extent_t.hpp} | 39 +- .../experimental/__p0009_bits/layout_left.hpp | 240 ++ .../__p0009_bits/layout_right.hpp | 240 ++ .../__p0009_bits/layout_stride.hpp | 553 +++++ .../experimental/__p0009_bits/macros.hpp | 647 ++++++ .../__p0009_bits/maybe_static_value.hpp | 152 ++ .../experimental/__p0009_bits/mdspan.hpp | 444 ++++ .../__p0009_bits/no_unique_address.hpp | 127 ++ .../standard_layout_static_array.hpp | 685 ++++++ .../__p0009_bits/static_array.hpp | 286 +++ .../experimental/__p0009_bits/submdspan.hpp | 586 +++++ .../__p0009_bits/trait_backports.hpp | 160 ++ .../experimental/__p0009_bits/type_list.hpp | 117 + .../experimental/__p1684_bits/mdarray.hpp | 463 ++++ .../mdspan/include/experimental/mdarray} | 19 +- .../tpls/mdspan/include/experimental/mdspan | 56 + 1117 files changed, 33357 insertions(+), 41720 deletions(-) create mode 100644 lib/kokkos/LICENSE_FILE_HEADER create mode 100644 lib/kokkos/algorithms/src/Kokkos_NestedSort.hpp create mode 100644 lib/kokkos/algorithms/unit_tests/TestNestedSort.hpp create mode 100644 lib/kokkos/cmake/Kokkos_Version_Info.cpp.in create mode 100644 lib/kokkos/cmake/Kokkos_Version_Info.hpp create mode 100644 lib/kokkos/cmake/build_env_info.cmake delete mode 100644 lib/kokkos/cmake/compile_tests/cplusplus14.cpp create mode 100644 lib/kokkos/cmake/compile_tests/cplusplus17.cpp delete mode 100644 lib/kokkos/cmake/compile_tests/pthread.cpp create mode 100644 lib/kokkos/core/perf_test/BenchmarkMain.cpp create mode 100644 lib/kokkos/core/perf_test/Benchmark_Context.hpp create mode 100644 lib/kokkos/core/perf_test/PerfTest_ViewCopy_Raw.cpp create mode 100644 lib/kokkos/core/perf_test/test_sharedSpace.cpp delete mode 100644 lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp create mode 100644 lib/kokkos/core/src/HIP/Kokkos_HIP.cpp create mode 100644 lib/kokkos/core/src/HIP/Kokkos_HIP.hpp create mode 100644 lib/kokkos/core/src/HIP/Kokkos_HIP_DeepCopy.cpp create mode 100644 lib/kokkos/core/src/HIP/Kokkos_HIP_DeepCopy.hpp create mode 100644 lib/kokkos/core/src/HIP/Kokkos_HIP_SharedAllocationRecord.cpp create mode 100644 lib/kokkos/core/src/HIP/Kokkos_HIP_SharedAllocationRecord.hpp create mode 100644 lib/kokkos/core/src/HIP/Kokkos_HIP_Space.hpp create mode 100644 lib/kokkos/core/src/HPX/Kokkos_HPX_MDRangePolicy.hpp delete mode 100644 lib/kokkos/core/src/Kokkos_HIP_Space.hpp create mode 100644 lib/kokkos/core/src/Kokkos_ReductionIdentity.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_DeepCopy.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_FunctorAdapter.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_MDRangePolicy.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_Macros.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_ParallelFor_MDRange.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_ParallelFor_Range.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_ParallelFor_Team.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_ParallelReduce_Range.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_ScheduleType.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_SharedAllocationRecord.cpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_SharedAllocationRecord.hpp create mode 100644 lib/kokkos/core/src/OpenACC/Kokkos_OpenACC_Team.hpp create mode 100644 lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_MDRangePolicy.hpp create mode 100644 lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_MDRangePolicy.hpp create mode 100644 lib/kokkos/core/src/Serial/Kokkos_Serial_MDRangePolicy.hpp create mode 100644 lib/kokkos/core/src/Threads/Kokkos_Threads_MDRangePolicy.hpp create mode 100644 lib/kokkos/core/src/View/MDSpan/Kokkos_MDSpan_Extents.hpp create mode 100644 lib/kokkos/core/src/View/MDSpan/Kokkos_MDSpan_Header.hpp delete mode 100644 lib/kokkos/core/src/impl/Kokkos_NumericTraits.cpp create mode 100644 lib/kokkos/core/src/impl/Kokkos_TeamMDPolicy.hpp create mode 100644 lib/kokkos/core/unit_test/TestCommonPolicyConstructors.hpp create mode 100644 lib/kokkos/core/unit_test/TestCommonPolicyInterface.hpp create mode 100644 lib/kokkos/core/unit_test/TestDeviceAndThreads.py create mode 100644 lib/kokkos/core/unit_test/TestLegionInitialization.cpp delete mode 100644 lib/kokkos/core/unit_test/TestLegionInteroperability.cpp create mode 100644 lib/kokkos/core/unit_test/TestMDRangePolicyConstructors.hpp create mode 100644 lib/kokkos/core/unit_test/TestMDSpan.hpp delete mode 100644 lib/kokkos/core/unit_test/TestPolicyConstruction.hpp create mode 100644 lib/kokkos/core/unit_test/TestRangePolicyConstructors.hpp create mode 100644 lib/kokkos/core/unit_test/TestReducerCTADs.hpp create mode 100644 lib/kokkos/core/unit_test/TestSharedHostPinnedSpace.cpp create mode 100644 lib/kokkos/core/unit_test/TestSharedSpace.cpp create mode 100644 lib/kokkos/core/unit_test/TestTeamMDRange.hpp create mode 100644 lib/kokkos/core/unit_test/TestTeamPolicyConstructors.hpp create mode 100644 lib/kokkos/core/unit_test/TestViewTypeTraits.cpp create mode 100644 lib/kokkos/core/unit_test/TestWindowsInclude.cpp create mode 100644 lib/kokkos/core/unit_test/UnitTest_DeviceAndThreads.cpp create mode 100644 lib/kokkos/core/unit_test/category_files/TestOpenACC_Category.hpp create mode 100644 lib/kokkos/core/unit_test/incremental/README.md create mode 100644 lib/kokkos/core/unit_test/view/TestExtentsDatatypeConversion.cpp create mode 100644 lib/kokkos/simd/src/Kokkos_SIMD_AVX2.hpp create mode 100644 lib/kokkos/simd/src/Kokkos_SIMD_NEON.hpp create mode 100644 lib/kokkos/tpls/desul/Config.hpp.cmake.in create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Adapt_CXX.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Adapt_GCC.hpp rename lib/kokkos/tpls/desul/include/desul/atomics/{SYCLConversions.hpp => Adapt_SYCL.hpp} (60%) delete mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/CUDA.hpp delete mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Compare_Exchange_Serial.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Fetch_Op.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Fetch_Op_CUDA.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Fetch_Op_GCC.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Fetch_Op_Generic.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Fetch_Op_HIP.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Fetch_Op_OpenMP.hpp rename lib/kokkos/tpls/desul/include/desul/atomics/{SYCL.hpp => Fetch_Op_SYCL.hpp} (72%) create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Fetch_Op_ScopeCaller.hpp delete mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/GCC.hpp delete mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/HIP.hpp rename lib/kokkos/tpls/desul/include/desul/atomics/{Lock_Array_Cuda.hpp => Lock_Array_CUDA.hpp} (75%) create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Lock_Based_Fetch_Op.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Lock_Based_Fetch_Op_CUDA.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Lock_Based_Fetch_Op_HIP.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Lock_Based_Fetch_Op_Host.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Lock_Based_Fetch_Op_Unimplemented.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Lock_Free_Fetch_Op.hpp delete mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/OpenMP.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Operator_Function_Objects.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Thread_Fence.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Thread_Fence_CUDA.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Thread_Fence_GCC.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Thread_Fence_HIP.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Thread_Fence_MSVC.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Thread_Fence_OpenMP.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Thread_Fence_SYCL.hpp create mode 100644 lib/kokkos/tpls/desul/include/desul/atomics/Thread_Fence_ScopeCaller.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/compressed_pair.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/config.hpp rename lib/kokkos/{core/src/Kokkos_HIP.hpp => tpls/mdspan/include/experimental/__p0009_bits/default_accessor.hpp} (55%) rename lib/kokkos/{core/src/impl/Kokkos_PhysicalLayout.hpp => tpls/mdspan/include/experimental/__p0009_bits/dynamic_extent.hpp} (57%) create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/extents.hpp rename lib/kokkos/{core/src/impl/Kokkos_Timer.hpp => tpls/mdspan/include/experimental/__p0009_bits/full_extent_t.hpp} (64%) create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/layout_left.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/layout_right.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/layout_stride.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/macros.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/maybe_static_value.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/mdspan.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/no_unique_address.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/standard_layout_static_array.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/static_array.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/submdspan.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/trait_backports.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p0009_bits/type_list.hpp create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/__p1684_bits/mdarray.hpp rename lib/kokkos/{core/src/Kokkos_TaskPolicy.hpp => tpls/mdspan/include/experimental/mdarray} (76%) create mode 100644 lib/kokkos/tpls/mdspan/include/experimental/mdspan diff --git a/lib/kokkos/BUILD.md b/lib/kokkos/BUILD.md index a8985ef1fd..b0d603e6db 100644 --- a/lib/kokkos/BUILD.md +++ b/lib/kokkos/BUILD.md @@ -52,6 +52,10 @@ There are numerous device backends, options, and architecture-specific optimizat ```` which activates the OpenMP backend. All of the options controlling device backends, options, architectures, and third-party libraries (TPLs) are given below. +Kokkos requires as a minimum C++17, however C++20 and C++23 are supported depending on the compiler. + +The latest minimum compiler versions can be found in `cmake/kokkos_compiler_id.cmake`. + ## Known Issues ### Cray @@ -148,12 +152,14 @@ Options can be enabled by specifying `-DKokkos_ENABLE_X`. * Whether to activate experimental lambda features * BOOL Default: OFF * Kokkos_ENABLE_CUDA_LDG_INTRINSIC + * Deprecated since 4.0, LDG intrinsics are always enabled. * Whether to use CUDA LDG intrinsics * BOOL Default: OFF * Kokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE * Whether to enable relocatable device code (RDC) for CUDA * BOOL Default: OFF * Kokkos_ENABLE_CUDA_UVM + * Deprecated since 4.0 * Whether to use unified memory (UM) by default for CUDA * BOOL Default: OFF * Kokkos_ENABLE_DEBUG @@ -184,10 +190,6 @@ Options can be enabled by specifying `-DKokkos_ENABLE_X`. * Whether to enable test suite * BOOL Default: OFF -## Other Options -* Kokkos_CXX_STANDARD - * The C++ standard for Kokkos to use: c++14, c++17, or c++20. This should be given in CMake style as 14, 17, or 20. - * STRING Default: 14 ## Third-party Libraries (TPLs) The following options control enabling TPLs: diff --git a/lib/kokkos/CHANGELOG.md b/lib/kokkos/CHANGELOG.md index bdbc75604b..c3409a9058 100644 --- a/lib/kokkos/CHANGELOG.md +++ b/lib/kokkos/CHANGELOG.md @@ -1,5 +1,108 @@ # Change Log +## [4.0.0](https://github.com/kokkos/kokkos/tree/4.0.0) (2023-02-21) +[Full Changelog](https://github.com/kokkos/kokkos/compare/3.7.01...4.0.0) + +### Features: +- Allow value types without default constructor in `Kokkos::View` with `Kokkos::WithoutInitializing` [\#5307](https://github.com/kokkos/kokkos/pull/5307) +- `parallel_scan` with `View` as result type. [\#5146](https://github.com/kokkos/kokkos/pull/5146) +- Introduced `SharedSpace`, an alias for a `MemorySpace` that is accessible by every `ExecutionSpace`. The memory is moved and then accessed locally. [\#5289](https://github.com/kokkos/kokkos/pull/5289) +- Introduced `SharedHostPinnedSpace`, an alias for a `MemorySpace` that is accessible by every `ExecutionSpace`. The memory is pinned to the host and accessed via zero-copy access. [\#5405](https://github.com/kokkos/kokkos/pull/5405) +- Groundwork for `MDSpan` integration. [\#4973](https://github.com/kokkos/kokkos/pull/4973) and [\#5304](https://github.com/kokkos/kokkos/pull/5304) +- Introduced MD version of hierarchical parallelism: `TeamThreadMDRange`, `ThreadVectorMDRange` and `TeamVectorMDRange`. [\#5238](https://github.com/kokkos/kokkos/pull/5238) + +### Backend and Architecture Enhancements: + +#### CUDA: +- Allow CUDA PTX forward compatibility [\#3612](https://github.com/kokkos/kokkos/pull/3612) [\#5536](https://github.com/kokkos/kokkos/pull/5536) [\#5527](https://github.com/kokkos/kokkos/pull/5527) +- Add support for NVIDIA Hopper GPU architecture [\#5538](https://github.com/kokkos/kokkos/pull/5538) +- Don't rely on synchronization behavior of default stream in CUDA and HIP [\#5391](https://github.com/kokkos/kokkos/pull/5391) +- Improve CUDA cache config settings [\#5706](https://github.com/kokkos/kokkos/pull/5706) + +#### HIP: + - Move `HIP`, `HIPSpace`, `HIPHostPinnedSpace`, and `HIPManagedSpace` out of the `Experimental` namespace [\#5383](https://github.com/kokkos/kokkos/pull/5383) + - Don't rely on synchronization behavior of default stream in CUDA and HIP [\#5391](https://github.com/kokkos/kokkos/pull/5391) + - Export AMD architecture flag when using Trilinos [\#5528](https://github.com/kokkos/kokkos/pull/5528) + - Fix linking error (see [OLCF issue](https://docs.olcf.ornl.gov/systems/crusher_quick_start_guide.html#olcfdev-1167-kokkos-build-failures-with-prgenv-amd)) when using `amdclang`: [\#5539](https://github.com/kokkos/kokkos/pull/5539) + - Remove support for MI25 and added support for Navi 1030 [\#5522](https://github.com/kokkos/kokkos/pull/5522) + - Fix race condition when using `HSA_XNACK=1` [\#5755](https://github.com/kokkos/kokkos/pull/5755) + - Add parameter to force using GlobalMemory launch mechanism. This can be used when encountering compiler bugs with ROCm 5.3 and 5.4 [\#5796](https://github.com/kokkos/kokkos/pull/5796) + +#### SYCL: +- Delegate choice of workgroup size for `parallel_reduce` with `RangePolicy` to the compiler. [\#5227](https://github.com/kokkos/kokkos/pull/5227) +- SYCL `RangePolicy`: manually specify workgroup size through chunk size [\#4875](https://github.com/kokkos/kokkos/pull/4875) + +#### OpenMPTarget: +- Select the right device [\#5492](https://github.com/kokkos/kokkos/pull/5492) + +#### OpenMP: + - Add `partition_space` [\#5105](https://github.com/kokkos/kokkos/pull/5105) + +### General Enhancements +- Implement `OffsetView` constructor taking `pair`s and `ViewCtorProp` [\#5303](https://github.com/kokkos/kokkos/pull/5303) +- Promote math constants to `Kokkos::numbers` namespace [\#5434](https://github.com/kokkos/kokkos/pull/5434) +- Add overloads of `hypot` math function that take 3 arguments [\#5341](https://github.com/kokkos/kokkos/pull/5341) +- Add `fma` fused multiply-add math function [\#5428](https://github.com/kokkos/kokkos/pull/5428) +- Views using `MemoryTraits::Atomic` don't need `volatile` overloads for the value type anymore. [\#5455](https://github.com/kokkos/kokkos/pull/5455) +- Added `is_team_handle` trait [\#5375](https://github.com/kokkos/kokkos/pull/5375) +- Refactor desul atomics to support compiling CUDA with NVC++ [\#5431](https://github.com/kokkos/kokkos/pull/5431) [\#5497](https://github.com/kokkos/kokkos/pull/5497) [\#5498](https://github.com/kokkos/kokkos/pull/5498) +- Support finding `libquadmath` with native compiler support [\#5286](https://github.com/kokkos/kokkos/pull/5286) +- Add architecture flags for MSVC [\#5673](https://github.com/kokkos/kokkos/pull/5673) +- SIMD backend for ARM NEON [\#5829](https://github.com/kokkos/kokkos/pull/5829) + +### Build System Changes +- Let CMake determine OpenMP flags. [\#4105](https://github.com/kokkos/kokkos/pull/4105) +- Update minimum compiler versions. [\#5323](https://github.com/kokkos/kokkos/pull/5323) +- Makefile and CMake support for C++23 [\#5283](https://github.com/kokkos/kokkos/pull/5283) +- Do not add `-cuda` to the link line with NVHPC compiler when the CUDA backend is not actually enabled [\#5485](https://github.com/kokkos/kokkos/pull/5485) +- Only add `-latomic` in generated GNU makefiles when OpenMPTarget backend is enabled [\#5501](https://github.com/kokkos/kokkos/pull/5501) [\#5537](https://github.com/kokkos/kokkos/pull/5537) (3.7 patch release candidate) +- `Kokkos_ENABLE_CUDA_LAMBDA` now `ON` by default with NVCC [\#5580](https://github.com/kokkos/kokkos/pull/5580) +- Fix enabling of relocatable device code when using CUDA as CMake language [\#5564](https://github.com/kokkos/kokkos/pull/5564) +- Fix cmake configuration with CUDA 12 [\#5691](https://github.com/kokkos/kokkos/pull/5691) + +### Incompatibilities (i.e. breaking changes) +- ***Require C++17*** [\#5277](https://github.com/kokkos/kokkos/pull/5277) +- Turn setting `Kokkos_CXX_STANDARD` into an error [\#5293](https://github.com/kokkos/kokkos/pull/5293) +- Remove all deprecations in Kokkos 3 [\#5297](https://github.com/kokkos/kokkos/pull/5297) +- Remove `KOKKOS_COMPILER_CUDA_VERSION` [\#5430](https://github.com/kokkos/kokkos/pull/5430) +- Drop `reciprocal_overflow_threshold` numeric trait [\#5326](https://github.com/kokkos/kokkos/pull/5326) +- Move `reduction_identity` out of `` into a new `` header [\#5450](https://github.com/kokkos/kokkos/pull/5450) +- Reduction and scan routines will report an error if the `join()` operator they would use takes `volatile`-qualified parameters [\#5409](https://github.com/kokkos/kokkos/pull/5409) +- `ENABLE_CUDA_UVM` is dropped in favor of using `SharedSpace` as `MemorySpace` explicitly [\#5608](https://github.com/kokkos/kokkos/pull/5608) +- Remove Kokkos_ENABLE_CUDA_LDG_INTRINSIC option [\#5623](https://github.com/kokkos/kokkos/pull/5623) +- Don't rely on synchronization behavior of default stream in CUDA and HIP - this potentially will break unintended implicit synchronization with other libraries such as MPI [\#5391](https://github.com/kokkos/kokkos/pull/5391) +- Make ExecutionSpace::concurrency() a non-static member function [\#5655](https://github.com/kokkos/kokkos/pull/5655) and related PRs + +### Deprecations +- Guard against non-public header inclusion [\#5178](https://github.com/kokkos/kokkos/pull/5178) +- Raise deprecation warnings if non empty WorkTag class is used [\#5230](https://github.com/kokkos/kokkos/pull/5230) +- Deprecate `parallel_*` overloads taking the label as trailing argument [\#5141](https://github.com/kokkos/kokkos/pull/5141) +- Deprecate nested types in functional [\#5185](https://github.com/kokkos/kokkos/pull/5185) +- Deprecate `InitArguments` struct and replace it with `InitializationSettings` [\#5135](https://github.com/kokkos/kokkos/pull/5135) +- Deprecate `finalize_all()` [\#5134](https://github.com/kokkos/kokkos/pull/5134) +- Deprecate command line arguments (other than `--help`) that are not prefixed with `kokkos-*` [\#5120](https://github.com/kokkos/kokkos/pull/5120) +- Deprecate `--[kokkos-]numa` cmdline arg and `KOKKOS_NUMA` env var [\#5117](https://github.com/kokkos/kokkos/pull/5117) +- Deprecate `--[kokkos-]threads` command line argument in favor of `--[kokkos-]num-threads` [\#5111](https://github.com/kokkos/kokkos/pull/5111) +- Deprecate `Kokkos::is_reducer_type` [\#4957](https://github.com/kokkos/kokkos/pull/4957) +- Deprecate `OffsetView` constructors taking `index_list_type` [\#4810](https://github.com/kokkos/kokkos/pull/4810) +- Deprecate overloads of `Kokkos::sort` taking a parameter `bool always_use_kokkos_sort` [\#5382](https://github.com/kokkos/kokkos/issues/5382) +- Deprecate `CudaUVMSpace::available()` which always returned `true` [\#5614](https://github.com/kokkos/kokkos/pull/5614) +- Deprecate `volatile`-qualified members from `Kokkos::pair` and `Kokkos::complex` [\#5412](https://github.com/kokkos/kokkos/pull/5412) +- Deprecate `KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_*` macros [\#5824](https://github.com/kokkos/kokkos/pull/5824) (oversight in 3.2) + +### Bug Fixes +- Avoid allocating memory for `UniqueToken` [\#5300](https://github.com/kokkos/kokkos/pull/5300) +- Fix `pragma ivdep` in `Kokkos_OpenMP_Parallel.hpp` [\#5356](https://github.com/kokkos/kokkos/pull/5356) +- Fix configuring with Threads support when rerunning CMake [\#5486](https://github.com/kokkos/kokkos/pull/5486) +- Fix View assignment between `LayoutLeft` and `LayoutRight` with static extents [\#5535](https://github.com/kokkos/kokkos/pull/5535) (3.7 patch release candidate) +- Add `fence()` calls to sorting routine overloads that don't take an execution space parameter [\#5389](https://github.com/kokkos/kokkos/pull/5389) +- `ClockTic` changed to 64 bit to fix overflow on Power [\#5577](https://github.com/kokkos/kokkos/pull/5577) (incl. in 3.7.01 patch release) +- Fix incorrect offset in CUDA and HIP `parallel_scan` for < 4 byte types [\#5555](https://github.com/kokkos/kokkos/pull/5555) (3.7 patch release candidate) +- Fix incorrect alignment behavior of scratch allocations in some corner cases (e.g. very small allocations) [\#5687](https://github.com/kokkos/kokkos/pull/5687) (3.7 patch release candidate) +- Add missing `ReductionIdentity` specialization [\#5798](https://github.com/kokkos/kokkos/pull/5798) +- Don't install standard algorithms headers multiple times [\#5670](https://github.com/kokkos/kokkos/pull/5670) +- Fix max scratch size calculation for level 0 scratch in CUDA and HIP [\#5718](https://github.com/kokkos/kokkos/pull/5718) + ## [3.7.01](https://github.com/kokkos/kokkos/tree/3.7.01) (2022-12-01) [Full Changelog](https://github.com/kokkos/kokkos/compare/3.7.00...3.7.01) diff --git a/lib/kokkos/CMakeLists.txt b/lib/kokkos/CMakeLists.txt index 7b78f29d73..02ebcf9e24 100644 --- a/lib/kokkos/CMakeLists.txt +++ b/lib/kokkos/CMakeLists.txt @@ -87,6 +87,16 @@ IF(NOT KOKKOS_HAS_TRILINOS) SET(KOKKOS_COMPILE_LANGUAGE CUDA) ENDIF() + # use lower case here since we haven't parsed options yet + IF (Kokkos_ENABLE_COMPILE_AS_CMAKE_LANGUAGE AND Kokkos_ENABLE_HIP) + + # Without this as a language for the package we would get a C++ compiler enabled. + # but we still need a C++ compiler even if we build all our cpp files as HIP only + # because otherwise the C++ features don't work etc. + SET(KOKKOS_INTERNAL_EXTRA_COMPILE_LANGUAGE CXX) + + SET(KOKKOS_COMPILE_LANGUAGE HIP) + ENDIF() IF (Spack_WORKAROUND) IF (Kokkos_ENABLE_COMPILE_AS_CMAKE_LANGUAGE) @@ -127,11 +137,17 @@ ELSEIF (NOT CMAKE_SIZEOF_VOID_P EQUAL 8) ENDIF() -set(Kokkos_VERSION_MAJOR 3) -set(Kokkos_VERSION_MINOR 7) -set(Kokkos_VERSION_PATCH 01) +set(Kokkos_VERSION_MAJOR 4) +set(Kokkos_VERSION_MINOR 0) +set(Kokkos_VERSION_PATCH 0) set(Kokkos_VERSION "${Kokkos_VERSION_MAJOR}.${Kokkos_VERSION_MINOR}.${Kokkos_VERSION_PATCH}") math(EXPR KOKKOS_VERSION "${Kokkos_VERSION_MAJOR} * 10000 + ${Kokkos_VERSION_MINOR} * 100 + ${Kokkos_VERSION_PATCH}") +# mathematical expressions below are not stricly necessary but they eliminate +# the rather aggravating leading 0 in the releases patch version number, and, +# in some way, are a sanity check for our arithmetic +math(EXPR KOKKOS_VERSION_MAJOR "${KOKKOS_VERSION} / 10000") +math(EXPR KOKKOS_VERSION_MINOR "${KOKKOS_VERSION} / 100 % 100") +math(EXPR KOKKOS_VERSION_PATCH "${KOKKOS_VERSION} % 100") # Load either the real TriBITS or a TriBITS wrapper # for certain utility functions that are universal (like GLOBAL_SET) @@ -167,7 +183,7 @@ IF(NOT MSVC) ENDIF() IF(Kokkos_ENABLE_TESTS AND NOT KOKKOS_HAS_TRILINOS) - find_package(GTest) + find_package(GTest QUIET) ENDIF() # Include a set of Kokkos-specific wrapper functions that @@ -180,6 +196,14 @@ INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_tribits.cmake) # to allow platform-specific checks INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_check_env.cmake) +IF(NOT KOKKOS_HAS_TRILINOS) + # This does not work in Trilinos and we simply don't care + # to fix it for Trilinos + # Gather information about the runtime environment + INCLUDE(${KOKKOS_SRC_PATH}/cmake/build_env_info.cmake) + check_git_setup() +ENDIF() + # The build environment setup goes in the following steps # 1) Check all the enable options. This includes checking Kokkos_DEVICES # 2) Check the compiler ID (type and version) @@ -194,14 +218,8 @@ KOKKOS_SETUP_BUILD_ENVIRONMENT() OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF) -SET(KOKKOS_EXT_LIBRARIES Kokkos::kokkos Kokkos::kokkoscore Kokkos::kokkoscontainers Kokkos::kokkosalgorithms) -SET(KOKKOS_SUB_LIBRARIES kokkoscore kokkoscontainers kokkosalgorithms) -IF (KOKKOS_CXX_STANDARD GREATER_EQUAL 17) - LIST(APPEND KOKKOS_EXT_LIBRARIES Kokkos::kokkossimd) - LIST(APPEND KOKKOS_SUB_LIBRARIES kokkossimd) -ENDIF() -SET(KOKKOS_INT_LIBRARIES kokkos ${KOKKOS_SUB_LIBRARIES}) -SET_PROPERTY(GLOBAL PROPERTY KOKKOS_INT_LIBRARIES ${KOKKOS_INT_LIBRARIES}) +SET(KOKKOS_COMPONENT_LIBRARIES kokkoscore kokkoscontainers kokkosalgorithms kokkossimd) +SET_PROPERTY(GLOBAL PROPERTY KOKKOS_INT_LIBRARIES kokkos ${KOKKOS_COMPONENT_LIBRARIES}) IF (KOKKOS_HAS_TRILINOS) SET(TRILINOS_INCDIR ${${PROJECT_NAME}_INSTALL_INCLUDE_DIR}) @@ -295,7 +313,7 @@ IF (NOT KOKKOS_HAS_TRILINOS AND NOT Kokkos_INSTALL_TESTING) #Make sure in-tree projects can reference this as Kokkos:: #to match the installed target names ADD_LIBRARY(Kokkos::kokkos ALIAS kokkos) - TARGET_LINK_LIBRARIES(kokkos INTERFACE ${KOKKOS_SUB_LIBRARIES}) + TARGET_LINK_LIBRARIES(kokkos INTERFACE ${KOKKOS_COMPONENT_LIBRARIES}) KOKKOS_INTERNAL_ADD_LIBRARY_INSTALL(kokkos) ENDIF() INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_install.cmake) diff --git a/lib/kokkos/LICENSE b/lib/kokkos/LICENSE index c6f17087d5..6572cc2db0 100644 --- a/lib/kokkos/LICENSE +++ b/lib/kokkos/LICENSE @@ -1,43 +1,238 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// 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 NTESS "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 NTESS 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 + ************************************************************************ + + Kokkos v. 4.0 + Copyright (2022) National Technology & Engineering + Solutions of Sandia, LLC (NTESS). + + Under the terms of Contract DE-NA0003525 with NTESS, + the U.S. Government retains certain rights in this software. + + + ============================================================================== + Kokkos is under the Apache License v2.0 with LLVM Exceptions: + ============================================================================== + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS Apache 2.0 + + ---- LLVM Exceptions to the Apache 2.0 License ---- + + As an exception, if, as a result of your compiling your source code, portions + of this Software are embedded into an Object form of such source code, you + may redistribute such embedded portions in such Object form without complying + with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + + In addition, if you combine or link compiled forms of this Software with + software that is licensed under the GPLv2 ("Combined Software") and if a + court of competent jurisdiction determines that the patent provision (Section + 3), the indemnity provision (Section 9) or other Section of the License + conflicts with the conditions of the GPLv2, you may retroactively and + prospectively choose to deem waived or otherwise exclude such Section(s) of + the License, but only in their entirety and only with respect to the Combined + Software. + + ============================================================================== + Software from third parties included in Kokkos: + ============================================================================== + + Kokkos contains third party software which is under different license + terms. All such code will be identified clearly using at least one of two + mechanisms: + 1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or + 2) It will contain specific license and restriction terms at the top of every + file. + + + THIS SOFTWARE IS PROVIDED BY NTESS "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 NTESS 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) and + Damien T. Lebrun-Grandie (lebrungrandt@ornl.gov) + + ************************************************************************ diff --git a/lib/kokkos/LICENSE_FILE_HEADER b/lib/kokkos/LICENSE_FILE_HEADER new file mode 100644 index 0000000000..03eb04f8bd --- /dev/null +++ b/lib/kokkos/LICENSE_FILE_HEADER @@ -0,0 +1,15 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER diff --git a/lib/kokkos/Makefile.kokkos b/lib/kokkos/Makefile.kokkos index b873fd1e06..792a237f5e 100644 --- a/lib/kokkos/Makefile.kokkos +++ b/lib/kokkos/Makefile.kokkos @@ -10,9 +10,9 @@ ifeq ($(mode),shared) CXXFLAGS += $(SHFLAGS) endif -KOKKOS_VERSION_MAJOR = 3 -KOKKOS_VERSION_MINOR = 7 -KOKKOS_VERSION_PATCH = 01 +KOKKOS_VERSION_MAJOR = 4 +KOKKOS_VERSION_MINOR = 0 +KOKKOS_VERSION_PATCH = 0 KOKKOS_VERSION = $(shell echo $(KOKKOS_VERSION_MAJOR)*10000+$(KOKKOS_VERSION_MINOR)*100+$(KOKKOS_VERSION_PATCH) | bc) # Options: Cuda,HIP,SYCL,OpenMPTarget,OpenMP,Threads,Serial @@ -23,7 +23,7 @@ KOKKOS_DEVICES ?= "OpenMP" # NVIDIA: Kepler,Kepler30,Kepler32,Kepler35,Kepler37,Maxwell,Maxwell50,Maxwell52,Maxwell53,Pascal60,Pascal61,Volta70,Volta72,Turing75,Ampere80,Ampere86,Ada89,Hopper90 # ARM: ARMv80,ARMv81,ARMv8-ThunderX,ARMv8-TX2,A64FX # IBM: BGQ,Power7,Power8,Power9 -# AMD-GPUS: Vega900,Vega906,Vega908,Vega90A +# AMD-GPUS: Vega906,Vega908,Vega90A,Navi1030 # AMD-CPUS: AMDAVX,Zen,Zen2,Zen3 # Intel-GPUs: Gen9,Gen11,Gen12LP,DG1,XeHP,PVC KOKKOS_ARCH ?= "" @@ -31,8 +31,8 @@ KOKKOS_ARCH ?= "" KOKKOS_DEBUG ?= "no" # Options: hwloc,librt,experimental_memkind KOKKOS_USE_TPLS ?= "" -# Options: c++14,c++1y,c++17,c++1z,c++2a -KOKKOS_CXX_STANDARD ?= "c++14" +# Options: c++17,c++1z,c++20,c++2a,c++23,c++2b +KOKKOS_CXX_STANDARD ?= "c++17" # Options: aggressive_vectorization,disable_profiling,enable_large_mem_tests,disable_complex_align,disable_deprecated_code,enable_deprecation_warnings,disable_desul_atomics KOKKOS_OPTIONS ?= "" KOKKOS_CMAKE ?= "no" @@ -67,12 +67,12 @@ kokkos_path_exists=$(if $(wildcard $1),1,0) # Check for general settings KOKKOS_INTERNAL_ENABLE_DEBUG := $(call kokkos_has_string,$(KOKKOS_DEBUG),yes) -KOKKOS_INTERNAL_ENABLE_CXX14 := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++14) -KOKKOS_INTERNAL_ENABLE_CXX1Y := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++1y) KOKKOS_INTERNAL_ENABLE_CXX17 := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++17) KOKKOS_INTERNAL_ENABLE_CXX1Z := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++1z) -KOKKOS_INTERNAL_ENABLE_CXX2A := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++2a) KOKKOS_INTERNAL_ENABLE_CXX20 := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++20) +KOKKOS_INTERNAL_ENABLE_CXX2A := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++2a) +KOKKOS_INTERNAL_ENABLE_CXX23 := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++23) +KOKKOS_INTERNAL_ENABLE_CXX2B := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++2b) # Check for external libraries. KOKKOS_INTERNAL_USE_HWLOC := $(call kokkos_has_string,$(KOKKOS_USE_TPLS),hwloc) @@ -87,6 +87,7 @@ KOKKOS_INTERNAL_DISABLE_COMPLEX_ALIGN := $(call kokkos_has_string,$(KOKKOS_OPTIO 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_ENABLE_LARGE_MEM_TESTS := $(call kokkos_has_string,$(KOKKOS_OPTIONS),enable_large_mem_tests) +# deprecated KOKKOS_INTERNAL_CUDA_USE_LDG := $(call kokkos_has_string,$(KOKKOS_CUDA_OPTIONS),use_ldg) KOKKOS_INTERNAL_CUDA_USE_UVM := $(call kokkos_has_string,$(KOKKOS_CUDA_OPTIONS),force_uvm) KOKKOS_INTERNAL_CUDA_USE_RELOC := $(call kokkos_has_string,$(KOKKOS_CUDA_OPTIONS),rdc) @@ -96,6 +97,7 @@ KOKKOS_INTERNAL_HPX_ENABLE_ASYNC_DISPATCH := $(call kokkos_has_string,$(KOKKOS_H # deprecated KOKKOS_INTERNAL_ENABLE_DESUL_ATOMICS := $(call kokkos_has_string,$(KOKKOS_OPTIONS),enable_desul_atomics) KOKKOS_INTERNAL_DISABLE_DESUL_ATOMICS := $(call kokkos_has_string,$(KOKKOS_OPTIONS),disable_desul_atomics) +KOKKOS_INTERNAL_DISABLE_BUNDLED_MDSPAN := $(call kokkos_has_string,$(KOKKOS_OPTIONS),impl_disable_bundled_mdspan) KOKKOS_INTERNAL_DISABLE_DEPRECATED_CODE := $(call kokkos_has_string,$(KOKKOS_OPTIONS),disable_deprecated_code) KOKKOS_INTERNAL_ENABLE_DEPRECATION_WARNINGS := $(call kokkos_has_string,$(KOKKOS_OPTIONS),enable_deprecation_warnings) @@ -104,14 +106,8 @@ KOKKOS_INTERNAL_HIP_USE_RELOC := $(call kokkos_has_string,$(KOKKOS_HIP_OPTIONS), # Check for Kokkos Host Execution Spaces one of which must be on. KOKKOS_INTERNAL_USE_OPENMP := $(call kokkos_has_string,$(subst OpenMPTarget,,$(KOKKOS_DEVICES)),OpenMP) KOKKOS_INTERNAL_USE_THREADS := $(call kokkos_has_string,$(KOKKOS_DEVICES),Threads) -# deprecated -KOKKOS_INTERNAL_USE_PTHREAD := $(call kokkos_has_string,$(KOKKOS_DEVICES),Pthread) KOKKOS_INTERNAL_USE_HPX := $(call kokkos_has_string,$(KOKKOS_DEVICES),HPX) KOKKOS_INTERNAL_USE_SERIAL := $(call kokkos_has_string,$(KOKKOS_DEVICES),Serial) -ifeq ($(KOKKOS_INTERNAL_USE_PTHREAD), 1) - KOKKOS_INTERNAL_USE_THREADS := 1 - $(warning Warning: Pthread is deprecated. Use Threads instead! KOKKOS_DEVICES=$(KOKKOS_DEVICES)) -endif ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 0) ifeq ($(KOKKOS_INTERNAL_USE_THREADS), 0) @@ -126,6 +122,7 @@ KOKKOS_INTERNAL_USE_CUDA := $(call kokkos_has_string,$(KOKKOS_DEVICES),Cuda) KOKKOS_INTERNAL_USE_HIP := $(call kokkos_has_string,$(KOKKOS_DEVICES),HIP) KOKKOS_INTERNAL_USE_SYCL := $(call kokkos_has_string,$(KOKKOS_DEVICES),SYCL) KOKKOS_INTERNAL_USE_OPENMPTARGET := $(call kokkos_has_string,$(KOKKOS_DEVICES),OpenMPTarget) +KOKKOS_INTERNAL_USE_OPENACC := $(call kokkos_has_string,$(KOKKOS_DEVICES),OpenACC) KOKKOS_DEVICELIST = ifeq ($(KOKKOS_INTERNAL_USE_SERIAL), 1) @@ -146,21 +143,14 @@ endif ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) KOKKOS_DEVICELIST += HIP endif -KOKKOS_INTERNAL_HAVE_CXX17_OR_NEWER := $(shell expr $(KOKKOS_INTERNAL_ENABLE_CXX17) \ - + $(KOKKOS_INTERNAL_ENABLE_CXX20) \ - + $(KOKKOS_INTERNAL_ENABLE_CXX2A)) ifeq ($(KOKKOS_INTERNAL_USE_SYCL), 1) KOKKOS_DEVICELIST += SYCL - ifneq ($(KOKKOS_INTERNAL_HAVE_CXX17_OR_NEWER), 1) - $(error SYCL backend requires C++17 or newer) - endif - endif ifeq ($(KOKKOS_INTERNAL_USE_OPENMPTARGET), 1) KOKKOS_DEVICELIST += OPENMPTARGET - ifneq ($(KOKKOS_INTERNAL_HAVE_CXX17_OR_NEWER), 1) - $(error OpenMPTarget backend requires C++17 or newer) - endif +endif +ifeq ($(KOKKOS_INTERNAL_USE_OPENACC), 1) + KOKKOS_DEVICELIST += OpenACC endif ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) @@ -183,10 +173,9 @@ KOKKOS_INTERNAL_OS_DARWIN := $(call kokkos_has_string,$(KOKKOS_OS),Darwin) # Check compiler. KOKKOS_CXX_VERSION := $(strip $(shell $(CXX) --version 2>&1)) KOKKOS_INTERNAL_COMPILER_INTEL := $(call kokkos_has_string,$(KOKKOS_CXX_VERSION),Intel Corporation) -KOKKOS_INTERNAL_COMPILER_PGI := $(call kokkos_has_string,$(KOKKOS_CXX_VERSION),PGI) -KOKKOS_INTERNAL_COMPILER_XL := $(strip $(shell $(CXX) -qversion 2>&1 | grep -c XL)) KOKKOS_INTERNAL_COMPILER_CRAY := $(strip $(shell $(CXX) -craype-verbose 2>&1 | grep -c "CC-")) KOKKOS_INTERNAL_COMPILER_NVCC := $(strip $(shell echo "$(shell export OMPI_CXX=$(OMPI_CXX); export MPICH_CXX=$(MPICH_CXX); $(CXX) --version 2>&1 | grep -c nvcc)>0" | bc)) +KOKKOS_INTERNAL_COMPILER_NVHPC := $(strip $(shell $(CXX) --version 2>&1 | grep -c "nvc++")) KOKKOS_INTERNAL_COMPILER_CLANG := $(call kokkos_has_string,$(KOKKOS_CXX_VERSION),clang) KOKKOS_INTERNAL_COMPILER_CRAY_CLANG := $(strip $(shell $(CXX) -craype-verbose 2>&1 | grep -c "clang++")) KOKKOS_INTERNAL_COMPILER_INTEL_CLANG := $(call kokkos_has_string,$(KOKKOS_CXX_VERSION),oneAPI) @@ -202,7 +191,6 @@ ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC_WRAPPER), 1) KOKKOS_CXX_HOST_VERSION := $(strip $(shell $(CXX) $(CXXFLAGS) --host-version 2>&1)) - KOKKOS_INTERNAL_COMPILER_PGI := $(call kokkos_has_string,$(KOKKOS_CXX_HOST_VERSION),PGI) KOKKOS_INTERNAL_COMPILER_INTEL := $(call kokkos_has_string,$(KOKKOS_CXX_HOST_VERSION),Intel Corporation) KOKKOS_INTERNAL_COMPILER_CLANG := $(call kokkos_has_string,$(KOKKOS_CXX_HOST_VERSION),clang) endif @@ -211,9 +199,6 @@ endif ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 2) KOKKOS_INTERNAL_COMPILER_CLANG = 1 endif -ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 2) - KOKKOS_INTERNAL_COMPILER_XL = 1 -endif # Apple Clang passes both clang and apple clang tests, so turn off clang. ifeq ($(KOKKOS_INTERNAL_COMPILER_APPLE_CLANG), 1) @@ -253,113 +238,78 @@ endif # Set compiler warnings flags. ifeq ($(KOKKOS_INTERNAL_ENABLE_COMPILER_WARNINGS), 1) - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - # TODO check if PGI accepts GNU style warnings + ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) + KOKKOS_INTERNAL_COMPILER_WARNINGS = -Wall -Wunused-parameter -Wshadow -pedantic -Wsign-compare -Wtype-limits -Wuninitialized + else ifeq ($(KOKKOS_INTERNAL_COMPILER_APPLE_CLANG), 1) + KOKKOS_INTERNAL_COMPILER_WARNINGS = -Wall -Wunused-parameter -Wshadow -pedantic -Wsign-compare -Wtype-limits -Wuninitialized + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) + # TODO check if cray accepts GNU style warnings KOKKOS_INTERNAL_COMPILER_WARNINGS = else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - KOKKOS_INTERNAL_COMPILER_WARNINGS = -Wall -Wunused-parameter -Wshadow -pedantic -Wsign-compare -Wtype-limits -Wuninitialized - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_APPLE_CLANG), 1) - KOKKOS_INTERNAL_COMPILER_WARNINGS = -Wall -Wunused-parameter -Wshadow -pedantic -Wsign-compare -Wtype-limits -Wuninitialized - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1) - KOKKOS_INTERNAL_COMPILER_WARNINGS = -Wall -Wunused-parameter -Wshadow -pedantic -Wsign-compare -Wtype-limits -Wuninitialized - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) - # TODO check if cray accepts GNU style warnings - KOKKOS_INTERNAL_COMPILER_WARNINGS = - else - #gcc - KOKKOS_INTERNAL_COMPILER_WARNINGS = -Wall -Wunused-parameter -Wshadow -pedantic -Wsign-compare -Wtype-limits -Wignored-qualifiers -Wempty-body -Wclobbered -Wuninitialized - endif - endif - endif - endif + #gcc + KOKKOS_INTERNAL_COMPILER_WARNINGS = -Wall -Wunused-parameter -Wshadow -pedantic -Wsign-compare -Wtype-limits -Wignored-qualifiers -Wempty-body -Wclobbered -Wuninitialized endif else KOKKOS_INTERNAL_COMPILER_WARNINGS = endif # Set OpenMP flags. -ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - KOKKOS_INTERNAL_OPENMP_FLAG := -mp -else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY_CLANG), 1) +ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) + ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY_CLANG), 1) + KOKKOS_INTERNAL_OPENMP_FLAG := -fopenmp + else ifeq ($(KOKKOS_INTERNAL_COMPILER_FUJITSU), 1) + # fujitsu (clang mode) fails with `=libomp` KOKKOS_INTERNAL_OPENMP_FLAG := -fopenmp - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_FUJITSU), 1) - # fujitsu (clang mode) fails with `=libomp` - KOKKOS_INTERNAL_OPENMP_FLAG := -fopenmp - else - KOKKOS_INTERNAL_OPENMP_FLAG := -fopenmp=libomp - endif - endif else - ifeq ($(KOKKOS_INTERNAL_COMPILER_APPLE_CLANG), 1) - KOKKOS_INTERNAL_OPENMP_FLAG := -fopenmp=libomp - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1) - KOKKOS_INTERNAL_OPENMP_FLAG := -qsmp=omp - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) - # OpenMP is turned on by default in Cray compiler environment. - KOKKOS_INTERNAL_OPENMP_FLAG := - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL_CLANG), 1) - KOKKOS_INTERNAL_OPENMP_FLAG := -fiopenmp - else - KOKKOS_INTERNAL_OPENMP_FLAG := -fopenmp - endif - endif - endif - endif + KOKKOS_INTERNAL_OPENMP_FLAG := -fopenmp=libomp + endif +else + ifeq ($(KOKKOS_INTERNAL_COMPILER_APPLE_CLANG), 1) + KOKKOS_INTERNAL_OPENMP_FLAG := -fopenmp=libomp + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) + # OpenMP is turned on by default in Cray compiler environment. + KOKKOS_INTERNAL_OPENMP_FLAG := + else ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL_CLANG), 1) + KOKKOS_INTERNAL_OPENMP_FLAG := -fiopenmp + else + KOKKOS_INTERNAL_OPENMP_FLAG := -fopenmp endif endif -ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1) - KOKKOS_INTERNAL_OPENMPTARGET_FLAG := -DKOKKOS_IBM_XL_OMP45_WORKAROUND -qsmp=omp -qoffload -qnoeh +ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) + #KOKKOS_INTERNAL_OPENMPTARGET_FLAG := -DKOKKOS_BUG_WORKAROUND_IBM_CLANG_OMP45_VIEW_INIT -fopenmp-implicit-declare-target -fopenmp-targets=nvptx64-nvidia-cuda -fopenmp -fopenmp=libomp + KOKKOS_INTERNAL_OPENMPTARGET_FLAG := -DKOKKOS_WORKAROUND_OPENMPTARGET_CLANG -fopenmp -fopenmp=libomp -Wno-openmp-mapping + KOKKOS_INTERNAL_OPENMPTARGET_LIB := -lomptarget +else ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL_CLANG), 1) + KOKKOS_INTERNAL_OPENMPTARGET_FLAG := -fiopenmp -Wno-openmp-mapping else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - #KOKKOS_INTERNAL_OPENMPTARGET_FLAG := -DKOKKOS_BUG_WORKAROUND_IBM_CLANG_OMP45_VIEW_INIT -fopenmp-implicit-declare-target -fopenmp-targets=nvptx64-nvidia-cuda -fopenmp -fopenmp=libomp - KOKKOS_INTERNAL_OPENMPTARGET_FLAG := -DKOKKOS_WORKAROUND_OPENMPTARGET_CLANG -fopenmp -fopenmp=libomp -Wno-openmp-mapping - KOKKOS_INTERNAL_OPENMPTARGET_LIB := -lomptarget + #Assume GCC + KOKKOS_INTERNAL_OPENMPTARGET_FLAG := -fopenmp -foffload=nvptx-none +endif + +ifeq ($(KOKKOS_INTERNAL_USE_OPENACC), 1) + # Set OpenACC flags. + ifeq ($(KOKKOS_INTERNAL_COMPILER_NVHPC), 1) + KOKKOS_INTERNAL_OPENACC_FLAG := -acc else - ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL_CLANG), 1) - KOKKOS_INTERNAL_OPENMPTARGET_FLAG := -fiopenmp -Wno-openmp-mapping - else - #Assume GCC - KOKKOS_INTERNAL_OPENMPTARGET_FLAG := -fopenmp -foffload=nvptx-none - endif + $(error Makefile.kokkos: OpenACC is enabled but the compiler must be NVHPC (got version string $(KOKKOS_CXX_VERSION))) endif endif # Set C++ version flags. -ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - KOKKOS_INTERNAL_CXX14_FLAG := --c++14 - KOKKOS_INTERNAL_CXX17_FLAG := --c++17 +ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) + KOKKOS_INTERNAL_CXX17_FLAG := -hstd=c++17 + KOKKOS_INTERNAL_CXX1Z_FLAG := -hstd=c++1z + KOKKOS_INTERNAL_CXX20_FLAG := -hstd=c++20 + KOKKOS_INTERNAL_CXX2A_FLAG := -hstd=c++2a + KOKKOS_INTERNAL_CXX23_FLAG := -hstd=c++23 + KOKKOS_INTERNAL_CXX2A_FLAG := -hstd=c++2b else - ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1) - KOKKOS_INTERNAL_CXX14_FLAG := -std=c++14 - KOKKOS_INTERNAL_CXX1Y_FLAG := -std=c++1y - #KOKKOS_INTERNAL_CXX17_FLAG := -std=c++17 - #KOKKOS_INTERNAL_CXX1Z_FLAG := -std=c++1Z - #KOKKOS_INTERNAL_CXX2A_FLAG := -std=c++2a - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) - KOKKOS_INTERNAL_CXX14_FLAG := -hstd=c++14 - #KOKKOS_INTERNAL_CXX1Y_FLAG := -hstd=c++1y - #KOKKOS_INTERNAL_CXX17_FLAG := -hstd=c++17 - #KOKKOS_INTERNAL_CXX1Z_FLAG := -hstd=c++1z - #KOKKOS_INTERNAL_CXX2A_FLAG := -hstd=c++2a - else - KOKKOS_INTERNAL_CXX14_FLAG := -std=c++14 - KOKKOS_INTERNAL_CXX1Y_FLAG := -std=c++1y - KOKKOS_INTERNAL_CXX17_FLAG := -std=c++17 - KOKKOS_INTERNAL_CXX1Z_FLAG := -std=c++1z - KOKKOS_INTERNAL_CXX2A_FLAG := -std=c++2a - endif - endif + KOKKOS_INTERNAL_CXX17_FLAG := -std=c++17 + KOKKOS_INTERNAL_CXX1Z_FLAG := -std=c++1z + KOKKOS_INTERNAL_CXX20_FLAG := -std=c++20 + KOKKOS_INTERNAL_CXX2A_FLAG := -std=c++2a + KOKKOS_INTERNAL_CXX23_FLAG := -std=c++23 + KOKKOS_INTERNAL_CXX2B_FLAG := -std=c++2b endif # Check for Kokkos Architecture settings. @@ -461,10 +411,10 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ZEN3), 0) KOKKOS_INTERNAL_USE_ARCH_ZEN := $(call kokkos_has_string,$(KOKKOS_ARCH),Zen) endif endif -KOKKOS_INTERNAL_USE_ARCH_VEGA900 := $(call kokkos_has_string,$(KOKKOS_ARCH),Vega900) KOKKOS_INTERNAL_USE_ARCH_VEGA906 := $(call kokkos_has_string,$(KOKKOS_ARCH),Vega906) KOKKOS_INTERNAL_USE_ARCH_VEGA908 := $(call kokkos_has_string,$(KOKKOS_ARCH),Vega908) KOKKOS_INTERNAL_USE_ARCH_VEGA90A := $(call kokkos_has_string,$(KOKKOS_ARCH),Vega90A) +KOKKOS_INTERNAL_USE_ARCH_NAVI1030 := $(call kokkos_has_string,$(KOKKOS_ARCH),Navi1030) # Any AVX? KOKKOS_INTERNAL_USE_ARCH_SSE42 := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_WSM)) @@ -532,13 +482,15 @@ tmp := $(call kokkos_append_header,'$H''endif') tmp := $(call kokkos_append_header,"") tmp := $(call kokkos_append_header,"$H""define KOKKOS_VERSION $(KOKKOS_VERSION)") +tmp := $(call kokkos_append_header,"$H""define KOKKOS_VERSION_MAJOR $(KOKKOS_VERSION_MAJOR)") +tmp := $(call kokkos_append_header,"$H""define KOKKOS_VERSION_MINOR $(KOKKOS_VERSION_MINOR)") +tmp := $(call kokkos_append_header,"$H""define KOKKOS_VERSION_PATCH $(KOKKOS_VERSION_PATCH)") tmp := $(call kokkos_append_header,"") tmp := $(call kokkos_append_header,"/* Execution Spaces */") ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA") - tmp := $(call kokkos_append_header,"$H""define KOKKOS_COMPILER_CUDA_VERSION $(KOKKOS_INTERNAL_COMPILER_NVCC_VERSION)") endif ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) @@ -557,6 +509,10 @@ ifeq ($(KOKKOS_INTERNAL_USE_OPENMPTARGET), 1) endif endif +ifeq ($(KOKKOS_INTERNAL_USE_OPENACC), 1) + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_OPENACC") +endif + ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1) tmp := $(call kokkos_append_header,'$H''define KOKKOS_ENABLE_OPENMP') endif @@ -576,22 +532,11 @@ endif #only add the c++ standard flags if this is not CMake tmp := $(call kokkos_append_header,"/* General Settings */") ifneq ($(KOKKOS_INTERNAL_DISABLE_DEPRECATED_CODE), 1) - tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_DEPRECATED_CODE_3") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_DEPRECATED_CODE_4") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_DEPRECATION_WARNINGS), 1) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_DEPRECATION_WARNINGS") endif -ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX14), 1) -ifneq ($(KOKKOS_STANDALONE_CMAKE), yes) - KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX14_FLAG) -endif - tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX14") -endif -ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX1Y), 1) - #I cannot make CMake add this in a good way - so add it here - KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX1Y_FLAG) - tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX14") -endif ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX17), 1) ifneq ($(KOKKOS_STANDALONE_CMAKE), yes) KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX17_FLAG) @@ -603,15 +548,25 @@ ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX1Z), 1) KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX1Z_FLAG) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX17") endif +ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX20), 1) + #I cannot make CMake add this in a good way - so add it here + KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX20_FLAG) + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX20") +endif ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX2A), 1) #I cannot make CMake add this in a good way - so add it here KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX2A_FLAG) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX20") endif -ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX20), 1) +ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX23), 1) #I cannot make CMake add this in a good way - so add it here - KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX20_FLAG) - tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX20") + KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX23_FLAG) + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX23") +endif +ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX2B), 1) + #I cannot make CMake add this in a good way - so add it here + KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX2B_FLAG) + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX23") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_DEBUG), 1) @@ -692,15 +647,15 @@ endif tmp := $(call kokkos_append_header,"/* Cuda Settings */") ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) + #deprecated ifeq ($(KOKKOS_INTERNAL_CUDA_USE_LDG), 1) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC") - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC") - endif + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC") endif ifeq ($(KOKKOS_INTERNAL_CUDA_USE_UVM), 1) + # deprecated tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_UVM") endif @@ -725,12 +680,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) ifeq ($(KOKKOS_INTERNAL_CUDA_USE_LAMBDA), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC), 1) - ifeq ($(shell test $(KOKKOS_INTERNAL_COMPILER_NVCC_VERSION) -gt 70; echo $$?),0) - tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_LAMBDA") - KOKKOS_CXXFLAGS += -expt-extended-lambda - else - $(warning Warning: Cuda Lambda support was requested but NVCC version is too low. This requires NVCC for Cuda version 7.5 or higher. Disabling Lambda support now.) - endif + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_LAMBDA") + KOKKOS_CXXFLAGS += -expt-extended-lambda endif ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) @@ -740,12 +691,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) ifeq ($(KOKKOS_INTERNAL_CUDA_USE_CONSTEXPR), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC), 1) - ifeq ($(shell test $(KOKKOS_INTERNAL_COMPILER_NVCC_VERSION) -ge 80; echo $$?),0) - tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_CONSTEXPR") - KOKKOS_CXXFLAGS += -expt-relaxed-constexpr - else - $(warning Warning: Cuda relaxed constexpr support was requested but NVCC version is too low. This requires NVCC for Cuda version 8.0 or higher. Disabling relaxed constexpr support now.) - endif + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_CONSTEXPR") + KOKKOS_CXXFLAGS += -expt-relaxed-constexpr endif ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) @@ -773,13 +720,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV80), 1) KOKKOS_CXXFLAGS += KOKKOS_LDFLAGS += else - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - KOKKOS_CXXFLAGS += - KOKKOS_LDFLAGS += - else - KOKKOS_CXXFLAGS += -march=armv8-a - KOKKOS_LDFLAGS += -march=armv8-a - endif + KOKKOS_CXXFLAGS += -march=armv8-a + KOKKOS_LDFLAGS += -march=armv8-a endif endif @@ -790,13 +732,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV81), 1) KOKKOS_CXXFLAGS += KOKKOS_LDFLAGS += else - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - KOKKOS_CXXFLAGS += - KOKKOS_LDFLAGS += - else - KOKKOS_CXXFLAGS += -march=armv8.1-a - KOKKOS_LDFLAGS += -march=armv8.1-a - endif + KOKKOS_CXXFLAGS += -march=armv8.1-a + KOKKOS_LDFLAGS += -march=armv8.1-a endif endif @@ -862,13 +799,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX), 1) KOKKOS_CXXFLAGS += KOKKOS_LDFLAGS += else - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - KOKKOS_CXXFLAGS += - KOKKOS_LDFLAGS += - else - KOKKOS_CXXFLAGS += -march=armv8-a -mtune=thunderx - KOKKOS_LDFLAGS += -march=armv8-a -mtune=thunderx - endif + KOKKOS_CXXFLAGS += -march=armv8-a -mtune=thunderx + KOKKOS_LDFLAGS += -march=armv8-a -mtune=thunderx endif endif @@ -880,13 +812,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2), 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 + KOKKOS_CXXFLAGS += -mtune=thunderx2t99 -mcpu=thunderx2t99 + KOKKOS_LDFLAGS += -mtune=thunderx2t99 -mcpu=thunderx2t99 endif endif @@ -896,19 +823,11 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_SSE42), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xSSE4.2 KOKKOS_LDFLAGS += -xSSE4.2 + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) - - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - KOKKOS_CXXFLAGS += -tp=nehalem - KOKKOS_LDFLAGS += -tp=nehalem - else - # Assume that this is a really a GNU compiler. - KOKKOS_CXXFLAGS += -msse4.2 - KOKKOS_LDFLAGS += -msse4.2 - endif - endif + # Assume that this is a really a GNU compiler. + KOKKOS_CXXFLAGS += -msse4.2 + KOKKOS_LDFLAGS += -msse4.2 endif endif @@ -918,54 +837,34 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -mavx KOKKOS_LDFLAGS += -mavx + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) - - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - KOKKOS_CXXFLAGS += -tp=sandybridge - KOKKOS_LDFLAGS += -tp=sandybridge - else - # Assume that this is a really a GNU compiler. - KOKKOS_CXXFLAGS += -mavx - KOKKOS_LDFLAGS += -mavx - endif - endif + # Assume that this is a really a GNU compiler. + KOKKOS_CXXFLAGS += -mavx + KOKKOS_LDFLAGS += -mavx endif endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER7), 1) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_POWER7") - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - - else - # Assume that this is a really a GNU compiler or it could be XL on P8. - KOKKOS_CXXFLAGS += -mcpu=power7 -mtune=power7 - KOKKOS_LDFLAGS += -mcpu=power7 -mtune=power7 - endif + # Assume that this is a really a GNU compiler. + KOKKOS_CXXFLAGS += -mcpu=power7 -mtune=power7 + KOKKOS_LDFLAGS += -mcpu=power7 -mtune=power7 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER8), 1) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_POWER8") - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - - else - KOKKOS_CXXFLAGS += -mcpu=power8 -mtune=power8 - KOKKOS_LDFLAGS += -mcpu=power8 -mtune=power8 - endif + KOKKOS_CXXFLAGS += -mcpu=power8 -mtune=power8 + KOKKOS_LDFLAGS += -mcpu=power8 -mtune=power8 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER9), 1) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_POWER9") - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - - else - KOKKOS_CXXFLAGS += -mcpu=power9 -mtune=power9 - KOKKOS_LDFLAGS += -mcpu=power9 -mtune=power9 - endif + KOKKOS_CXXFLAGS += -mcpu=power9 -mtune=power9 + KOKKOS_LDFLAGS += -mcpu=power9 -mtune=power9 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_HSW), 1) @@ -974,19 +873,11 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_HSW), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xCORE-AVX2 KOKKOS_LDFLAGS += -xCORE-AVX2 + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) - - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - KOKKOS_CXXFLAGS += -tp=haswell - KOKKOS_LDFLAGS += -tp=haswell - else - # Assume that this is a really a GNU compiler. - KOKKOS_CXXFLAGS += -march=core-avx2 -mtune=core-avx2 - KOKKOS_LDFLAGS += -march=core-avx2 -mtune=core-avx2 - endif - endif + # Assume that this is a really a GNU compiler. + KOKKOS_CXXFLAGS += -march=core-avx2 -mtune=core-avx2 + KOKKOS_LDFLAGS += -march=core-avx2 -mtune=core-avx2 endif endif @@ -996,19 +887,11 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_BDW), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xCORE-AVX2 KOKKOS_LDFLAGS += -xCORE-AVX2 + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) - - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - KOKKOS_CXXFLAGS += -tp=haswell - KOKKOS_LDFLAGS += -tp=haswell - else - # Assume that this is a really a GNU compiler. - KOKKOS_CXXFLAGS += -march=core-avx2 -mtune=core-avx2 -mrtm - KOKKOS_LDFLAGS += -march=core-avx2 -mtune=core-avx2 -mrtm - endif - endif + # Assume that this is a really a GNU compiler. + KOKKOS_CXXFLAGS += -march=core-avx2 -mtune=core-avx2 -mrtm + KOKKOS_LDFLAGS += -march=core-avx2 -mtune=core-avx2 -mrtm endif endif @@ -1018,18 +901,11 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX512MIC), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xMIC-AVX512 KOKKOS_LDFLAGS += -xMIC-AVX512 + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) - - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - - else - # Asssume that this is really a GNU compiler. - KOKKOS_CXXFLAGS += -march=knl -mtune=knl - KOKKOS_LDFLAGS += -march=knl -mtune=knl - endif - endif + # Asssume that this is really a GNU compiler. + KOKKOS_CXXFLAGS += -march=knl -mtune=knl + KOKKOS_LDFLAGS += -march=knl -mtune=knl endif endif @@ -1039,18 +915,11 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_SKL), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xSKYLAKE KOKKOS_LDFLAGS += -xSKYLAKE + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) - - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - - else - # Nothing here yet. - KOKKOS_CXXFLAGS += -march=skylake - KOKKOS_LDFLAGS += -march=skylake - endif - endif + # Nothing here yet. + KOKKOS_CXXFLAGS += -march=skylake + KOKKOS_LDFLAGS += -march=skylake endif endif @@ -1060,18 +929,11 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_SKX), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xCORE-AVX512 KOKKOS_LDFLAGS += -xCORE-AVX512 + else ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) else - ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) - - else - ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) - - else - # Nothing here yet. - KOKKOS_CXXFLAGS += -march=skylake-avx512 -mtune=skylake-avx512 - KOKKOS_LDFLAGS += -march=skylake-avx512 -mtune=skylake-avx512 - endif - endif + # Nothing here yet. + KOKKOS_CXXFLAGS += -march=skylake-avx512 -mtune=skylake-avx512 + KOKKOS_LDFLAGS += -march=skylake-avx512 -mtune=skylake-avx512 endif endif @@ -1221,20 +1083,12 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA_ARCH), 1) endif endif endif - ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) - KOKKOS_CXXFLAGS += --expt-extended-lambda - endif endif # Figure out the architecture flag for ROCm. ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) # Lets start with adding architecture defines - ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VEGA900), 1) - tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA900") - tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA") - KOKKOS_INTERNAL_HIP_ARCH_FLAG := --offload-arch=gfx900 - endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VEGA906), 1) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA906") tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA") @@ -1250,6 +1104,11 @@ ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA") KOKKOS_INTERNAL_HIP_ARCH_FLAG := --offload-arch=gfx90a endif + ifeq ($(KOKKOS_INTERNAL_USE_ARCH_NAVI1030), 1) + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_NAVI1030") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_NAVI") + KOKKOS_INTERNAL_HIP_ARCH_FLAG := --offload-arch=gfx1030 + endif KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/HIP/*.cpp) @@ -1306,12 +1165,12 @@ endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_INTEL_XEHP), 1) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_INTEL_GPU") tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_INTEL_XEHP") - KOKKOS_INTERNAL_INTEL_ARCH_FLAG := -f${KOKKOS_INTERNAL_LC_BACKEND}-targets=spir64_gen -X${KOKKOS_INTERNAL_LC_BACKEND}-target-backend "-device xehp" + KOKKOS_INTERNAL_INTEL_ARCH_FLAG := -f${KOKKOS_INTERNAL_LC_BACKEND}-targets=spir64_gen -X${KOKKOS_INTERNAL_LC_BACKEND}-target-backend "-device 12.50.4" endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_INTEL_PVC), 1) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_INTEL_GPU") tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_INTEL_PVC") - KOKKOS_INTERNAL_INTEL_ARCH_FLAG := -f${KOKKOS_INTERNAL_LC_BACKEND}-targets=spir64_gen -X${KOKKOS_INTERNAL_LC_BACKEND}-target-backend "-device 12.4.0" + KOKKOS_INTERNAL_INTEL_ARCH_FLAG := -f${KOKKOS_INTERNAL_LC_BACKEND}-targets=spir64_gen -X${KOKKOS_INTERNAL_LC_BACKEND}-target-backend "-device 12.60.7" endif ifeq ($(KOKKOS_INTERNAL_USE_SYCL), 1) @@ -1332,12 +1191,15 @@ endif ifeq ($(KOKKOS_INTERNAL_DISABLE_DESUL_ATOMICS), 0) tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_IMPL_DESUL_ATOMICS") KOKKOS_CPPFLAGS+=-I$(KOKKOS_PATH)/tpls/desul/include -else - ifeq ($(KOKKOS_INTERNAL_ENABLE_DESUL_ATOMICS), 1) - $(error Contradictory Desul atomics options: KOKKOS_OPTIONS=$(KOKKOS_OPTIONS) ) - endif +else ifeq ($(KOKKOS_INTERNAL_ENABLE_DESUL_ATOMICS), 1) + $(error Contradictory Desul atomics options: KOKKOS_OPTIONS=$(KOKKOS_OPTIONS) ) endif +ifeq ($(KOKKOS_INTERNAL_DISABLE_BUNDLED_MDSPAN), 0) + KOKKOS_CPPFLAGS+=-I$(KOKKOS_PATH)/tpls/mdspan/include +endif +tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_IMPL_MDSPAN") + KOKKOS_INTERNAL_LS_CONFIG := $(shell ls KokkosCore_config.h 2>&1) ifeq ($(KOKKOS_INTERNAL_LS_CONFIG), KokkosCore_config.h) @@ -1365,9 +1227,6 @@ ifneq ($(KOKKOS_INTERNAL_NEW_CONFIG), 0) tmp := $(call kokkos_append_config_header,"$H""include ","KokkosCore_Config_FwdBackend.hpp") tmp := $(call kokkos_append_config_header,"$H""include ","KokkosCore_Config_DeclareBackend.hpp") tmp := $(call kokkos_append_config_header,"$H""include ","KokkosCore_Config_SetupBackend.hpp") - ifeq ($(KOKKOS_INTERNAL_CUDA_USE_UVM), 1) - else - endif endif ifeq ($(KOKKOS_INTERNAL_USE_OPENMPTARGET), 1) tmp := $(call kokkos_append_config_header,"$H""include ","KokkosCore_Config_FwdBackend.hpp") @@ -1386,6 +1245,10 @@ ifneq ($(KOKKOS_INTERNAL_NEW_CONFIG), 0) tmp := $(call kokkos_append_config_header,"$H""include ","KokkosCore_Config_FwdBackend.hpp") tmp := $(call kokkos_append_config_header,"$H""include ","KokkosCore_Config_DeclareBackend.hpp") endif + ifeq ($(KOKKOS_INTERNAL_USE_OPENACC), 1) + tmp := $(call kokkos_append_config_header,"\#include ","KokkosCore_Config_FwdBackend.hpp") + tmp := $(call kokkos_append_config_header,"\#include ","KokkosCore_Config_DeclareBackend.hpp") + endif ifeq ($(KOKKOS_INTERNAL_USE_THREADS), 1) tmp := $(call kokkos_append_config_header,"$H""include ","KokkosCore_Config_FwdBackend.hpp") tmp := $(call kokkos_append_config_header,"$H""include ","KokkosCore_Config_DeclareBackend.hpp") @@ -1453,6 +1316,14 @@ ifeq ($(KOKKOS_INTERNAL_USE_OPENMPTARGET), 1) KOKKOS_LIBS += $(KOKKOS_INTERNAL_OPENMPTARGET_LIB) endif +ifeq ($(KOKKOS_INTERNAL_USE_OPENACC), 1) + KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/OpenACC/*.cpp) + KOKKOS_HEADERS += $(wildcard $(KOKKOS_PATH)/core/src/OpenACC/*.hpp) + KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_OPENACC_FLAG) + KOKKOS_LDFLAGS += $(KOKKOS_INTERNAL_OPENACC_FLAG) + KOKKOS_LIBS += $(KOKKOS_INTERNAL_OPENACC_LIB) +endif + ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1) KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/OpenMP/*.cpp) KOKKOS_HEADERS += $(wildcard $(KOKKOS_PATH)/core/src/OpenMP/*.hpp) @@ -1523,11 +1394,64 @@ endif KOKKOS_EXTRA_LIBS := ${KOKKOS_LIBS} KOKKOS_LIBS := -lkokkos ${KOKKOS_LIBS} +# Generating the header +DESUL_INTERNAL_CONFIG_TMP=Desul_Config.tmp +ifeq ($(KOKKOS_INTERNAL_DISABLE_DESUL_ATOMICS), 0) + DESUL_CONFIG_HEADER=desul/atomics/Config.hpp +else + DESUL_CONFIG_HEADER=NothingToSeeHereMoveAlong +endif +desul_append_header = $(shell echo $1 >> $(DESUL_INTERNAL_CONFIG_TMP)) +tmp := $(call desul_append_header, "// generated by on-demand build system by crtrott" > $(DESUL_INTERNAL_CONFIG_TMP)) +tmp := $(call desul_append_header, "$H""ifndef DESUL_ATOMICS_CONFIG_HPP_") +tmp := $(call desul_append_header, "$H""define DESUL_ATOMICS_CONFIG_HPP_") +tmp := $(call desul_append_header, "") +ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) + tmp := $(call desul_append_header,"$H""define DESUL_ATOMICS_ENABLE_CUDA") +else + tmp := $(call desul_append_header,"/* $H""undef DESUL_ATOMICS_ENABLE_CUDA */") +endif + +ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) + tmp := $(call desul_append_header,"$H""define DESUL_ATOMICS_ENABLE_HIP") +else + tmp := $(call desul_append_header,"/* $H""undef DESUL_ATOMICS_ENABLE_HIP */") +endif + +ifeq ($(KOKKOS_INTERNAL_USE_SYCL), 1) + tmp := $(call desul_append_header,"$H""define DESUL_ATOMICS_ENABLE_SYCL") +else + tmp := $(call desul_append_header,"/* $H""undef DESUL_ATOMICS_ENABLE_SYCL */") +endif + +ifeq ($(KOKKOS_INTERNAL_USE_OPENMPTARGET), 1) + tmp := $(call desul_append_header,"$H""define DESUL_ATOMICS_ENABLE_OPENMP") +else + tmp := $(call desul_append_header,"/* $H""undef DESUL_ATOMICS_ENABLE_OPENMP */") +endif +tmp := $(call desul_append_header, "") +tmp := $(call desul_append_header, "$H""endif") + +DESUL_INTERNAL_LS_CONFIG := $(shell ls $(DESUL_CONFIG_HEADER) 2>&1) + +ifeq ($(DESUL_INTERNAL_LS_CONFIG), $(DESUL_CONFIG_HEADER)) + KOKKOS_INTERNAL_NEW_CONFIG := $(strip $(shell diff $(DESUL_CONFIG_HEADER) $(DESUL_INTERNAL_CONFIG_TMP) | grep -c define)) +else + DESUL_INTERNAL_NEW_CONFIG := 1 +endif + +ifneq ($(DESUL_INTERNAL_NEW_CONFIG), 0) + tmp := $(shell mkdir -p desul/atomics) + tmp := $(shell cp $(DESUL_INTERNAL_CONFIG_TMP) $(DESUL_CONFIG_HEADER)) +endif + # Setting up dependencies. KokkosCore_config.h: -KOKKOS_CPP_DEPENDS := KokkosCore_config.h $(KOKKOS_HEADERS) +$(DESUL_CONFIG_HEADER): + +KOKKOS_CPP_DEPENDS := $(DESUL_CONFIG_HEADER) KokkosCore_config.h $(KOKKOS_HEADERS) KOKKOS_OBJ = $(KOKKOS_SRC:.cpp=.o) KOKKOS_OBJ_LINK = $(notdir $(KOKKOS_OBJ)) @@ -1535,7 +1459,7 @@ KOKKOS_OBJ_LINK = $(notdir $(KOKKOS_OBJ)) include $(KOKKOS_PATH)/Makefile.targets kokkos-clean: - rm -f $(KOKKOS_OBJ_LINK) KokkosCore_config.h KokkosCore_config.tmp libkokkos.a KokkosCore_Config_SetupBackend.hpp \ + rm -f $(KOKKOS_OBJ_LINK) $(DESUL_CONFIG_HEADER) $(DESUL_INTERNAL_CONFIG_TMP) KokkosCore_config.h KokkosCore_config.tmp libkokkos.a KokkosCore_Config_SetupBackend.hpp \ KokkosCore_Config_FwdBackend.hpp KokkosCore_Config_DeclareBackend.hpp KokkosCore_Config_DeclareBackend.tmp \ KokkosCore_Config_FwdBackend.tmp KokkosCore_Config_PostInclude.hpp KokkosCore_Config_PostInclude.tmp KokkosCore_Config_SetupBackend.tmp diff --git a/lib/kokkos/Makefile.targets b/lib/kokkos/Makefile.targets index 876726e947..32b1fab261 100644 --- a/lib/kokkos/Makefile.targets +++ b/lib/kokkos/Makefile.targets @@ -67,6 +67,12 @@ Kokkos_SYCL_Instance.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/SYCL/Kokko endif ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) +Kokkos_HIP.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/HIP/Kokkos_HIP.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/HIP/Kokkos_HIP.cpp +Kokkos_HIP_SharedAllocationRecord.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/HIP/Kokkos_HIP_SharedAllocationRecord.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/HIP/Kokkos_HIP_SharedAllocationRecord.cpp +Kokkos_HIP_DeepCopy.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/HIP/Kokkos_HIP_DeepCopy.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/HIP/Kokkos_HIP_DeepCopy.cpp Kokkos_HIP_Space.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/HIP/Kokkos_HIP_Space.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/HIP/Kokkos_HIP_Space.cpp Kokkos_HIP_Instance.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/HIP/Kokkos_HIP_Instance.cpp @@ -107,5 +113,16 @@ Kokkos_OpenMPTarget_Task.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/OpenMP $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Task.cpp endif +ifeq ($(KOKKOS_INTERNAL_USE_OPENACC), 1) +Kokkos_OpenACC.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/OpenACC/Kokkos_OpenACC.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/OpenACC/Kokkos_OpenACC.cpp +Kokkos_OpenACCSpace.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/OpenACC/Kokkos_OpenACCSpace.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/OpenACC/Kokkos_OpenACCSpace.cpp +Kokkos_OpenACC_Instance.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/OpenACC/Kokkos_OpenACC_Instance.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/OpenACC/Kokkos_OpenACC_Instance.cpp +Kokkos_OpenACC_SharedAllocationRecord.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/OpenACC/Kokkos_OpenACC_SharedAllocationRecord.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/OpenACC/Kokkos_OpenACC_SharedAllocationRecord.cpp +endif + Kokkos_HBWSpace.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/impl/Kokkos_HBWSpace.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/impl/Kokkos_HBWSpace.cpp diff --git a/lib/kokkos/algorithms/CMakeLists.txt b/lib/kokkos/algorithms/CMakeLists.txt index eb54db8a55..f32363dc9a 100644 --- a/lib/kokkos/algorithms/CMakeLists.txt +++ b/lib/kokkos/algorithms/CMakeLists.txt @@ -5,7 +5,8 @@ KOKKOS_SUBPACKAGE(Algorithms) IF (NOT Kokkos_INSTALL_TESTING) ADD_SUBDIRECTORY(src) ENDIF() -IF(NOT (KOKKOS_ENABLE_OPENMPTARGET AND KOKKOS_CXX_COMPILER_ID STREQUAL NVHPC)) +# FIXME_OPENACC: temporarily disabled due to unimplemented features +IF(NOT ((KOKKOS_ENABLE_OPENMPTARGET OR KOKKOS_ENABLE_OPENACC) AND KOKKOS_CXX_COMPILER_ID STREQUAL NVHPC)) KOKKOS_ADD_TEST_DIRECTORIES(unit_tests) ENDIF() diff --git a/lib/kokkos/algorithms/src/CMakeLists.txt b/lib/kokkos/algorithms/src/CMakeLists.txt index 597626b111..606d83d18b 100644 --- a/lib/kokkos/algorithms/src/CMakeLists.txt +++ b/lib/kokkos/algorithms/src/CMakeLists.txt @@ -25,7 +25,7 @@ INSTALL ( # These will get ignored for standalone CMake and a true interface library made KOKKOS_ADD_INTERFACE_LIBRARY( kokkosalgorithms - HEADERS ${ALGO_HEADERS} + NOINSTALLHEADERS ${ALGO_HEADERS} SOURCES ${ALGO_SOURCES} ) KOKKOS_LIB_INCLUDE_DIRECTORIES(kokkosalgorithms diff --git a/lib/kokkos/algorithms/src/KokkosAlgorithms_dummy.cpp b/lib/kokkos/algorithms/src/KokkosAlgorithms_dummy.cpp index 9c08a088b0..ddd6374483 100644 --- a/lib/kokkos/algorithms/src/KokkosAlgorithms_dummy.cpp +++ b/lib/kokkos/algorithms/src/KokkosAlgorithms_dummy.cpp @@ -1 +1,17 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + void KOKKOS_ALGORITHMS_SRC_DUMMY_PREVENT_LINK_ERROR() {} diff --git a/lib/kokkos/algorithms/src/Kokkos_NestedSort.hpp b/lib/kokkos/algorithms/src/Kokkos_NestedSort.hpp new file mode 100644 index 0000000000..4c8be792d8 --- /dev/null +++ b/lib/kokkos/algorithms/src/Kokkos_NestedSort.hpp @@ -0,0 +1,188 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_NESTEDSORT_HPP_ +#define KOKKOS_NESTEDSORT_HPP_ + +#include +#include +#include + +namespace Kokkos { +namespace Experimental { +namespace Impl { + +// true for TeamVectorRange, false for ThreadVectorRange +template +struct NestedRange {}; + +// Specialization for team-level +template <> +struct NestedRange { + template + KOKKOS_FUNCTION static auto create(const TeamMember& t, SizeType len) { + return Kokkos::TeamVectorRange(t, len); + } + template + KOKKOS_FUNCTION static void barrier(const TeamMember& t) { + t.team_barrier(); + } +}; + +// Specialization for thread-level +template <> +struct NestedRange { + template + KOKKOS_FUNCTION static auto create(const TeamMember& t, SizeType len) { + return Kokkos::ThreadVectorRange(t, len); + } + // Barrier is no-op, as vector lanes of a thread are implicitly synchronized + // after parallel region + template + KOKKOS_FUNCTION static void barrier(const TeamMember&) {} +}; + +// When just doing sort (not sort_by_key), use nullptr_t for ValueViewType. +// This only takes the NestedRange instance for template arg deduction. +template +KOKKOS_INLINE_FUNCTION void sort_nested_impl( + const TeamMember& t, const KeyViewType& keyView, + [[maybe_unused]] const ValueViewType& valueView, const Comparator& comp, + const NestedRange) { + using SizeType = typename KeyViewType::size_type; + using KeyType = typename KeyViewType::non_const_value_type; + using Range = NestedRange; + SizeType n = keyView.extent(0); + SizeType npot = 1; + SizeType levels = 0; + // FIXME: ceiling power-of-two is a common thing to need - make it a utility + while (npot < n) { + levels++; + npot <<= 1; + } + for (SizeType i = 0; i < levels; i++) { + for (SizeType j = 0; j <= i; j++) { + // n/2 pairs of items are compared in parallel + Kokkos::parallel_for(Range::create(t, npot / 2), [=](const SizeType k) { + // How big are the brown/pink boxes? + // (Terminology comes from Wikipedia diagram) + // https://commons.wikimedia.org/wiki/File:BitonicSort.svg#/media/File:BitonicSort.svg + SizeType boxSize = SizeType(2) << (i - j); + // Which box contains this thread? + SizeType boxID = k >> (i - j); // k * 2 / boxSize; + SizeType boxStart = boxID << (1 + i - j); // boxID * boxSize + SizeType boxOffset = k - (boxStart >> 1); // k - boxID * boxSize / 2; + SizeType elem1 = boxStart + boxOffset; + // In first phase (j == 0, brown box): within a box, compare with the + // opposite value in the box. + // In later phases (j > 0, pink box): within a box, compare with fixed + // distance (boxSize / 2) apart. + SizeType elem2 = (j == 0) ? (boxStart + boxSize - 1 - boxOffset) + : (elem1 + boxSize / 2); + if (elem2 < n) { + KeyType key1 = keyView(elem1); + KeyType key2 = keyView(elem2); + if (comp(key2, key1)) { + keyView(elem1) = key2; + keyView(elem2) = key1; + if constexpr (!std::is_same_v) { + Kokkos::Experimental::swap(valueView(elem1), valueView(elem2)); + } + } + } + }); + Range::barrier(t); + } + } +} + +} // namespace Impl + +template +KOKKOS_INLINE_FUNCTION void sort_team(const TeamMember& t, + const ViewType& view) { + Impl::sort_nested_impl(t, view, nullptr, + Experimental::Impl::StdAlgoLessThanBinaryPredicate< + typename ViewType::non_const_value_type>(), + Impl::NestedRange()); +} + +template +KOKKOS_INLINE_FUNCTION void sort_team(const TeamMember& t, const ViewType& view, + const Comparator& comp) { + Impl::sort_nested_impl(t, view, nullptr, comp, Impl::NestedRange()); +} + +template +KOKKOS_INLINE_FUNCTION void sort_by_key_team(const TeamMember& t, + const KeyViewType& keyView, + const ValueViewType& valueView) { + Impl::sort_nested_impl(t, keyView, valueView, + Experimental::Impl::StdAlgoLessThanBinaryPredicate< + typename KeyViewType::non_const_value_type>(), + Impl::NestedRange()); +} + +template +KOKKOS_INLINE_FUNCTION void sort_by_key_team(const TeamMember& t, + const KeyViewType& keyView, + const ValueViewType& valueView, + const Comparator& comp) { + Impl::sort_nested_impl(t, keyView, valueView, comp, + Impl::NestedRange()); +} + +template +KOKKOS_INLINE_FUNCTION void sort_thread(const TeamMember& t, + const ViewType& view) { + Impl::sort_nested_impl(t, view, nullptr, + Experimental::Impl::StdAlgoLessThanBinaryPredicate< + typename ViewType::non_const_value_type>(), + Impl::NestedRange()); +} + +template +KOKKOS_INLINE_FUNCTION void sort_thread(const TeamMember& t, + const ViewType& view, + const Comparator& comp) { + Impl::sort_nested_impl(t, view, nullptr, comp, Impl::NestedRange()); +} + +template +KOKKOS_INLINE_FUNCTION void sort_by_key_thread(const TeamMember& t, + const KeyViewType& keyView, + const ValueViewType& valueView) { + Impl::sort_nested_impl(t, keyView, valueView, + Experimental::Impl::StdAlgoLessThanBinaryPredicate< + typename KeyViewType::non_const_value_type>(), + Impl::NestedRange()); +} + +template +KOKKOS_INLINE_FUNCTION void sort_by_key_thread(const TeamMember& t, + const KeyViewType& keyView, + const ValueViewType& valueView, + const Comparator& comp) { + Impl::sort_nested_impl(t, keyView, valueView, comp, + Impl::NestedRange()); +} + +} // namespace Experimental +} // namespace Kokkos +#endif diff --git a/lib/kokkos/algorithms/src/Kokkos_Random.hpp b/lib/kokkos/algorithms/src/Kokkos_Random.hpp index 1d85ffdfb9..91e9ce6fc8 100644 --- a/lib/kokkos/algorithms/src/Kokkos_Random.hpp +++ b/lib/kokkos/algorithms/src/Kokkos_Random.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_RANDOM_HPP #define KOKKOS_RANDOM_HPP @@ -631,8 +603,7 @@ struct Random_XorShift1024_UseCArrayState : std::false_type {}; #endif #ifdef KOKKOS_ENABLE_HIP template <> -struct Random_XorShift1024_UseCArrayState - : std::false_type {}; +struct Random_XorShift1024_UseCArrayState : std::false_type {}; #endif #ifdef KOKKOS_ENABLE_OPENMPTARGET template <> @@ -657,7 +628,7 @@ struct Random_UniqueIndex { #if defined(KOKKOS_ENABLE_CUDA) #define KOKKOS_IMPL_EXECUTION_SPACE_CUDA_OR_HIP Kokkos::Cuda #elif defined(KOKKOS_ENABLE_HIP) -#define KOKKOS_IMPL_EXECUTION_SPACE_CUDA_OR_HIP Kokkos::Experimental::HIP +#define KOKKOS_IMPL_EXECUTION_SPACE_CUDA_OR_HIP Kokkos::HIP #endif template @@ -907,38 +878,32 @@ class Random_XorShift64_Pool { using execution_space = typename device_type::execution_space; using locks_type = View; using state_data_type = View; - locks_type locks_; - state_data_type state_; - int num_states_; - int padding_; + + locks_type locks_ = {}; + state_data_type state_ = {}; + int num_states_ = {}; + int padding_ = {}; public: using generator_type = Random_XorShift64; - KOKKOS_INLINE_FUNCTION - Random_XorShift64_Pool() { - num_states_ = 0; - padding_ = 0; - } +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4 + KOKKOS_DEFAULTED_FUNCTION Random_XorShift64_Pool() = default; + + KOKKOS_DEFAULTED_FUNCTION Random_XorShift64_Pool( + Random_XorShift64_Pool const&) = default; + + KOKKOS_DEFAULTED_FUNCTION Random_XorShift64_Pool& operator=( + Random_XorShift64_Pool const&) = default; +#else + Random_XorShift64_Pool() = default; +#endif Random_XorShift64_Pool(uint64_t seed) { num_states_ = 0; init(seed, execution_space().concurrency()); } - KOKKOS_INLINE_FUNCTION - Random_XorShift64_Pool(const Random_XorShift64_Pool& src) - : locks_(src.locks_), state_(src.state_), num_states_(src.num_states_) {} - - KOKKOS_INLINE_FUNCTION - Random_XorShift64_Pool operator=(const Random_XorShift64_Pool& src) { - locks_ = src.locks_; - state_ = src.state_; - num_states_ = src.num_states_; - padding_ = src.padding_; - return *this; - } - void init(uint64_t seed, int num_states) { if (seed == 0) seed = uint64_t(1318319); // I only want to pad on CPU like archs (less than 1000 threads). 64 is a @@ -976,8 +941,8 @@ class Random_XorShift64_Pool { deep_copy(locks_, h_lock); } - KOKKOS_INLINE_FUNCTION - Random_XorShift64 get_state() const { + KOKKOS_INLINE_FUNCTION Random_XorShift64 get_state() const { + KOKKOS_EXPECTS(num_states_ > 0); const int i = Impl::Random_UniqueIndex::get_state_idx(locks_); return Random_XorShift64(state_(i, 0), i); } @@ -1158,43 +1123,35 @@ class Random_XorShift1024_Pool { using int_view_type = View; using state_data_type = View; - locks_type locks_; - state_data_type state_; - int_view_type p_; - int num_states_; - int padding_; + locks_type locks_ = {}; + state_data_type state_ = {}; + int_view_type p_ = {}; + int num_states_ = {}; + int padding_ = {}; friend class Random_XorShift1024; public: using generator_type = Random_XorShift1024; - KOKKOS_INLINE_FUNCTION - Random_XorShift1024_Pool() { num_states_ = 0; } +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4 + KOKKOS_DEFAULTED_FUNCTION Random_XorShift1024_Pool() = default; - inline Random_XorShift1024_Pool(uint64_t seed) { + KOKKOS_DEFAULTED_FUNCTION Random_XorShift1024_Pool( + Random_XorShift1024_Pool const&) = default; + + KOKKOS_DEFAULTED_FUNCTION Random_XorShift1024_Pool& operator=( + Random_XorShift1024_Pool const&) = default; +#else + Random_XorShift1024_Pool() = default; +#endif + + Random_XorShift1024_Pool(uint64_t seed) { num_states_ = 0; init(seed, execution_space().concurrency()); } - KOKKOS_INLINE_FUNCTION - Random_XorShift1024_Pool(const Random_XorShift1024_Pool& src) - : locks_(src.locks_), - state_(src.state_), - p_(src.p_), - num_states_(src.num_states_) {} - - KOKKOS_INLINE_FUNCTION - Random_XorShift1024_Pool operator=(const Random_XorShift1024_Pool& src) { - locks_ = src.locks_; - state_ = src.state_; - p_ = src.p_; - num_states_ = src.num_states_; - padding_ = src.padding_; - return *this; - } - - inline void init(uint64_t seed, int num_states) { + void init(uint64_t seed, int num_states) { if (seed == 0) seed = uint64_t(1318319); // I only want to pad on CPU like archs (less than 1000 threads). 64 is a // magic number, or random number I just wanted something not too large and @@ -1237,6 +1194,7 @@ class Random_XorShift1024_Pool { KOKKOS_INLINE_FUNCTION Random_XorShift1024 get_state() const { + KOKKOS_EXPECTS(num_states_ > 0); const int i = Impl::Random_UniqueIndex::get_state_idx(locks_); return Random_XorShift1024(state_, p_(i, 0), i); }; diff --git a/lib/kokkos/algorithms/src/Kokkos_Sort.hpp b/lib/kokkos/algorithms/src/Kokkos_Sort.hpp index c7be70e09a..033de22164 100644 --- a/lib/kokkos/algorithms/src/Kokkos_Sort.hpp +++ b/lib/kokkos/algorithms/src/Kokkos_Sort.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_SORT_HPP_ #define KOKKOS_SORT_HPP_ @@ -50,9 +22,50 @@ #endif #include - +#include +#include #include +#if defined(KOKKOS_ENABLE_CUDA) + +// Workaround for `Instruction 'shfl' without '.sync' is not supported on +// .target sm_70 and higher from PTX ISA version 6.4`. +// Also see https://github.com/NVIDIA/cub/pull/170. +#if !defined(CUB_USE_COOPERATIVE_GROUPS) +#define CUB_USE_COOPERATIVE_GROUPS +#endif + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" + +#if defined(KOKKOS_COMPILER_CLANG) +// Some versions of Clang fail to compile Thrust, failing with errors like +// this: +// /thrust/system/cuda/detail/core/agent_launcher.h:557:11: +// error: use of undeclared identifier 'va_printf' +// The exact combination of versions for Clang and Thrust (or CUDA) for this +// failure was not investigated, however even very recent version combination +// (Clang 10.0.0 and Cuda 10.0) demonstrated failure. +// +// Defining _CubLog here locally allows us to avoid that code path, however +// disabling some debugging diagnostics +#pragma push_macro("_CubLog") +#ifdef _CubLog +#undef _CubLog +#endif +#define _CubLog +#include +#include +#pragma pop_macro("_CubLog") +#else +#include +#include +#endif + +#pragma GCC diagnostic pop + +#endif + namespace Kokkos { namespace Impl { @@ -559,24 +572,6 @@ struct BinOp3D { namespace Impl { -template -bool try_std_sort(ViewType view, const ExecutionSpace& exec) { - bool possible = true; - size_t stride[8] = {view.stride_0(), view.stride_1(), view.stride_2(), - view.stride_3(), view.stride_4(), view.stride_5(), - view.stride_6(), view.stride_7()}; - possible = possible && - SpaceAccessibility::accessible; - possible = possible && (ViewType::Rank == 1); - possible = possible && (stride[0] == 1); - if (possible) { - exec.fence("Kokkos::sort: Fence before sorting on the host"); - std::sort(view.data(), view.data() + view.extent(0)); - } - return possible; -} - template struct min_max_functor { using minmax_scalar = @@ -594,9 +589,14 @@ struct min_max_functor { } // namespace Impl -template -std::enable_if_t::value> sort( - const ExecutionSpace& exec, ViewType const& view) { +template +std::enable_if_t<(Kokkos::is_execution_space::value) && + (!SpaceAccessibility< + HostSpace, typename Kokkos::View:: + memory_space>::accessible)> +sort(const ExecutionSpace& exec, + const Kokkos::View& view) { + using ViewType = Kokkos::View; using CompType = BinOp1D; Kokkos::MinMaxScalar result; @@ -634,18 +634,25 @@ std::enable_if_t::value> sort( bin_sort.sort(exec, view); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -template -KOKKOS_DEPRECATED_WITH_COMMENT( - "Use the overload not taking bool always_use_kokkos_sort") -std::enable_if_t::value> sort( - const ExecutionSpace& exec, ViewType const& view, - bool const always_use_kokkos_sort) { - if (!always_use_kokkos_sort && Impl::try_std_sort(view, exec)) { - return; - } else { - sort(exec, view); - } +template +std::enable_if_t<(Kokkos::is_execution_space::value) && + (SpaceAccessibility< + HostSpace, typename Kokkos::View:: + memory_space>::accessible)> +sort(const ExecutionSpace&, const Kokkos::View& view) { + auto first = Experimental::begin(view); + auto last = Experimental::end(view); + std::sort(first, last); +} + +#if defined(KOKKOS_ENABLE_CUDA) +template +void sort(const Cuda& space, + const Kokkos::View& view) { + const auto exec = thrust::cuda::par.on(space.cuda_stream()); + auto first = Experimental::begin(view); + auto last = Experimental::end(view); + thrust::sort(exec, first, last); } #endif @@ -657,17 +664,6 @@ void sort(ViewType const& view) { exec.fence("Kokkos::sort: fence after sorting"); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -template -KOKKOS_DEPRECATED_WITH_COMMENT( - "Use the overload not taking bool always_use_kokkos_sort") -void sort(ViewType const& view, bool const always_use_kokkos_sort) { - typename ViewType::execution_space exec; - sort(exec, view, always_use_kokkos_sort); - exec.fence("Kokkos::Sort: fence after sorting"); -} -#endif - template std::enable_if_t::value> sort( const ExecutionSpace& exec, ViewType view, size_t const begin, diff --git a/lib/kokkos/algorithms/src/Kokkos_StdAlgorithms.hpp b/lib/kokkos/algorithms/src/Kokkos_StdAlgorithms.hpp index 3e0f731cf0..436ae0d10b 100644 --- a/lib/kokkos/algorithms/src/Kokkos_StdAlgorithms.hpp +++ b/lib/kokkos/algorithms/src/Kokkos_StdAlgorithms.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_HPP #define KOKKOS_STD_ALGORITHMS_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AdjacentDifference.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AdjacentDifference.hpp index 0a7cf06f5b..38dcd1a674 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AdjacentDifference.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AdjacentDifference.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ADJACENT_DIFFERENCE_HPP #define KOKKOS_STD_ALGORITHMS_ADJACENT_DIFFERENCE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AdjacentFind.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AdjacentFind.hpp index 332f9dd369..43c2b66010 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AdjacentFind.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AdjacentFind.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ADJACENT_FIND_HPP #define KOKKOS_STD_ALGORITHMS_ADJACENT_FIND_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AllOf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AllOf.hpp index 66a49541f3..2ffec7e144 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AllOf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AllOf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ALL_OF_HPP #define KOKKOS_STD_ALGORITHMS_ALL_OF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AnyOf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AnyOf.hpp index e50e90f6da..019c466c6d 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AnyOf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_AnyOf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ANY_OF_HPP #define KOKKOS_STD_ALGORITHMS_ANY_OF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_BeginEnd.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_BeginEnd.hpp index 5449196192..3836d4bf62 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_BeginEnd.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_BeginEnd.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_BEGIN_END_HPP #define KOKKOS_BEGIN_END_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Copy.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Copy.hpp index b3237041b7..028f3b66b2 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Copy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Copy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_COPY_HPP #define KOKKOS_STD_ALGORITHMS_COPY_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyBackward.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyBackward.hpp index 83efd96672..deff6baf9a 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyBackward.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyBackward.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_COPY_BACKWARD_HPP #define KOKKOS_STD_ALGORITHMS_COPY_BACKWARD_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyIf.hpp index c83cc29886..3db2fc074f 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_COPY_IF_HPP #define KOKKOS_STD_ALGORITHMS_COPY_IF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyN.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyN.hpp index 7f3b9374c7..a64f99b5c0 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyN.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CopyN.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_COPY_N_HPP #define KOKKOS_STD_ALGORITHMS_COPY_N_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Count.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Count.hpp index a885ee4ad2..3ac63467ec 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Count.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Count.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_COUNT_HPP #define KOKKOS_STD_ALGORITHMS_COUNT_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CountIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CountIf.hpp index 98b9d74c4c..b9731d378a 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CountIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_CountIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_COUNT_IF_HPP #define KOKKOS_STD_ALGORITHMS_COUNT_IF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Distance.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Distance.hpp index 4e148642b1..8605606307 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Distance.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Distance.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_DISTANCE_HPP #define KOKKOS_STD_ALGORITHMS_DISTANCE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Equal.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Equal.hpp index 8634019fad..37c0d75ef5 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Equal.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Equal.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_EQUAL_HPP #define KOKKOS_STD_ALGORITHMS_EQUAL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ExclusiveScan.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ExclusiveScan.hpp index b97710f24f..4e05676c2c 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ExclusiveScan.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ExclusiveScan.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_EXCLUSIVE_SCAN_HPP #define KOKKOS_STD_ALGORITHMS_EXCLUSIVE_SCAN_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Fill.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Fill.hpp index 200e03b9dc..1e300a4c20 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Fill.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Fill.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FILL_HPP #define KOKKOS_STD_ALGORITHMS_FILL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FillN.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FillN.hpp index 2e814dc55f..02503dfd14 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FillN.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FillN.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FILL_N_HPP #define KOKKOS_STD_ALGORITHMS_FILL_N_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Find.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Find.hpp index 6758f00ce4..65b68cf931 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Find.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Find.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FIND_HPP #define KOKKOS_STD_ALGORITHMS_FIND_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindEnd.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindEnd.hpp index 61b54c8225..f6a38855eb 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindEnd.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindEnd.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FIND_END_HPP #define KOKKOS_STD_ALGORITHMS_FIND_END_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindFirstOf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindFirstOf.hpp index b8c27cb272..6b0e4993ee 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindFirstOf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindFirstOf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FIND_FIRST_OF_HPP #define KOKKOS_STD_ALGORITHMS_FIND_FIRST_OF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindIf.hpp index 54896da117..911316a668 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FIND_IF_HPP #define KOKKOS_STD_ALGORITHMS_FIND_IF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindIfNot.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindIfNot.hpp index cfe6bb84d8..18294d7b7d 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindIfNot.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_FindIfNot.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FIND_IF_NOT_HPP #define KOKKOS_STD_ALGORITHMS_FIND_IF_NOT_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ForEach.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ForEach.hpp index 8a2f90e82b..d7b08e4842 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ForEach.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ForEach.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FOR_EACH_HPP #define KOKKOS_STD_ALGORITHMS_FOR_EACH_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ForEachN.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ForEachN.hpp index dd917a33e8..f1769da05b 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ForEachN.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ForEachN.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FOR_EACH_N_HPP #define KOKKOS_STD_ALGORITHMS_FOR_EACH_N_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Generate.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Generate.hpp index 955cb42d4b..13e12783e0 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Generate.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Generate.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_GENERATE_HPP #define KOKKOS_STD_ALGORITHMS_GENERATE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_GenerateN.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_GenerateN.hpp index 470edb1596..4d17512228 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_GenerateN.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_GenerateN.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_GENERATE_N_HPP #define KOKKOS_STD_ALGORITHMS_GENERATE_N_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_InclusiveScan.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_InclusiveScan.hpp index c34b5f43c9..bcd731b850 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_InclusiveScan.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_InclusiveScan.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_INCLUSIVE_SCAN_HPP #define KOKKOS_STD_ALGORITHMS_INCLUSIVE_SCAN_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsPartitioned.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsPartitioned.hpp index 8a2ca207ae..29d6be9e8b 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsPartitioned.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsPartitioned.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_IS_PARTITIONED_HPP #define KOKKOS_STD_ALGORITHMS_IS_PARTITIONED_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsSorted.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsSorted.hpp index 0ab466f338..f036254a02 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsSorted.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsSorted.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_IS_SORTED_HPP #define KOKKOS_STD_ALGORITHMS_IS_SORTED_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsSortedUntil.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsSortedUntil.hpp index c480d9ee5a..276b3bb884 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsSortedUntil.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IsSortedUntil.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_IS_SORTED_UNTIL_HPP #define KOKKOS_STD_ALGORITHMS_IS_SORTED_UNTIL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IterSwap.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IterSwap.hpp index 1174740a5b..a796a306dd 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IterSwap.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_IterSwap.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ITER_SWAP_HPP #define KOKKOS_STD_ALGORITHMS_ITER_SWAP_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_LexicographicalCompare.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_LexicographicalCompare.hpp index 4704a9ec56..0a77ef629f 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_LexicographicalCompare.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_LexicographicalCompare.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_LEXICOGRAPHICAL_COMPARE_HPP #define KOKKOS_STD_ALGORITHMS_LEXICOGRAPHICAL_COMPARE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MaxElement.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MaxElement.hpp index 5f6e5cbf62..2c1374f700 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MaxElement.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MaxElement.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_MAX_ELEMENT_HPP #define KOKKOS_STD_ALGORITHMS_MAX_ELEMENT_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MinElement.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MinElement.hpp index 63cc548960..1d03b7c962 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MinElement.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MinElement.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_MIN_ELEMENT_HPP #define KOKKOS_STD_ALGORITHMS_MIN_ELEMENT_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MinMaxElement.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MinMaxElement.hpp index 07cdefcc05..d481b499cc 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MinMaxElement.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MinMaxElement.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_MINMAX_ELEMENT_HPP #define KOKKOS_STD_ALGORITHMS_MINMAX_ELEMENT_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Mismatch.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Mismatch.hpp index 3418e048a9..13c994ca90 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Mismatch.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Mismatch.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_MISMATCH_HPP #define KOKKOS_STD_ALGORITHMS_MISMATCH_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Move.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Move.hpp index c2ce4655fa..d49acd9f70 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Move.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Move.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_MOVE_HPP #define KOKKOS_STD_ALGORITHMS_MOVE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MoveBackward.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MoveBackward.hpp index f7462d52d8..60d50fa881 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MoveBackward.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_MoveBackward.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_MOVE_BACKWARD_HPP #define KOKKOS_STD_ALGORITHMS_MOVE_BACKWARD_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_NoneOf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_NoneOf.hpp index 30ffb52442..cf5de3b72b 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_NoneOf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_NoneOf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_NONE_OF_HPP #define KOKKOS_STD_ALGORITHMS_NONE_OF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_PartitionCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_PartitionCopy.hpp index 5b00669fd1..38c0a35b62 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_PartitionCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_PartitionCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_PARTITION_COPY_HPP #define KOKKOS_STD_ALGORITHMS_PARTITION_COPY_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_PartitionPoint.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_PartitionPoint.hpp index b714d5a271..24798e377e 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_PartitionPoint.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_PartitionPoint.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_PARTITION_POINT_HPP #define KOKKOS_STD_ALGORITHMS_PARTITION_POINT_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Reduce.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Reduce.hpp index 3cf9153202..a31fa1497a 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Reduce.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Reduce.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REDUCE_HPP #define KOKKOS_STD_ALGORITHMS_REDUCE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Remove.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Remove.hpp index d8d7c999b6..c8602d2f53 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Remove.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Remove.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REMOVE_HPP #define KOKKOS_STD_ALGORITHMS_REMOVE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveCopy.hpp index 7d5c163af9..c2c06f6202 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REMOVE_COPY_HPP #define KOKKOS_STD_ALGORITHMS_REMOVE_COPY_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveCopyIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveCopyIf.hpp index 8a9a3e4c14..6d642ed6f0 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveCopyIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveCopyIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REMOVE_COPY_IF_HPP #define KOKKOS_STD_ALGORITHMS_REMOVE_COPY_IF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveIf.hpp index e4171ca917..4062e8d373 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RemoveIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REMOVE_IF_HPP #define KOKKOS_STD_ALGORITHMS_REMOVE_IF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Replace.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Replace.hpp index 10ca46af25..4d1490ded0 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Replace.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Replace.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REPLACE_HPP #define KOKKOS_STD_ALGORITHMS_REPLACE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceCopy.hpp index f5136eb438..e7f464e4bd 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REPLACE_COPY_HPP #define KOKKOS_STD_ALGORITHMS_REPLACE_COPY_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceCopyIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceCopyIf.hpp index a3f3fe69ab..71ae8f8452 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceCopyIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceCopyIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REPLACE_COPY_IF_HPP #define KOKKOS_STD_ALGORITHMS_REPLACE_COPY_IF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceIf.hpp index bdb59f28af..7f06540e06 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReplaceIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REPLACE_IF_HPP #define KOKKOS_STD_ALGORITHMS_REPLACE_IF_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Reverse.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Reverse.hpp index 4848b20f66..9f2fc5f3cc 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Reverse.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Reverse.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REVERSE_HPP #define KOKKOS_STD_ALGORITHMS_REVERSE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReverseCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReverseCopy.hpp index bb4462bf41..279bb22086 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReverseCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ReverseCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REVERSE_COPY_HPP #define KOKKOS_STD_ALGORITHMS_REVERSE_COPY_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Rotate.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Rotate.hpp index 39975811a4..738e9bf137 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Rotate.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Rotate.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ROTATE_HPP #define KOKKOS_STD_ALGORITHMS_ROTATE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RotateCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RotateCopy.hpp index f98686ab63..f5d826c4bb 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RotateCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_RotateCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ROTATE_COPY_HPP #define KOKKOS_STD_ALGORITHMS_ROTATE_COPY_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Search.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Search.hpp index ce656da31c..b1154b297e 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Search.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Search.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SEARCH_HPP #define KOKKOS_STD_ALGORITHMS_SEARCH_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_SearchN.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_SearchN.hpp index 854d911e76..a649c8f205 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_SearchN.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_SearchN.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SEARCH_N_HPP #define KOKKOS_STD_ALGORITHMS_SEARCH_N_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ShiftLeft.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ShiftLeft.hpp index cee111af98..4b91a17ab8 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ShiftLeft.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ShiftLeft.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SHIFT_LEFT_HPP #define KOKKOS_STD_ALGORITHMS_SHIFT_LEFT_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ShiftRight.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ShiftRight.hpp index f104d2bd7a..2ea50fd74e 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ShiftRight.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_ShiftRight.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SHIFT_RIGHT_HPP #define KOKKOS_STD_ALGORITHMS_SHIFT_RIGHT_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Swap.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Swap.hpp index 9006aa9167..acd2a572c8 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Swap.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Swap.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SWAP_HPP #define KOKKOS_STD_ALGORITHMS_SWAP_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_SwapRanges.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_SwapRanges.hpp index 2997cdab4b..5fbf045318 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_SwapRanges.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_SwapRanges.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SWAP_RANGES_HPP #define KOKKOS_STD_ALGORITHMS_SWAP_RANGES_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Transform.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Transform.hpp index 6dfb83a8c0..27dee30426 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Transform.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Transform.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_TRANSFORM_HPP #define KOKKOS_STD_ALGORITHMS_TRANSFORM_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformExclusiveScan.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformExclusiveScan.hpp index d0073599b0..9d85aee06f 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformExclusiveScan.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformExclusiveScan.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_TRASFORM_EXCLUSIVE_SCAN_HPP #define KOKKOS_STD_ALGORITHMS_TRASFORM_EXCLUSIVE_SCAN_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformInclusiveScan.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformInclusiveScan.hpp index 088e162adb..7489af7e37 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformInclusiveScan.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformInclusiveScan.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_TRANSFORM_INCLUSIVE_SCAN_HPP #define KOKKOS_STD_ALGORITHMS_TRANSFORM_INCLUSIVE_SCAN_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformReduce.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformReduce.hpp index 5caced5917..b5ec9066d2 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformReduce.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_TransformReduce.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_TRANSFORM_REDUCE_HPP #define KOKKOS_STD_ALGORITHMS_TRANSFORM_REDUCE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Unique.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Unique.hpp index aeb54a6ffe..b47ecffb20 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Unique.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_Unique.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_UNIQUE_HPP #define KOKKOS_STD_ALGORITHMS_UNIQUE_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_UniqueCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_UniqueCopy.hpp index 632b560fa8..bd2451c220 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/Kokkos_UniqueCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/Kokkos_UniqueCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_UNIQUE_COPY_HPP #define KOKKOS_STD_ALGORITHMS_UNIQUE_COPY_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AdjacentDifference.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AdjacentDifference.hpp index 35c78b86bf..8a474508d7 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AdjacentDifference.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AdjacentDifference.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ADJACENT_DIFFERENCE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_ADJACENT_DIFFERENCE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AdjacentFind.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AdjacentFind.hpp index 155f6c7bb8..cc6b63f028 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AdjacentFind.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AdjacentFind.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ADJACENT_FIND_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_ADJACENT_FIND_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AllOfAnyOfNoneOf.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AllOfAnyOfNoneOf.hpp index dd8ae4f5b4..ad562070a0 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AllOfAnyOfNoneOf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_AllOfAnyOfNoneOf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ALL_OF_ANY_OF_NONE_OF_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_ALL_OF_ANY_OF_NONE_OF_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Constraints.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Constraints.hpp index ec54cd1900..52e7625e4d 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Constraints.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Constraints.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_CONSTRAINTS_HPP_ #define KOKKOS_STD_ALGORITHMS_CONSTRAINTS_HPP_ diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyBackward.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyBackward.hpp index 18f614094c..b3adbc5e2d 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyBackward.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyBackward.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_COPY_BACKWARD_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_COPY_BACKWARD_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyCopyN.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyCopyN.hpp index 03b6fc6eca..1b120c46d0 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyCopyN.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyCopyN.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_COPY_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_COPY_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyIf.hpp index aebb5a9a46..3c0c4f7e9b 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CopyIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_COPY_IF_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_COPY_IF_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CountCountIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CountCountIf.hpp index 982ac40464..18b8c46359 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CountCountIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_CountCountIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_COUNT_IF_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_COUNT_IF_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Equal.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Equal.hpp index 9482917abb..e045080d4a 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Equal.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Equal.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_EQUAL_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_EQUAL_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ExclusiveScan.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ExclusiveScan.hpp index 0ae4651c6a..f2bfa23ccd 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ExclusiveScan.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ExclusiveScan.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_EXCLUSIVE_SCAN_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_EXCLUSIVE_SCAN_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FillFillN.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FillFillN.hpp index 843771b6b1..316d865f31 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FillFillN.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FillFillN.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FILL_AND_FILL_N_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_FILL_AND_FILL_N_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindEnd.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindEnd.hpp index 35a6c4b4ac..3fa41af8ea 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindEnd.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindEnd.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FIND_END_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_FIND_END_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindFirstOf.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindFirstOf.hpp index 6907bbdbc3..df10da2fd5 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindFirstOf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindFirstOf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FIND_FIRST_OF_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_FIND_FIRST_OF_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindIfOrNot.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindIfOrNot.hpp index c79c4b5216..f7ec4b1110 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindIfOrNot.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_FindIfOrNot.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FIND_IF_AND_FIND_IF_NOT_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_FIND_IF_AND_FIND_IF_NOT_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ForEachForEachN.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ForEachForEachN.hpp index 8bd37b13bc..f9a6ff2e99 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ForEachForEachN.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ForEachForEachN.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_FOR_EACH_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_FOR_EACH_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_GenerateGenerateN.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_GenerateGenerateN.hpp index f01d9bfb55..228390bdff 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_GenerateGenerateN.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_GenerateGenerateN.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_GENERATE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_GENERATE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_HelperPredicates.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_HelperPredicates.hpp index 244bce48e4..db0def6f22 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_HelperPredicates.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_HelperPredicates.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_HELPER_PREDICATES_HPP #define KOKKOS_STD_ALGORITHMS_HELPER_PREDICATES_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IdentityReferenceUnaryFunctor.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IdentityReferenceUnaryFunctor.hpp index f41e567c9b..252511c5d0 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IdentityReferenceUnaryFunctor.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IdentityReferenceUnaryFunctor.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_NUMERIC_IDENTITY_REFERENCE_UNARY_FUNCTOR_HPP #define KOKKOS_STD_ALGORITHMS_NUMERIC_IDENTITY_REFERENCE_UNARY_FUNCTOR_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_InclusiveScan.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_InclusiveScan.hpp index 2088ebd439..55e1a78695 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_InclusiveScan.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_InclusiveScan.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_INCLUSIVE_SCAN_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_INCLUSIVE_SCAN_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsPartitioned.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsPartitioned.hpp index 0f00bebb6d..92a22f3c3a 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsPartitioned.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsPartitioned.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_IS_PARTITIONED_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_IS_PARTITIONED_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsSorted.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsSorted.hpp index 4e36ae3890..4696821586 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsSorted.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsSorted.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_IS_SORTED_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_IS_SORTED_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsSortedUntil.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsSortedUntil.hpp index 4e99c301b2..fe52e18a33 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsSortedUntil.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_IsSortedUntil.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_IS_SORTED_UNTIL_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_IS_SORTED_UNTIL_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_LexicographicalCompare.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_LexicographicalCompare.hpp index c3dd13e6b5..170ec9f291 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_LexicographicalCompare.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_LexicographicalCompare.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_LEXICOGRAPHICAL_COMPARE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_LEXICOGRAPHICAL_COMPARE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_MinMaxMinmaxElement.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_MinMaxMinmaxElement.hpp index 0a9d41b9bb..048420f7a8 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_MinMaxMinmaxElement.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_MinMaxMinmaxElement.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_MIN_MAX_MINMAX_ELEMENT_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_MIN_MAX_MINMAX_ELEMENT_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Mismatch.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Mismatch.hpp index 180afe925c..9d2e31f63f 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Mismatch.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Mismatch.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_MISMATCH_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_MISMATCH_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Move.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Move.hpp index 6b1ed1da4c..01086d1772 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Move.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Move.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_MOVE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_MOVE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_MoveBackward.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_MoveBackward.hpp index c34ab679db..9a28c3fb4a 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_MoveBackward.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_MoveBackward.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_MOVE_BACKWARD_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_MOVE_BACKWARD_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_PartitionCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_PartitionCopy.hpp index 508e4baedf..5457ae2508 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_PartitionCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_PartitionCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_PARTITION_COPY_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_PARTITION_COPY_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_PartitionPoint.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_PartitionPoint.hpp index 671e8d70f0..2d0ae2aac6 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_PartitionPoint.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_PartitionPoint.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_PARTITION_POINT_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_PARTITION_POINT_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RandomAccessIterator.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RandomAccessIterator.hpp index 2457d9400a..5c9854b87d 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RandomAccessIterator.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RandomAccessIterator.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_RANDOM_ACCESS_ITERATOR_IMPL_HPP #define KOKKOS_RANDOM_ACCESS_ITERATOR_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Reduce.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Reduce.hpp index 26e0795d8b..45a0de3727 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Reduce.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Reduce.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REDUCE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_REDUCE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReducerWithArbitraryJoinerNoNeutralElement.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReducerWithArbitraryJoinerNoNeutralElement.hpp index d8e383b859..b460982d33 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReducerWithArbitraryJoinerNoNeutralElement.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReducerWithArbitraryJoinerNoNeutralElement.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REDUCER_WITH_ARBITRARY_JOINER_NONEUTRAL_ELEMENT_HPP #define KOKKOS_STD_ALGORITHMS_REDUCER_WITH_ARBITRARY_JOINER_NONEUTRAL_ELEMENT_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RemoveAllVariants.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RemoveAllVariants.hpp index 742d4d776a..bda6470199 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RemoveAllVariants.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RemoveAllVariants.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REMOVE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_REMOVE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Replace.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Replace.hpp index 877ffa276f..e3a6b538f4 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Replace.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Replace.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REPLACE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_REPLACE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceCopy.hpp index b75dde9cd8..729cf89311 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REPLACE_COPY_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_REPLACE_COPY_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceCopyIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceCopyIf.hpp index 8f7c8140e6..dca7e7f6a5 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceCopyIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceCopyIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REPLACE_COPY_IF_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_REPLACE_COPY_IF_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceIf.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceIf.hpp index 6fe33019c0..54b6e1c528 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceIf.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReplaceIf.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REPLACE_IF_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_REPLACE_IF_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Reverse.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Reverse.hpp index f84eb2c81a..a4aaba26b9 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Reverse.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Reverse.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REVERSE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_REVERSE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReverseCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReverseCopy.hpp index 88b6ed16b5..6dd52813e0 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReverseCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ReverseCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_REVERSE_COPY_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_REVERSE_COPY_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Rotate.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Rotate.hpp index c08cf1aecb..3aa1ab5d40 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Rotate.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Rotate.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ROTATE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_ROTATE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RotateCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RotateCopy.hpp index a8111a511f..28023cc4df 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RotateCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_RotateCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_ROTATE_COPY_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_ROTATE_COPY_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Search.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Search.hpp index 2afb0a74f0..a612a57231 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Search.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Search.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SEARCH_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_SEARCH_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_SearchN.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_SearchN.hpp index cd8b394386..0d3b6bc706 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_SearchN.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_SearchN.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SEARCH_N_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_SEARCH_N_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ShiftLeft.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ShiftLeft.hpp index 796864461f..7a33762f17 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ShiftLeft.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ShiftLeft.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SHIFT_LEFT_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_SHIFT_LEFT_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ShiftRight.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ShiftRight.hpp index 0ffde42ab2..2b0a4bb524 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ShiftRight.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ShiftRight.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SHIFT_RIGHT_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_SHIFT_RIGHT_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_SwapRanges.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_SwapRanges.hpp index 3e6ca14697..438acb989f 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_SwapRanges.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_SwapRanges.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_SWAP_RANGES_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_SWAP_RANGES_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Transform.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Transform.hpp index 5d2c0cc982..840e9d2054 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Transform.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Transform.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_TRANSFORM_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_TRANSFORM_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformExclusiveScan.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformExclusiveScan.hpp index 9fb8cbcc30..773e8c2f88 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformExclusiveScan.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformExclusiveScan.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_TRANSFORM_EXCLUSIVE_SCAN_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_TRANSFORM_EXCLUSIVE_SCAN_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformInclusiveScan.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformInclusiveScan.hpp index 281eb6f8a1..9dde2b0fb1 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformInclusiveScan.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformInclusiveScan.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_TRANSFORM_INCLUSIVE_SCAN_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_TRANSFORM_INCLUSIVE_SCAN_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformReduce.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformReduce.hpp index e3a780f485..03771056a2 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformReduce.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_TransformReduce.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_TRANSFORM_REDUCE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_TRANSFORM_REDUCE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Unique.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Unique.hpp index 5e4ea7d792..4bab551563 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Unique.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_Unique.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_UNIQUE_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_UNIQUE_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_UniqueCopy.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_UniqueCopy.hpp index e4fd6f3ed8..d0aa1ed1d0 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_UniqueCopy.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_UniqueCopy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_UNIQUE_COPY_IMPL_HPP #define KOKKOS_STD_ALGORITHMS_UNIQUE_COPY_IMPL_HPP diff --git a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ValueWrapperForNoNeutralElement.hpp b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ValueWrapperForNoNeutralElement.hpp index da9b6ef9a9..9b0d4d8244 100644 --- a/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ValueWrapperForNoNeutralElement.hpp +++ b/lib/kokkos/algorithms/src/std_algorithms/impl/Kokkos_ValueWrapperForNoNeutralElement.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STD_ALGORITHMS_VALUE_WRAPPER_FOR_NO_NEUTRAL_ELEMENT_HPP #define KOKKOS_STD_ALGORITHMS_VALUE_WRAPPER_FOR_NO_NEUTRAL_ELEMENT_HPP diff --git a/lib/kokkos/algorithms/unit_tests/CMakeLists.txt b/lib/kokkos/algorithms/unit_tests/CMakeLists.txt index 0c50ff7a08..0fe9c2006e 100644 --- a/lib/kokkos/algorithms/unit_tests/CMakeLists.txt +++ b/lib/kokkos/algorithms/unit_tests/CMakeLists.txt @@ -28,16 +28,24 @@ foreach(Tag Threads;Serial;OpenMP;Cuda;HPX;HIP;SYCL;OpenMPTarget) ) endif() - set(file ${dir}/TestRandomAndSort.cpp) - # Write to a temporary intermediate file and call configure_file to avoid - # updating timestamps triggering unnecessary rebuilds on subsequent cmake runs. - file(WRITE ${dir}/dummy.cpp - "#include \n" - "#include \n" - "#include \n" - ) - configure_file(${dir}/dummy.cpp ${file}) - list(APPEND SOURCES_A ${file}) + # Each of these inputs is an .hpp file. + # Generate a .cpp file for each one that runs it on the current backend (Tag), + # and add this .cpp file to the sources for UnitTest_RandomAndSort. + foreach(SOURCES_A_Input + TestRandomCommon + TestSortCommon + TestNestedSort + ) + set(file ${dir}/${SOURCES_A_Input}.cpp) + # Write to a temporary intermediate file and call configure_file to avoid + # updating timestamps triggering unnecessary rebuilds on subsequent cmake runs. + file(WRITE ${dir}/dummy.cpp + "#include \n" + "#include <${SOURCES_A_Input}.hpp>\n" + ) + configure_file(${dir}/dummy.cpp ${file}) + list(APPEND SOURCES_A ${file}) + endforeach() # ------------------------------------------ # std set A @@ -137,12 +145,31 @@ foreach(Tag Threads;Serial;OpenMP;Cuda;HPX;HIP;SYCL;OpenMPTarget) endif() endforeach() -KOKKOS_ADD_EXECUTABLE_AND_TEST( - UnitTest_RandomAndSort - SOURCES - UnitTestMain.cpp - ${SOURCES_A} -) +# FIXME_OPENMPTARGET These tests cause internal compiler errors as of 09/01/22 +# when compiling for Intel's Xe-HP GPUs. +if(KOKKOS_ENABLE_OPENMPTARGET AND KOKKOS_CXX_COMPILER_ID STREQUAL IntelLLVM) + list(REMOVE_ITEM STDALGO_SOURCES_D + TestStdAlgorithmsCopyIf.cpp + TestStdAlgorithmsRemoveCopy.cpp + TestStdAlgorithmsUnique.cpp + TestStdAlgorithmsUniqueCopy.cpp + ) + list(REMOVE_ITEM STDALGO_SOURCES_E + TestStdAlgorithmsExclusiveScan.cpp + TestStdAlgorithmsInclusiveScan.cpp + ) +endif() + +# FIXME_OPENMPTARGET This test causes internal compiler errors as of 09/01/22 +# when compiling for Intel's Xe-HP GPUs. +if(NOT (KOKKOS_ENABLE_OPENMPTARGET AND KOKKOS_CXX_COMPILER_ID STREQUAL IntelLLVM)) + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_RandomAndSort + SOURCES + UnitTestMain.cpp + ${SOURCES_A} + ) +endif() foreach(ID A;B;C;D;E) KOKKOS_ADD_EXECUTABLE_AND_TEST( @@ -153,7 +180,11 @@ foreach(ID A;B;C;D;E) ) endforeach() -KOKKOS_ADD_EXECUTABLE( - UnitTest_StdAlgoCompileOnly - SOURCES TestStdAlgorithmsCompileOnly.cpp -) +# FIXME_OPENMPTARGET This test causes internal compiler errors as of 09/01/22 +# when compiling for Intel's Xe-HP GPUs. +if(NOT (KOKKOS_ENABLE_OPENMPTARGET AND KOKKOS_CXX_COMPILER_ID STREQUAL IntelLLVM)) + KOKKOS_ADD_EXECUTABLE( + UnitTest_StdAlgoCompileOnly + SOURCES TestStdAlgorithmsCompileOnly.cpp + ) +endif() diff --git a/lib/kokkos/algorithms/unit_tests/TestNestedSort.hpp b/lib/kokkos/algorithms/unit_tests/TestNestedSort.hpp new file mode 100644 index 0000000000..37ee211b42 --- /dev/null +++ b/lib/kokkos/algorithms/unit_tests/TestNestedSort.hpp @@ -0,0 +1,408 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_ALGORITHMS_UNITTESTS_TEST_NESTED_SORT_HPP +#define KOKKOS_ALGORITHMS_UNITTESTS_TEST_NESTED_SORT_HPP + +#include +#include +#include +#include + +namespace Test { + +namespace Impl { + +// Comparator for sorting in descending order +template +struct GreaterThan { + KOKKOS_FUNCTION constexpr bool operator()(const Key& lhs, + const Key& rhs) const { + return lhs > rhs; + } +}; + +// Functor to test sort_team: each team responsible for sorting one array +template +struct TeamSortFunctor { + using TeamMem = typename Kokkos::TeamPolicy::member_type; + using SizeType = typename KeyViewType::size_type; + using KeyType = typename KeyViewType::non_const_value_type; + TeamSortFunctor(const KeyViewType& keys_, const OffsetViewType& offsets_, + bool sortDescending_) + : keys(keys_), offsets(offsets_), sortDescending(sortDescending_) {} + KOKKOS_INLINE_FUNCTION void operator()(const TeamMem& t) const { + int i = t.league_rank(); + SizeType begin = offsets(i); + SizeType end = offsets(i + 1); + if (sortDescending) + Kokkos::Experimental::sort_team( + t, Kokkos::subview(keys, Kokkos::make_pair(begin, end)), + GreaterThan()); + else + Kokkos::Experimental::sort_team( + t, Kokkos::subview(keys, Kokkos::make_pair(begin, end))); + } + KeyViewType keys; + OffsetViewType offsets; + bool sortDescending; +}; + +// Functor to test sort_by_key_team: each team responsible for sorting one array +template +struct TeamSortByKeyFunctor { + using TeamMem = typename Kokkos::TeamPolicy::member_type; + using SizeType = typename KeyViewType::size_type; + using KeyType = typename KeyViewType::non_const_value_type; + TeamSortByKeyFunctor(const KeyViewType& keys_, const ValueViewType& values_, + const OffsetViewType& offsets_, bool sortDescending_) + : keys(keys_), + values(values_), + offsets(offsets_), + sortDescending(sortDescending_) {} + KOKKOS_INLINE_FUNCTION void operator()(const TeamMem& t) const { + int i = t.league_rank(); + SizeType begin = offsets(i); + SizeType end = offsets(i + 1); + if (sortDescending) { + Kokkos::Experimental::sort_by_key_team( + t, Kokkos::subview(keys, Kokkos::make_pair(begin, end)), + Kokkos::subview(values, Kokkos::make_pair(begin, end)), + GreaterThan()); + } else { + Kokkos::Experimental::sort_by_key_team( + t, Kokkos::subview(keys, Kokkos::make_pair(begin, end)), + Kokkos::subview(values, Kokkos::make_pair(begin, end))); + } + } + KeyViewType keys; + ValueViewType values; + OffsetViewType offsets; + bool sortDescending; +}; + +// Functor to test sort_thread: each thread (multiple vector lanes) responsible +// for sorting one array +template +struct ThreadSortFunctor { + using TeamMem = typename Kokkos::TeamPolicy::member_type; + using SizeType = typename KeyViewType::size_type; + using KeyType = typename KeyViewType::non_const_value_type; + ThreadSortFunctor(const KeyViewType& keys_, const OffsetViewType& offsets_, + bool sortDescending_) + : keys(keys_), offsets(offsets_), sortDescending(sortDescending_) {} + KOKKOS_INLINE_FUNCTION void operator()(const TeamMem& t) const { + int i = t.league_rank() * t.team_size() + t.team_rank(); + // Number of arrays to sort doesn't have to be divisible by team size, so + // some threads may be idle. + if (i < offsets.extent_int(0) - 1) { + SizeType begin = offsets(i); + SizeType end = offsets(i + 1); + if (sortDescending) + Kokkos::Experimental::sort_thread( + t, Kokkos::subview(keys, Kokkos::make_pair(begin, end)), + GreaterThan()); + else + Kokkos::Experimental::sort_thread( + t, Kokkos::subview(keys, Kokkos::make_pair(begin, end))); + } + } + KeyViewType keys; + OffsetViewType offsets; + bool sortDescending; +}; + +// Functor to test sort_by_key_thread +template +struct ThreadSortByKeyFunctor { + using TeamMem = typename Kokkos::TeamPolicy::member_type; + using SizeType = typename KeyViewType::size_type; + using KeyType = typename KeyViewType::non_const_value_type; + ThreadSortByKeyFunctor(const KeyViewType& keys_, const ValueViewType& values_, + const OffsetViewType& offsets_, bool sortDescending_) + : keys(keys_), + values(values_), + offsets(offsets_), + sortDescending(sortDescending_) {} + KOKKOS_INLINE_FUNCTION void operator()(const TeamMem& t) const { + int i = t.league_rank() * t.team_size() + t.team_rank(); + // Number of arrays to sort doesn't have to be divisible by team size, so + // some threads may be idle. + if (i < offsets.extent_int(0) - 1) { + SizeType begin = offsets(i); + SizeType end = offsets(i + 1); + if (sortDescending) { + Kokkos::Experimental::sort_by_key_thread( + t, Kokkos::subview(keys, Kokkos::make_pair(begin, end)), + Kokkos::subview(values, Kokkos::make_pair(begin, end)), + GreaterThan()); + } else { + Kokkos::Experimental::sort_by_key_thread( + t, Kokkos::subview(keys, Kokkos::make_pair(begin, end)), + Kokkos::subview(values, Kokkos::make_pair(begin, end))); + } + } + } + KeyViewType keys; + ValueViewType values; + OffsetViewType offsets; + bool sortDescending; +}; + +// Generate the offsets view for a set of n packed arrays, each with uniform +// random length in [0,k]. Array i will occupy the indices [offsets(i), +// offsets(i+1)), like a row in a CRS graph. Returns the total length of all the +// arrays. +template +size_t randomPackedArrayOffsets(unsigned n, unsigned k, + OffsetViewType& offsets) { + offsets = OffsetViewType("Offsets", n + 1); + auto offsetsHost = Kokkos::create_mirror_view(Kokkos::HostSpace(), offsets); + std::mt19937 gen; + std::uniform_int_distribution<> distrib(0, k); + // This will leave offsetsHost(n) == 0. + std::generate(offsetsHost.data(), offsetsHost.data() + n, + [&]() { return distrib(gen); }); + // Exclusive prefix-sum to get offsets + size_t accum = 0; + for (unsigned i = 0; i <= n; i++) { + size_t num = offsetsHost(i); + offsetsHost(i) = accum; + accum += num; + } + Kokkos::deep_copy(offsets, offsetsHost); + return offsetsHost(n); +} + +template +ValueViewType uniformRandomViewFill(size_t totalLength, + typename ValueViewType::value_type minVal, + typename ValueViewType::value_type maxVal) { + ValueViewType vals("vals", totalLength); + Kokkos::Random_XorShift64_Pool g( + 1931); + Kokkos::fill_random(vals, g, minVal, maxVal); + return vals; +} + +template +void test_nested_sort_impl(unsigned narray, unsigned n, bool useTeams, + bool customCompare, KeyType minKey, KeyType maxKey) { + using KeyViewType = Kokkos::View; + using OffsetViewType = Kokkos::View; + using TeamPol = Kokkos::TeamPolicy; + OffsetViewType offsets; + size_t totalLength = randomPackedArrayOffsets(narray, n, offsets); + KeyViewType keys = + uniformRandomViewFill(totalLength, minKey, maxKey); + // note: doing create_mirror because we always want this to be a separate + // copy, even if keys is already host-accessible. keysHost becomes the correct + // result to compare against. + auto keysHost = Kokkos::create_mirror(Kokkos::HostSpace(), keys); + Kokkos::deep_copy(keysHost, keys); + auto offsetsHost = + Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), offsets); + // Sort the same arrays on host to compare against + for (unsigned i = 0; i < narray; i++) { + KeyType* begin = keysHost.data() + offsetsHost(i); + KeyType* end = keysHost.data() + offsetsHost(i + 1); + if (customCompare) + std::sort(begin, end, + [](const KeyType& a, const KeyType& b) { return a > b; }); + else + std::sort(begin, end); + } + if (useTeams) { + int vectorLen = std::min(4, TeamPol::vector_length_max()); + TeamPol policy(narray, Kokkos::AUTO(), vectorLen); + Kokkos::parallel_for( + policy, TeamSortFunctor( + keys, offsets, customCompare)); + } else { + ThreadSortFunctor functor( + keys, offsets, customCompare); + int vectorLen = std::min(4, TeamPol::vector_length_max()); + TeamPol dummy(1, Kokkos::AUTO(), vectorLen); + int teamSize = + dummy.team_size_recommended(functor, Kokkos::ParallelForTag()); + int numTeams = (narray + teamSize - 1) / teamSize; + Kokkos::parallel_for(TeamPol(numTeams, teamSize, vectorLen), functor); + } + auto keysOut = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), keys); + std::string testLabel = useTeams ? "sort_team" : "sort_thread"; + for (unsigned i = 0; i < keys.extent(0); i++) { + EXPECT_EQ(keysOut(i), keysHost(i)) + << testLabel << ": after sorting, key at index " << i + << " is incorrect."; + } +} + +template +void test_nested_sort_by_key_impl(unsigned narray, unsigned n, bool useTeams, + bool customCompare, KeyType minKey, + KeyType maxKey, ValueType minVal, + ValueType maxVal) { + using KeyViewType = Kokkos::View; + using ValueViewType = Kokkos::View; + using OffsetViewType = Kokkos::View; + using TeamPol = Kokkos::TeamPolicy; + OffsetViewType offsets; + size_t totalLength = randomPackedArrayOffsets(narray, n, offsets); + KeyViewType keys = + uniformRandomViewFill(totalLength, minKey, maxKey); + ValueViewType values = + uniformRandomViewFill(totalLength, minVal, maxVal); + // note: doing create_mirror because we always want this to be a separate + // copy, even if keys/vals are already host-accessible. keysHost and valsHost + // becomes the correct result to compare against. + auto keysHost = Kokkos::create_mirror(Kokkos::HostSpace(), keys); + auto valuesHost = Kokkos::create_mirror(Kokkos::HostSpace(), values); + Kokkos::deep_copy(keysHost, keys); + Kokkos::deep_copy(valuesHost, values); + auto offsetsHost = + Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), offsets); + // Sort the same arrays on host to compare against + for (unsigned i = 0; i < narray; i++) { + // std:: doesn't have a sort_by_key, so sort a vector of key-value pairs + // instead + using KV = std::pair; + std::vector keysAndValues(offsetsHost(i + 1) - offsetsHost(i)); + for (unsigned j = 0; j < keysAndValues.size(); j++) { + keysAndValues[j].first = keysHost(offsetsHost(i) + j); + keysAndValues[j].second = valuesHost(offsetsHost(i) + j); + } + if (customCompare) { + std::sort(keysAndValues.begin(), keysAndValues.end(), + [](const KV& a, const KV& b) { return a.first > b.first; }); + } else { + std::sort(keysAndValues.begin(), keysAndValues.end(), + [](const KV& a, const KV& b) { return a.first < b.first; }); + } + // Copy back from pairs to views + for (unsigned j = 0; j < keysAndValues.size(); j++) { + keysHost(offsetsHost(i) + j) = keysAndValues[j].first; + valuesHost(offsetsHost(i) + j) = keysAndValues[j].second; + } + } + if (useTeams) { + int vectorLen = std::min(4, TeamPol::vector_length_max()); + TeamPol policy(narray, Kokkos::AUTO(), vectorLen); + Kokkos::parallel_for( + policy, TeamSortByKeyFunctor(keys, values, offsets, + customCompare)); + } else { + ThreadSortByKeyFunctor + functor(keys, values, offsets, customCompare); + int vectorLen = std::min(4, TeamPol::vector_length_max()); + TeamPol dummy(1, Kokkos::AUTO(), vectorLen); + int teamSize = + dummy.team_size_recommended(functor, Kokkos::ParallelForTag()); + int numTeams = (narray + teamSize - 1) / teamSize; + Kokkos::parallel_for(TeamPol(numTeams, teamSize, vectorLen), functor); + } + auto keysOut = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), keys); + auto valuesOut = + Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), values); + std::string testLabel = useTeams ? "sort_by_key_team" : "sort_by_key_thread"; + // First, compare keys since they will always match exactly + for (unsigned i = 0; i < keys.extent(0); i++) { + EXPECT_EQ(keysOut(i), keysHost(i)) + << testLabel << ": after sorting, key at index " << i + << " is incorrect."; + } + // Kokkos::sort_by_key_X is not stable, so if a key happens to + // appear more than once, the order of the values may not match exactly. + // But the set of values for a given key should be identical. + unsigned keyStart = 0; + while (keyStart < keys.extent(0)) { + KeyType key = keysHost(keyStart); + unsigned keyEnd = keyStart + 1; + while (keyEnd < keys.extent(0) && keysHost(keyEnd) == key) keyEnd++; + std::unordered_multiset correctVals; + std::unordered_multiset outputVals; + for (unsigned i = keyStart; i < keyEnd; i++) { + correctVals.insert(valuesHost(i)); + outputVals.insert(valuesOut(i)); + } + // Check one value at a time that they match + for (auto it = correctVals.begin(); it != correctVals.end(); it++) { + ValueType val = *it; + EXPECT_TRUE(outputVals.find(val) != outputVals.end()) + << testLabel << ": after sorting, value " << val + << " corresponding to key " << key << " is missing."; + EXPECT_EQ(correctVals.count(val), outputVals.count(val)) + << testLabel << ": after sorting, the number of occurences of value " + << val << " corresponding to key " << key << " changed."; + } + keyStart = keyEnd; + } +} + +template +void test_nested_sort(unsigned int N, KeyType minKey, KeyType maxKey) { + // 2nd arg: true = team-level, false = thread-level. + // 3rd arg: true = custom comparator, false = default comparator. + test_nested_sort_impl(N, N, true, false, minKey, + maxKey); + test_nested_sort_impl(N, N, true, true, minKey, + maxKey); + test_nested_sort_impl(N, N, false, false, minKey, + maxKey); + test_nested_sort_impl(N, N, false, true, minKey, + maxKey); +} + +template +void test_nested_sort_by_key(unsigned int N, KeyType minKey, KeyType maxKey, + ValueType minVal, ValueType maxVal) { + // 2nd arg: true = team-level, false = thread-level. + // 3rd arg: true = custom comparator, false = default comparator. + test_nested_sort_by_key_impl( + N, N, true, false, minKey, maxKey, minVal, maxVal); + test_nested_sort_by_key_impl( + N, N, true, true, minKey, maxKey, minVal, maxVal); + test_nested_sort_by_key_impl( + N, N, false, false, minKey, maxKey, minVal, maxVal); + test_nested_sort_by_key_impl( + N, N, false, true, minKey, maxKey, minVal, maxVal); +} +} // namespace Impl + +TEST(TEST_CATEGORY, NestedSort) { + Impl::test_nested_sort(171, 0U, UINT_MAX); + Impl::test_nested_sort(42, -1e6f, 1e6f); + Impl::test_nested_sort(67, CHAR_MIN, CHAR_MAX); +} + +TEST(TEST_CATEGORY, NestedSortByKey) { + // Second/third template arguments are key and value respectively. + // In sort_by_key_X functions, a key view and a value view are both permuted + // to make the keys sorted. This means that the value type doesn't need to be + // ordered, unlike key + Impl::test_nested_sort_by_key( + 161, 0U, UINT_MAX, 0U, UINT_MAX); + Impl::test_nested_sort_by_key( + 267, -1e6f, 1e6f, CHAR_MIN, CHAR_MAX); + Impl::test_nested_sort_by_key( + 11, CHAR_MIN, CHAR_MAX, 2.718, 3.14); +} + +} // namespace Test +#endif diff --git a/lib/kokkos/algorithms/unit_tests/TestOpenMP_Sort1D.cpp b/lib/kokkos/algorithms/unit_tests/TestOpenMP_Sort1D.cpp index 4a5839f0c8..e06486618f 100644 --- a/lib/kokkos/algorithms/unit_tests/TestOpenMP_Sort1D.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestOpenMP_Sort1D.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #ifdef KOKKOS_ENABLE_OPENMP diff --git a/lib/kokkos/algorithms/unit_tests/TestOpenMP_Sort3D.cpp b/lib/kokkos/algorithms/unit_tests/TestOpenMP_Sort3D.cpp index 127d911d7c..cd6e8e8cbf 100644 --- a/lib/kokkos/algorithms/unit_tests/TestOpenMP_Sort3D.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestOpenMP_Sort3D.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #ifdef KOKKOS_ENABLE_OPENMP diff --git a/lib/kokkos/algorithms/unit_tests/TestOpenMP_SortDynamicView.cpp b/lib/kokkos/algorithms/unit_tests/TestOpenMP_SortDynamicView.cpp index 3dc8854044..549d09f1f2 100644 --- a/lib/kokkos/algorithms/unit_tests/TestOpenMP_SortDynamicView.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestOpenMP_SortDynamicView.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #ifdef KOKKOS_ENABLE_OPENMP diff --git a/lib/kokkos/algorithms/unit_tests/TestRandom.hpp b/lib/kokkos/algorithms/unit_tests/TestRandom.hpp index 19c82003cf..607e94c784 100644 --- a/lib/kokkos/algorithms/unit_tests/TestRandom.hpp +++ b/lib/kokkos/algorithms/unit_tests/TestRandom.hpp @@ -1,43 +1,17 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_DUALVIEW_HPP @@ -189,50 +163,10 @@ struct test_random_functor { static_cast(1.0 * HIST_DIM3D * tmp2 / theMax); const uint64_t ind3_3d = static_cast(1.0 * HIST_DIM3D * tmp3 / theMax); -// Workaround Intel 17 compiler bug which sometimes add random -// instruction alignment which makes the lock instruction -// illegal. Seems to be mostly just for unsigned int atomics. -// Looking at the assembly the compiler -// appears to insert cache line alignment for the instruction. -// Isn't restricted to specific archs. Seen it on SNB and SKX, but for -// different code. Another occurrence was with Desul atomics in -// a different unit test. This one here happens without desul atomics. -// Inserting an assembly nop instruction changes the alignment and -// works round this. -// -// 17.0.4 for 64bit Random works with 1/1/1/2/1 -// 17.0.4 for 1024bit Random works with 1/1/1/1/1 -#ifdef KOKKOS_COMPILER_INTEL -#if (KOKKOS_COMPILER_INTEL < 1800) - asm volatile("nop\n"); -#endif -#endif atomic_fetch_add(&density_1d(ind1_1d), 1); -#ifdef KOKKOS_COMPILER_INTEL -#if (KOKKOS_COMPILER_INTEL < 1800) - asm volatile("nop\n"); -#endif -#endif atomic_fetch_add(&density_1d(ind2_1d), 1); -#ifdef KOKKOS_COMPILER_INTEL -#if (KOKKOS_COMPILER_INTEL < 1800) - asm volatile("nop\n"); -#endif -#endif atomic_fetch_add(&density_1d(ind3_1d), 1); -#ifdef KOKKOS_COMPILER_INTEL -#if (KOKKOS_COMPILER_INTEL < 1800) - if (std::is_same>::value) - asm volatile("nop\n"); - asm volatile("nop\n"); -#endif -#endif atomic_fetch_add(&density_3d(ind1_3d, ind2_3d, ind3_3d), 1); -#ifdef KOKKOS_COMPILER_INTEL -#if (KOKKOS_COMPILER_INTEL < 1800) - asm volatile("nop\n"); -#endif -#endif } rand_pool.free_state(rand_gen); } diff --git a/lib/kokkos/algorithms/unit_tests/TestRandomAccessIterator.cpp b/lib/kokkos/algorithms/unit_tests/TestRandomAccessIterator.cpp index 5136ad434b..439d171c8a 100644 --- a/lib/kokkos/algorithms/unit_tests/TestRandomAccessIterator.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestRandomAccessIterator.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/algorithms/unit_tests/TestRandomCommon.hpp b/lib/kokkos/algorithms/unit_tests/TestRandomCommon.hpp index c6d3b59ae1..c53d66f4d0 100644 --- a/lib/kokkos/algorithms/unit_tests/TestRandomCommon.hpp +++ b/lib/kokkos/algorithms/unit_tests/TestRandomCommon.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_ALGORITHMS_UNITTESTS_TESTRANDOM_COMMON_HPP #define KOKKOS_ALGORITHMS_UNITTESTS_TESTRANDOM_COMMON_HPP diff --git a/lib/kokkos/algorithms/unit_tests/TestSort.hpp b/lib/kokkos/algorithms/unit_tests/TestSort.hpp index 120a04bdb5..d903888878 100644 --- a/lib/kokkos/algorithms/unit_tests/TestSort.hpp +++ b/lib/kokkos/algorithms/unit_tests/TestSort.hpp @@ -1,43 +1,17 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_ALGORITHMS_UNITTESTS_TESTSORT_HPP @@ -130,19 +104,14 @@ struct sum3D { }; template -void test_1D_sort_impl(unsigned int n, bool force_kokkos) { +void test_1D_sort_impl(unsigned int n) { using KeyViewType = Kokkos::View; KeyViewType keys("Keys", n); // Test sorting array with all numbers equal ExecutionSpace exec; Kokkos::deep_copy(exec, keys, KeyType(1)); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - Kokkos::sort(exec, keys, force_kokkos); -#else - (void)force_kokkos; // suppress warnings about unused variable Kokkos::sort(exec, keys); -#endif Kokkos::Random_XorShift64_Pool g(1931); Kokkos::fill_random(keys, g, @@ -156,11 +125,7 @@ void test_1D_sort_impl(unsigned int n, bool force_kokkos) { Kokkos::parallel_reduce(Kokkos::RangePolicy(exec, 0, n), sum(keys), sum_before); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - Kokkos::sort(exec, keys, force_kokkos); -#else Kokkos::sort(exec, keys); -#endif Kokkos::parallel_reduce(Kokkos::RangePolicy(exec, 0, n), sum(keys), sum_after); @@ -415,10 +380,7 @@ void test_sort_integer_overflow() { template void test_1D_sort(unsigned int N) { - test_1D_sort_impl(N * N * N, true); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - test_1D_sort_impl(N * N * N, false); -#endif + test_1D_sort_impl(N * N * N); } template @@ -444,12 +406,20 @@ void test_issue_4978_sort() { template void test_sort(unsigned int N) { test_1D_sort(N); - test_3D_sort(N); +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if (!std::is_same_v) +#endif + test_3D_sort(N); // FIXME_OPENMPTARGET: OpenMPTarget doesn't support DynamicView yet. #ifndef KOKKOS_ENABLE_OPENMPTARGET test_dynamic_view_sort(N); #endif - test_issue_1160_sort(); +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if (!std::is_same_v) +#endif + test_issue_1160_sort(); test_issue_4978_sort(); test_sort_integer_overflow(); test_sort_integer_overflow(); diff --git a/lib/kokkos/algorithms/unit_tests/TestSortCommon.hpp b/lib/kokkos/algorithms/unit_tests/TestSortCommon.hpp index 56657b6574..b8e2e17e4f 100644 --- a/lib/kokkos/algorithms/unit_tests/TestSortCommon.hpp +++ b/lib/kokkos/algorithms/unit_tests/TestSortCommon.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_ALGORITHMS_UNITTESTS_TESTSORT_COMMON_HPP #define KOKKOS_ALGORITHMS_UNITTESTS_TESTSORT_COMMON_HPP diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAdjacentDifference.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAdjacentDifference.cpp index d37f657f57..d414d524b6 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAdjacentDifference.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAdjacentDifference.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAdjacentFind.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAdjacentFind.cpp index 874748193e..ee34761265 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAdjacentFind.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAdjacentFind.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -315,6 +287,12 @@ void run_all_scenarios() { } TEST(std_algorithms_nonmod_seq_ops, adjacent_find) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif run_all_scenarios(); run_all_scenarios(); run_all_scenarios(); diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAllAnyNoneOf.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAllAnyNoneOf.cpp index a1307d4c23..1c39a4735e 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAllAnyNoneOf.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsAllAnyNoneOf.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -175,6 +147,12 @@ void run_all_scenarios() { } TEST(std_algorithms_all_any_none_of_test, test) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif run_all_scenarios(); run_all_scenarios(); run_all_scenarios(); diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCommon.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCommon.cpp index 871cce155b..39a508bb8f 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCommon.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCommon.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCommon.hpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCommon.hpp index a06f9c61c0..694676a878 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCommon.hpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCommon.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_ALGORITHMS_UNITTESTS_TEST_STD_ALGOS_COMMON_HPP #define KOKKOS_ALGORITHMS_UNITTESTS_TEST_STD_ALGOS_COMMON_HPP diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCompileOnly.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCompileOnly.cpp index 037dac36ed..9324db12f2 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCompileOnly.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCompileOnly.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 @@ -123,18 +95,20 @@ struct TrivialTransformReduceBinaryTransformer { } }; -// put all code here and don't call from main -// so that even if one runs the executable, -// nothing is run anyway +namespace KE = Kokkos::Experimental; -namespace KE = Kokkos::Experimental; -using count_type = std::size_t; -using T = double; -Kokkos::View in1("in1", 10); -Kokkos::View in2("in2", 10); -Kokkos::View in3("in3", 10); -Kokkos::DefaultExecutionSpace exe_space; -std::string const label = "trivial"; +struct TestStruct { + // put all code here and don't call from main + // so that even if one runs the executable, + // nothing is run anyway + + using count_type = std::size_t; + using T = double; + Kokkos::View in1 = Kokkos::View("in1", 10); + Kokkos::View in2 = Kokkos::View("in2", 10); + Kokkos::View in3 = Kokkos::View("in3", 10); + Kokkos::DefaultExecutionSpace exe_space; + std::string const label = "trivial"; // // just iterators @@ -239,293 +213,299 @@ std::string const label = "trivial"; (void)KE::ALGO(exe_space, /*--*/ in1, ARG, in2); \ (void)KE::ALGO(label, exe_space, in1, ARG, in2); -void non_modifying_seq_ops() { - TEST_ALGO_MACRO_B1E1_VARIAD(find, T{}); - TEST_ALGO_MACRO_V1_VARIAD(find, T{}); + void non_modifying_seq_ops() { + TEST_ALGO_MACRO_B1E1_VARIAD(find, T{}); + TEST_ALGO_MACRO_V1_VARIAD(find, T{}); - TEST_ALGO_MACRO_B1E1_VARIAD(find_if, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1_VARIAD(find_if, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_B1E1_VARIAD(find_if, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1_VARIAD(find_if, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_B1E1_VARIAD(find_if_not, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1_VARIAD(find_if_not, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_B1E1_VARIAD(find_if_not, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1_VARIAD(find_if_not, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_B1E1_VARIAD(for_each, TimesTwoFunctor()); - TEST_ALGO_MACRO_V1_VARIAD(for_each, TimesTwoFunctor()); + TEST_ALGO_MACRO_B1E1_VARIAD(for_each, TimesTwoFunctor()); + TEST_ALGO_MACRO_V1_VARIAD(for_each, TimesTwoFunctor()); - TEST_ALGO_MACRO_B1_VARIAD(for_each_n, count_type{}, TimesTwoFunctor()); - TEST_ALGO_MACRO_V1_VARIAD(for_each_n, count_type{}, TimesTwoFunctor()); + TEST_ALGO_MACRO_B1_VARIAD(for_each_n, count_type{}, TimesTwoFunctor()); + TEST_ALGO_MACRO_V1_VARIAD(for_each_n, count_type{}, TimesTwoFunctor()); - TEST_ALGO_MACRO_B1E1_VARIAD(count_if, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1_VARIAD(count_if, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_B1E1_VARIAD(count_if, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1_VARIAD(count_if, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_B1E1_VARIAD(count, T{}); - TEST_ALGO_MACRO_V1_VARIAD(count, T{}); + TEST_ALGO_MACRO_B1E1_VARIAD(count, T{}); + TEST_ALGO_MACRO_V1_VARIAD(count, T{}); - TEST_ALGO_MACRO_B1E1B2E2(mismatch); - TEST_ALGO_MACRO_B1E1B2E2_VARIAD(mismatch, TrivialBinaryPredicate()); - TEST_ALGO_MACRO_V1V2(mismatch); - TEST_ALGO_MACRO_V1V2_VARIAD(mismatch, TrivialBinaryPredicate()); + TEST_ALGO_MACRO_B1E1B2E2(mismatch); + TEST_ALGO_MACRO_B1E1B2E2_VARIAD(mismatch, TrivialBinaryPredicate()); + TEST_ALGO_MACRO_V1V2(mismatch); + TEST_ALGO_MACRO_V1V2_VARIAD(mismatch, TrivialBinaryPredicate()); - TEST_ALGO_MACRO_B1E1_VARIAD(all_of, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1_VARIAD(all_of, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_B1E1_VARIAD(all_of, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1_VARIAD(all_of, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_B1E1_VARIAD(any_of, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1_VARIAD(any_of, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_B1E1_VARIAD(any_of, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1_VARIAD(any_of, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_B1E1_VARIAD(none_of, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1_VARIAD(none_of, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_B1E1_VARIAD(none_of, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1_VARIAD(none_of, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_B1E1B2(equal); - TEST_ALGO_MACRO_B1E1B2_VARIAD(equal, TrivialBinaryPredicate()); - TEST_ALGO_MACRO_V1V2(equal); - TEST_ALGO_MACRO_V1V2_VARIAD(equal, TrivialBinaryPredicate()); - TEST_ALGO_MACRO_B1E1B2E2(equal); - TEST_ALGO_MACRO_B1E1B2E2_VARIAD(equal, TrivialBinaryPredicate()); + TEST_ALGO_MACRO_B1E1B2(equal); + TEST_ALGO_MACRO_B1E1B2_VARIAD(equal, TrivialBinaryPredicate()); + TEST_ALGO_MACRO_V1V2(equal); + TEST_ALGO_MACRO_V1V2_VARIAD(equal, TrivialBinaryPredicate()); + TEST_ALGO_MACRO_B1E1B2E2(equal); + TEST_ALGO_MACRO_B1E1B2E2_VARIAD(equal, TrivialBinaryPredicate()); - TEST_ALGO_MACRO_B1E1B2E2(lexicographical_compare); - TEST_ALGO_MACRO_B1E1B2E2_VARIAD(lexicographical_compare, - TrivialComparator()); - TEST_ALGO_MACRO_V1V2(lexicographical_compare); - TEST_ALGO_MACRO_V1V2_VARIAD(lexicographical_compare, TrivialComparator()); + TEST_ALGO_MACRO_B1E1B2E2(lexicographical_compare); + TEST_ALGO_MACRO_B1E1B2E2_VARIAD(lexicographical_compare, + TrivialComparator()); + TEST_ALGO_MACRO_V1V2(lexicographical_compare); + TEST_ALGO_MACRO_V1V2_VARIAD(lexicographical_compare, + TrivialComparator()); - TEST_ALGO_MACRO_B1E1(adjacent_find); - TEST_ALGO_MACRO_V1(adjacent_find); - TEST_ALGO_MACRO_B1E1_VARIAD(adjacent_find, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_V1_VARIAD(adjacent_find, TrivialBinaryFunctor()); + TEST_ALGO_MACRO_B1E1(adjacent_find); + TEST_ALGO_MACRO_V1(adjacent_find); + TEST_ALGO_MACRO_B1E1_VARIAD(adjacent_find, TrivialBinaryFunctor()); + TEST_ALGO_MACRO_V1_VARIAD(adjacent_find, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_B1E1B2E2(search); - TEST_ALGO_MACRO_V1V2(search); - TEST_ALGO_MACRO_B1E1B2E2_VARIAD(search, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_V1V2_VARIAD(search, TrivialBinaryFunctor()); + TEST_ALGO_MACRO_B1E1B2E2(search); + TEST_ALGO_MACRO_V1V2(search); + TEST_ALGO_MACRO_B1E1B2E2_VARIAD(search, TrivialBinaryFunctor()); + TEST_ALGO_MACRO_V1V2_VARIAD(search, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_B1E1B2E2(find_first_of); - TEST_ALGO_MACRO_V1V2(find_first_of); - TEST_ALGO_MACRO_B1E1B2E2_VARIAD(find_first_of, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_V1V2_VARIAD(find_first_of, TrivialBinaryFunctor()); + TEST_ALGO_MACRO_B1E1B2E2(find_first_of); + TEST_ALGO_MACRO_V1V2(find_first_of); + TEST_ALGO_MACRO_B1E1B2E2_VARIAD(find_first_of, TrivialBinaryFunctor()); + TEST_ALGO_MACRO_V1V2_VARIAD(find_first_of, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_B1E1_VARIAD(search_n, count_type{}, T{}); - TEST_ALGO_MACRO_V1_VARIAD(search_n, count_type{}, T{}); - TEST_ALGO_MACRO_B1E1_VARIAD(search_n, count_type{}, T{}, + TEST_ALGO_MACRO_B1E1_VARIAD(search_n, count_type{}, T{}); + TEST_ALGO_MACRO_V1_VARIAD(search_n, count_type{}, T{}); + TEST_ALGO_MACRO_B1E1_VARIAD(search_n, count_type{}, T{}, + TrivialBinaryPredicate()); + TEST_ALGO_MACRO_V1_VARIAD(search_n, count_type{}, T{}, TrivialBinaryPredicate()); - TEST_ALGO_MACRO_V1_VARIAD(search_n, count_type{}, T{}, - TrivialBinaryPredicate()); - TEST_ALGO_MACRO_B1E1B2E2(find_end); - TEST_ALGO_MACRO_V1V2(find_end); - TEST_ALGO_MACRO_B1E1B2E2_VARIAD(find_end, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_V1V2_VARIAD(find_end, TrivialBinaryFunctor()); -} + TEST_ALGO_MACRO_B1E1B2E2(find_end); + TEST_ALGO_MACRO_V1V2(find_end); + TEST_ALGO_MACRO_B1E1B2E2_VARIAD(find_end, TrivialBinaryFunctor()); + TEST_ALGO_MACRO_V1V2_VARIAD(find_end, TrivialBinaryFunctor()); + } -void modifying_seq_ops() { - TEST_ALGO_MACRO_B1E1B2_VARIAD(replace_copy, T{}, T{}); - TEST_ALGO_MACRO_V1V2_VARIAD(replace_copy, T{}, T{}); + void modifying_seq_ops() { + TEST_ALGO_MACRO_B1E1B2_VARIAD(replace_copy, T{}, T{}); + TEST_ALGO_MACRO_V1V2_VARIAD(replace_copy, T{}, T{}); - TEST_ALGO_MACRO_B1E1B2_VARIAD(replace_copy_if, TrivialUnaryPredicate(), + TEST_ALGO_MACRO_B1E1B2_VARIAD(replace_copy_if, TrivialUnaryPredicate(), + T{}); + TEST_ALGO_MACRO_V1V2_VARIAD(replace_copy_if, TrivialUnaryPredicate(), T{}); - TEST_ALGO_MACRO_V1V2_VARIAD(replace_copy_if, TrivialUnaryPredicate(), T{}); - TEST_ALGO_MACRO_B1E1_VARIAD(replace, T{}, T{}); - TEST_ALGO_MACRO_V1_VARIAD(replace, T{}, T{}); + TEST_ALGO_MACRO_B1E1_VARIAD(replace, T{}, T{}); + TEST_ALGO_MACRO_V1_VARIAD(replace, T{}, T{}); - TEST_ALGO_MACRO_B1E1_VARIAD(replace_if, TrivialUnaryPredicate(), T{}); - TEST_ALGO_MACRO_V1_VARIAD(replace_if, TrivialUnaryPredicate(), T{}); + TEST_ALGO_MACRO_B1E1_VARIAD(replace_if, TrivialUnaryPredicate(), T{}); + TEST_ALGO_MACRO_V1_VARIAD(replace_if, TrivialUnaryPredicate(), T{}); - TEST_ALGO_MACRO_B1E1B2(copy); - TEST_ALGO_MACRO_V1V2(copy); + TEST_ALGO_MACRO_B1E1B2(copy); + TEST_ALGO_MACRO_V1V2(copy); - TEST_ALGO_MACRO_B1_ARG_B2(copy_n, count_type{}); - TEST_ALGO_MACRO_V1_ARG_V2(copy_n, count_type{}); + TEST_ALGO_MACRO_B1_ARG_B2(copy_n, count_type{}); + TEST_ALGO_MACRO_V1_ARG_V2(copy_n, count_type{}); - TEST_ALGO_MACRO_B1E1B2(copy_backward); - TEST_ALGO_MACRO_V1V2(copy_backward); + TEST_ALGO_MACRO_B1E1B2(copy_backward); + TEST_ALGO_MACRO_V1V2(copy_backward); - TEST_ALGO_MACRO_B1E1B2_VARIAD(copy_if, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1V2_VARIAD(copy_if, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_B1E1B2_VARIAD(copy_if, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1V2_VARIAD(copy_if, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_B1E1_VARIAD(fill, T{}); - TEST_ALGO_MACRO_V1_VARIAD(fill, T{}); + TEST_ALGO_MACRO_B1E1_VARIAD(fill, T{}); + TEST_ALGO_MACRO_V1_VARIAD(fill, T{}); - TEST_ALGO_MACRO_B1_VARIAD(fill_n, count_type{}, T{}); - TEST_ALGO_MACRO_V1_VARIAD(fill_n, count_type{}, T{}); + TEST_ALGO_MACRO_B1_VARIAD(fill_n, count_type{}, T{}); + TEST_ALGO_MACRO_V1_VARIAD(fill_n, count_type{}, T{}); - TEST_ALGO_MACRO_B1E1B2_VARIAD(transform, TrivialUnaryFunctor{}); - TEST_ALGO_MACRO_V1V2_VARIAD(transform, TrivialUnaryFunctor{}); + TEST_ALGO_MACRO_B1E1B2_VARIAD(transform, TrivialUnaryFunctor{}); + TEST_ALGO_MACRO_V1V2_VARIAD(transform, TrivialUnaryFunctor{}); - TEST_ALGO_MACRO_B1E1B2_VARIAD(transform, TrivialUnaryFunctor{}); - TEST_ALGO_MACRO_B1E1B2B3_VARIAD(transform, TrivialBinaryFunctor{}); - TEST_ALGO_MACRO_V1V2_VARIAD(transform, TrivialUnaryFunctor{}); - TEST_ALGO_MACRO_V1V2V3_VARIAD(transform, TrivialBinaryFunctor{}); + TEST_ALGO_MACRO_B1E1B2_VARIAD(transform, TrivialUnaryFunctor{}); + TEST_ALGO_MACRO_B1E1B2B3_VARIAD(transform, TrivialBinaryFunctor{}); + TEST_ALGO_MACRO_V1V2_VARIAD(transform, TrivialUnaryFunctor{}); + TEST_ALGO_MACRO_V1V2V3_VARIAD(transform, TrivialBinaryFunctor{}); - TEST_ALGO_MACRO_B1E1_VARIAD(generate, TrivialGenerator{}); - TEST_ALGO_MACRO_V1_VARIAD(generate, TrivialGenerator{}); + TEST_ALGO_MACRO_B1E1_VARIAD(generate, TrivialGenerator{}); + TEST_ALGO_MACRO_V1_VARIAD(generate, TrivialGenerator{}); - TEST_ALGO_MACRO_B1_VARIAD(generate_n, count_type{}, TrivialGenerator{}); - TEST_ALGO_MACRO_V1_VARIAD(generate_n, count_type{}, TrivialGenerator{}); + TEST_ALGO_MACRO_B1_VARIAD(generate_n, count_type{}, TrivialGenerator{}); + TEST_ALGO_MACRO_V1_VARIAD(generate_n, count_type{}, TrivialGenerator{}); - TEST_ALGO_MACRO_B1E1B2(reverse_copy); - TEST_ALGO_MACRO_V1V2(reverse_copy); + TEST_ALGO_MACRO_B1E1B2(reverse_copy); + TEST_ALGO_MACRO_V1V2(reverse_copy); - TEST_ALGO_MACRO_B1E1(reverse); - TEST_ALGO_MACRO_V1(reverse); + TEST_ALGO_MACRO_B1E1(reverse); + TEST_ALGO_MACRO_V1(reverse); - TEST_ALGO_MACRO_B1E1B2(move); - TEST_ALGO_MACRO_V1V2(move); + TEST_ALGO_MACRO_B1E1B2(move); + TEST_ALGO_MACRO_V1V2(move); - TEST_ALGO_MACRO_B1E1E2(move_backward); - TEST_ALGO_MACRO_V1V2(move_backward); + TEST_ALGO_MACRO_B1E1E2(move_backward); + TEST_ALGO_MACRO_V1V2(move_backward); - TEST_ALGO_MACRO_B1E1B2(swap_ranges); - TEST_ALGO_MACRO_V1V2(swap_ranges); + TEST_ALGO_MACRO_B1E1B2(swap_ranges); + TEST_ALGO_MACRO_V1V2(swap_ranges); - TEST_ALGO_MACRO_B1E1(unique); - TEST_ALGO_MACRO_V1(unique); - TEST_ALGO_MACRO_B1E1_VARIAD(unique, TrivialBinaryPredicate{}); - TEST_ALGO_MACRO_V1_VARIAD(unique, TrivialBinaryPredicate{}); + TEST_ALGO_MACRO_B1E1(unique); + TEST_ALGO_MACRO_V1(unique); + TEST_ALGO_MACRO_B1E1_VARIAD(unique, TrivialBinaryPredicate{}); + TEST_ALGO_MACRO_V1_VARIAD(unique, TrivialBinaryPredicate{}); - TEST_ALGO_MACRO_B1E1B2(unique_copy); - TEST_ALGO_MACRO_V1V2(unique_copy); - TEST_ALGO_MACRO_B1E1B2_VARIAD(unique_copy, TrivialBinaryPredicate{}); - TEST_ALGO_MACRO_V1V2_VARIAD(unique_copy, TrivialBinaryPredicate{}); + TEST_ALGO_MACRO_B1E1B2(unique_copy); + TEST_ALGO_MACRO_V1V2(unique_copy); + TEST_ALGO_MACRO_B1E1B2_VARIAD(unique_copy, TrivialBinaryPredicate{}); + TEST_ALGO_MACRO_V1V2_VARIAD(unique_copy, TrivialBinaryPredicate{}); - TEST_ALGO_MACRO_B1E1E2(rotate); - TEST_ALGO_MACRO_V1_VARIAD(rotate, count_type{}); + TEST_ALGO_MACRO_B1E1E2(rotate); + TEST_ALGO_MACRO_V1_VARIAD(rotate, count_type{}); - TEST_ALGO_MACRO_B1E1E1B2(rotate_copy); - TEST_ALGO_MACRO_V1_ARG_V2(rotate_copy, count_type{}); + TEST_ALGO_MACRO_B1E1E1B2(rotate_copy); + TEST_ALGO_MACRO_V1_ARG_V2(rotate_copy, count_type{}); - TEST_ALGO_MACRO_B1E1_VARIAD(remove_if, TrivialUnaryPredicate{}); - TEST_ALGO_MACRO_V1_VARIAD(remove_if, TrivialUnaryPredicate{}); + TEST_ALGO_MACRO_B1E1_VARIAD(remove_if, TrivialUnaryPredicate{}); + TEST_ALGO_MACRO_V1_VARIAD(remove_if, TrivialUnaryPredicate{}); - TEST_ALGO_MACRO_B1E1_VARIAD(remove, T{}); - TEST_ALGO_MACRO_V1_VARIAD(remove, T{}); + TEST_ALGO_MACRO_B1E1_VARIAD(remove, T{}); + TEST_ALGO_MACRO_V1_VARIAD(remove, T{}); - TEST_ALGO_MACRO_B1E1B2_VARIAD(remove_copy, T{}); - TEST_ALGO_MACRO_V1V2_VARIAD(remove_copy, T{}); + TEST_ALGO_MACRO_B1E1B2_VARIAD(remove_copy, T{}); + TEST_ALGO_MACRO_V1V2_VARIAD(remove_copy, T{}); - TEST_ALGO_MACRO_B1E1B2_VARIAD(remove_copy_if, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1V2_VARIAD(remove_copy_if, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_B1E1B2_VARIAD(remove_copy_if, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1V2_VARIAD(remove_copy_if, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_B1E1_VARIAD(shift_left, count_type{}); - TEST_ALGO_MACRO_V1_VARIAD(shift_left, count_type{}); + TEST_ALGO_MACRO_B1E1_VARIAD(shift_left, count_type{}); + TEST_ALGO_MACRO_V1_VARIAD(shift_left, count_type{}); - TEST_ALGO_MACRO_B1E1_VARIAD(shift_right, count_type{}); - TEST_ALGO_MACRO_V1_VARIAD(shift_right, count_type{}); -} + TEST_ALGO_MACRO_B1E1_VARIAD(shift_right, count_type{}); + TEST_ALGO_MACRO_V1_VARIAD(shift_right, count_type{}); + } -void sorting_ops() { - TEST_ALGO_MACRO_B1E1(is_sorted_until); - TEST_ALGO_MACRO_V1(is_sorted_until); + void sorting_ops() { + TEST_ALGO_MACRO_B1E1(is_sorted_until); + TEST_ALGO_MACRO_V1(is_sorted_until); #ifndef KOKKOS_ENABLE_OPENMPTARGET - TEST_ALGO_MACRO_B1E1_VARIAD(is_sorted_until, TrivialComparator()); - TEST_ALGO_MACRO_V1_VARIAD(is_sorted_until, TrivialComparator()); + TEST_ALGO_MACRO_B1E1_VARIAD(is_sorted_until, TrivialComparator()); + TEST_ALGO_MACRO_V1_VARIAD(is_sorted_until, TrivialComparator()); #endif - TEST_ALGO_MACRO_B1E1(is_sorted); - TEST_ALGO_MACRO_V1(is_sorted); + TEST_ALGO_MACRO_B1E1(is_sorted); + TEST_ALGO_MACRO_V1(is_sorted); #ifndef KOKKOS_ENABLE_OPENMPTARGET - TEST_ALGO_MACRO_B1E1_VARIAD(is_sorted, TrivialComparator()); - TEST_ALGO_MACRO_V1_VARIAD(is_sorted, TrivialComparator()); + TEST_ALGO_MACRO_B1E1_VARIAD(is_sorted, TrivialComparator()); + TEST_ALGO_MACRO_V1_VARIAD(is_sorted, TrivialComparator()); #endif -} + } -void minmax_ops() { - TEST_ALGO_MACRO_B1E1(min_element); - TEST_ALGO_MACRO_V1(min_element); - TEST_ALGO_MACRO_B1E1(max_element); - TEST_ALGO_MACRO_V1(max_element); - TEST_ALGO_MACRO_B1E1(minmax_element); - TEST_ALGO_MACRO_V1(minmax_element); + void minmax_ops() { + TEST_ALGO_MACRO_B1E1(min_element); + TEST_ALGO_MACRO_V1(min_element); + TEST_ALGO_MACRO_B1E1(max_element); + TEST_ALGO_MACRO_V1(max_element); + TEST_ALGO_MACRO_B1E1(minmax_element); + TEST_ALGO_MACRO_V1(minmax_element); #ifndef KOKKOS_ENABLE_OPENMPTARGET - TEST_ALGO_MACRO_B1E1_VARIAD(min_element, TrivialComparator()); - TEST_ALGO_MACRO_V1_VARIAD(min_element, TrivialComparator()); - TEST_ALGO_MACRO_B1E1_VARIAD(max_element, TrivialComparator()); - TEST_ALGO_MACRO_V1_VARIAD(max_element, TrivialComparator()); - TEST_ALGO_MACRO_B1E1_VARIAD(minmax_element, TrivialComparator()); - TEST_ALGO_MACRO_V1_VARIAD(minmax_element, TrivialComparator()); + TEST_ALGO_MACRO_B1E1_VARIAD(min_element, TrivialComparator()); + TEST_ALGO_MACRO_V1_VARIAD(min_element, TrivialComparator()); + TEST_ALGO_MACRO_B1E1_VARIAD(max_element, TrivialComparator()); + TEST_ALGO_MACRO_V1_VARIAD(max_element, TrivialComparator()); + TEST_ALGO_MACRO_B1E1_VARIAD(minmax_element, TrivialComparator()); + TEST_ALGO_MACRO_V1_VARIAD(minmax_element, TrivialComparator()); #endif -} + } -void partitionig_ops() { - TEST_ALGO_MACRO_B1E1_VARIAD(is_partitioned, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1_VARIAD(is_partitioned, TrivialUnaryPredicate()); + void partitionig_ops() { + TEST_ALGO_MACRO_B1E1_VARIAD(is_partitioned, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1_VARIAD(is_partitioned, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_B1E1B2B3_VARIAD(partition_copy, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1V2V3_VARIAD(partition_copy, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_B1E1B2B3_VARIAD(partition_copy, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1V2V3_VARIAD(partition_copy, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_B1E1_VARIAD(partition_point, TrivialUnaryPredicate()); - TEST_ALGO_MACRO_V1_VARIAD(partition_point, TrivialUnaryPredicate()); -} + TEST_ALGO_MACRO_B1E1_VARIAD(partition_point, TrivialUnaryPredicate()); + TEST_ALGO_MACRO_V1_VARIAD(partition_point, TrivialUnaryPredicate()); + } -void numeric() { - TEST_ALGO_MACRO_B1E1B2(adjacent_difference); - TEST_ALGO_MACRO_B1E1B2_VARIAD(adjacent_difference, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_V1V2(adjacent_difference); - TEST_ALGO_MACRO_V1V2_VARIAD(adjacent_difference, TrivialBinaryFunctor()); + void numeric() { + TEST_ALGO_MACRO_B1E1B2(adjacent_difference); + TEST_ALGO_MACRO_B1E1B2_VARIAD(adjacent_difference, + TrivialBinaryFunctor()); + TEST_ALGO_MACRO_V1V2(adjacent_difference); + TEST_ALGO_MACRO_V1V2_VARIAD(adjacent_difference, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_B1E1B2_VARIAD(exclusive_scan, T{}); - TEST_ALGO_MACRO_V1V2_VARIAD(exclusive_scan, T{}); + TEST_ALGO_MACRO_B1E1B2_VARIAD(exclusive_scan, T{}); + TEST_ALGO_MACRO_V1V2_VARIAD(exclusive_scan, T{}); #ifndef KOKKOS_ENABLE_OPENMPTARGET - TEST_ALGO_MACRO_B1E1B2_VARIAD(exclusive_scan, T{}, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_V1V2_VARIAD(exclusive_scan, T{}, TrivialBinaryFunctor()); + TEST_ALGO_MACRO_B1E1B2_VARIAD(exclusive_scan, T{}, + TrivialBinaryFunctor()); + TEST_ALGO_MACRO_V1V2_VARIAD(exclusive_scan, T{}, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_B1E1B2_VARIAD(transform_exclusive_scan, T{}, + TEST_ALGO_MACRO_B1E1B2_VARIAD(transform_exclusive_scan, T{}, + TrivialBinaryFunctor(), + TrivialUnaryFunctor()); + TEST_ALGO_MACRO_V1V2_VARIAD(transform_exclusive_scan, T{}, TrivialBinaryFunctor(), TrivialUnaryFunctor()); - TEST_ALGO_MACRO_V1V2_VARIAD(transform_exclusive_scan, T{}, - TrivialBinaryFunctor(), - TrivialUnaryFunctor()); #endif - TEST_ALGO_MACRO_B1E1B2(inclusive_scan); - TEST_ALGO_MACRO_V1V2(inclusive_scan); + TEST_ALGO_MACRO_B1E1B2(inclusive_scan); + TEST_ALGO_MACRO_V1V2(inclusive_scan); #ifndef KOKKOS_ENABLE_OPENMPTARGET - TEST_ALGO_MACRO_B1E1B2_VARIAD(inclusive_scan, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_V1V2_VARIAD(inclusive_scan, TrivialBinaryFunctor()); - TEST_ALGO_MACRO_B1E1B2_VARIAD(inclusive_scan, TrivialBinaryFunctor(), T{}); - TEST_ALGO_MACRO_V1V2_VARIAD(inclusive_scan, TrivialBinaryFunctor(), T{}); + TEST_ALGO_MACRO_B1E1B2_VARIAD(inclusive_scan, TrivialBinaryFunctor()); + TEST_ALGO_MACRO_V1V2_VARIAD(inclusive_scan, TrivialBinaryFunctor()); + TEST_ALGO_MACRO_B1E1B2_VARIAD(inclusive_scan, TrivialBinaryFunctor(), + T{}); + TEST_ALGO_MACRO_V1V2_VARIAD(inclusive_scan, TrivialBinaryFunctor(), T{}); - TEST_ALGO_MACRO_B1E1B2_VARIAD(transform_inclusive_scan, + TEST_ALGO_MACRO_B1E1B2_VARIAD(transform_inclusive_scan, + TrivialBinaryFunctor(), + TrivialUnaryFunctor()); + TEST_ALGO_MACRO_V1V2_VARIAD(transform_inclusive_scan, TrivialBinaryFunctor(), TrivialUnaryFunctor()); - TEST_ALGO_MACRO_V1V2_VARIAD(transform_inclusive_scan, - TrivialBinaryFunctor(), - TrivialUnaryFunctor()); - TEST_ALGO_MACRO_B1E1B2_VARIAD(transform_inclusive_scan, + TEST_ALGO_MACRO_B1E1B2_VARIAD(transform_inclusive_scan, + TrivialBinaryFunctor(), + TrivialUnaryFunctor(), T{}); + TEST_ALGO_MACRO_V1V2_VARIAD(transform_inclusive_scan, TrivialBinaryFunctor(), TrivialUnaryFunctor(), T{}); - TEST_ALGO_MACRO_V1V2_VARIAD(transform_inclusive_scan, - TrivialBinaryFunctor(), - TrivialUnaryFunctor(), T{}); #endif #ifndef KOKKOS_ENABLE_OPENMPTARGET - TEST_ALGO_MACRO_B1E1(reduce); - TEST_ALGO_MACRO_V1(reduce); - TEST_ALGO_MACRO_B1E1_VARIAD(reduce, T{}); - TEST_ALGO_MACRO_V1_VARIAD(reduce, T{}); - TEST_ALGO_MACRO_B1E1_VARIAD(reduce, T{}, TrivialReduceJoinFunctor()); - TEST_ALGO_MACRO_V1_VARIAD(reduce, T{}, TrivialReduceJoinFunctor()); + TEST_ALGO_MACRO_B1E1(reduce); + TEST_ALGO_MACRO_V1(reduce); + TEST_ALGO_MACRO_B1E1_VARIAD(reduce, T{}); + TEST_ALGO_MACRO_V1_VARIAD(reduce, T{}); + TEST_ALGO_MACRO_B1E1_VARIAD(reduce, T{}, TrivialReduceJoinFunctor()); + TEST_ALGO_MACRO_V1_VARIAD(reduce, T{}, TrivialReduceJoinFunctor()); - TEST_ALGO_MACRO_B1E1B2_VARIAD(transform_reduce, T{}); - TEST_ALGO_MACRO_V1V2_VARIAD(transform_reduce, T{}); - TEST_ALGO_MACRO_B1E1B2_VARIAD(transform_reduce, T{}, + TEST_ALGO_MACRO_B1E1B2_VARIAD(transform_reduce, T{}); + TEST_ALGO_MACRO_V1V2_VARIAD(transform_reduce, T{}); + TEST_ALGO_MACRO_B1E1B2_VARIAD(transform_reduce, T{}, + TrivialReduceJoinFunctor(), + TrivialTransformReduceBinaryTransformer()); + TEST_ALGO_MACRO_V1V2_VARIAD(transform_reduce, T{}, TrivialReduceJoinFunctor(), TrivialTransformReduceBinaryTransformer()); - TEST_ALGO_MACRO_V1V2_VARIAD(transform_reduce, T{}, - TrivialReduceJoinFunctor(), - TrivialTransformReduceBinaryTransformer()); - TEST_ALGO_MACRO_B1E1_VARIAD(transform_reduce, T{}, + TEST_ALGO_MACRO_B1E1_VARIAD(transform_reduce, T{}, + TrivialReduceJoinFunctor(), + TrivialTransformReduceUnaryTransformer()); + TEST_ALGO_MACRO_V1_VARIAD(transform_reduce, T{}, TrivialReduceJoinFunctor(), TrivialTransformReduceUnaryTransformer()); - TEST_ALGO_MACRO_V1_VARIAD(transform_reduce, T{}, - TrivialReduceJoinFunctor(), - TrivialTransformReduceUnaryTransformer()); #endif -} + } +}; } // namespace compileonly } // namespace stdalgos diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsConstraints.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsConstraints.cpp index 3eb13c98c4..5d55199801 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsConstraints.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsConstraints.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCopyIf.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCopyIf.cpp index d5758e2438..e21d50f69b 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCopyIf.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCopyIf.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCount.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCount.cpp index 4c92a99059..9423d2e15a 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCount.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsCount.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsEqual.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsEqual.cpp index e5b1e8514d..ef0209b345 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsEqual.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsEqual.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsExclusiveScan.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsExclusiveScan.cpp index e470ee8620..4969541a02 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsExclusiveScan.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsExclusiveScan.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFind.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFind.cpp index 35b232e94f..3b8b5e85af 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFind.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFind.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -179,6 +151,12 @@ void run_all_scenarios() { } TEST(std_algorithms_find_test, test) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif run_all_scenarios(); run_all_scenarios(); run_all_scenarios(); diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFindEnd.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFindEnd.cpp index 2a6d271856..ddc4bc1ba6 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFindEnd.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFindEnd.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -376,6 +348,12 @@ void run_all_scenarios() { } TEST(std_algorithms_non_mod_seq_ops, find_end) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif run_all_scenarios(); run_all_scenarios(); } diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFindFirstOf.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFindFirstOf.cpp index 84892bc376..c2f7a2fdb8 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFindFirstOf.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsFindFirstOf.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -292,6 +264,12 @@ void run_all_scenarios() { } TEST(std_algorithms_non_mod_seq_ops, find_first_of) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif run_all_scenarios(); run_all_scenarios(); } diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsForEach.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsForEach.cpp index 79badc7c4f..83b44f01aa 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsForEach.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsForEach.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsHelperFunctors.hpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsHelperFunctors.hpp index 882a6012eb..a2a31f1f65 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsHelperFunctors.hpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsHelperFunctors.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_ALGORITHMS_UNITTESTS_TEST_STD_ALGOS_HELPERS_FUNCTORS_HPP #define KOKKOS_ALGORITHMS_UNITTESTS_TEST_STD_ALGOS_HELPERS_FUNCTORS_HPP diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsInclusiveScan.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsInclusiveScan.cpp index 173fbed660..510f1d195a 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsInclusiveScan.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsInclusiveScan.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsIsSorted.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsIsSorted.cpp index b0df935392..f31d49e06b 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsIsSorted.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsIsSorted.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsIsSortedUntil.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsIsSortedUntil.cpp index 7f0071e248..ce8669a84f 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsIsSortedUntil.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsIsSortedUntil.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -213,6 +185,12 @@ void run_is_sorted_until_all_scenarios() { } TEST(std_algorithms_sorting_ops_test, is_sorted_until) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif run_is_sorted_until_all_scenarios(); run_is_sorted_until_all_scenarios(); run_is_sorted_until_all_scenarios(); diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsLexicographicalCompare.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsLexicographicalCompare.cpp index 8bfa51b4f5..2acd4934ac 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsLexicographicalCompare.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsLexicographicalCompare.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -168,6 +140,12 @@ void run_all_scenarios() { } TEST(std_algorithms_lexicographical_compare_test, test) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif // FIXME: should this disable only custom comparator tests? #if !defined KOKKOS_ENABLE_OPENMPTARGET run_all_scenarios(); diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMinMaxElementOps.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMinMaxElementOps.cpp index 56819de8c1..f8634ffafe 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMinMaxElementOps.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMinMaxElementOps.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMismatch.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMismatch.cpp index 4bc4e018b4..bb4b6fb2a2 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMismatch.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMismatch.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -217,6 +189,12 @@ void run_all_scenarios() { } TEST(std_algorithms_mismatch_test, test) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif run_all_scenarios(); run_all_scenarios(); } diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsModOps.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsModOps.cpp index 8d4f604037..4fce044bcf 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsModOps.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsModOps.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsModSeqOps.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsModSeqOps.cpp index 1e3960c5e6..6b806d7bc5 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsModSeqOps.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsModSeqOps.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMoveBackward.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMoveBackward.cpp index 002d354661..635714eb54 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMoveBackward.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsMoveBackward.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsNumerics.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsNumerics.cpp index 0ea5fcc99a..288a67c369 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsNumerics.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsNumerics.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsPartitionCopy.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsPartitionCopy.cpp index a461f27515..0399e9eee4 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsPartitionCopy.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsPartitionCopy.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsPartitioningOps.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsPartitioningOps.cpp index 0d46151559..1bfb536c2c 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsPartitioningOps.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsPartitioningOps.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 @@ -176,6 +148,12 @@ struct std_algorithms_partitioning_test : public std_algorithms_test { }; TEST_F(std_algorithms_partitioning_test, is_partitioned_trivial) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif IsNegativeFunctor p; const auto result1 = KE::is_partitioned(exespace(), KE::cbegin(m_static_view), KE::cbegin(m_static_view), p); @@ -191,6 +169,12 @@ TEST_F(std_algorithms_partitioning_test, is_partitioned_trivial) { } TEST_F(std_algorithms_partitioning_test, is_partitioned_accepting_iterators) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif const IsNegativeFunctor p; for (int id = 0; id < FixtureViews::Count; ++id) { @@ -212,6 +196,12 @@ TEST_F(std_algorithms_partitioning_test, is_partitioned_accepting_iterators) { } TEST_F(std_algorithms_partitioning_test, is_partitioned_accepting_view) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif const IsNegativeFunctor p; for (int id = 0; id < FixtureViews::Count; ++id) { @@ -230,6 +220,12 @@ TEST_F(std_algorithms_partitioning_test, is_partitioned_accepting_view) { } TEST_F(std_algorithms_partitioning_test, partition_point) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif const IsNegativeFunctor p; for (int id = 0; id < FixtureViews::Count; ++id) { diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemove.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemove.cpp index 8f345f044e..8832d71f95 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemove.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemove.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveCopy.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveCopy.cpp index bb7d0b52bd..949f8f60c9 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveCopy.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveCopy.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveCopyIf.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveCopyIf.cpp index b209b88ea9..9dc1e4a7e1 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveCopyIf.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveCopyIf.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveIf.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveIf.cpp index f1f232369b..e9d15f29d8 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveIf.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRemoveIf.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplace.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplace.cpp index f044d975a7..b226de5535 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplace.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplace.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceCopy.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceCopy.cpp index 682622cc13..16b181fdd2 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceCopy.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceCopy.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceCopyIf.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceCopyIf.cpp index c2ba66e920..a402e30ad9 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceCopyIf.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceCopyIf.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceIf.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceIf.cpp index 7237e29555..f481144e1c 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceIf.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReplaceIf.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReverse.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReverse.cpp index f8c81dc105..7d16e54029 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReverse.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsReverse.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRotate.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRotate.cpp index bbf273970e..a5a6f99bac 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRotate.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRotate.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRotateCopy.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRotateCopy.cpp index 2012fde008..27451a1d04 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRotateCopy.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsRotateCopy.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsSearch.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsSearch.cpp index e57385a8be..ab4bf50713 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsSearch.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsSearch.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -353,6 +325,12 @@ void run_all_scenarios() { } TEST(std_algorithms_non_mod_seq_ops, search) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif run_all_scenarios(); run_all_scenarios(); } diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsSearch_n.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsSearch_n.cpp index 31446046a5..a6fe9c1e89 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsSearch_n.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsSearch_n.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -325,6 +297,12 @@ void run_all_scenarios() { } TEST(std_algorithms_non_mod_seq_ops, search_n) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "FIXME wrong result"; + } +#endif run_all_scenarios(); run_all_scenarios(); } diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsShiftLeft.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsShiftLeft.cpp index 0c97f255e9..8e4ced9635 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsShiftLeft.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsShiftLeft.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsShiftRight.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsShiftRight.cpp index d8aa350f1d..a1614be027 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsShiftRight.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsShiftRight.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformExclusiveScan.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformExclusiveScan.cpp index e415eff06c..70c04dbafa 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformExclusiveScan.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformExclusiveScan.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformInclusiveScan.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformInclusiveScan.cpp index 21ce01fb10..80ff813251 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformInclusiveScan.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformInclusiveScan.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformUnaryOp.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformUnaryOp.cpp index 35c293adcf..dab81b8f1e 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformUnaryOp.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsTransformUnaryOp.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsUnique.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsUnique.cpp index 88dd4d2599..a810d31d82 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsUnique.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsUnique.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsUniqueCopy.cpp b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsUniqueCopy.cpp index fdede95170..f609d8517e 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsUniqueCopy.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdAlgorithmsUniqueCopy.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/TestStdReducers.cpp b/lib/kokkos/algorithms/unit_tests/TestStdReducers.cpp index a88860749c..3847e1e6a3 100644 --- a/lib/kokkos/algorithms/unit_tests/TestStdReducers.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestStdReducers.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/algorithms/unit_tests/UnitTestMain.cpp b/lib/kokkos/algorithms/unit_tests/UnitTestMain.cpp index e245aad35f..11a1cb717a 100644 --- a/lib/kokkos/algorithms/unit_tests/UnitTestMain.cpp +++ b/lib/kokkos/algorithms/unit_tests/UnitTestMain.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/appveyor.yml b/lib/kokkos/appveyor.yml index e63fec718a..ceb33bf441 100644 --- a/lib/kokkos/appveyor.yml +++ b/lib/kokkos/appveyor.yml @@ -5,6 +5,6 @@ build_script: - cmd: >- mkdir build && cd build && - cmake c:\projects\source -DKokkos_ENABLE_TESTS=ON -DCMAKE_CXX_FLAGS="/W0 /EHsc" -DKokkos_ENABLE_DEPRECATED_CODE_3=ON -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF -DKokkos_ARCH_NATIVE=ON && + cmake c:\projects\source -DKokkos_ENABLE_TESTS=ON -DKokkos_ENABLE_BENCHMARKS=ON -DCMAKE_CXX_FLAGS="/W0 /EHsc" -DKokkos_ENABLE_DEPRECATED_CODE_4=ON -DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF && cmake --build . --target install && ctest -C Debug --output-on-failure diff --git a/lib/kokkos/benchmarks/atomic/main.cpp b/lib/kokkos/benchmarks/atomic/main.cpp index 6e32c6fe64..af1b96f27d 100644 --- a/lib/kokkos/benchmarks/atomic/main.cpp +++ b/lib/kokkos/benchmarks/atomic/main.cpp @@ -1,3 +1,19 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + #include #include #include diff --git a/lib/kokkos/benchmarks/bytes_and_flops/bench.hpp b/lib/kokkos/benchmarks/bytes_and_flops/bench.hpp index be190e868e..2589fd7309 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/bench.hpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/bench.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/benchmarks/bytes_and_flops/bench_double.cpp b/lib/kokkos/benchmarks/bytes_and_flops/bench_double.cpp index 73ad21b05c..f955c99666 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/bench_double.cpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/bench_double.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/benchmarks/bytes_and_flops/bench_float.cpp b/lib/kokkos/benchmarks/bytes_and_flops/bench_float.cpp index 3964df3fa8..137ff67d40 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/bench_float.cpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/bench_float.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/benchmarks/bytes_and_flops/bench_int32_t.cpp b/lib/kokkos/benchmarks/bytes_and_flops/bench_int32_t.cpp index d63c308077..29ccec0141 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/bench_int32_t.cpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/bench_int32_t.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/benchmarks/bytes_and_flops/bench_int64_t.cpp b/lib/kokkos/benchmarks/bytes_and_flops/bench_int64_t.cpp index 51a31b16f0..c153d5eff3 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/bench_int64_t.cpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/bench_int64_t.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/benchmarks/bytes_and_flops/bench_stride.hpp b/lib/kokkos/benchmarks/bytes_and_flops/bench_stride.hpp index c29f2a18c3..b63d486fc9 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/bench_stride.hpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/bench_stride.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ #define UNROLL 1 #include 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 58bf17b0bb..0f7a298c1b 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/bench_unroll_stride.hpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/bench_unroll_stride.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ template struct Run { @@ -66,25 +38,25 @@ struct Run { Scalar a1 = A(n, i, 0); const Scalar b = B(n, i, 0); #if (UNROLL > 1) - Scalar a2 = a1 * 1.3; + Scalar a2 = a1 * static_cast(1.3); #endif #if (UNROLL > 2) - Scalar a3 = a2 * 1.1; + Scalar a3 = a2 * static_cast(1.1); #endif #if (UNROLL > 3) - Scalar a4 = a3 * 1.1; + Scalar a4 = a3 * static_cast(1.1); #endif #if (UNROLL > 4) - Scalar a5 = a4 * 1.3; + Scalar a5 = a4 * static_cast(1.3); #endif #if (UNROLL > 5) - Scalar a6 = a5 * 1.1; + Scalar a6 = a5 * static_cast(1.1); #endif #if (UNROLL > 6) - Scalar a7 = a6 * 1.1; + Scalar a7 = a6 * static_cast(1.1); #endif #if (UNROLL > 7) - Scalar a8 = a7 * 1.1; + Scalar a8 = a7 * static_cast(1.1); #endif for (int f = 0; f < F; f++) { diff --git a/lib/kokkos/benchmarks/bytes_and_flops/main.cpp b/lib/kokkos/benchmarks/bytes_and_flops/main.cpp index b26b8ef5ed..20077757d1 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/main.cpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/main.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/benchmarks/gather/gather.hpp b/lib/kokkos/benchmarks/gather/gather.hpp index 239614184b..d83461702c 100644 --- a/lib/kokkos/benchmarks/gather/gather.hpp +++ b/lib/kokkos/benchmarks/gather/gather.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ template struct RunGather { diff --git a/lib/kokkos/benchmarks/gather/gather_unroll.hpp b/lib/kokkos/benchmarks/gather/gather_unroll.hpp index 4dc046f99c..5ee5742a3f 100644 --- a/lib/kokkos/benchmarks/gather/gather_unroll.hpp +++ b/lib/kokkos/benchmarks/gather/gather_unroll.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/benchmarks/gather/main.cpp b/lib/kokkos/benchmarks/gather/main.cpp index dd502faaa4..7f4fc9ede6 100644 --- a/lib/kokkos/benchmarks/gather/main.cpp +++ b/lib/kokkos/benchmarks/gather/main.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/benchmarks/gups/gups-kokkos.cpp b/lib/kokkos/benchmarks/gups/gups-kokkos.cpp index 5a3ad23800..97c339d09d 100644 --- a/lib/kokkos/benchmarks/gups/gups-kokkos.cpp +++ b/lib/kokkos/benchmarks/gups/gups-kokkos.cpp @@ -1,44 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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. -// -// ************************************************************************ //@HEADER -*/ #include "Kokkos_Core.hpp" #include diff --git a/lib/kokkos/benchmarks/policy_performance/main.cpp b/lib/kokkos/benchmarks/policy_performance/main.cpp index da49cdb019..28cfde552a 100644 --- a/lib/kokkos/benchmarks/policy_performance/main.cpp +++ b/lib/kokkos/benchmarks/policy_performance/main.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include "policy_perf_test.hpp" diff --git a/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp b/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp index 8e6cd7447d..cc2cc40257 100644 --- a/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp +++ b/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/benchmarks/stream/stream-kokkos.cpp b/lib/kokkos/benchmarks/stream/stream-kokkos.cpp index 311947c197..24c598ffad 100644 --- a/lib/kokkos/benchmarks/stream/stream-kokkos.cpp +++ b/lib/kokkos/benchmarks/stream/stream-kokkos.cpp @@ -1,44 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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. -// -// ************************************************************************ //@HEADER -*/ #include "Kokkos_Core.hpp" #include diff --git a/lib/kokkos/bin/hpcbind b/lib/kokkos/bin/hpcbind index 9da3d99469..cb2af2c4b5 100755 --- a/lib/kokkos/bin/hpcbind +++ b/lib/kokkos/bin/hpcbind @@ -586,8 +586,6 @@ if [[ ${HPCBIND_TEE} -eq 0 || ${HPCBIND_VERBOSE} -eq 0 ]]; then echo "${TMP_ENV}" | grep -E "^GOMP_" >> ${HPCBIND_LOG} echo "[KMP] (icc, icpc, and ifort)" >> ${HPCBIND_LOG} echo "${TMP_ENV}" | grep -E "^KMP_" >> ${HPCBIND_LOG} - echo "[XLSMPOPTS] (xlc, xlc++, and xlf)" >> ${HPCBIND_LOG} - echo "${TMP_ENV}" | grep -E "^XLSMPOPTS" >> ${HPCBIND_LOG} if [[ ${HPCBIND_HAS_HWLOC} -eq 1 ]]; then echo "[BINDINGS]" >> ${HPCBIND_LOG} @@ -610,8 +608,6 @@ else echo "${TMP_ENV}" | grep -E "^GOMP_" > >(tee -a ${HPCBIND_LOG}) echo "[KMP] (icc, icpc, and ifort)" > >(tee -a ${HPCBIND_LOG}) echo "${TMP_ENV}" | grep -E "^KMP_" > >(tee -a ${HPCBIND_LOG}) - echo "[XLSMPOPTS] (xlc, xlc++, and xlf)" > >(tee -a ${HPCBIND_LOG}) - echo "${TMP_ENV}" | grep -E "^XLSMPOPTS" > >(tee -a ${HPCBIND_LOG}) if [[ ${HPCBIND_HAS_HWLOC} -eq 1 ]]; then echo "[BINDINGS]" > >(tee -a ${HPCBIND_LOG}) diff --git a/lib/kokkos/bin/nvcc_wrapper b/lib/kokkos/bin/nvcc_wrapper index 566b355c5b..2204514d1b 100755 --- a/lib/kokkos/bin/nvcc_wrapper +++ b/lib/kokkos/bin/nvcc_wrapper @@ -229,11 +229,11 @@ do fi ;; #Handle known nvcc args - --dryrun|--verbose|--keep|--source-in-ptx|-src-in-ptx|--keep-dir*|-G|-lineinfo|-expt-extended-lambda|-expt-relaxed-constexpr|--resource-usage|--fmad=*|--use_fast_math|--Wext-lambda-captures-this|-Wext-lambda-captures-this) + --dryrun|--verbose|--keep|--source-in-ptx|-src-in-ptx|--keep-dir*|-G|-lineinfo|-extended-lambda|-expt-extended-lambda|-expt-relaxed-constexpr|--resource-usage|--fmad=*|--use_fast_math|--Wext-lambda-captures-this|-Wext-lambda-captures-this) cuda_args="$cuda_args $1" ;; #Handle more known nvcc args - --expt-extended-lambda|--expt-relaxed-constexpr|--Wno-deprecated-gpu-targets|-Wno-deprecated-gpu-targets|-allow-unsupported-compiler|--allow-unsupported-compiler) + --extended-lambda|--expt-extended-lambda|--expt-relaxed-constexpr|--Wno-deprecated-gpu-targets|-Wno-deprecated-gpu-targets|-allow-unsupported-compiler|--allow-unsupported-compiler) cuda_args="$cuda_args $1" ;; #Handle known nvcc args that have an argument diff --git a/lib/kokkos/cmake/Dependencies.cmake b/lib/kokkos/cmake/Dependencies.cmake index 10df9fe456..23b473ce24 100644 --- a/lib/kokkos/cmake/Dependencies.cmake +++ b/lib/kokkos/cmake/Dependencies.cmake @@ -1,14 +1,3 @@ -IF (CMAKE_CXX_STANDARD GREATER_EQUAL 17) - SET(KOKKOS_SIMD_TEST_CLASS PT) -ELSE() - SET(KOKKOS_SIMD_TEST_CLASS EX) - IF (${PROJECT_NAME}_ENABLE_KokkosSimd) - MESSAGE(WARNING "KokkosSimd is explicitly enabled but C++17 is not available") - ELSE() - MESSAGE(STATUS "Disabling KokkosSimd by default because C++17 is not available") - ENDIF() -ENDIF() - TRIBITS_PACKAGE_DEFINE_DEPENDENCIES( SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS #SubPackageName Directory Class Req/Opt @@ -17,5 +6,5 @@ TRIBITS_PACKAGE_DEFINE_DEPENDENCIES( Core core PS REQUIRED Containers containers PS OPTIONAL Algorithms algorithms PS OPTIONAL - Simd simd ${KOKKOS_SIMD_TEST_CLASS} OPTIONAL + Simd simd PT OPTIONAL ) diff --git a/lib/kokkos/cmake/KokkosConfigCommon.cmake.in b/lib/kokkos/cmake/KokkosConfigCommon.cmake.in index 23bc86cc84..bb5ce5ff81 100644 --- a/lib/kokkos/cmake/KokkosConfigCommon.cmake.in +++ b/lib/kokkos/cmake/KokkosConfigCommon.cmake.in @@ -14,10 +14,6 @@ ENDFOREACH() IF(NOT Kokkos_FIND_QUIETLY) MESSAGE(STATUS "Enabled Kokkos devices: ${Kokkos_DEVICES}") ENDIF() -IF(Kokkos_ENABLE_THREADS AND NOT DEPRECATED_CODE_3 IN_LIST Kokkos_OPTIONS) # for backward compatibility - SET(Kokkos_ENABLE_PTHREAD ON) - LIST(APPEND Kokkos_DEVICES PTHREAD) -ENDIF() IF (Kokkos_ENABLE_CUDA) # If we are building CUDA, we have tricked CMake because we declare a CXX project diff --git a/lib/kokkos/cmake/KokkosCore_Config_HeaderSet.in b/lib/kokkos/cmake/KokkosCore_Config_HeaderSet.in index 8d1eee31b2..73fa0b736c 100644 --- a/lib/kokkos/cmake/KokkosCore_Config_HeaderSet.in +++ b/lib/kokkos/cmake/KokkosCore_Config_HeaderSet.in @@ -2,45 +2,20 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. // -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 @HEADER_GUARD_TAG@ #define @HEADER_GUARD_TAG@ diff --git a/lib/kokkos/cmake/KokkosCore_config.h.in b/lib/kokkos/cmake/KokkosCore_config.h.in index 9e614b8770..431069fe07 100644 --- a/lib/kokkos/cmake/KokkosCore_config.h.in +++ b/lib/kokkos/cmake/KokkosCore_config.h.in @@ -9,7 +9,10 @@ // KOKKOS_VERSION % 100 is the patch level // KOKKOS_VERSION / 100 % 100 is the minor version // KOKKOS_VERSION / 10000 is the major version -#cmakedefine KOKKOS_VERSION @KOKKOS_VERSION@ +#define KOKKOS_VERSION @KOKKOS_VERSION@ +#define KOKKOS_VERSION_MAJOR @KOKKOS_VERSION_MAJOR@ +#define KOKKOS_VERSION_MINOR @KOKKOS_VERSION_MINOR@ +#define KOKKOS_VERSION_PATCH @KOKKOS_VERSION_PATCH@ /* Execution Spaces */ #cmakedefine KOKKOS_ENABLE_SERIAL @@ -25,15 +28,14 @@ #cmakedefine KOKKOS_ENABLE_SYCL /* General Settings */ -#cmakedefine KOKKOS_ENABLE_CXX14 #cmakedefine KOKKOS_ENABLE_CXX17 #cmakedefine KOKKOS_ENABLE_CXX20 +#cmakedefine KOKKOS_ENABLE_CXX23 #cmakedefine KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE #cmakedefine KOKKOS_ENABLE_CUDA_UVM #cmakedefine KOKKOS_ENABLE_CUDA_LAMBDA #cmakedefine KOKKOS_ENABLE_CUDA_CONSTEXPR -#cmakedefine KOKKOS_ENABLE_CUDA_LDG_INTRINSIC #cmakedefine KOKKOS_ENABLE_IMPL_CUDA_MALLOC_ASYNC #cmakedefine KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE #cmakedefine KOKKOS_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS @@ -44,12 +46,14 @@ #cmakedefine KOKKOS_ENABLE_PROFILING_LOAD_PRINT #cmakedefine KOKKOS_ENABLE_TUNING #cmakedefine KOKKOS_ENABLE_DEPRECATED_CODE_3 +#cmakedefine KOKKOS_ENABLE_DEPRECATED_CODE_4 #cmakedefine KOKKOS_ENABLE_DEPRECATION_WARNINGS #cmakedefine KOKKOS_ENABLE_LARGE_MEM_TESTS #cmakedefine KOKKOS_ENABLE_COMPLEX_ALIGN #cmakedefine KOKKOS_ENABLE_IMPL_DESUL_ATOMICS #cmakedefine KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION // deprecated #cmakedefine KOKKOS_ENABLE_AGGRESSIVE_VECTORIZATION +#cmakedefine KOKKOS_ENABLE_IMPL_MDSPAN /* TPL Settings */ #cmakedefine KOKKOS_ENABLE_HWLOC @@ -59,8 +63,6 @@ #cmakedefine KOKKOS_ENABLE_LIBQUADMATH #cmakedefine KOKKOS_IMPL_CUDA_CLANG_WORKAROUND -#cmakedefine KOKKOS_COMPILER_CUDA_VERSION @KOKKOS_COMPILER_CUDA_VERSION@ - #cmakedefine KOKKOS_ARCH_SSE42 #cmakedefine KOKKOS_ARCH_ARMV80 #cmakedefine KOKKOS_ARCH_ARMV8_THUNDERX @@ -82,6 +84,7 @@ #cmakedefine KOKKOS_ARCH_INTEL_GEN11 #cmakedefine KOKKOS_ARCH_INTEL_GEN12LP #cmakedefine KOKKOS_ARCH_INTEL_XEHP +#cmakedefine KOKKOS_ARCH_INTEL_PVC #cmakedefine KOKKOS_ARCH_INTEL_GPU #cmakedefine KOKKOS_ARCH_KEPLER #cmakedefine KOKKOS_ARCH_KEPLER30 @@ -103,12 +106,14 @@ #cmakedefine KOKKOS_ARCH_AMPERE80 #cmakedefine KOKKOS_ARCH_AMPERE86 #cmakedefine KOKKOS_ARCH_ADA89 +#cmakedefine KOKKOS_ARCH_HOPPER #cmakedefine KOKKOS_ARCH_HOPPER90 #cmakedefine KOKKOS_ARCH_AMD_ZEN #cmakedefine KOKKOS_ARCH_AMD_ZEN2 #cmakedefine KOKKOS_ARCH_AMD_ZEN3 #cmakedefine KOKKOS_ARCH_VEGA -#cmakedefine KOKKOS_ARCH_VEGA900 #cmakedefine KOKKOS_ARCH_VEGA906 #cmakedefine KOKKOS_ARCH_VEGA908 #cmakedefine KOKKOS_ARCH_VEGA90A +#cmakedefine KOKKOS_ARCH_NAVI +#cmakedefine KOKKOS_ARCH_NAVI1030 diff --git a/lib/kokkos/cmake/Kokkos_Version_Info.cpp.in b/lib/kokkos/cmake/Kokkos_Version_Info.cpp.in new file mode 100644 index 0000000000..e9fabe8177 --- /dev/null +++ b/lib/kokkos/cmake/Kokkos_Version_Info.cpp.in @@ -0,0 +1,30 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#include "Kokkos_Version_Info.hpp" + +namespace Kokkos { +namespace Impl { + +std::string GIT_BRANCH = "@GIT_BRANCH@"; +std::string GIT_COMMIT_HASH = "@GIT_COMMIT_HASH@"; +std::string GIT_CLEAN_STATUS = "@GIT_CLEAN_STATUS@"; +std::string GIT_COMMIT_DESCRIPTION = "@GIT_COMMIT_DESCRIPTION@"; +std::string GIT_COMMIT_DATE = "@GIT_COMMIT_DATE@"; + +} // namespace Impl + +} // namespace Kokkos diff --git a/lib/kokkos/cmake/Kokkos_Version_Info.hpp b/lib/kokkos/cmake/Kokkos_Version_Info.hpp new file mode 100644 index 0000000000..ba605a301d --- /dev/null +++ b/lib/kokkos/cmake/Kokkos_Version_Info.hpp @@ -0,0 +1,34 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef GIT_VERSION_H +#define GIT_VERSION_H + +#include + +namespace Kokkos { +namespace Impl { + +extern std::string GIT_BRANCH; +extern std::string GIT_COMMIT_HASH; +extern std::string GIT_CLEAN_STATUS; +extern std::string GIT_COMMIT_DESCRIPTION; +extern std::string GIT_COMMIT_DATE; + +} // namespace Impl +} // namespace Kokkos + +#endif diff --git a/lib/kokkos/cmake/Modules/FindTPLLIBQUADMATH.cmake b/lib/kokkos/cmake/Modules/FindTPLLIBQUADMATH.cmake index be70b711e0..70e0d6c454 100644 --- a/lib/kokkos/cmake/Modules/FindTPLLIBQUADMATH.cmake +++ b/lib/kokkos/cmake/Modules/FindTPLLIBQUADMATH.cmake @@ -1 +1,18 @@ -KOKKOS_FIND_IMPORTED(LIBQUADMATH HEADER quadmath.h LIBRARY quadmath) +# gcc bundles libquadmath and doesn't need any extra link or include directories +# (which would not be contained in CMake's search paths anyway). +# Hence, try if the compiler supports libquadmath natively first before doing +# the standard package search. +SET(CMAKE_REQUIRED_LIBRARIES "quadmath") +INCLUDE(CheckCXXSourceCompiles) +CHECK_CXX_SOURCE_COMPILES(" + #include + int main(void){ + __float128 foo = ::sqrtq(123.456); + return foo; + }" + KOKKOS_QUADMATH_COMPILER_SUPPORT) +IF (KOKKOS_QUADMATH_COMPILER_SUPPORT) + KOKKOS_CREATE_IMPORTED_TPL(LIBQUADMATH INTERFACE LINK_LIBRARIES quadmath) +ELSE() + KOKKOS_FIND_IMPORTED(LIBQUADMATH HEADER quadmath.h LIBRARY quadmath) +ENDIF() diff --git a/lib/kokkos/cmake/Modules/FindTPLROCM.cmake b/lib/kokkos/cmake/Modules/FindTPLROCM.cmake index 512ad6ceb2..aacdfcaf19 100644 --- a/lib/kokkos/cmake/Modules/FindTPLROCM.cmake +++ b/lib/kokkos/cmake/Modules/FindTPLROCM.cmake @@ -3,9 +3,19 @@ include(FindPackageHandleStandardArgs) FIND_LIBRARY(AMD_HIP_LIBRARY amdhip64 PATHS ENV ROCM_PATH PATH_SUFFIXES lib) FIND_LIBRARY(HSA_RUNTIME_LIBRARY hsa-runtime64 PATHS ENV ROCM_PATH PATH_SUFFIXES lib) -find_package_handle_standard_args(TPLROCM DEFAULT_MSG AMD_HIP_LIBRARY HSA_RUNTIME_LIBRARY) +# clang_rt.builtins is necessary to use half precision. The following code to +# find clang_rt.buitins is based on +# https://github.com/ROCm-Developer-Tools/HIP/blob/develop/hip-lang-config.cmake.in#L99-L111 +file(GLOB_RECURSE CLANG_RT_DIR "$ENV{ROCM_PATH}/llvm/lib/clang/*/lib/*/*clang_rt.builtins*") +FIND_LIBRARY(CLANG_RT_LIBRARY + NAMES + clang_rt.builtins + clang_rt.builtins-x86_64 + PATHS "${CLANG_RT_DIR}/..") + +find_package_handle_standard_args(TPLROCM DEFAULT_MSG AMD_HIP_LIBRARY HSA_RUNTIME_LIBRARY CLANG_RT_LIBRARY) kokkos_create_imported_tpl(ROCM INTERFACE - LINK_LIBRARIES ${HSA_RUNTIME_LIBRARY} ${AMD_HIP_LIBRARY} + LINK_LIBRARIES ${HSA_RUNTIME_LIBRARY} ${AMD_HIP_LIBRARY} ${CLANG_RT_LIBRARY} COMPILE_DEFINITIONS __HIP_ROCclr__ ) diff --git a/lib/kokkos/cmake/Modules/FindTPLTHREADS.cmake b/lib/kokkos/cmake/Modules/FindTPLTHREADS.cmake index 0e3c9f8dd6..ff0db5123f 100644 --- a/lib/kokkos/cmake/Modules/FindTPLTHREADS.cmake +++ b/lib/kokkos/cmake/Modules/FindTPLTHREADS.cmake @@ -1,5 +1,5 @@ INCLUDE(FindPackageHandleStandardArgs) -INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/tpls/FindTPLPthread.cmake") +FIND_PACKAGE(Threads) IF (TARGET Threads::Threads) SET(FOUND_THREADS TRUE) @@ -11,5 +11,5 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(TPLTHREADS DEFAULT_MSG FOUND_THREADS) #Only create the TPL if we succeed IF (FOUND_THREADS) KOKKOS_CREATE_IMPORTED_TPL(THREADS INTERFACE LINK_OPTIONS - ${TPL_Pthread_LIBRARIES}) + ${CMAKE_THREAD_LIBS_INIT}) ENDIF() diff --git a/lib/kokkos/cmake/build_env_info.cmake b/lib/kokkos/cmake/build_env_info.cmake new file mode 100644 index 0000000000..2cd169cba4 --- /dev/null +++ b/lib/kokkos/cmake/build_env_info.cmake @@ -0,0 +1,121 @@ +# https://jonathanhamberg.com/post/cmake-embedding-git-hash/ + +find_package(Git QUIET) + +SET(CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}) +SET(pre_configure_dir ${CMAKE_CURRENT_LIST_DIR}) +SET(post_configure_dir ${CMAKE_BINARY_DIR}/generated) + +SET(pre_configure_file ${pre_configure_dir}/Kokkos_Version_Info.cpp.in) +SET(post_configure_file ${post_configure_dir}/Kokkos_Version_Info.cpp) + +FUNCTION(check_git_write git_hash git_clean_status) + FILE( + WRITE + ${CMAKE_BINARY_DIR}/git-state.txt + "${git_hash}-${git_clean_status}") +ENDFUNCTION() + +FUNCTION(check_git_read git_hash) + IF(EXISTS ${CMAKE_BINARY_DIR}/git-state.txt) + FILE(STRINGS ${CMAKE_BINARY_DIR}/git-state.txt CONTENT) + LIST(GET CONTENT 0 var) + + message(DEBUG "Cached Git hash: ${var}") + SET(${git_hash} ${var} PARENT_SCOPE) + else() + SET(${git_hash} "INVALID" PARENT_SCOPE) + ENDIF() +ENDFUNCTION() + +FUNCTION(check_git_version) + IF(NOT EXISTS ${post_configure_dir}/Kokkos_Version_Info.hpp) + FILE( + COPY ${pre_configure_dir}/Kokkos_Version_Info.hpp + DESTINATION ${post_configure_dir}) + ENDIF() + + IF(NOT Git_FOUND OR NOT EXISTS ${KOKKOS_SOURCE_DIR}/.git) + configure_file(${pre_configure_file} ${post_configure_file} @ONLY) + return() + ENDIF() + + # Get the current working branch + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + WORKING_DIRECTORY ${KOKKOS_SOURCE_DIR} + OUTPUT_VARIABLE GIT_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE) + + # Get the latest commit description + execute_process( + COMMAND ${GIT_EXECUTABLE} show -s --format=%s + WORKING_DIRECTORY ${KOKKOS_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMIT_DESCRIPTION + OUTPUT_STRIP_TRAILING_WHITESPACE) + + # Get the latest commit date + execute_process( + COMMAND ${GIT_EXECUTABLE} log -1 --format=%cI + WORKING_DIRECTORY ${KOKKOS_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMIT_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE) + + # Check if repo is dirty / clean + execute_process( + COMMAND ${GIT_EXECUTABLE} diff-index --quiet HEAD -- + WORKING_DIRECTORY ${KOKKOS_SOURCE_DIR} + RESULT_VARIABLE IS_DIRTY + OUTPUT_STRIP_TRAILING_WHITESPACE) + + IF(IS_DIRTY EQUAL 0) + SET(GIT_CLEAN_STATUS "CLEAN") + else() + SET(GIT_CLEAN_STATUS "DIRTY") + ENDIF() + + # Get the latest abbreviated commit hash of the working branch + execute_process( + COMMAND ${GIT_EXECUTABLE} log -1 --format=%h + WORKING_DIRECTORY ${KOKKOS_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE) + + check_git_read(GIT_HASH_CACHE) + + IF(NOT EXISTS ${post_configure_dir}) + file(MAKE_DIRECTORY ${post_configure_dir}) + ENDIF() + + # Only update the git_version.cpp if the hash has changed. This will + # prevent us from rebuilding the project more than we need to. + IF(NOT "${GIT_COMMIT_HASH}-${GIT_CLEAN_STATUS}" STREQUAL ${GIT_HASH_CACHE} + OR NOT EXISTS ${post_configure_file}) + # Set the GIT_HASH_CACHE variable so the next build won't have + # to regenerate the source file. + check_git_write(${GIT_COMMIT_HASH} ${GIT_CLEAN_STATUS}) + + configure_file(${pre_configure_file} ${post_configure_file} @ONLY) + message(STATUS "Configured git information in ${post_configure_file}") + ENDIF() +ENDFUNCTION() + +FUNCTION(check_git_setup) + add_custom_target( + AlwaysCheckGit COMMAND ${CMAKE_COMMAND} + -DRUN_CHECK_GIT_VERSION=1 + -DKOKKOS_SOURCE_DIR=${Kokkos_SOURCE_DIR} + -P ${CURRENT_LIST_DIR}/build_env_info.cmake + BYPRODUCTS ${post_configure_file}) + + add_library(impl_git_version ${CMAKE_BINARY_DIR}/generated/Kokkos_Version_Info.cpp) + target_include_directories(impl_git_version PUBLIC ${CMAKE_BINARY_DIR}/generated) + add_dependencies(impl_git_version AlwaysCheckGit) + + check_git_version() +ENDFUNCTION() + +# This is used to run this function from an external cmake process. +IF(RUN_CHECK_GIT_VERSION) + check_git_version() +ENDIF() diff --git a/lib/kokkos/cmake/compile_tests/clang_omp.cpp b/lib/kokkos/cmake/compile_tests/clang_omp.cpp index 60a5c52282..153130f968 100644 --- a/lib/kokkos/cmake/compile_tests/clang_omp.cpp +++ b/lib/kokkos/cmake/compile_tests/clang_omp.cpp @@ -1,3 +1,19 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + #include int main(int, char**) { diff --git a/lib/kokkos/cmake/compile_tests/cplusplus14.cpp b/lib/kokkos/cmake/compile_tests/cplusplus14.cpp deleted file mode 100644 index 52ec9885ec..0000000000 --- a/lib/kokkos/cmake/compile_tests/cplusplus14.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() { - // _t versions of type traits were added in C++14 - std::remove_cv_t i = 0; - - return i; -} diff --git a/lib/kokkos/cmake/compile_tests/cplusplus17.cpp b/lib/kokkos/cmake/compile_tests/cplusplus17.cpp new file mode 100644 index 0000000000..b425d23adf --- /dev/null +++ b/lib/kokkos/cmake/compile_tests/cplusplus17.cpp @@ -0,0 +1,25 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#include + +int main() { + // _v versions of type traits were added in C++17 + if constexpr (std::is_same_v) + return 0; + else + return 1; +} diff --git a/lib/kokkos/cmake/compile_tests/cuda_compute_capability.cc b/lib/kokkos/cmake/compile_tests/cuda_compute_capability.cc index 581c8db9bc..b81c4218a9 100644 --- a/lib/kokkos/cmake/compile_tests/cuda_compute_capability.cc +++ b/lib/kokkos/cmake/compile_tests/cuda_compute_capability.cc @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/cmake/compile_tests/pthread.cpp b/lib/kokkos/cmake/compile_tests/pthread.cpp deleted file mode 100644 index 3f83bf6a5f..0000000000 --- a/lib/kokkos/cmake/compile_tests/pthread.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include - -void* kokkos_test(void* args) { return args; } - -int main() { - pthread_t thread; - /* Use NULL to avoid C++11. Some compilers - do not have C++11 by default. Forcing C++11 - in the compile tests can be done, but is unnecessary - */ - pthread_create(&thread, NULL, kokkos_test, NULL); - pthread_join(thread, NULL); - return 0; -} diff --git a/lib/kokkos/cmake/deps/CUDA.cmake b/lib/kokkos/cmake/deps/CUDA.cmake index beaf4e6d6c..68bf5b3d57 100644 --- a/lib/kokkos/cmake/deps/CUDA.cmake +++ b/lib/kokkos/cmake/deps/CUDA.cmake @@ -1,41 +1,16 @@ -# @HEADER +#@HEADER # ************************************************************************ # -# Kokkos v. 3.0 -# Copyright (2020) National Technology & Engineering +# Kokkos v. 4.0 +# Copyright (2022) National Technology & Engineering # Solutions of Sandia, LLC (NTESS). # # Under the terms of Contract DE-NA0003525 with NTESS, # 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: +# Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. # -# 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 NTESS "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 NTESS 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) +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ************************************************************************ # @HEADER diff --git a/lib/kokkos/cmake/deps/CUSPARSE.cmake b/lib/kokkos/cmake/deps/CUSPARSE.cmake index 073c40d814..b016971ab9 100644 --- a/lib/kokkos/cmake/deps/CUSPARSE.cmake +++ b/lib/kokkos/cmake/deps/CUSPARSE.cmake @@ -1,41 +1,16 @@ -# @HEADER +#@HEADER # ************************************************************************ # -# Kokkos v. 3.0 -# Copyright (2020) National Technology & Engineering +# Kokkos v. 4.0 +# Copyright (2022) National Technology & Engineering # Solutions of Sandia, LLC (NTESS). # # Under the terms of Contract DE-NA0003525 with NTESS, # 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: +# Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. # -# 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 NTESS "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 NTESS 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) +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ************************************************************************ # @HEADER diff --git a/lib/kokkos/cmake/deps/HWLOC.cmake b/lib/kokkos/cmake/deps/HWLOC.cmake index f8402db00a..77d5a9b83a 100644 --- a/lib/kokkos/cmake/deps/HWLOC.cmake +++ b/lib/kokkos/cmake/deps/HWLOC.cmake @@ -1,41 +1,16 @@ -# @HEADER +#@HEADER # ************************************************************************ # -# Kokkos v. 3.0 -# Copyright (2020) National Technology & Engineering +# Kokkos v. 4.0 +# Copyright (2022) National Technology & Engineering # Solutions of Sandia, LLC (NTESS). # # Under the terms of Contract DE-NA0003525 with NTESS, # 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: +# Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. # -# 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 NTESS "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 NTESS 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) +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ************************************************************************ # @HEADER diff --git a/lib/kokkos/cmake/deps/Pthread.cmake b/lib/kokkos/cmake/deps/Pthread.cmake index 639e4ef697..e879bff374 100644 --- a/lib/kokkos/cmake/deps/Pthread.cmake +++ b/lib/kokkos/cmake/deps/Pthread.cmake @@ -1,41 +1,16 @@ -# @HEADER +#@HEADER # ************************************************************************ # -# Kokkos v. 3.0 -# Copyright (2020) National Technology & Engineering +# Kokkos v. 4.0 +# Copyright (2022) National Technology & Engineering # Solutions of Sandia, LLC (NTESS). # # Under the terms of Contract DE-NA0003525 with NTESS, # 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: +# Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. # -# 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 NTESS "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 NTESS 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) +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ************************************************************************ # @HEADER diff --git a/lib/kokkos/cmake/deps/quadmath.cmake b/lib/kokkos/cmake/deps/quadmath.cmake index 826f5021d3..6aef08e881 100644 --- a/lib/kokkos/cmake/deps/quadmath.cmake +++ b/lib/kokkos/cmake/deps/quadmath.cmake @@ -1,41 +1,16 @@ -# @HEADER +#@HEADER # ************************************************************************ # -# Kokkos v. 3.0 -# Copyright (2020) National Technology & Engineering +# Kokkos v. 4.0 +# Copyright (2022) National Technology & Engineering # Solutions of Sandia, LLC (NTESS). # # Under the terms of Contract DE-NA0003525 with NTESS, # 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: +# Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. # -# 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 NTESS "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 NTESS 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) +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ************************************************************************ # @HEADER diff --git a/lib/kokkos/cmake/fake_tribits.cmake b/lib/kokkos/cmake/fake_tribits.cmake index f394572057..71e85e915c 100644 --- a/lib/kokkos/cmake/fake_tribits.cmake +++ b/lib/kokkos/cmake/fake_tribits.cmake @@ -117,7 +117,7 @@ FUNCTION(KOKKOS_ADD_TEST) if(TEST_TOOL) add_dependencies(${EXE} ${TEST_TOOL}) #make sure the exe has to build the tool foreach(TEST_ADDED ${ALL_TESTS_ADDED}) - set_property(TEST ${TEST_ADDED} APPEND PROPERTY ENVIRONMENT "KOKKOS_PROFILE_LIBRARY=$") + set_property(TEST ${TEST_ADDED} APPEND PROPERTY ENVIRONMENT "KOKKOS_TOOLS_LIBS=$") endforeach() endif() endif() diff --git a/lib/kokkos/cmake/kokkos_arch.cmake b/lib/kokkos/cmake/kokkos_arch.cmake index f20a91e42f..96196d168e 100644 --- a/lib/kokkos/cmake/kokkos_arch.cmake +++ b/lib/kokkos/cmake/kokkos_arch.cmake @@ -68,7 +68,7 @@ DECLARE_AND_CHECK_HOST_ARCH(ZEN "AMD Zen architecture") DECLARE_AND_CHECK_HOST_ARCH(ZEN2 "AMD Zen2 architecture") DECLARE_AND_CHECK_HOST_ARCH(ZEN3 "AMD Zen3 architecture") -IF(Kokkos_ENABLE_CUDA OR Kokkos_ENABLE_OPENMPTARGET OR Kokkos_ENABLE_OPENACC OR Kokkos_ENABLE_UNSUPPORTED_ARCHS) +IF(Kokkos_ENABLE_CUDA OR Kokkos_ENABLE_OPENMPTARGET OR Kokkos_ENABLE_OPENACC OR Kokkos_ENABLE_SYCL) SET(KOKKOS_SHOW_CUDA_ARCHS ON) ENDIF() @@ -89,16 +89,24 @@ KOKKOS_ARCH_OPTION(AMPERE86 GPU "NVIDIA Ampere generation CC 8.6" "KOKK KOKKOS_ARCH_OPTION(ADA89 GPU "NVIDIA Ada generation CC 8.9" "KOKKOS_SHOW_CUDA_ARCHS") KOKKOS_ARCH_OPTION(HOPPER90 GPU "NVIDIA Hopper generation CC 9.0" "KOKKOS_SHOW_CUDA_ARCHS") -IF(Kokkos_ENABLE_HIP OR Kokkos_ENABLE_OPENMPTARGET OR Kokkos_ENABLE_UNSUPPORTED_ARCHS) +IF(Kokkos_ENABLE_HIP OR Kokkos_ENABLE_OPENMPTARGET) SET(KOKKOS_SHOW_HIP_ARCHS ON) ENDIF() -KOKKOS_ARCH_OPTION(VEGA900 GPU "AMD GPU MI25 GFX900" "KOKKOS_SHOW_HIP_ARCHS") -KOKKOS_ARCH_OPTION(VEGA906 GPU "AMD GPU MI50/MI60 GFX906" "KOKKOS_SHOW_HIP_ARCHS") -KOKKOS_ARCH_OPTION(VEGA908 GPU "AMD GPU MI100 GFX908" "KOKKOS_SHOW_HIP_ARCHS") -KOKKOS_ARCH_OPTION(VEGA90A GPU "AMD GPU MI200 GFX90A" "KOKKOS_SHOW_HIP_ARCHS") +# AMD archs ordered in decreasing priority of autodetection +LIST(APPEND SUPPORTED_AMD_GPUS MI200 MI100 MI50/60 V620/W6800) +LIST(APPEND SUPPORTED_AMD_ARCHS VEGA90A VEGA908 VEGA906 NAVI1030) +LIST(APPEND CORRESPONDING_AMD_FLAGS gfx90a gfx908 gfx906 gfx1030) -IF(Kokkos_ENABLE_SYCL OR Kokkos_ENABLE_OPENMPTARGET OR Kokkos_ENABLE_UNSUPPORTED_ARCHS) +#FIXME CAN BE REPLACED WITH LIST_ZIP IN CMAKE 3.17 +FOREACH(ARCH IN LISTS SUPPORTED_AMD_ARCHS) + LIST(FIND SUPPORTED_AMD_ARCHS ${ARCH} LIST_INDEX) + LIST(GET SUPPORTED_AMD_GPUS ${LIST_INDEX} GPU) + LIST(GET CORRESPONDING_AMD_FLAGS ${LIST_INDEX} FLAG) + KOKKOS_ARCH_OPTION(${ARCH} GPU "AMD GPU ${GPU} ${FLAG}" "KOKKOS_SHOW_HIP_ARCHS") +ENDFOREACH() + +IF(Kokkos_ENABLE_SYCL OR Kokkos_ENABLE_OPENMPTARGET) SET(KOKKOS_SHOW_SYCL_ARCHS ON) ENDIF() @@ -139,7 +147,7 @@ IF(KOKKOS_ENABLE_COMPILER_WARNINGS) SET(GNU_WARNINGS "-Wempty-body" "-Wclobbered" "-Wignored-qualifiers" ${COMMON_WARNINGS}) - IF(KOKKOS_CXX_COMPILER_ID STREQUAL GNU AND KOKKOS_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7) + IF(KOKKOS_CXX_COMPILER_ID STREQUAL GNU) LIST(APPEND GNU_WARNINGS "-Wimplicit-fallthrough") ENDIF() @@ -162,9 +170,7 @@ GLOBAL_SET(KOKKOS_CUDA_OPTIONS) IF (KOKKOS_ENABLE_CUDA_LAMBDA) IF(KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) GLOBAL_APPEND(KOKKOS_CUDA_OPTIONS "-expt-extended-lambda") - IF(KOKKOS_COMPILER_CUDA_VERSION GREATER_EQUAL 110) - GLOBAL_APPEND(KOKKOS_CUDA_OPTIONS "-Wext-lambda-captures-this") - ENDIF() + GLOBAL_APPEND(KOKKOS_CUDA_OPTIONS "-Wext-lambda-captures-this") ENDIF() ENDIF() @@ -202,9 +208,6 @@ IF (KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) GLOBAL_APPEND(KOKKOS_CUDA_OPTIONS -lineinfo) ENDIF() UNSET(_UPPERCASE_CMAKE_BUILD_TYPE) - IF (KOKKOS_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0 AND KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 10.0) - GLOBAL_APPEND(KOKKOS_CUDAFE_OPTIONS --diag_suppress=esa_on_defaulted_function_ignored) - ENDIF() ENDIF() @@ -223,6 +226,10 @@ ENDIF() IF(KOKKOS_ARCH_NATIVE) + IF(KOKKOS_CXX_HOST_COMPILER_ID STREQUAL "MSVC") + MESSAGE(FATAL_ERROR "MSVC doesn't support ARCH_NATIVE!") + ENDIF() + COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID DEFAULT -march=native -mtune=native @@ -233,6 +240,7 @@ IF (KOKKOS_ARCH_ARMV80) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID Cray NO-VALUE-SPECIFIED + MSVC /arch:armv8.0 NVHPC NO-VALUE-SPECIFIED DEFAULT -march=armv8-a ) @@ -242,6 +250,7 @@ IF (KOKKOS_ARCH_ARMV81) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID Cray NO-VALUE-SPECIFIED + MSVC /arch:armv8.1 NVHPC NO-VALUE-SPECIFIED DEFAULT -march=armv8.1-a ) @@ -252,6 +261,7 @@ IF (KOKKOS_ARCH_ARMV8_THUNDERX) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID Cray NO-VALUE-SPECIFIED + MSVC /arch:armv8.0 NVHPC NO-VALUE-SPECIFIED DEFAULT -march=armv8-a -mtune=thunderx ) @@ -262,6 +272,7 @@ IF (KOKKOS_ARCH_ARMV8_THUNDERX2) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID Cray NO-VALUE-SPECIFIED + MSVC /arch:armv8.1 NVHPC NO-VALUE-SPECIFIED DEFAULT -mcpu=thunderx2t99 -mtune=thunderx2t99 ) @@ -270,10 +281,11 @@ ENDIF() IF (KOKKOS_ARCH_A64FX) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID - NVHPC NO-VALUE-SPECIFIED - DEFAULT -march=armv8.2-a+sve Clang -march=armv8.2-a+sve -msve-vector-bits=512 GNU -march=armv8.2-a+sve -msve-vector-bits=512 + MSVC NO-VALUE-SPECIFIED + NVHPC NO-VALUE-SPECIFIED + DEFAULT -march=armv8.2-a+sve ) ENDIF() @@ -281,6 +293,7 @@ IF (KOKKOS_ARCH_ZEN) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID Intel -mavx2 + MSVC /arch:AVX2 NVHPC -tp=zen DEFAULT -march=znver1 -mtune=znver1 ) @@ -292,6 +305,7 @@ IF (KOKKOS_ARCH_ZEN2) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID Intel -mavx2 + MSVC /arch:AVX2 NVHPC -tp=zen2 DEFAULT -march=znver2 -mtune=znver2 ) @@ -303,6 +317,7 @@ IF (KOKKOS_ARCH_ZEN3) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID Intel -mavx2 + MSVC /arch:AVX2 NVHPC -tp=zen2 DEFAULT -march=znver3 -mtune=znver3 ) @@ -313,9 +328,10 @@ ENDIF() IF (KOKKOS_ARCH_WSM) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID - Intel -xSSE4.2 - NVHPC -tp=px Cray NO-VALUE-SPECIFIED + Intel -xSSE4.2 + MSVC NO-VALUE-SPECIFIED + NVHPC -tp=px DEFAULT -msse4.2 ) SET(KOKKOS_ARCH_SSE42 ON) @@ -325,9 +341,10 @@ IF (KOKKOS_ARCH_SNB OR KOKKOS_ARCH_AMDAVX) SET(KOKKOS_ARCH_AVX ON) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID - Intel -mavx - NVHPC -tp=sandybridge Cray NO-VALUE-SPECIFIED + Intel -mavx + MSVC /arch:AVX + NVHPC -tp=sandybridge DEFAULT -mavx ) ENDIF() @@ -336,9 +353,10 @@ IF (KOKKOS_ARCH_HSW) SET(KOKKOS_ARCH_AVX2 ON) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID - Intel -xCORE-AVX2 - NVHPC -tp=haswell Cray NO-VALUE-SPECIFIED + Intel -xCORE-AVX2 + MSVC /arch:AVX2 + NVHPC -tp=haswell DEFAULT -march=core-avx2 -mtune=core-avx2 ) ENDIF() @@ -347,9 +365,10 @@ IF (KOKKOS_ARCH_BDW) SET(KOKKOS_ARCH_AVX2 ON) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID - Intel -xCORE-AVX2 - NVHPC -tp=haswell Cray NO-VALUE-SPECIFIED + Intel -xCORE-AVX2 + MSVC /arch:AVX2 + NVHPC -tp=haswell DEFAULT -march=core-avx2 -mtune=core-avx2 -mrtm ) ENDIF() @@ -359,9 +378,10 @@ IF (KOKKOS_ARCH_KNL) SET(KOKKOS_ARCH_AVX512MIC ON) #not a cache variable COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID - Intel -xMIC-AVX512 - NVHPC -tp=knl Cray NO-VALUE-SPECIFIED + Intel -xMIC-AVX512 + MSVC /arch:AVX512 + NVHPC -tp=knl DEFAULT -march=knl -mtune=knl ) ENDIF() @@ -369,6 +389,7 @@ ENDIF() IF (KOKKOS_ARCH_KNC) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID + MSVC NO-VALUE-SPECIFIED DEFAULT -mmic ) ENDIF() @@ -376,9 +397,10 @@ ENDIF() IF (KOKKOS_ARCH_SKL) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID - Intel -xSKYLAKE - NVHPC -tp=skylake Cray NO-VALUE-SPECIFIED + Intel -xSKYLAKE + MSVC /arch:AVX2 + NVHPC -tp=skylake DEFAULT -march=skylake -mtune=skylake ) ENDIF() @@ -388,9 +410,10 @@ IF (KOKKOS_ARCH_SKX) SET(KOKKOS_ARCH_AVX512XEON ON) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID - Intel -xCORE-AVX512 - NVHPC -tp=skylake Cray NO-VALUE-SPECIFIED + Intel -xCORE-AVX512 + MSVC /arch:AVX512 + NVHPC -tp=skylake DEFAULT -march=skylake-avx512 -mtune=skylake-avx512 ) ENDIF() @@ -399,6 +422,7 @@ IF (KOKKOS_ARCH_ICL) SET(KOKKOS_ARCH_AVX512XEON ON) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID + MSVC /arch:AVX512 DEFAULT -march=icelake-client -mtune=icelake-client ) ENDIF() @@ -407,6 +431,7 @@ IF (KOKKOS_ARCH_ICX) SET(KOKKOS_ARCH_AVX512XEON ON) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID + MSVC /arch:AVX512 DEFAULT -march=icelake-server -mtune=icelake-server ) ENDIF() @@ -415,6 +440,7 @@ IF (KOKKOS_ARCH_SPR) SET(KOKKOS_ARCH_AVX512XEON ON) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID + MSVC /arch:AVX512 DEFAULT -march=sapphirerapids -mtune=sapphirerapids ) ENDIF() @@ -422,6 +448,7 @@ ENDIF() IF (KOKKOS_ARCH_POWER7) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID + MSVC NO-VALUE-SPECIFIED NVHPC NO-VALUE-SPECIFIED DEFAULT -mcpu=power7 -mtune=power7 ) @@ -430,6 +457,7 @@ ENDIF() IF (KOKKOS_ARCH_POWER8) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID + MSVC NO-VALUE-SPECIFIED NVHPC -tp=pwr8 DEFAULT -mcpu=power8 -mtune=power8 ) @@ -438,21 +466,24 @@ ENDIF() IF (KOKKOS_ARCH_POWER9) COMPILER_SPECIFIC_FLAGS( COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID + MSVC NO-VALUE-SPECIFIED NVHPC -tp=pwr9 DEFAULT -mcpu=power9 -mtune=power9 ) ENDIF() -IF (KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE) - COMPILER_SPECIFIC_FLAGS( - Clang -fcuda-rdc - NVIDIA --relocatable-device-code=true - NVHPC -gpu=rdc - ) -ELSEIF(KOKKOS_ENABLE_CUDA) - COMPILER_SPECIFIC_FLAGS( - NVHPC -gpu=nordc - ) +IF (NOT KOKKOS_COMPILE_LANGUAGE STREQUAL CUDA) + IF (KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE) + COMPILER_SPECIFIC_FLAGS( + Clang -fcuda-rdc + NVIDIA --relocatable-device-code=true + NVHPC -gpu=rdc + ) + ELSEIF(KOKKOS_ENABLE_CUDA) + COMPILER_SPECIFIC_FLAGS( + NVHPC -gpu=nordc + ) + ENDIF() ENDIF() # Clang needs mcx16 option enabled for Windows atomic functions @@ -463,7 +494,7 @@ IF (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND WIN32) ENDIF() # MSVC ABI has many deprecation warnings, so ignore them -IF (CMAKE_CXX_COMPILER_ID STREQUAL MSVC OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") +IF (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") COMPILER_SPECIFIC_DEFS( Clang _CRT_SECURE_NO_WARNINGS ) @@ -571,26 +602,17 @@ ENDFUNCTION() #These will define KOKKOS_AMDGPU_ARCH_FLAG #to the corresponding flag name if ON -CHECK_AMDGPU_ARCH(VEGA900 gfx900) # Radeon Instinct MI25 -CHECK_AMDGPU_ARCH(VEGA906 gfx906) # Radeon Instinct MI50 and MI60 -CHECK_AMDGPU_ARCH(VEGA908 gfx908) # Radeon Instinct MI100 -CHECK_AMDGPU_ARCH(VEGA90A gfx90a) # Radeon Instinct MI200 +FOREACH(ARCH IN LISTS SUPPORTED_AMD_ARCHS) + LIST(FIND SUPPORTED_AMD_ARCHS ${ARCH} LIST_INDEX) + LIST(GET CORRESPONDING_AMD_FLAGS ${LIST_INDEX} FLAG) + CHECK_AMDGPU_ARCH(${ARCH} ${FLAG}) +ENDFOREACH() -IF(KOKKOS_ENABLE_HIP AND NOT AMDGPU_ARCH_ALREADY_SPECIFIED) - IF(KOKKOS_CXX_COMPILER_ID STREQUAL HIPCC) - FIND_PROGRAM(ROCM_ENUMERATOR rocm_agent_enumerator) - EXECUTE_PROCESS(COMMAND ${ROCM_ENUMERATOR} OUTPUT_VARIABLE GPU_ARCHS) - STRING(LENGTH "${GPU_ARCHS}" len_str) - # enumerator always output gfx000 as the first line - IF(${len_str} LESS 8) - MESSAGE(SEND_ERROR "HIP enabled but no AMD GPU architecture currently enabled. " - "Please enable one AMD GPU architecture via -DKokkos_ARCH_{..}=ON'.") - ENDIF() - ELSE() - MESSAGE(SEND_ERROR "HIP enabled but no AMD GPU architecture currently enabled. " - "Please enable one AMD GPU architecture via -DKokkos_ARCH_{..}=ON'.") - ENDIF() -ENDIF() +MACRO(SET_AND_CHECK_AMD_ARCH ARCH FLAG) + KOKKOS_SET_OPTION(ARCH_${ARCH} ON) + CHECK_AMDGPU_ARCH(${ARCH} ${FLAG}) + LIST(APPEND KOKKOS_ENABLED_ARCH_LIST ${ARCH}) +ENDMACRO() MACRO(CHECK_MULTIPLE_INTEL_ARCH) IF(KOKKOS_ARCH_INTEL_GPU) @@ -627,7 +649,6 @@ IF (KOKKOS_ENABLE_OPENMPTARGET) STRING(REPLACE "sm_" "cc" NVHPC_CUDA_ARCH ${CLANG_CUDA_ARCH}) COMPILER_SPECIFIC_FLAGS( Clang -Xopenmp-target -march=${CLANG_CUDA_ARCH} -fopenmp-targets=nvptx64 - XL -qtgtarch=${KOKKOS_CUDA_ARCH_FLAG} NVHPC -gpu=${NVHPC_CUDA_ARCH} ) ENDIF() @@ -659,11 +680,11 @@ IF (KOKKOS_ENABLE_OPENMPTARGET) ) ELSEIF(KOKKOS_ARCH_INTEL_XEHP) COMPILER_SPECIFIC_FLAGS( - IntelLLVM -fopenmp-targets=spir64_gen -Xopenmp-target-backend "-device xehp" -D__STRICT_ANSI__ + IntelLLVM -fopenmp-targets=spir64_gen -Xopenmp-target-backend "-device 12.50.4" -D__STRICT_ANSI__ ) ELSEIF(KOKKOS_ARCH_INTEL_PVC) COMPILER_SPECIFIC_FLAGS( - IntelLLVM -fopenmp-targets=spir64_gen -Xopenmp-target-backend "-device 12.4.0" -D__STRICT_ANSI__ + IntelLLVM -fopenmp-targets=spir64_gen -Xopenmp-target-backend "-device 12.60.7" -D__STRICT_ANSI__ ) ENDIF() ENDIF() @@ -712,11 +733,11 @@ IF (KOKKOS_ENABLE_SYCL) ) ELSEIF(KOKKOS_ARCH_INTEL_XEHP) COMPILER_SPECIFIC_FLAGS( - DEFAULT -fsycl-targets=spir64_gen -Xsycl-target-backend "-device xehp" + DEFAULT -fsycl-targets=spir64_gen -Xsycl-target-backend "-device 12.50.4" ) ELSEIF(KOKKOS_ARCH_INTEL_PVC) COMPILER_SPECIFIC_FLAGS( - DEFAULT -fsycl-targets=spir64_gen -Xsycl-target-backend "-device 12.4.0" + DEFAULT -fsycl-targets=spir64_gen -Xsycl-target-backend "-device 12.60.7" ) ENDIF() ENDIF() @@ -756,8 +777,8 @@ IF(KOKKOS_ENABLE_CUDA AND NOT CUDA_ARCH_ALREADY_SPECIFIED) IF(CMAKE_CUDA_COMPILER) # copy our test to .cu so cmake compiles as CUDA CONFIGURE_FILE( - ${PROJECT_SOURCE_DIR}/cmake/compile_tests/cuda_compute_capability.cc - ${PROJECT_BINARY_DIR}/compile_tests/cuda_compute_capability.cu + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/compile_tests/cuda_compute_capability.cc + ${CMAKE_CURRENT_BINARY_DIR}/compile_tests/cuda_compute_capability.cu COPYONLY ) # run test again @@ -765,7 +786,7 @@ IF(KOKKOS_ENABLE_CUDA AND NOT CUDA_ARCH_ALREADY_SPECIFIED) _RESULT _COMPILE_RESULT ${_BINARY_TEST_DIR} - ${PROJECT_BINARY_DIR}/compile_tests/cuda_compute_capability.cu + ${CMAKE_CURRENT_BINARY_DIR}/compile_tests/cuda_compute_capability.cu COMPILE_DEFINITIONS -DSM_ONLY RUN_OUTPUT_VARIABLE _CUDA_COMPUTE_CAPABILITY) ENDIF() @@ -819,6 +840,58 @@ IF (KOKKOS_ARCH_VEGA900 OR KOKKOS_ARCH_VEGA906 OR KOKKOS_ARCH_VEGA908 OR KOKKOS_ SET(KOKKOS_ARCH_VEGA ON) ENDIF() +#HIP detection of gpu arch +IF(KOKKOS_ENABLE_HIP AND NOT AMDGPU_ARCH_ALREADY_SPECIFIED) + FIND_PROGRAM(ROCM_ENUMERATOR rocm_agent_enumerator) + IF(NOT ROCM_ENUMERATOR) + MESSAGE(FATAL_ERROR "Autodetection of AMD GPU architecture not possible as " + "rocm_agent_enumerator could not be found. " + "Please specify an arch manually via -DKokkos_ARCH_{..}=ON") + ELSE() + EXECUTE_PROCESS(COMMAND ${ROCM_ENUMERATOR} OUTPUT_VARIABLE GPU_ARCHS) + STRING(LENGTH "${GPU_ARCHS}" len_str) + # enumerator always output gfx000 as the first line + IF(${len_str} LESS 8) + MESSAGE(SEND_ERROR "HIP enabled but no AMD GPU architecture could be automatically detected. " + "Please manually specify one AMD GPU architecture via -DKokkos_ARCH_{..}=ON'.") + # check for known gpu archs, otherwise error out + ELSE() + SET(AMD_ARCH_DETECTED "") + FOREACH(ARCH IN LISTS SUPPORTED_AMD_ARCHS) + LIST(FIND SUPPORTED_AMD_ARCHS ${ARCH} LIST_INDEX) + LIST(GET CORRESPONDING_AMD_FLAGS ${LIST_INDEX} FLAG) + STRING(REGEX MATCH "(${FLAG})" DETECTED_GPU_ARCH ${GPU_ARCHS}) + IF("${DETECTED_GPU_ARCH}" STREQUAL "${FLAG}") + SET_AND_CHECK_AMD_ARCH(${ARCH} ${FLAG}) + SET(AMD_ARCH_DETECTED ${ARCH}) + BREAK() + ENDIF() + ENDFOREACH() + IF("${AMD_ARCH_DETECTED}" STREQUAL "") + MESSAGE(FATAL_ERROR "HIP enabled but no automatically detected AMD GPU architecture " + "is supported. " + "Please manually specify one AMD GPU architecture via -DKokkos_ARCH_{..}=ON'.") + ENDIF() + ENDIF() + ENDIF() +ENDIF() + +#Regardless of version, make sure we define the general architecture name +FOREACH(ARCH IN LISTS SUPPORTED_AMD_ARCHS) + IF (KOKKOS_ARCH_${ARCH}) + STRING(REGEX MATCH "(VEGA)" IS_VEGA ${ARCH}) + IF(IS_VEGA) + SET(KOKKOS_ARCH_VEGA ON) + BREAK() + ENDIF() + STRING(REGEX MATCH "(NAVI)" IS_NAVI ${ARCH}) + IF(IS_NAVI) + SET(KOKKOS_ARCH_NAVI ON) + BREAK() + ENDIF() + ENDIF() +ENDFOREACH() + #CMake verbose is kind of pointless #Let's just always print things MESSAGE(STATUS "Built-in Execution Spaces:") @@ -834,11 +907,19 @@ FOREACH (_BACKEND Cuda OpenMPTarget HIP SYCL OpenACC) ENDIF() IF (${_BACKEND} STREQUAL "Cuda") IF(KOKKOS_ENABLE_CUDA_UVM) - SET(_DEFAULT_DEVICE_MEMSPACE "Kokkos::${_BACKEND}UVMSpace") + MESSAGE(DEPRECATION "Setting Kokkos_ENABLE_CUDA_UVM is deprecated - use the portable Kokkos::SharedSpace as an explicit memory space in your code instead") + IF(KOKKOS_ENABLE_DEPRECATED_CODE_4) + SET(_DEFAULT_DEVICE_MEMSPACE "Kokkos::${_BACKEND}UVMSpace") + ELSE() + MESSAGE(FATAL_ERROR "Kokkos_ENABLE_DEPRECATED_CODE_4 must be set to use Kokkos_ENABLE_CUDA_UVM") + ENDIF() ELSE() SET(_DEFAULT_DEVICE_MEMSPACE "Kokkos::${_BACKEND}Space") ENDIF() SET(_DEVICE_PARALLEL "Kokkos::${_BACKEND}") + ELSEIF(${_BACKEND} STREQUAL "HIP") + SET(_DEFAULT_DEVICE_MEMSPACE "Kokkos::${_BACKEND}Space") + SET(_DEVICE_PARALLEL "Kokkos::${_BACKEND}") ELSE() SET(_DEFAULT_DEVICE_MEMSPACE "Kokkos::Experimental::${_BACKEND}Space") SET(_DEVICE_PARALLEL "Kokkos::Experimental::${_BACKEND}") diff --git a/lib/kokkos/cmake/kokkos_compiler_id.cmake b/lib/kokkos/cmake/kokkos_compiler_id.cmake index b9fe2ffab0..27a3102a6b 100644 --- a/lib/kokkos/cmake/kokkos_compiler_id.cmake +++ b/lib/kokkos/cmake/kokkos_compiler_id.cmake @@ -147,49 +147,66 @@ ENDIF() # Enforce the minimum compilers supported by Kokkos. SET(KOKKOS_MESSAGE_TEXT "Compiler not supported by Kokkos. Required compiler versions:") -SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n Clang 4.0.0 or higher") -SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n GCC 5.3.0 or higher") -SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n Intel 17.0.0 or higher") -SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n IntelLLVM 2022.0.0 or higher") -SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n NVCC 9.2.88 or higher") -SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n HIPCC 4.5.0 or higher") -SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n PGI 17.4 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n Clang(CPU) 8.0.0 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n Clang(CUDA) 10.0.0 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n GCC 8.2.0 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n Intel 19.0.5 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n IntelLLVM(CPU) 2021.1.1 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n IntelLLVM(SYCL) 2022.0.0 or higher") #FIXME +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n NVCC 11.0.0 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n HIPCC 5.2.0 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n NVHPC/PGI 22.3 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n MSVC 19.29 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n XL/XLClang not supported") SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\nCompiler: ${KOKKOS_CXX_COMPILER_ID} ${KOKKOS_CXX_COMPILER_VERSION}\n") -IF(KOKKOS_CXX_COMPILER_ID STREQUAL Clang) - IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 4.0.0) +IF(KOKKOS_CXX_COMPILER_ID STREQUAL Clang AND NOT Kokkos_ENABLE_CUDA) + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 8.0.0) + MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") + ENDIF() +ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL Clang AND Kokkos_ENABLE_CUDA) + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 10.0.0) MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") ENDIF() ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL GNU) - IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 5.3.0) + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 8.2.0) MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") ENDIF() ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL Intel) - IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 17.0.0) + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 19.0.5) + MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") + ENDIF() +ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL IntelLLVM AND NOT Kokkos_ENABLE_SYCL) + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 2021.1.1) MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") ENDIF() ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL IntelLLVM AND Kokkos_ENABLE_SYCL) - IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 2022.0.0) + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 2022.0.0) #FIXME 2022.2.0 MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") ENDIF() ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) - IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 9.2.88) + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 11.0.0) MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") ENDIF() SET(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Kokkos turns off CXX extensions" FORCE) ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL HIPCC) - # Note that ROCm 4.5 reports as version 4.4 - IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 4.4.0) + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 5.2.0) MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") ENDIF() -ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL PGI) - IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 17.4) +ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL PGI OR KOKKOS_CXX_COMPILER_ID STREQUAL NVHPC) + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 22.3) MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") ENDIF() # Treat PGI internally as NVHPC to simplify handling both compilers. # Before CMake 3.20 NVHPC was identified as PGI, nvc++ is # backward-compatible to pgc++. SET(KOKKOS_CXX_COMPILER_ID NVHPC CACHE STRING INTERNAL FORCE) +ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL "MSVC") + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 19.29) + MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") + ENDIF() +ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL XL OR KOKKOS_CXX_COMPILER_ID STREQUAL XLClang) + MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") ENDIF() IF(NOT DEFINED KOKKOS_CXX_HOST_COMPILER_ID) @@ -201,4 +218,12 @@ ENDIF() STRING(REPLACE "." ";" VERSION_LIST ${KOKKOS_CXX_COMPILER_VERSION}) LIST(GET VERSION_LIST 0 KOKKOS_COMPILER_VERSION_MAJOR) LIST(GET VERSION_LIST 1 KOKKOS_COMPILER_VERSION_MINOR) -LIST(GET VERSION_LIST 2 KOKKOS_COMPILER_VERSION_PATCH) +LIST(LENGTH VERSION_LIST LIST_LENGTH) + +# On Android, the compiler doesn't have a patch version, just a major/minor +IF(LIST_LENGTH GREATER 2) + LIST(GET VERSION_LIST 2 KOKKOS_COMPILER_VERSION_PATCH) +ELSE() + SET(KOKKOS_COMPILER_VERSION_PATCH 0) +ENDIF() + diff --git a/lib/kokkos/cmake/kokkos_corner_cases.cmake b/lib/kokkos/cmake/kokkos_corner_cases.cmake index a84ac2b630..ede2b4e0ca 100644 --- a/lib/kokkos/cmake/kokkos_corner_cases.cmake +++ b/lib/kokkos/cmake/kokkos_corner_cases.cmake @@ -1,62 +1,4 @@ -IF(KOKKOS_CXX_COMPILER_ID STREQUAL Clang AND KOKKOS_ENABLE_OPENMP AND NOT KOKKOS_CLANG_IS_CRAY AND NOT KOKKOS_COMPILER_CLANG_MSVC) - # The clang "version" doesn't actually tell you what runtimes and tools - # were built into Clang. We should therefore make sure that libomp - # was actually built into Clang. Otherwise the user will get nonsensical - # errors when they try to build. - - #Try compile is the height of CMake nonsense - #I can't just give it compiler and link flags - #I have to hackily pretend that compiler flags are compiler definitions - #and that linker flags are libraries - #also - this is easier to use than CMakeCheckCXXSourceCompiles - TRY_COMPILE(CLANG_HAS_OMP - ${KOKKOS_TOP_BUILD_DIR}/corner_cases - ${KOKKOS_SOURCE_DIR}/cmake/compile_tests/clang_omp.cpp - COMPILE_DEFINITIONS -fopenmp=libomp - LINK_LIBRARIES -fopenmp=libomp - ) - IF (NOT CLANG_HAS_OMP) - UNSET(CLANG_HAS_OMP CACHE) #make sure CMake always re-runs this - MESSAGE(FATAL_ERROR "Clang failed OpenMP check. You have requested -DKokkos_ENABLE_OPENMP=ON, but the Clang compiler does not appear to have been built with OpenMP support") - ENDIF() - UNSET(CLANG_HAS_OMP CACHE) #make sure CMake always re-runs this -ENDIF() - -IF(KOKKOS_CXX_COMPILER_ID STREQUAL AppleClang AND KOKKOS_ENABLE_OPENMP) - # The clang "version" doesn't actually tell you what runtimes and tools - # were built into Clang. We should therefore make sure that libomp - # was actually built into Clang. Otherwise the user will get nonsensical - # errors when they try to build. - - #Try compile is the height of CMake nonsense - #I can't just give it compiler and link flags - #I have to hackily pretend that compiler flags are compiler definitions - #and that linker flags are libraries - #also - this is easier to use than CMakeCheckCXXSourceCompiles - TRY_COMPILE(APPLECLANG_HAS_OMP - ${KOKKOS_TOP_BUILD_DIR}/corner_cases - ${KOKKOS_SOURCE_DIR}/cmake/compile_tests/clang_omp.cpp - COMPILE_DEFINITIONS -Xpreprocessor -fopenmp - LINK_LIBRARIES -lomp - ) - IF (NOT APPLECLANG_HAS_OMP) - UNSET(APPLECLANG_HAS_OMP CACHE) #make sure CMake always re-runs this - MESSAGE(FATAL_ERROR "AppleClang failed OpenMP check. You have requested -DKokkos_ENABLE_OPENMP=ON, but the AppleClang compiler does not appear to have been built with OpenMP support") - ENDIF() - UNSET(APPLECLANG_HAS_OMP CACHE) #make sure CMake always re-runs this -ENDIF() - - -IF (KOKKOS_CXX_STANDARD STREQUAL 17) - IF (KOKKOS_CXX_COMPILER_ID STREQUAL GNU AND KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 7) - MESSAGE(FATAL_ERROR "You have requested C++17 support for GCC ${KOKKOS_CXX_COMPILER_VERSION}. Although CMake has allowed this and GCC accepts -std=c++1z/c++17, GCC < 7 does not properly support *this capture. Please reduce the C++ standard to 14 or upgrade the compiler if you do need C++17 support.") - ENDIF() - - IF (KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA AND KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 11) - MESSAGE(FATAL_ERROR "You have requested C++17 support for NVCC ${KOKKOS_CXX_COMPILER_VERSION}. NVCC only supports C++17 from version 11 on. Please reduce the C++ standard to 14 or upgrade the compiler if you need C++17 support.") - ENDIF() - IF (KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA AND KOKKOS_ENABLE_CUDA_CONSTEXPR) - MESSAGE(WARNING "You have requested -DKokkos_ENABLE_CUDA_CONSTEXPR=ON with C++17 support for NVCC ${KOKKOS_CXX_COMPILER_VERSION} which is known to trigger compiler bugs. See https://github.com/kokkos/kokkos/issues/3496") - ENDIF() +IF (KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA AND KOKKOS_ENABLE_CUDA_CONSTEXPR AND KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 11.2) + MESSAGE(WARNING "You have requested -DKokkos_ENABLE_CUDA_CONSTEXPR=ON for NVCC ${KOKKOS_CXX_COMPILER_VERSION} which is known to trigger compiler bugs before NVCC version 11.2. See https://github.com/kokkos/kokkos/issues/3496") ENDIF() diff --git a/lib/kokkos/cmake/kokkos_enable_devices.cmake b/lib/kokkos/cmake/kokkos_enable_devices.cmake index c7a454c214..d4a7744eb5 100644 --- a/lib/kokkos/cmake/kokkos_enable_devices.cmake +++ b/lib/kokkos/cmake/kokkos_enable_devices.cmake @@ -20,13 +20,6 @@ KOKKOS_DEPRECATED_LIST(DEVICES ENABLE) KOKKOS_DEVICE_OPTION(THREADS OFF HOST "Whether to build C++ threads backend") -IF(Kokkos_ENABLE_PTHREAD) # for backward compatibility - SET(Kokkos_ENABLE_THREADS ON CACHE BOOL "Whether to build C++ threads backend" FORCE) - SET(KOKKOS_ENABLE_THREADS ON) - LIST(APPEND KOKKOS_ENABLED_DEVICES THREADS) - SET(KOKKOS_HAS_HOST ON) - MESSAGE(DEPRECATION "The Kokkos_ENABLE_PTHREAD option is deprecated. Use Kokkos_ENABLE_THREADS instead!") -ENDIF() # detect clang++ / cl / clang-cl clashes IF (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") @@ -46,45 +39,6 @@ ELSE() SET(OMP_DEFAULT OFF) ENDIF() KOKKOS_DEVICE_OPTION(OPENMP ${OMP_DEFAULT} HOST "Whether to build OpenMP backend") -IF(KOKKOS_ENABLE_OPENMP) - SET(ClangOpenMPFlag -fopenmp=libomp) - IF(KOKKOS_CLANG_IS_CRAY) - SET(ClangOpenMPFlag -fopenmp) - ENDIF() - IF(KOKKOS_COMPILER_CLANG_MSVC) - #for clang-cl expression /openmp yields an error, so directly add the specific Clang flag - SET(ClangOpenMPFlag /clang:-fopenmp=libomp) - ENDIF() - IF(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL Clang) - #link omp library from LLVM lib dir, no matter if it is clang-cl or clang++ - get_filename_component(LLVM_BIN_DIR ${CMAKE_CXX_COMPILER_AR} DIRECTORY) - COMPILER_SPECIFIC_LIBS(Clang "${LLVM_BIN_DIR}/../lib/libomp.lib") - ENDIF() - IF(KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) - COMPILER_SPECIFIC_FLAGS( - COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID - Clang -Xcompiler ${ClangOpenMPFlag} - IntelLLVM -Xcompiler -fiopenmp - NVHPC -Xcompiler -mp - Cray NO-VALUE-SPECIFIED - XL -Xcompiler -qsmp=omp - DEFAULT -Xcompiler -fopenmp - ) - ELSE() - COMPILER_SPECIFIC_FLAGS( - Clang ${ClangOpenMPFlag} - IntelLLVM -fiopenmp - AppleClang -Xpreprocessor -fopenmp - NVHPC -mp - Cray NO-VALUE-SPECIFIED - XL -qsmp=omp - DEFAULT -fopenmp - ) - COMPILER_SPECIFIC_LIBS( - AppleClang -lomp - ) - ENDIF() -ENDIF() KOKKOS_DEVICE_OPTION(OPENACC OFF DEVICE "Whether to build the OpenACC backend") @@ -98,12 +52,10 @@ IF (KOKKOS_ENABLE_OPENMPTARGET) COMPILER_SPECIFIC_FLAGS( Clang ${ClangOpenMPFlag} -Wno-openmp-mapping IntelLLVM -fiopenmp -Wno-openmp-mapping - XL -qsmp=omp -qoffload -qnoeh NVHPC -mp=gpu DEFAULT -fopenmp ) COMPILER_SPECIFIC_DEFS( - XL KOKKOS_IBM_XL_OMP45_WORKAROUND Clang KOKKOS_WORKAROUND_OPENMPTARGET_CLANG ) # Are there compilers which identify as Clang and need this library? diff --git a/lib/kokkos/cmake/kokkos_enable_options.cmake b/lib/kokkos/cmake/kokkos_enable_options.cmake index ea606bb0c9..f9f1bc5a8b 100644 --- a/lib/kokkos/cmake/kokkos_enable_options.cmake +++ b/lib/kokkos/cmake/kokkos_enable_options.cmake @@ -34,11 +34,13 @@ KOKKOS_ENABLE_OPTION(CUDA_UVM OFF "Whether to use unified memory (UM KOKKOS_ENABLE_OPTION(CUDA_LDG_INTRINSIC OFF "Whether to use CUDA LDG intrinsics") # As of 08/12/2021 CudaMallocAsync causes issues if UCX is used as MPI communication layer. KOKKOS_ENABLE_OPTION(IMPL_CUDA_MALLOC_ASYNC OFF "Whether to enable CudaMallocAsync (requires CUDA Toolkit 11.2)") -KOKKOS_ENABLE_OPTION(DEPRECATED_CODE_3 ON "Whether code deprecated in major release 3 is available" ) +KOKKOS_ENABLE_OPTION(DEPRECATED_CODE_3 OFF "Whether code deprecated in major release 3 is available" ) +KOKKOS_ENABLE_OPTION(DEPRECATED_CODE_4 ON "Whether code deprecated in major release 4 is available" ) KOKKOS_ENABLE_OPTION(DEPRECATION_WARNINGS ON "Whether to emit deprecation warnings" ) KOKKOS_ENABLE_OPTION(HIP_RELOCATABLE_DEVICE_CODE OFF "Whether to enable relocatable device code (RDC) for HIP") KOKKOS_ENABLE_OPTION(HPX_ASYNC_DISPATCH OFF "Whether HPX supports asynchronous dispatch") KOKKOS_ENABLE_OPTION(TESTS OFF "Whether to build the unit tests") +KOKKOS_ENABLE_OPTION(BENCHMARKS OFF "Whether to build the benchmarks") KOKKOS_ENABLE_OPTION(EXAMPLES OFF "Whether to build the examples") STRING(TOUPPER "${CMAKE_BUILD_TYPE}" UPPERCASE_CMAKE_BUILD_TYPE) IF(UPPERCASE_CMAKE_BUILD_TYPE STREQUAL "DEBUG") @@ -63,13 +65,16 @@ KOKKOS_ENABLE_OPTION(HIP_MULTIPLE_KERNEL_INSTANTIATIONS OFF "Whether multiple ke KOKKOS_ENABLE_OPTION(IMPL_DESUL_ATOMICS ON "Whether to use desul based atomics - option only during beta") KOKKOS_ENABLE_OPTION(DESUL_ATOMICS_EXTERNAL OFF "Whether to use an external desul installation") -IF (KOKKOS_ENABLE_CUDA) - SET(KOKKOS_COMPILER_CUDA_VERSION "${KOKKOS_COMPILER_VERSION_MAJOR}${KOKKOS_COMPILER_VERSION_MINOR}") -ENDIF() +KOKKOS_ENABLE_OPTION(IMPL_MDSPAN OFF "Whether to enable experimental mdspan support") +KOKKOS_ENABLE_OPTION(MDSPAN_EXTERNAL OFF BOOL "Whether to use an external version of mdspan") +KOKKOS_ENABLE_OPTION(IMPL_SKIP_COMPILER_MDSPAN OFF BOOL "Whether to use an internal version of mdspan even if the compiler supports mdspan") +mark_as_advanced(Kokkos_ENABLE_IMPL_MDSPAN) +mark_as_advanced(Kokkos_ENABLE_MDSPAN_EXTERNAL) +mark_as_advanced(Kokkos_ENABLE_IMPL_SKIP_COMPILER_MDSPAN) IF (Trilinos_ENABLE_Kokkos AND TPL_ENABLE_CUDA) SET(CUDA_LAMBDA_DEFAULT ON) -ELSEIF (KOKKOS_ENABLE_CUDA AND (KOKKOS_CXX_COMPILER_ID STREQUAL Clang)) +ELSEIF (KOKKOS_ENABLE_CUDA) SET(CUDA_LAMBDA_DEFAULT ON) ELSE() SET(CUDA_LAMBDA_DEFAULT OFF) @@ -125,6 +130,23 @@ IF (KOKKOS_ENABLE_AGGRESSIVE_VECTORIZATION) SET(KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION ON) ENDIF() +# Force consistency of KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE +# and CMAKE_CUDA_SEPARABLE_COMPILATION when we are compiling +# using the CMake CUDA language support. +# Either one being on will turn the other one on. +IF (KOKKOS_COMPILE_LANGUAGE STREQUAL CUDA) + IF (KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE) + IF (NOT CMAKE_CUDA_SEPARABLE_COMPILATION) + MESSAGE(STATUS "Setting CMAKE_CUDA_SEPARABLE_COMPILATION=ON since Kokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE is true. When compiling Kokkos with CMake language CUDA, please use CMAKE_CUDA_SEPARABLE_COMPILATION to control RDC support") + SET(CMAKE_CUDA_SEPARABLE_COMPILATION ON) + ENDIF() + ELSE() + IF (CMAKE_CUDA_SEPARABLE_COMPILATION) + SET(KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE ON) + ENDIF() + ENDIF() +ENDIF() + # This is known to occur with Clang 9. We would need to use nvcc as the linker # http://lists.llvm.org/pipermail/cfe-dev/2018-June/058296.html # TODO: Through great effort we can use a different linker by hacking @@ -136,3 +158,11 @@ ENDIF() IF (KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE AND BUILD_SHARED_LIBS) MESSAGE(FATAL_ERROR "Relocatable device code requires static libraries.") ENDIF() + +IF(Kokkos_ENABLE_CUDA_LDG_INTRINSIC) + IF(KOKKOS_ENABLE_DEPRECATED_CODE_4) + MESSAGE(DEPRECATION "Setting Kokkos_ENABLE_CUDA_LDG_INTRINSIC is deprecated. LDG intrinsics are always enabled.") + ELSE() + MESSAGE(FATAL_ERROR "Kokkos_ENABLE_CUDA_LDG_INTRINSIC has been removed. LDG intrinsics are always enabled.") + ENDIF() +ENDIF() diff --git a/lib/kokkos/cmake/kokkos_functions.cmake b/lib/kokkos/cmake/kokkos_functions.cmake index 11fa9b302c..4c51bdeabf 100644 --- a/lib/kokkos/cmake/kokkos_functions.cmake +++ b/lib/kokkos/cmake/kokkos_functions.cmake @@ -281,7 +281,11 @@ MACRO(kokkos_import_tpl NAME) MESSAGE(FATAL_ERROR "Find module succeeded for ${NAME}, but did not produce valid target ${TPL_IMPORTED_NAME}") ENDIF() IF(NOT TPL_NO_EXPORT) - KOKKOS_EXPORT_IMPORTED_TPL(${TPL_IMPORTED_NAME}) + GET_TARGET_PROPERTY(TPL_ORIGINAL_NAME ${TPL_IMPORTED_NAME} ALIASED_TARGET) + IF (NOT TPL_ORIGINAL_NAME) + SET(TPL_ORIGINAL_NAME ${TPL_IMPORTED_NAME}) + ENDIF() + KOKKOS_EXPORT_IMPORTED_TPL(${TPL_ORIGINAL_NAME}) ENDIF() LIST(APPEND KOKKOS_ENABLED_TPLS ${NAME}) ENDIF() @@ -823,7 +827,7 @@ FUNCTION(kokkos_link_tpl TARGET) ENDFUNCTION() FUNCTION(COMPILER_SPECIFIC_OPTIONS_HELPER) - SET(COMPILERS NVIDIA NVHPC XL XLClang DEFAULT Cray Intel Clang AppleClang IntelLLVM GNU HIPCC Fujitsu) + SET(COMPILERS NVIDIA NVHPC DEFAULT Cray Intel Clang AppleClang IntelLLVM GNU HIPCC Fujitsu MSVC) CMAKE_PARSE_ARGUMENTS( PARSE "LINK_OPTIONS;COMPILE_OPTIONS;COMPILE_DEFINITIONS;LINK_LIBRARIES" diff --git a/lib/kokkos/cmake/kokkos_install.cmake b/lib/kokkos/cmake/kokkos_install.cmake index ff66d015fb..c65c2af52b 100644 --- a/lib/kokkos/cmake/kokkos_install.cmake +++ b/lib/kokkos/cmake/kokkos_install.cmake @@ -19,7 +19,7 @@ IF (NOT KOKKOS_HAS_TRILINOS AND NOT Kokkos_INSTALL_TESTING) WRITE_BASIC_PACKAGE_VERSION_FILE("${Kokkos_BINARY_DIR}/KokkosConfigVersion.cmake" VERSION "${Kokkos_VERSION}" - COMPATIBILITY SameMajorVersion) + COMPATIBILITY AnyNewerVersion) # Install the KokkosConfig*.cmake files install(FILES diff --git a/lib/kokkos/cmake/kokkos_pick_cxx_std.cmake b/lib/kokkos/cmake/kokkos_pick_cxx_std.cmake index 03f1a0d18a..d4eca651d4 100644 --- a/lib/kokkos/cmake/kokkos_pick_cxx_std.cmake +++ b/lib/kokkos/cmake/kokkos_pick_cxx_std.cmake @@ -1,46 +1,19 @@ # From CMake 3.10 documentation #This can run at any time -KOKKOS_OPTION(CXX_STANDARD "" STRING "[[DEPRECATED - USE CMAKE_CXX_STANDARD INSTEAD]] The C++ standard for Kokkos to use: 14, 17, or 20. If empty, this will default to CMAKE_CXX_STANDARD. If both CMAKE_CXX_STANDARD and Kokkos_CXX_STANDARD are empty, this will default to 14") +KOKKOS_OPTION(CXX_STANDARD "" STRING "[[DEPRECATED - USE CMAKE_CXX_STANDARD INSTEAD]] The C++ standard for Kokkos to use: 17 or 20. If empty, this will default to CMAKE_CXX_STANDARD. If both CMAKE_CXX_STANDARD and Kokkos_CXX_STANDARD are empty, this will default to 17") # Set CXX standard flags -SET(KOKKOS_ENABLE_CXX14 OFF) SET(KOKKOS_ENABLE_CXX17 OFF) SET(KOKKOS_ENABLE_CXX20 OFF) +SET(KOKKOS_ENABLE_CXX23 OFF) IF (KOKKOS_CXX_STANDARD) - MESSAGE(DEPRECATION "Setting the variable Kokkos_CXX_STANDARD in configuration is deprecated - set CMAKE_CXX_STANDARD directly instead") - - IF (${KOKKOS_CXX_STANDARD} STREQUAL "c++98") - MESSAGE(FATAL_ERROR "Kokkos no longer supports C++98 - minimum C++14") - ELSEIF (${KOKKOS_CXX_STANDARD} STREQUAL "c++11") - MESSAGE(FATAL_ERROR "Kokkos no longer supports C++11 - minimum C++14") - ELSEIF(${KOKKOS_CXX_STANDARD} STREQUAL "c++14") - MESSAGE(WARNING "Deprecated Kokkos C++ standard set as 'c++14'. Use '14' instead.") - SET(KOKKOS_CXX_STANDARD "14") - ELSEIF(${KOKKOS_CXX_STANDARD} STREQUAL "c++17") - MESSAGE(WARNING "Deprecated Kokkos C++ standard set as 'c++17'. Use '17' instead.") - SET(KOKKOS_CXX_STANDARD "17") - ELSEIF(${KOKKOS_CXX_STANDARD} STREQUAL "c++1y") - MESSAGE(WARNING "Deprecated Kokkos C++ standard set as 'c++1y'. Use '1Y' instead.") - SET(KOKKOS_CXX_STANDARD "1Y") - ELSEIF(${KOKKOS_CXX_STANDARD} STREQUAL "c++1z") - MESSAGE(WARNING "Deprecated Kokkos C++ standard set as 'c++1z'. Use '1Z' instead.") - SET(KOKKOS_CXX_STANDARD "1Z") - ELSEIF(${KOKKOS_CXX_STANDARD} STREQUAL "c++2a") - MESSAGE(WARNING "Deprecated Kokkos C++ standard set as 'c++2a'. Use '2A' instead.") - SET(KOKKOS_CXX_STANDARD "2A") - ENDIF() + MESSAGE(FATAL_ERROR "Setting the variable Kokkos_CXX_STANDARD in configuration is deprecated - set CMAKE_CXX_STANDARD directly instead") ENDIF() -IF (NOT KOKKOS_CXX_STANDARD AND NOT CMAKE_CXX_STANDARD) - MESSAGE(STATUS "Setting default Kokkos CXX standard to 14") - SET(KOKKOS_CXX_STANDARD "14") -ELSEIF(NOT KOKKOS_CXX_STANDARD) - MESSAGE(STATUS "Setting default Kokkos CXX standard to ${CMAKE_CXX_STANDARD}") +IF (NOT CMAKE_CXX_STANDARD) + SET(KOKKOS_CXX_STANDARD "17") +ELSE() SET(KOKKOS_CXX_STANDARD ${CMAKE_CXX_STANDARD}) ENDIF() - - - - - +MESSAGE(STATUS "Setting default Kokkos CXX standard to ${KOKKOS_CXX_STANDARD}") diff --git a/lib/kokkos/cmake/kokkos_test_cxx_std.cmake b/lib/kokkos/cmake/kokkos_test_cxx_std.cmake index a5a8f40af8..eda3124586 100644 --- a/lib/kokkos/cmake/kokkos_test_cxx_std.cmake +++ b/lib/kokkos/cmake/kokkos_test_cxx_std.cmake @@ -29,7 +29,7 @@ FUNCTION(kokkos_set_cxx_standard_feature standard) ELSEIF(NOT KOKKOS_USE_CXX_EXTENSIONS AND ${STANDARD_NAME}) MESSAGE(STATUS "Using ${${STANDARD_NAME}} for C++${standard} standard as feature") IF (KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA AND (KOKKOS_CXX_HOST_COMPILER_ID STREQUAL GNU OR KOKKOS_CXX_HOST_COMPILER_ID STREQUAL Clang)) - SET(SUPPORTED_NVCC_FLAGS "-std=c++14;-std=c++17") + SET(SUPPORTED_NVCC_FLAGS "-std=c++17") IF (NOT ${${STANDARD_NAME}} IN_LIST SUPPORTED_NVCC_FLAGS) MESSAGE(FATAL_ERROR "CMake wants to use ${${STANDARD_NAME}} which is not supported by NVCC. Using a more recent host compiler or a more recent CMake version might help.") ENDIF() @@ -58,21 +58,7 @@ FUNCTION(kokkos_set_cxx_standard_feature standard) ENDIF() ENDFUNCTION() - -IF (KOKKOS_CXX_STANDARD AND CMAKE_CXX_STANDARD) - #make sure these are consistent - IF (NOT KOKKOS_CXX_STANDARD STREQUAL CMAKE_CXX_STANDARD) - MESSAGE(WARNING "Specified both CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} and KOKKOS_CXX_STANDARD=${KOKKOS_CXX_STANDARD}, but they don't match") - SET(CMAKE_CXX_STANDARD ${KOKKOS_CXX_STANDARD} CACHE STRING "C++ standard" FORCE) - ENDIF() -ENDIF() - - -IF(KOKKOS_CXX_STANDARD STREQUAL "14") - kokkos_set_cxx_standard_feature(14) - SET(KOKKOS_CXX_INTERMEDIATE_STANDARD "1Y") - SET(KOKKOS_ENABLE_CXX14 ON) -ELSEIF(KOKKOS_CXX_STANDARD STREQUAL "17") +IF(KOKKOS_CXX_STANDARD STREQUAL "17") kokkos_set_cxx_standard_feature(17) SET(KOKKOS_CXX_INTERMEDIATE_STANDARD "1Z") SET(KOKKOS_ENABLE_CXX17 ON) @@ -80,34 +66,36 @@ ELSEIF(KOKKOS_CXX_STANDARD STREQUAL "20") kokkos_set_cxx_standard_feature(20) SET(KOKKOS_CXX_INTERMEDIATE_STANDARD "2A") SET(KOKKOS_ENABLE_CXX20 ON) -ELSEIF(KOKKOS_CXX_STANDARD STREQUAL "98" OR KOKKOS_CXX_STANDARD STREQUAL "11") - MESSAGE(FATAL_ERROR "Kokkos requires C++14 or newer!") +ELSEIF(KOKKOS_CXX_STANDARD STREQUAL "23") + kokkos_set_cxx_standard_feature(23) + SET(KOKKOS_CXX_INTERMEDIATE_STANDARD "2B") + SET(KOKKOS_ENABLE_CXX23 ON) ELSE() - MESSAGE(FATAL_ERROR "Unknown C++ standard ${KOKKOS_CXX_STANDARD} - must be 14, 17, or 20") + MESSAGE(FATAL_ERROR "Kokkos requires C++17 or newer but requested ${KOKKOS_CXX_STANDARD}!") ENDIF() -# Enforce that we can compile a simple C++14 program +# Enforce that we can compile a simple C++17 program -TRY_COMPILE(CAN_COMPILE_CPP14 +TRY_COMPILE(CAN_COMPILE_CPP17 ${KOKKOS_TOP_BUILD_DIR}/corner_cases - ${KOKKOS_SOURCE_DIR}/cmake/compile_tests/cplusplus14.cpp + ${KOKKOS_SOURCE_DIR}/cmake/compile_tests/cplusplus17.cpp OUTPUT_VARIABLE ERROR_MESSAGE - CXX_STANDARD 14 + CXX_STANDARD 17 ) -if (NOT CAN_COMPILE_CPP14) - UNSET(CAN_COMPILE_CPP14 CACHE) #make sure CMake always re-runs this - MESSAGE(FATAL_ERROR "C++${KOKKOS_CXX_STANDARD}-compliant compiler detected, but unable to compile C++14 or later program. Verify that ${CMAKE_CXX_COMPILER_ID}:${CMAKE_CXX_COMPILER_VERSION} is set up correctly (e.g., check that correct library headers are being used).\nFailing output:\n ${ERROR_MESSAGE}") +if (NOT CAN_COMPILE_CPP17) + UNSET(CAN_COMPILE_CPP17 CACHE) #make sure CMake always re-runs this + MESSAGE(FATAL_ERROR "C++${KOKKOS_CXX_STANDARD}-compliant compiler detected, but unable to compile C++17 or later program. Verify that ${CMAKE_CXX_COMPILER_ID}:${CMAKE_CXX_COMPILER_VERSION} is set up correctly (e.g., check that correct library headers are being used).\nFailing output:\n ${ERROR_MESSAGE}") ENDIF() -UNSET(CAN_COMPILE_CPP14 CACHE) #make sure CMake always re-runs this +UNSET(CAN_COMPILE_CPP17 CACHE) #make sure CMake always re-runs this # Enforce that extensions are turned off for nvcc_wrapper. # For compiling CUDA code using nvcc_wrapper, we will use the host compiler's -# flags for turning on C++14. Since for compiler ID and versioning purposes +# flags for turning on C++17. Since for compiler ID and versioning purposes # CMake recognizes the host compiler when calling nvcc_wrapper, this just -# works. Both NVCC and nvcc_wrapper only recognize '-std=c++14' which means +# works. Both NVCC and nvcc_wrapper only recognize '-std=c++17' which means # that we can only use host compilers for CUDA builds that use those flags. -# It also means that extensions (gnu++14) can't be turned on for CUDA builds. +# It also means that extensions (gnu++17) can't be turned on for CUDA builds. IF(KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) IF(NOT DEFINED CMAKE_CXX_EXTENSIONS) diff --git a/lib/kokkos/cmake/kokkos_tpls.cmake b/lib/kokkos/cmake/kokkos_tpls.cmake index 2c712a519b..ba66ee4d38 100644 --- a/lib/kokkos/cmake/kokkos_tpls.cmake +++ b/lib/kokkos/cmake/kokkos_tpls.cmake @@ -39,7 +39,8 @@ IF(KOKKOS_ENABLE_MEMKIND) ENDIF() KOKKOS_TPL_OPTION(CUDA ${Kokkos_ENABLE_CUDA} TRIBITS CUDA) KOKKOS_TPL_OPTION(LIBRT Off) -IF(KOKKOS_ENABLE_HIP AND NOT KOKKOS_CXX_COMPILER_ID STREQUAL HIPCC) +IF(KOKKOS_ENABLE_HIP AND NOT KOKKOS_CXX_COMPILER_ID STREQUAL HIPCC AND NOT + KOKKOS_HAS_TRILINOS) SET(ROCM_DEFAULT ON) ELSE() SET(ROCM_DEFAULT OFF) @@ -82,7 +83,9 @@ KOKKOS_IMPORT_TPL(MEMKIND) IF (NOT WIN32) KOKKOS_IMPORT_TPL(THREADS INTERFACE) ENDIF() -KOKKOS_IMPORT_TPL(ROCM INTERFACE) +IF (NOT KOKKOS_ENABLE_COMPILE_AS_CMAKE_LANGUAGE) + KOKKOS_IMPORT_TPL(ROCM INTERFACE) +ENDIF() KOKKOS_IMPORT_TPL(LIBQUADMATH) IF (Kokkos_ENABLE_IMPL_DESUL_ATOMICS AND Kokkos_ENABLE_DESUL_ATOMICS_EXTERNAL) @@ -90,6 +93,22 @@ IF (Kokkos_ENABLE_IMPL_DESUL_ATOMICS AND Kokkos_ENABLE_DESUL_ATOMICS_EXTERNAL) KOKKOS_EXPORT_CMAKE_TPL(desul REQUIRED COMPONENTS atomics) ENDIF() +if (Kokkos_ENABLE_IMPL_MDSPAN AND Kokkos_ENABLE_MDSPAN_EXTERNAL) + find_package(mdspan REQUIRED) + KOKKOS_EXPORT_CMAKE_TPL(mdspan REQUIRED) +endif() + +IF (Kokkos_ENABLE_OPENMP) + find_package(OpenMP REQUIRED) + # FIXME_TRILINOS Trilinos doesn't allow for Kokkos to use find_dependency + # so we just append the flags here instead of linking with the OpenMP target. + IF(KOKKOS_HAS_TRILINOS) + COMPILER_SPECIFIC_FLAGS(DEFAULT ${OpenMP_CXX_FLAGS}) + ELSE() + KOKKOS_EXPORT_CMAKE_TPL(OpenMP REQUIRED) + ENDIF() +ENDIF() + #Convert list to newlines (which CMake doesn't always like in cache variables) STRING(REPLACE ";" "\n" KOKKOS_TPL_EXPORT_TEMP "${KOKKOS_TPL_EXPORTS}") #Convert to a regular variable diff --git a/lib/kokkos/cmake/kokkos_tribits.cmake b/lib/kokkos/cmake/kokkos_tribits.cmake index 34e45ecf72..0557db2098 100644 --- a/lib/kokkos/cmake/kokkos_tribits.cmake +++ b/lib/kokkos/cmake/kokkos_tribits.cmake @@ -8,8 +8,10 @@ MESSAGE(STATUS "The project name is: ${PROJECT_NAME}") IF(GTest_FOUND) SET(KOKKOS_GTEST_LIB GTest::gtest) + MESSAGE(STATUS "Using gtest found in ${GTest_DIR}") ELSE() # fallback to internal gtest SET(KOKKOS_GTEST_LIB kokkos_gtest) + MESSAGE(STATUS "Using internal gtest for testing") ENDIF() FUNCTION(VERIFY_EMPTY CONTEXT) @@ -88,9 +90,7 @@ MACRO(KOKKOS_PROCESS_SUBPACKAGES) ADD_SUBDIRECTORY(core) ADD_SUBDIRECTORY(containers) ADD_SUBDIRECTORY(algorithms) - if (KOKKOS_CXX_STANDARD GREATER_EQUAL 17) - ADD_SUBDIRECTORY(simd) - endif() + ADD_SUBDIRECTORY(simd) ADD_SUBDIRECTORY(example) endif() ENDMACRO() @@ -217,6 +217,7 @@ MACRO(KOKKOS_SETUP_BUILD_ENVIRONMENT) SET(Kokkos_INSTALL_TESTING OFF CACHE INTERNAL "Whether to build tests and examples against installation") IF (Kokkos_INSTALL_TESTING) SET(KOKKOS_ENABLE_TESTS ON) + SET(KOKKOS_ENABLE_BENCHMARKS ON) SET(KOKKOS_ENABLE_EXAMPLES ON) # This looks a little weird, but what we are doing # is to NOT build Kokkos but instead look for an @@ -281,11 +282,7 @@ MACRO(KOKKOS_CONFIGURE_CORE) LIST(APPEND FWD_BACKEND_LIST ${MEMSPACE}) ENDFOREACH() FOREACH(BACKEND_ ${KOKKOS_ENABLED_DEVICES}) - IF( ${BACKEND_} STREQUAL "PTHREAD") - LIST(APPEND FWD_BACKEND_LIST THREADS) - ELSE() - LIST(APPEND FWD_BACKEND_LIST ${BACKEND_}) - ENDIF() + LIST(APPEND FWD_BACKEND_LIST ${BACKEND_}) ENDFOREACH() MESSAGE(STATUS "Kokkos Devices: ${KOKKOS_ENABLED_DEVICES}, Kokkos Backends: ${FWD_BACKEND_LIST}") KOKKOS_CONFIG_HEADER( KokkosCore_Config_HeaderSet.in KokkosCore_Config_FwdBackend.hpp "KOKKOS_FWD" "fwd/Kokkos_Fwd" "${FWD_BACKEND_LIST}") @@ -534,13 +531,6 @@ FUNCTION(KOKKOS_ADD_INTERFACE_LIBRARY NAME) IF (KOKKOS_HAS_TRILINOS) TRIBITS_ADD_LIBRARY(${NAME} ${ARGN}) ELSE() - CMAKE_PARSE_ARGUMENTS(PARSE - "" - "" - "HEADERS;SOURCES" - ${ARGN} - ) - ADD_LIBRARY(${NAME} INTERFACE) KOKKOS_INTERNAL_ADD_LIBRARY_INSTALL(${NAME}) ENDIF() diff --git a/lib/kokkos/cmake/tpls/FindTPLCUSPARSE.cmake b/lib/kokkos/cmake/tpls/FindTPLCUSPARSE.cmake index 1ae4f19dd4..4709f8002b 100644 --- a/lib/kokkos/cmake/tpls/FindTPLCUSPARSE.cmake +++ b/lib/kokkos/cmake/tpls/FindTPLCUSPARSE.cmake @@ -1,44 +1,18 @@ -# @HEADER +#@HEADER # ************************************************************************ # -# Kokkos v. 3.0 -# Copyright (2020) National Technology & Engineering +# Kokkos v. 4.0 +# Copyright (2022) National Technology & Engineering # Solutions of Sandia, LLC (NTESS). # # Under the terms of Contract DE-NA0003525 with NTESS, # 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: +# Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. # -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # -# 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 NTESS "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 NTESS 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 +#@HEADER # Check for CUDA support diff --git a/lib/kokkos/cmake/tpls/FindTPLHWLOC.cmake b/lib/kokkos/cmake/tpls/FindTPLHWLOC.cmake index 467635083f..4e05d22534 100644 --- a/lib/kokkos/cmake/tpls/FindTPLHWLOC.cmake +++ b/lib/kokkos/cmake/tpls/FindTPLHWLOC.cmake @@ -1,41 +1,16 @@ -# @HEADER +#@HEADER # ************************************************************************ # -# Kokkos v. 3.0 -# Copyright (2020) National Technology & Engineering +# Kokkos v. 4.0 +# Copyright (2022) National Technology & Engineering # Solutions of Sandia, LLC (NTESS). # # Under the terms of Contract DE-NA0003525 with NTESS, # 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: +# Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. # -# 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 NTESS "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 NTESS 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) +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ************************************************************************ # @HEADER diff --git a/lib/kokkos/cmake/tpls/FindTPLPthread.cmake b/lib/kokkos/cmake/tpls/FindTPLPthread.cmake index c78630b7f1..3d5b03805d 100644 --- a/lib/kokkos/cmake/tpls/FindTPLPthread.cmake +++ b/lib/kokkos/cmake/tpls/FindTPLPthread.cmake @@ -1,46 +1,20 @@ -# @HEADER +#@HEADER # ************************************************************************ # -# Kokkos v. 3.0 -# Copyright (2020) National Technology & Engineering +# Kokkos v. 4.0 +# Copyright (2022) National Technology & Engineering # Solutions of Sandia, LLC (NTESS). # # Under the terms of Contract DE-NA0003525 with NTESS, # 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: +# Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. # -# 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 NTESS "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 NTESS 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) +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ************************************************************************ # @HEADER - SET(USE_THREADS FALSE) IF(NOT TPL_Pthread_INCLUDE_DIRS AND NOT TPL_Pthread_LIBRARY_DIRS AND NOT TPL_Pthread_LIBRARIES) diff --git a/lib/kokkos/cmake/tpls/FindTPLquadmath.cmake b/lib/kokkos/cmake/tpls/FindTPLquadmath.cmake index 1f7587da80..8560ec60f1 100644 --- a/lib/kokkos/cmake/tpls/FindTPLquadmath.cmake +++ b/lib/kokkos/cmake/tpls/FindTPLquadmath.cmake @@ -1,41 +1,16 @@ -# @HEADER +#@HEADER # ************************************************************************ # -# Kokkos v. 3.0 -# Copyright (2020) National Technology & Engineering +# Kokkos v. 4.0 +# Copyright (2022) National Technology & Engineering # Solutions of Sandia, LLC (NTESS). # # Under the terms of Contract DE-NA0003525 with NTESS, # 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: +# Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. # -# 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 NTESS "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 NTESS 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) +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ************************************************************************ # @HEADER diff --git a/lib/kokkos/containers/CMakeLists.txt b/lib/kokkos/containers/CMakeLists.txt index b0e0c4eade..b450c27209 100644 --- a/lib/kokkos/containers/CMakeLists.txt +++ b/lib/kokkos/containers/CMakeLists.txt @@ -6,7 +6,10 @@ IF (NOT Kokkos_INSTALL_TESTING) ADD_SUBDIRECTORY(src) ENDIF() +# FIXME_OPENACC: temporarily disabled due to unimplemented features +IF(NOT KOKKOS_ENABLE_OPENACC) KOKKOS_ADD_TEST_DIRECTORIES(unit_tests) KOKKOS_ADD_TEST_DIRECTORIES(performance_tests) +ENDIF() KOKKOS_SUBPACKAGE_POSTPROCESS() diff --git a/lib/kokkos/containers/performance_tests/TestCuda.cpp b/lib/kokkos/containers/performance_tests/TestCuda.cpp index 8874590e2a..e98595a41e 100644 --- a/lib/kokkos/containers/performance_tests/TestCuda.cpp +++ b/lib/kokkos/containers/performance_tests/TestCuda.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 @@ -72,6 +44,10 @@ TEST(TEST_CATEGORY, dynrankview_perf) { } TEST(TEST_CATEGORY, global_2_local) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + GTEST_SKIP() << "errors reported for all sizes"; +#endif std::cout << "Cuda" << std::endl; std::cout << "size, create, generate, fill, find" << std::endl; for (unsigned i = Performance::begin_id_size; i <= Performance::end_id_size; diff --git a/lib/kokkos/containers/performance_tests/TestDynRankView.hpp b/lib/kokkos/containers/performance_tests/TestDynRankView.hpp index 7ed9a0271a..48c5defeb7 100644 --- a/lib/kokkos/containers/performance_tests/TestDynRankView.hpp +++ b/lib/kokkos/containers/performance_tests/TestDynRankView.hpp @@ -1,44 +1,17 @@ - //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_DYNRANKVIEW_HPP diff --git a/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp b/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp index 77451bb9e8..ac11d2493f 100644 --- a/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp +++ b/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp @@ -1,43 +1,17 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_GLOBAL_TO_LOCAL_IDS_HPP diff --git a/lib/kokkos/containers/performance_tests/TestHIP.cpp b/lib/kokkos/containers/performance_tests/TestHIP.cpp index 8033c76be6..56680f7d64 100644 --- a/lib/kokkos/containers/performance_tests/TestHIP.cpp +++ b/lib/kokkos/containers/performance_tests/TestHIP.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 @@ -68,7 +40,7 @@ namespace Performance { TEST(TEST_CATEGORY, dynrankview_perf) { std::cout << "HIP" << std::endl; std::cout << " DynRankView vs View: Initialization Only " << std::endl; - test_dynrankview_op_perf(40960); + test_dynrankview_op_perf(40960); } TEST(TEST_CATEGORY, global_2_local) { @@ -76,15 +48,15 @@ TEST(TEST_CATEGORY, global_2_local) { std::cout << "size, create, generate, fill, find" << std::endl; for (unsigned i = Performance::begin_id_size; i <= Performance::end_id_size; i *= Performance::id_step) - test_global_to_local_ids(i); + test_global_to_local_ids(i); } TEST(TEST_CATEGORY, unordered_map_performance_near) { - Perf::run_performance_tests("hip-near"); + Perf::run_performance_tests("hip-near"); } TEST(TEST_CATEGORY, unordered_map_performance_far) { - Perf::run_performance_tests("hip-far"); + Perf::run_performance_tests("hip-far"); } } // namespace Performance diff --git a/lib/kokkos/containers/performance_tests/TestHPX.cpp b/lib/kokkos/containers/performance_tests/TestHPX.cpp index f229901dcc..b3bfb2140b 100644 --- a/lib/kokkos/containers/performance_tests/TestHPX.cpp +++ b/lib/kokkos/containers/performance_tests/TestHPX.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/containers/performance_tests/TestMain.cpp b/lib/kokkos/containers/performance_tests/TestMain.cpp index 140ba418fd..0bf647012a 100644 --- a/lib/kokkos/containers/performance_tests/TestMain.cpp +++ b/lib/kokkos/containers/performance_tests/TestMain.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/containers/performance_tests/TestOpenMP.cpp b/lib/kokkos/containers/performance_tests/TestOpenMP.cpp index f414b0d828..0e16200961 100644 --- a/lib/kokkos/containers/performance_tests/TestOpenMP.cpp +++ b/lib/kokkos/containers/performance_tests/TestOpenMP.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/containers/performance_tests/TestScatterView.hpp b/lib/kokkos/containers/performance_tests/TestScatterView.hpp index bd06be9667..a74f833b9f 100644 --- a/lib/kokkos/containers/performance_tests/TestScatterView.hpp +++ b/lib/kokkos/containers/performance_tests/TestScatterView.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_SCATTER_VIEW_HPP #define KOKKOS_TEST_SCATTER_VIEW_HPP diff --git a/lib/kokkos/containers/performance_tests/TestThreads.cpp b/lib/kokkos/containers/performance_tests/TestThreads.cpp index 72bef1a3ad..d32b09702a 100644 --- a/lib/kokkos/containers/performance_tests/TestThreads.cpp +++ b/lib/kokkos/containers/performance_tests/TestThreads.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp b/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp index 8ff208d6a8..6d3764a989 100644 --- a/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp +++ b/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp @@ -1,43 +1,17 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_UNORDERED_MAP_PERFORMANCE_HPP diff --git a/lib/kokkos/containers/src/Kokkos_Bitset.hpp b/lib/kokkos/containers/src/Kokkos_Bitset.hpp index 05121b4e51..35f691ecf4 100644 --- a/lib/kokkos/containers/src/Kokkos_Bitset.hpp +++ b/lib/kokkos/containers/src/Kokkos_Bitset.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_BITSET_HPP #define KOKKOS_BITSET_HPP diff --git a/lib/kokkos/containers/src/Kokkos_DualView.hpp b/lib/kokkos/containers/src/Kokkos_DualView.hpp index 916c54d605..07256b4464 100644 --- a/lib/kokkos/containers/src/Kokkos_DualView.hpp +++ b/lib/kokkos/containers/src/Kokkos_DualView.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ /// \file Kokkos_DualView.hpp /// \brief Declaration and definition of Kokkos::DualView. @@ -939,20 +911,9 @@ class DualView : public ViewTraits { typename t_host::memory_space(), d_view); } } else if (alloc_prop_input::initialize) { - if (alloc_prop_input::has_execution_space) { - // Add execution_space if not provided to avoid need for if constexpr - using alloc_prop = Impl::ViewCtorProp< - ViewCtorArgs..., - std::conditional_t, - typename t_dev::execution_space>>; - alloc_prop arg_prop_copy(arg_prop); - using execution_space_type = typename alloc_prop::execution_space; - const execution_space_type& exec_space = - static_cast< - Kokkos::Impl::ViewCtorProp const&>( - arg_prop_copy) - .value; + if constexpr (alloc_prop_input::has_execution_space) { + const auto& exec_space = + Impl::get_property(arg_prop); ::Kokkos::deep_copy(exec_space, d_view, typename t_dev::value_type{}); } else ::Kokkos::deep_copy(d_view, typename t_dev::value_type{}); @@ -1032,10 +993,11 @@ class DualView : public ViewTraits { if (modified_flags.data() == nullptr) { modified_flags = t_modified_flags("DualView::modified_flags"); } - if (modified_flags(1) >= modified_flags(0)) { + + [[maybe_unused]] auto resize_on_device = [&](const auto& properties) { /* Resize on Device */ if (sizeMismatch) { - ::Kokkos::resize(arg_prop, d_view, n0, n1, n2, n3, n4, n5, n6, n7); + ::Kokkos::resize(properties, d_view, n0, n1, n2, n3, n4, n5, n6, n7); if (alloc_prop_input::initialize) { h_view = create_mirror_view(typename t_host::memory_space(), d_view); } else { @@ -1046,10 +1008,12 @@ class DualView : public ViewTraits { /* Mark Device copy as modified */ ++modified_flags(1); } - } else { + }; + + [[maybe_unused]] auto resize_on_host = [&](const auto& properties) { /* Resize on Host */ if (sizeMismatch) { - ::Kokkos::resize(arg_prop, h_view, n0, n1, n2, n3, n4, n5, n6, n7); + ::Kokkos::resize(properties, h_view, n0, n1, n2, n3, n4, n5, n6, n7); if (alloc_prop_input::initialize) { d_view = create_mirror_view(typename t_dev::memory_space(), h_view); @@ -1061,6 +1025,37 @@ class DualView : public ViewTraits { /* Mark Host copy as modified */ ++modified_flags(0); } + }; + + constexpr bool has_execution_space = alloc_prop_input::has_execution_space; + + if constexpr (has_execution_space) { + using ExecSpace = typename alloc_prop_input::execution_space; + const auto& exec_space = + Impl::get_property(arg_prop); + constexpr bool exec_space_can_access_device = + SpaceAccessibility::accessible; + constexpr bool exec_space_can_access_host = + SpaceAccessibility::accessible; + static_assert(exec_space_can_access_device || exec_space_can_access_host); + if constexpr (exec_space_can_access_device) { + sync(exec_space); + resize_on_device(arg_prop); + return; + } + if constexpr (exec_space_can_access_host) { + sync(exec_space); + resize_on_host(arg_prop); + return; + } + } else { + if (modified_flags(1) >= modified_flags(0)) { + resize_on_device(arg_prop); + } else { + resize_on_host(arg_prop); + } } } diff --git a/lib/kokkos/containers/src/Kokkos_DynRankView.hpp b/lib/kokkos/containers/src/Kokkos_DynRankView.hpp index 059ce8a610..ce433b0bfc 100644 --- a/lib/kokkos/containers/src/Kokkos_DynRankView.hpp +++ b/lib/kokkos/containers/src/Kokkos_DynRankView.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ /// \file Kokkos_DynRankView.hpp /// \brief Declaration and definition of Kokkos::DynRankView. @@ -1099,21 +1071,11 @@ class DynRankView : public ViewTraits { m_rank(Impl::DynRankDimTraits:: template computeRank( arg_prop, arg_layout)) { - // Append layout and spaces if not input - using alloc_prop_input = Kokkos::Impl::ViewCtorProp; - - // use 'std::integral_constant' for non-types - // to avoid duplicate class error. - using alloc_prop = Kokkos::Impl::ViewCtorProp< - P..., - std::conditional_t, std::string>, - std::conditional_t, - typename traits::device_type::memory_space>, - std::conditional_t, - typename traits::device_type::execution_space>>; + // Copy the input allocation properties with possibly defaulted properties + auto prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string{}, typename traits::device_type::memory_space{}, + typename traits::device_type::execution_space{}); + using alloc_prop = decltype(prop_copy); static_assert(traits::is_managed, "View allocation constructor requires managed memory"); @@ -1127,9 +1089,6 @@ class DynRankView : public ViewTraits { "execution space"); } - // Copy the input allocation properties with possibly defaulted properties - alloc_prop prop_copy(arg_prop); - //------------------------------------------------------------ #if defined(KOKKOS_ENABLE_CUDA) // If allocating in CudaUVMSpace must fence before and after @@ -2011,10 +1970,8 @@ inline typename DynRankView::HostMirror create_mirror( "The view constructor arguments passed to Kokkos::create_mirror must " "not explicitly allow padding!"); - using alloc_prop = Impl::ViewCtorProp; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - std::string(src.label()).append("_mirror"); + auto prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string(src.label()).append("_mirror")); return dst_type(prop_copy, Impl::reconstructLayout(src.layout(), src.rank())); } @@ -2044,10 +2001,8 @@ inline auto create_mirror( "The view constructor arguments passed to Kokkos::create_mirror must " "not explicitly allow padding!"); - using alloc_prop = Impl::ViewCtorProp; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - std::string(src.label()).append("_mirror"); + auto prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string(src.label()).append("_mirror")); return dst_type(prop_copy, Impl::reconstructLayout(src.layout(), src.rank())); } @@ -2308,30 +2263,17 @@ auto create_mirror_view_and_copy( using Space = typename alloc_prop_input::memory_space; using Mirror = typename Impl::MirrorDRViewType::view_type; - // Add some properties if not provided to avoid need for if constexpr - using alloc_prop = Impl::ViewCtorProp< - ViewCtorArgs..., - std::conditional_t, std::string>, - std::conditional_t, - Impl::WithoutInitializing_t>, - std::conditional_t, - typename Space::execution_space>>; - alloc_prop arg_prop_copy(arg_prop); + auto arg_prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string{}, WithoutInitializing, + typename Space::execution_space{}); - std::string& label = - static_cast&>(arg_prop_copy).value; + std::string& label = Impl::get_property(arg_prop_copy); if (label.empty()) label = src.label(); auto mirror = typename Mirror::non_const_type{ arg_prop_copy, Impl::reconstructLayout(src.layout(), src.rank())}; - if (alloc_prop_input::has_execution_space) { - using ExecutionSpace = typename alloc_prop::execution_space; - deep_copy( - static_cast&>(arg_prop_copy) - .value, - mirror, src); + if constexpr (alloc_prop_input::has_execution_space) { + deep_copy(Impl::get_property(arg_prop_copy), + mirror, src); } else deep_copy(mirror, src); return mirror; @@ -2374,24 +2316,14 @@ inline void impl_resize(const Impl::ViewCtorProp& arg_prop, "The view constructor arguments passed to Kokkos::resize must " "not include a memory space instance!"); - // Add execution space here to avoid the need for if constexpr below - using alloc_prop = Impl::ViewCtorProp< - ViewCtorArgs..., std::string, - std::conditional_t, - typename drview_type::execution_space>>; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - v.label(); + auto prop_copy = Impl::with_properties_if_unset( + arg_prop, v.label(), typename drview_type::execution_space{}); drview_type v_resized(prop_copy, n0, n1, n2, n3, n4, n5, n6, n7); - if (alloc_prop_input::has_execution_space) + if constexpr (alloc_prop_input::has_execution_space) Kokkos::Impl::DynRankViewRemap( - static_cast&>(prop_copy) - .value, - v_resized, v); + Impl::get_property(prop_copy), v_resized, v); else Kokkos::Impl::DynRankViewRemap(v_resized, v); @@ -2462,10 +2394,7 @@ inline void impl_realloc(DynRankView& v, const size_t n0, "The view constructor arguments passed to Kokkos::realloc must " "not include a memory space instance!"); - using alloc_prop = Impl::ViewCtorProp; - alloc_prop arg_prop_copy(arg_prop); - static_cast&>(arg_prop_copy) - .value = v.label(); + auto arg_prop_copy = Impl::with_properties_if_unset(arg_prop, v.label()); v = drview_type(); // Deallocate first, if the only view to allocation v = drview_type(arg_prop_copy, n0, n1, n2, n3, n4, n5, n6, n7); diff --git a/lib/kokkos/containers/src/Kokkos_DynamicView.hpp b/lib/kokkos/containers/src/Kokkos_DynamicView.hpp index a2b68064de..f8636b6212 100644 --- a/lib/kokkos/containers/src/Kokkos_DynamicView.hpp +++ b/lib/kokkos/containers/src/Kokkos_DynamicView.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_DYNAMIC_VIEW_HPP #define KOKKOS_DYNAMIC_VIEW_HPP @@ -535,9 +507,7 @@ class DynamicView : public Kokkos::ViewTraits { m_chunks = device_accessor(m_chunk_max, m_chunk_size); const std::string& label = - static_cast const&>( - arg_prop) - .value; + Kokkos::Impl::get_property(arg_prop); if (device_accessor::template IsAccessibleFrom::value) { m_chunks.template allocate_with_destroy(label); @@ -552,17 +522,14 @@ class DynamicView : public Kokkos::ViewTraits { label, m_chunks.get_ptr()); m_chunks_host.initialize(); - // Add some properties if not provided to avoid need for if constexpr using alloc_prop_input = Kokkos::Impl::ViewCtorProp; - using alloc_prop = Kokkos::Impl::ViewCtorProp< - Prop..., std::conditional_t, - typename device_space::execution_space>>; - alloc_prop arg_prop_copy(arg_prop); - const auto& exec = static_cast&>(arg_prop_copy) - .value; + auto arg_prop_copy = ::Kokkos::Impl::with_properties_if_unset( + arg_prop, typename device_space::execution_space{}); + + const auto& exec = + Kokkos::Impl::get_property( + arg_prop_copy); m_chunks_host.deep_copy_to(exec, m_chunks); if (!alloc_prop_input::has_execution_space) exec.fence( @@ -641,10 +608,8 @@ inline auto create_mirror( "The view constructor arguments passed to Kokkos::create_mirror must " "not explicitly allow padding!"); - using alloc_prop = Impl::ViewCtorProp; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - std::string(src.label()).append("_mirror"); + auto prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string(src.label()).append("_mirror")); auto ret = typename Kokkos::Experimental::DynamicView::HostMirror( prop_copy, src.chunk_size(), src.chunk_max() * src.chunk_size()); @@ -676,10 +641,8 @@ inline auto create_mirror( "not explicitly allow padding!"); using MemorySpace = typename alloc_prop_input::memory_space; - using alloc_prop = Impl::ViewCtorProp; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - std::string(src.label()).append("_mirror"); + auto prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string(src.label()).append("_mirror")); auto ret = typename Kokkos::Impl::MirrorDynamicViewType< MemorySpace, T, P...>::view_type(prop_copy, src.chunk_size(), @@ -915,8 +878,8 @@ inline void deep_copy(const View& dst, template inline void deep_copy(const Kokkos::Experimental::DynamicView& dst, const View& src) { - using dst_type = Kokkos::Experimental::DynamicView; - using src_type = View; + using dst_type = Kokkos::Experimental::DynamicView; + using src_type = View; using dst_execution_space = typename ViewTraits::execution_space; using src_memory_space = typename ViewTraits::memory_space; @@ -1075,31 +1038,18 @@ auto create_mirror_view_and_copy( using Mirror = typename Impl::MirrorDynamicViewType::view_type; - // Add some properties if not provided to avoid need for if constexpr - using alloc_prop = Impl::ViewCtorProp< - ViewCtorArgs..., - std::conditional_t, std::string>, - std::conditional_t, - Impl::WithoutInitializing_t>, - std::conditional_t, - typename Space::execution_space>>; - alloc_prop arg_prop_copy(arg_prop); + auto arg_prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string{}, WithoutInitializing, + typename Space::execution_space{}); - std::string& label = - static_cast&>(arg_prop_copy).value; + std::string& label = Impl::get_property(arg_prop_copy); if (label.empty()) label = src.label(); auto mirror = typename Mirror::non_const_type( arg_prop_copy, src.chunk_size(), src.chunk_max() * src.chunk_size()); mirror.resize_serial(src.extent(0)); - if (alloc_prop_input::has_execution_space) { - using ExecutionSpace = typename alloc_prop::execution_space; - deep_copy( - static_cast&>(arg_prop_copy) - .value, - mirror, src); + if constexpr (alloc_prop_input::has_execution_space) { + deep_copy(Impl::get_property(arg_prop_copy), + mirror, src); } else deep_copy(mirror, src); return mirror; diff --git a/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp b/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp index 8affa0bac4..0482bb6fb3 100644 --- a/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp +++ b/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_EXPERIMENTAL_ERROR_REPORTER_HPP #define KOKKOS_EXPERIMENTAL_ERROR_REPORTER_HPP diff --git a/lib/kokkos/containers/src/Kokkos_Functional.hpp b/lib/kokkos/containers/src/Kokkos_Functional.hpp index 478a087d0c..4d39716cc3 100644 --- a/lib/kokkos/containers/src/Kokkos_Functional.hpp +++ b/lib/kokkos/containers/src/Kokkos_Functional.hpp @@ -1,43 +1,17 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_FUNCTIONAL_HPP @@ -56,13 +30,6 @@ namespace Kokkos { template struct pod_hash { -#if defined KOKKOS_ENABLE_DEPRECATED_CODE_3 - using argument_type KOKKOS_DEPRECATED = T; - using first_argument_type KOKKOS_DEPRECATED = T; - using second_argument_type KOKKOS_DEPRECATED = uint32_t; - using result_type KOKKOS_DEPRECATED = uint32_t; -#endif - KOKKOS_FORCEINLINE_FUNCTION uint32_t operator()(T const& t) const { return Impl::MurmurHash3_x86_32(&t, sizeof(T), 0); @@ -76,12 +43,6 @@ struct pod_hash { template struct pod_equal_to { -#if defined KOKKOS_ENABLE_DEPRECATED_CODE_3 - using first_argument_type KOKKOS_DEPRECATED = T; - using second_argument_type KOKKOS_DEPRECATED = T; - using result_type KOKKOS_DEPRECATED = bool; -#endif - KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return Impl::bitwise_equal(&a, &b); @@ -90,12 +51,6 @@ struct pod_equal_to { template struct pod_not_equal_to { -#if defined KOKKOS_ENABLE_DEPRECATED_CODE_3 - using first_argument_type KOKKOS_DEPRECATED = T; - using second_argument_type KOKKOS_DEPRECATED = T; - using result_type KOKKOS_DEPRECATED = bool; -#endif - KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return !Impl::bitwise_equal(&a, &b); @@ -104,72 +59,36 @@ struct pod_not_equal_to { template struct equal_to { -#if defined KOKKOS_ENABLE_DEPRECATED_CODE_3 - using first_argument_type KOKKOS_DEPRECATED = T; - using second_argument_type KOKKOS_DEPRECATED = T; - using result_type KOKKOS_DEPRECATED = bool; -#endif - KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a == b; } }; template struct not_equal_to { -#if defined KOKKOS_ENABLE_DEPRECATED_CODE_3 - using first_argument_type KOKKOS_DEPRECATED = T; - using second_argument_type KOKKOS_DEPRECATED = T; - using result_type KOKKOS_DEPRECATED = bool; -#endif - KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a != b; } }; template struct greater { -#if defined KOKKOS_ENABLE_DEPRECATED_CODE_3 - using first_argument_type KOKKOS_DEPRECATED = T; - using second_argument_type KOKKOS_DEPRECATED = T; - using result_type KOKKOS_DEPRECATED = bool; -#endif - KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a > b; } }; template struct less { -#if defined KOKKOS_ENABLE_DEPRECATED_CODE_3 - using first_argument_type KOKKOS_DEPRECATED = T; - using second_argument_type KOKKOS_DEPRECATED = T; - using result_type KOKKOS_DEPRECATED = bool; -#endif - KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a < b; } }; template struct greater_equal { -#if defined KOKKOS_ENABLE_DEPRECATED_CODE_3 - using first_argument_type KOKKOS_DEPRECATED = T; - using second_argument_type KOKKOS_DEPRECATED = T; - using result_type KOKKOS_DEPRECATED = bool; -#endif - KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a >= b; } }; template struct less_equal { -#if defined KOKKOS_ENABLE_DEPRECATED_CODE_3 - using first_argument_type KOKKOS_DEPRECATED = T; - using second_argument_type KOKKOS_DEPRECATED = T; - using result_type KOKKOS_DEPRECATED = bool; -#endif - KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a <= b; } }; diff --git a/lib/kokkos/containers/src/Kokkos_OffsetView.hpp b/lib/kokkos/containers/src/Kokkos_OffsetView.hpp index 5027763a02..35b28999c1 100644 --- a/lib/kokkos/containers/src/Kokkos_OffsetView.hpp +++ b/lib/kokkos/containers/src/Kokkos_OffsetView.hpp @@ -1,9 +1,18 @@ -/* - * Kokkos_OffsetView.hpp - * - * Created on: Apr 23, 2018 - * Author: swbova - */ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER #ifndef KOKKOS_OFFSETVIEW_HPP_ #define KOKKOS_OFFSETVIEW_HPP_ @@ -196,17 +205,17 @@ class OffsetView : public ViewTraits { template ::value, iType> = 0> - KOKKOS_INLINE_FUNCTION int64_t begin(const iType local_dimension) const { + KOKKOS_FUNCTION int64_t begin(const iType local_dimension) const { return local_dimension < Rank ? m_begins[local_dimension] : KOKKOS_INVALID_OFFSET; } - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION begins_type begins() const { return m_begins; } template ::value, iType> = 0> - KOKKOS_INLINE_FUNCTION int64_t end(const iType local_dimension) const { + KOKKOS_FUNCTION int64_t end(const iType local_dimension) const { return begin(local_dimension) + m_map.extent(local_dimension); } @@ -245,63 +254,46 @@ class OffsetView : public ViewTraits { /** \brief rank() to be implemented */ - // KOKKOS_INLINE_FUNCTION + // KOKKOS_FUNCTION // static // constexpr unsigned rank() { return map_type::Rank; } template - KOKKOS_INLINE_FUNCTION constexpr std::enable_if_t< - std::is_integral::value, size_t> + KOKKOS_FUNCTION constexpr std::enable_if_t::value, + size_t> extent(const iType& r) const { return m_map.extent(r); } template - KOKKOS_INLINE_FUNCTION constexpr std::enable_if_t< - std::is_integral::value, int> + KOKKOS_FUNCTION constexpr std::enable_if_t::value, + int> extent_int(const iType& r) const { return static_cast(m_map.extent(r)); } - KOKKOS_INLINE_FUNCTION constexpr typename traits::array_layout layout() - const { + KOKKOS_FUNCTION constexpr typename traits::array_layout layout() const { return m_map.layout(); } - KOKKOS_INLINE_FUNCTION constexpr size_t size() const { + KOKKOS_FUNCTION constexpr size_t size() const { return m_map.dimension_0() * m_map.dimension_1() * m_map.dimension_2() * m_map.dimension_3() * m_map.dimension_4() * m_map.dimension_5() * m_map.dimension_6() * m_map.dimension_7(); } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_0() const { - return m_map.stride_0(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_1() const { - return m_map.stride_1(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_2() const { - return m_map.stride_2(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_3() const { - return m_map.stride_3(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_4() const { - return m_map.stride_4(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t stride_5() const { - return m_map.stride_5(); - } - 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(); - } + KOKKOS_FUNCTION constexpr size_t stride_0() const { return m_map.stride_0(); } + KOKKOS_FUNCTION constexpr size_t stride_1() const { return m_map.stride_1(); } + KOKKOS_FUNCTION constexpr size_t stride_2() const { return m_map.stride_2(); } + KOKKOS_FUNCTION constexpr size_t stride_3() const { return m_map.stride_3(); } + KOKKOS_FUNCTION constexpr size_t stride_4() const { return m_map.stride_4(); } + KOKKOS_FUNCTION constexpr size_t stride_5() const { return m_map.stride_5(); } + KOKKOS_FUNCTION constexpr size_t stride_6() const { return m_map.stride_6(); } + KOKKOS_FUNCTION constexpr size_t stride_7() const { return m_map.stride_7(); } template - KOKKOS_INLINE_FUNCTION constexpr std::enable_if_t< - std::is_integral::value, size_t> + KOKKOS_FUNCTION constexpr std::enable_if_t::value, + size_t> stride(iType r) const { return ( r == 0 @@ -322,7 +314,7 @@ class OffsetView : public ViewTraits { } template - KOKKOS_INLINE_FUNCTION void stride(iType* const s) const { + KOKKOS_FUNCTION void stride(iType* const s) const { m_map.stride(s); } @@ -337,21 +329,19 @@ class OffsetView : public ViewTraits { std::is_lvalue_reference::value }; - KOKKOS_INLINE_FUNCTION constexpr size_t span() const { return m_map.span(); } - KOKKOS_INLINE_FUNCTION bool span_is_contiguous() const { + KOKKOS_FUNCTION constexpr size_t span() const { return m_map.span(); } + KOKKOS_FUNCTION bool span_is_contiguous() const { return m_map.span_is_contiguous(); } - KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + KOKKOS_FUNCTION constexpr bool is_allocated() const { return m_map.data() != nullptr; } - KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const { - return m_map.data(); - } + KOKKOS_FUNCTION constexpr pointer_type data() const { return m_map.data(); } //---------------------------------------- // Allow specializations to query their specialized map - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION const Kokkos::Impl::ViewMapping& implementation_map() const { return m_map; } @@ -782,24 +772,24 @@ class OffsetView : public ViewTraits { KOKKOS_DEFAULTED_FUNCTION ~OffsetView() = default; - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION OffsetView() : m_track(), m_map() { for (size_t i = 0; i < Rank; ++i) m_begins[i] = KOKKOS_INVALID_OFFSET; } - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION OffsetView(const OffsetView& rhs) : m_track(rhs.m_track, traits::is_managed), m_map(rhs.m_map), m_begins(rhs.m_begins) {} - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION OffsetView(OffsetView&& rhs) : m_track(std::move(rhs.m_track)), m_map(std::move(rhs.m_map)), m_begins(std::move(rhs.m_begins)) {} - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION OffsetView& operator=(const OffsetView& rhs) { m_track = rhs.m_track; m_map = rhs.m_map; @@ -807,7 +797,7 @@ class OffsetView : public ViewTraits { return *this; } - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION OffsetView& operator=(OffsetView&& rhs) { m_track = std::move(rhs.m_track); m_map = std::move(rhs.m_map); @@ -822,14 +812,14 @@ class OffsetView : public ViewTraits { typename traits::device_type, typename traits::memory_traits>; public: - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION view_type view() const { view_type v(m_track, m_map); return v; } template - KOKKOS_INLINE_FUNCTION OffsetView(const View& aview) + KOKKOS_FUNCTION OffsetView(const View& aview) : m_track(aview.impl_track()), m_map() { using SrcTraits = typename OffsetView::traits; using Mapping = Kokkos::Impl::ViewMapping; @@ -843,8 +833,8 @@ class OffsetView : public ViewTraits { } template - KOKKOS_INLINE_FUNCTION OffsetView(const View& aview, - const index_list_type& minIndices) + KOKKOS_FUNCTION OffsetView(const View& aview, + const index_list_type& minIndices) : m_track(aview.impl_track()), m_map() { using SrcTraits = typename OffsetView::traits; using Mapping = Kokkos::Impl::ViewMapping; @@ -863,8 +853,8 @@ class OffsetView : public ViewTraits { } } template - KOKKOS_INLINE_FUNCTION OffsetView(const View& aview, - const begins_type& beg) + KOKKOS_FUNCTION OffsetView(const View& aview, + const begins_type& beg) : m_track(aview.impl_track()), m_map(), m_begins(beg) { using SrcTraits = typename OffsetView::traits; using Mapping = Kokkos::Impl::ViewMapping; @@ -876,7 +866,7 @@ class OffsetView : public ViewTraits { // may assign unmanaged from managed. template - KOKKOS_INLINE_FUNCTION OffsetView(const OffsetView& rhs) + KOKKOS_FUNCTION OffsetView(const OffsetView& rhs) : m_track(rhs.m_track, traits::is_managed), m_map(), m_begins(rhs.m_begins) { @@ -895,8 +885,8 @@ class OffsetView : public ViewTraits { }; // Subtraction should return a non-negative number and not overflow - KOKKOS_INLINE_FUNCTION static subtraction_failure check_subtraction( - int64_t lhs, int64_t rhs) { + KOKKOS_FUNCTION static subtraction_failure check_subtraction(int64_t lhs, + int64_t rhs) { if (lhs < rhs) return subtraction_failure::negative; if (static_cast(-1) / static_cast(2) < @@ -910,10 +900,10 @@ class OffsetView : public ViewTraits { // which doesn't have iterators) and index_list_type (aka // std::initializer_list which doesn't have .data() or operator[]). // Returns by value - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION static int64_t at(const begins_type& a, size_t pos) { return a[pos]; } - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION static int64_t at(index_list_type a, size_t pos) { return *(a.begin() + pos); } @@ -994,8 +984,8 @@ class OffsetView : public ViewTraits { // Check the begins < ends for all elements template - KOKKOS_INLINE_FUNCTION static subtraction_failure - runtime_check_begins_ends_device(const B& begins, const E& ends) { + KOKKOS_FUNCTION static subtraction_failure runtime_check_begins_ends_device( + const B& begins, const E& ends) { if (begins.size() != Rank) Kokkos::abort( "Kokkos::Experimental::OffsetView ERROR: for unmanaged " @@ -1025,7 +1015,7 @@ class OffsetView : public ViewTraits { } template - KOKKOS_INLINE_FUNCTION static subtraction_failure runtime_check_begins_ends( + KOKKOS_FUNCTION static subtraction_failure runtime_check_begins_ends( const B& begins, const E& ends) { KOKKOS_IF_ON_HOST((return runtime_check_begins_ends_host(begins, ends);)) KOKKOS_IF_ON_DEVICE( @@ -1037,9 +1027,9 @@ class OffsetView : public ViewTraits { // Each of B, E can be begins_type and/or index_list_type // Precondition: begins.size() == ends.size() == m_begins.size() == Rank template - KOKKOS_INLINE_FUNCTION OffsetView(const pointer_type& p, const B& begins_, - const E& ends_, - subtraction_failure) + KOKKOS_FUNCTION OffsetView(const pointer_type& p, const B& begins_, + const E& ends_, + subtraction_failure) : m_track() // no tracking , m_map(Kokkos::Impl::ViewCtorProp(p), @@ -1061,25 +1051,25 @@ class OffsetView : public ViewTraits { // Constructor around unmanaged data // Four overloads, as both begins and ends can be either // begins_type or index_list_type - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION OffsetView(const pointer_type& p, const begins_type& begins_, const begins_type& ends_) : OffsetView(p, begins_, ends_, runtime_check_begins_ends(begins_, ends_)) {} - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION OffsetView(const pointer_type& p, const begins_type& begins_, index_list_type ends_) : OffsetView(p, begins_, ends_, runtime_check_begins_ends(begins_, ends_)) {} - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION OffsetView(const pointer_type& p, index_list_type begins_, const begins_type& ends_) : OffsetView(p, begins_, ends_, runtime_check_begins_ends(begins_, ends_)) {} - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION OffsetView(const pointer_type& p, index_list_type begins_, index_list_type ends_) : OffsetView(p, begins_, ends_, @@ -1087,10 +1077,10 @@ class OffsetView : public ViewTraits { //---------------------------------------- // Allocation tracking properties - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION int use_count() const { return m_track.use_count(); } - inline const std::string label() const { + const std::string label() const { return m_track.template get_label(); } @@ -1101,7 +1091,7 @@ class OffsetView : public ViewTraits { // std::get<{0,1}>(RangeType const&) with std::tuple_size::value==2 // but this wouldn't allow using the syntax in the example above. template - explicit inline OffsetView( + explicit OffsetView( const Label& arg_label, std::enable_if_t::value, const std::pair> @@ -1128,38 +1118,32 @@ class OffsetView : public ViewTraits { {range0.first, range1.first, range2.first, range3.first, range4.first, range5.first, range6.first, range7.first}) {} -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - template - KOKKOS_DEPRECATED_WITH_COMMENT( - "Use the constructor taking std::pair arguments " - "instead!") - explicit inline OffsetView( - const Label& arg_label, - std::enable_if_t::value, - const index_list_type> - range0, - const index_list_type range1 = KOKKOS_INVALID_INDEX_RANGE, - const index_list_type range2 = KOKKOS_INVALID_INDEX_RANGE, - const index_list_type range3 = KOKKOS_INVALID_INDEX_RANGE, - const index_list_type range4 = KOKKOS_INVALID_INDEX_RANGE, - const index_list_type range5 = KOKKOS_INVALID_INDEX_RANGE, - const index_list_type range6 = KOKKOS_INVALID_INDEX_RANGE, - const index_list_type range7 = KOKKOS_INVALID_INDEX_RANGE) + template + explicit OffsetView( + const Kokkos::Impl::ViewCtorProp& arg_prop, + const std::pair range0 = KOKKOS_INVALID_INDEX_RANGE, + const std::pair range1 = KOKKOS_INVALID_INDEX_RANGE, + const std::pair range2 = KOKKOS_INVALID_INDEX_RANGE, + const std::pair range3 = KOKKOS_INVALID_INDEX_RANGE, + const std::pair range4 = KOKKOS_INVALID_INDEX_RANGE, + const std::pair range5 = KOKKOS_INVALID_INDEX_RANGE, + const std::pair range6 = KOKKOS_INVALID_INDEX_RANGE, + const std::pair range7 = KOKKOS_INVALID_INDEX_RANGE) : OffsetView( - arg_label, - std::pair(range0.begin()[0], range0.begin()[1]), - std::pair(range1.begin()[0], range1.begin()[1]), - std::pair(range2.begin()[0], range2.begin()[1]), - std::pair(range3.begin()[0], range3.begin()[1]), - std::pair(range4.begin()[0], range4.begin()[1]), - std::pair(range5.begin()[0], range5.begin()[1]), - std::pair(range6.begin()[0], range6.begin()[1]), - std::pair(range7.begin()[0], range7.begin()[1])) { - } -#endif + arg_prop, + typename traits::array_layout(range0.second - range0.first + 1, + range1.second - range1.first + 1, + range2.second - range2.first + 1, + range3.second - range3.first + 1, + range4.second - range4.first + 1, + range5.second - range5.first + 1, + range6.second - range6.first + 1, + range7.second - range7.first + 1), + {range0.first, range1.first, range2.first, range3.first, + range4.first, range5.first, range6.first, range7.first}) {} template - explicit KOKKOS_INLINE_FUNCTION OffsetView( + explicit KOKKOS_FUNCTION OffsetView( const Kokkos::Impl::ViewCtorProp& arg_prop, std::enable_if_t::has_pointer, typename traits::array_layout> const& arg_layout, @@ -1178,7 +1162,7 @@ class OffsetView : public ViewTraits { } template - explicit inline OffsetView( + explicit OffsetView( const Kokkos::Impl::ViewCtorProp& arg_prop, std::enable_if_t::has_pointer, typename traits::array_layout> const& arg_layout, @@ -1189,21 +1173,11 @@ class OffsetView : public ViewTraits { { for (size_t i = 0; i < Rank; ++i) m_begins[i] = minIndices.begin()[i]; - // Append layout and spaces if not input - using alloc_prop_input = Kokkos::Impl::ViewCtorProp; - - // use 'std::integral_constant' for non-types - // to avoid duplicate class error. - using alloc_prop = Kokkos::Impl::ViewCtorProp< - P..., - std::conditional_t, std::string>, - std::conditional_t, - typename traits::device_type::memory_space>, - std::conditional_t, - typename traits::device_type::execution_space>>; + // Copy the input allocation properties with possibly defaulted properties + auto prop_copy = Kokkos::Impl::with_properties_if_unset( + arg_prop, std::string{}, typename traits::device_type::memory_space{}, + typename traits::device_type::execution_space{}); + using alloc_prop = decltype(prop_copy); static_assert(traits::is_managed, "OffsetView allocation constructor requires managed memory"); @@ -1217,9 +1191,6 @@ class OffsetView : public ViewTraits { "execution space"); } - // Copy the input allocation properties with possibly defaulted properties - alloc_prop prop_copy(arg_prop); - //------------------------------------------------------------ #if defined(KOKKOS_ENABLE_CUDA) // If allocating in CudaUVMSpace must fence before and after @@ -1931,10 +1902,8 @@ inline auto create_mirror(const Kokkos::Experimental::OffsetView& src, "The view constructor arguments passed to Kokkos::create_mirror must " "not explicitly allow padding!"); - using alloc_prop = Impl::ViewCtorProp; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - std::string(src.label()).append("_mirror"); + auto prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string(src.label()).append("_mirror")); return typename Kokkos::Impl::MirrorOffsetType::view_type( prop_copy, src.layout(), diff --git a/lib/kokkos/containers/src/Kokkos_ScatterView.hpp b/lib/kokkos/containers/src/Kokkos_ScatterView.hpp index a9529d1c87..3b30996ad6 100644 --- a/lib/kokkos/containers/src/Kokkos_ScatterView.hpp +++ b/lib/kokkos/containers/src/Kokkos_ScatterView.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ /// \file Kokkos_ScatterView.hpp /// \brief Declaration and definition of Kokkos::ScatterView. @@ -195,16 +167,16 @@ struct DefaultContribution -struct DefaultDuplication { +struct DefaultDuplication { using type = Kokkos::Experimental::ScatterNonDuplicated; }; template <> -struct DefaultContribution { using type = Kokkos::Experimental::ScatterAtomic; }; template <> -struct DefaultContribution { using type = Kokkos::Experimental::ScatterAtomic; }; @@ -1027,10 +999,8 @@ class ScatterView const&>( - arg_prop) - .value; + auto const& exec_space = + Kokkos::Impl::get_property(arg_prop); reset(exec_space); } @@ -1289,18 +1259,14 @@ class ScatterView const&>( - arg_prop) - .value; + auto const& name = + Kokkos::Impl::get_property(arg_prop); internal_view = internal_view_type(view_alloc(WithoutInitializing, name), arg_N[0], arg_N[1], arg_N[2], arg_N[3], arg_N[4], arg_N[5], arg_N[6], arg_N[7]); - auto const exec_space = - static_cast<::Kokkos::Impl::ViewCtorProp const&>( - arg_prop) - .value; + auto const& exec_space = + Kokkos::Impl::get_property(arg_prop); reset(exec_space); } diff --git a/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp b/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp index 219b08b4b4..8ce868cac2 100644 --- a/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp +++ b/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_STATICCRSGRAPH_HPP #define KOKKOS_STATICCRSGRAPH_HPP diff --git a/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp b/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp index 6c112644c9..058b6626c4 100644 --- a/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp +++ b/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ /// \file Kokkos_UnorderedMap.hpp /// \brief Declaration and definition of Kokkos::UnorderedMap. @@ -311,13 +283,8 @@ class UnorderedMap { capacity() + 1) // +1 so that the *_at functions can // always return a valid reference , -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - m_keys("UnorderedMap keys", capacity() + 1), - m_values("UnorderedMap values", (is_set ? 1 : capacity() + 1)), -#else m_keys("UnorderedMap keys", capacity()), m_values("UnorderedMap values", (is_set ? 0 : capacity())), -#endif m_scalars("UnorderedMap scalars") { if (!is_insertable_map) { Kokkos::Impl::throw_runtime_exception( @@ -347,24 +314,13 @@ class UnorderedMap { const key_type tmp = key_type(); Kokkos::deep_copy(m_keys, tmp); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - if (is_set) { - const impl_value_type tmp = impl_value_type(); - Kokkos::deep_copy(m_values, tmp); - } -#endif Kokkos::deep_copy(m_scalars, 0); m_size = 0; } KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - return (m_keys.is_allocated() && m_values.is_allocated() && - m_scalars.is_allocated()); -#else return (m_keys.is_allocated() && (is_set || m_values.is_allocated()) && m_scalars.is_allocated()); -#endif } /// \brief Change the capacity of the the map @@ -702,26 +658,10 @@ class UnorderedMap { !std::is_void::value, // !is_set std::conditional_t> value_at(size_type i) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - return m_values[i < capacity() ? i : capacity()]; -#else KOKKOS_EXPECTS(i < capacity()); return m_values[i]; -#endif } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - template - KOKKOS_DEPRECATED_WITH_COMMENT( - "Calling value_at for value_type==void is deprecated!") - KOKKOS_FORCEINLINE_FUNCTION std::enable_if_t< - std::is_void::value, // is_set - std::conditional_t> value_at(size_type /*i*/) const { - return m_values[0]; - } -#endif - /// \brief Get the key with \c i as its direct index. /// /// \param i [in] Index directly into the array of entries. @@ -730,12 +670,8 @@ class UnorderedMap { /// kernel. KOKKOS_FORCEINLINE_FUNCTION key_type key_at(size_type i) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - return m_keys[i < capacity() ? i : capacity()]; -#else KOKKOS_EXPECTS(i < capacity()); return m_keys[i]; -#endif } KOKKOS_FORCEINLINE_FUNCTION diff --git a/lib/kokkos/containers/src/Kokkos_Vector.hpp b/lib/kokkos/containers/src/Kokkos_Vector.hpp index 8dd080737b..29bb15f5ea 100644 --- a/lib/kokkos/containers/src/Kokkos_Vector.hpp +++ b/lib/kokkos/containers/src/Kokkos_Vector.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_VECTOR_HPP #define KOKKOS_VECTOR_HPP @@ -183,8 +155,8 @@ class vector : public DualView { private: template struct impl_is_input_iterator - : /* TODO replace this */ std::integral_constant< - bool, !std::is_convertible::value> {}; + : /* TODO replace this */ std::bool_constant< + !std::is_convertible::value> {}; public: // TODO: can use detection idiom to generate better error message here later diff --git a/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp b/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp index 134b30769f..c598e4b67b 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_BITSET_IMPL_HPP #define KOKKOS_BITSET_IMPL_HPP diff --git a/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp b/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp index 5fe3ab0df5..d77c673e81 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp @@ -1,43 +1,17 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_FUNCTIONAL_IMPL_HPP @@ -106,8 +80,8 @@ uint32_t MurmurHash3_x86_32(const void* key, int len, uint32_t seed) { uint32_t k1 = 0; switch (len & 3) { - case 3: k1 ^= tail[2] << 16; KOKKOS_IMPL_FALLTHROUGH - case 2: k1 ^= tail[1] << 8; KOKKOS_IMPL_FALLTHROUGH + case 3: k1 ^= tail[2] << 16; [[fallthrough]]; + case 2: k1 ^= tail[1] << 8; [[fallthrough]]; case 1: k1 ^= tail[0]; k1 *= c1; diff --git a/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp b/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp index b81b1eee1e..468e617d50 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_STATICCRSGRAPH_FACTORY_HPP #define KOKKOS_IMPL_STATICCRSGRAPH_FACTORY_HPP diff --git a/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.cpp b/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.cpp index fc861992f0..5a22bf31f3 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.cpp +++ b/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #define KOKKOS_IMPL_PUBLIC_INCLUDE diff --git a/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp b/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp index 5acba244f6..2c431d1579 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_UNORDERED_MAP_IMPL_HPP #define KOKKOS_UNORDERED_MAP_IMPL_HPP @@ -76,16 +48,13 @@ struct UnorderedMapRehash { *this); } - template - KOKKOS_INLINE_FUNCTION std::enable_if_t::value> - operator()(size_type i) const { - if (m_src.valid_at(i)) m_dst.insert(m_src.key_at(i)); - } - - template - KOKKOS_INLINE_FUNCTION std::enable_if_t::value> - operator()(size_type i) const { - if (m_src.valid_at(i)) m_dst.insert(m_src.key_at(i), m_src.value_at(i)); + KOKKOS_INLINE_FUNCTION + void operator()(size_type i) const { + if constexpr (std::is_void_v) { + if (m_src.valid_at(i)) m_dst.insert(m_src.key_at(i)); + } else { + if (m_src.valid_at(i)) m_dst.insert(m_src.key_at(i), m_src.value_at(i)); + } } }; diff --git a/lib/kokkos/containers/unit_tests/TestBitset.hpp b/lib/kokkos/containers/unit_tests/TestBitset.hpp index 6cb03d6c56..d97bdf9679 100644 --- a/lib/kokkos/containers/unit_tests/TestBitset.hpp +++ b/lib/kokkos/containers/unit_tests/TestBitset.hpp @@ -1,43 +1,17 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_BITSET_HPP @@ -216,8 +190,19 @@ void test_bitset() { { Impl::TestBitsetTest f(bitset); uint32_t count = f.testit(); +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (!std::is_same_v) { + EXPECT_EQ(bitset.size(), count); + EXPECT_EQ(count, bitset.count()); + } else { + (void)count; + } +#else EXPECT_EQ(bitset.size(), count); EXPECT_EQ(count, bitset.count()); +#endif } // std::cout << " Check reset() " << std::endl; diff --git a/lib/kokkos/containers/unit_tests/TestCompileMain.cpp b/lib/kokkos/containers/unit_tests/TestCompileMain.cpp index 237c8ce181..fe164b5ba8 100644 --- a/lib/kokkos/containers/unit_tests/TestCompileMain.cpp +++ b/lib/kokkos/containers/unit_tests/TestCompileMain.cpp @@ -1 +1,17 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + int main() {} diff --git a/lib/kokkos/containers/unit_tests/TestCreateMirror.cpp b/lib/kokkos/containers/unit_tests/TestCreateMirror.cpp index 0e43be4364..8556f756b0 100644 --- a/lib/kokkos/containers/unit_tests/TestCreateMirror.cpp +++ b/lib/kokkos/containers/unit_tests/TestCreateMirror.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -49,8 +21,7 @@ template void check_memory_space(TestView, MemorySpace) { - static_assert( - std::is_same::value, ""); + static_assert(std::is_same_v); } template @@ -69,70 +40,58 @@ void test_create_mirror_properties(const View& view) { // clang-format off // create_mirror -#ifndef KOKKOS_ENABLE_CXX14 // FIXME DynamicView: HostMirror is the same type if constexpr (!is_dynamic_view::value) { check_memory_space(create_mirror(WithoutInitializing, view), host_mirror_test_space(view)); check_memory_space(create_mirror( view), host_mirror_test_space(view)); } -#endif check_memory_space(create_mirror(WithoutInitializing, DefaultExecutionSpace{}, view), DeviceMemorySpace{}); check_memory_space(create_mirror( DefaultExecutionSpace{}, view), DeviceMemorySpace{}); // create_mirror_view -#ifndef KOKKOS_ENABLE_CXX14 // FIXME DynamicView: HostMirror is the same type if constexpr (!is_dynamic_view::value) { check_memory_space(create_mirror_view(WithoutInitializing, view), host_mirror_test_space(view)); check_memory_space(create_mirror_view( view), host_mirror_test_space(view)); } -#endif check_memory_space(create_mirror_view(WithoutInitializing, DefaultExecutionSpace{}, view), DeviceMemorySpace{}); check_memory_space(create_mirror_view( DefaultExecutionSpace{}, view), DeviceMemorySpace{}); // create_mirror view_alloc -#ifndef KOKKOS_ENABLE_CXX14 // FIXME DynamicView: HostMirror is the same type if constexpr (!is_dynamic_view::value) { check_memory_space(create_mirror(view_alloc(WithoutInitializing), view), host_mirror_test_space(view)); check_memory_space(create_mirror(view_alloc(), view), host_mirror_test_space(view)); } -#endif check_memory_space(create_mirror(view_alloc(WithoutInitializing, DeviceMemorySpace{}), view), DeviceMemorySpace{}); check_memory_space(create_mirror(view_alloc( DeviceMemorySpace{}), view), DeviceMemorySpace{}); // create_mirror_view view_alloc -#ifndef KOKKOS_ENABLE_CXX14 // FIXME DynamicView: HostMirror is the same type if constexpr (!is_dynamic_view::value) { check_memory_space(create_mirror_view(view_alloc(WithoutInitializing), view), host_mirror_test_space(view)); check_memory_space(create_mirror_view(view_alloc(), view), host_mirror_test_space(view)); } -#endif check_memory_space(create_mirror_view(view_alloc(WithoutInitializing, DeviceMemorySpace{}), view), DeviceMemorySpace{}); check_memory_space(create_mirror_view(view_alloc( DeviceMemorySpace{}), view), DeviceMemorySpace{}); // create_mirror view_alloc + execution space -#ifndef KOKKOS_ENABLE_CXX14 // FIXME DynamicView: HostMirror is the same type if constexpr (!is_dynamic_view::value) { - check_memory_space(create_mirror(view_alloc(DefaultExecutionSpace{}, WithoutInitializing), view), host_mirror_test_space(view)); - check_memory_space(create_mirror(view_alloc(DefaultHostExecutionSpace{}), view), host_mirror_test_space(view)); + check_memory_space(create_mirror(view_alloc(DefaultHostExecutionSpace{}, WithoutInitializing), view), host_mirror_test_space(view)); + check_memory_space(create_mirror(view_alloc(DefaultHostExecutionSpace{}), view), host_mirror_test_space(view)); } -#endif - check_memory_space(create_mirror(view_alloc(DefaultExecutionSpace{}, WithoutInitializing, DeviceMemorySpace{}), view), DeviceMemorySpace{}); - check_memory_space(create_mirror(view_alloc(DefaultExecutionSpace{}, DeviceMemorySpace{}), view), DeviceMemorySpace{}); + check_memory_space(create_mirror(view_alloc(DefaultExecutionSpace{}, WithoutInitializing, DeviceMemorySpace{}), view), DeviceMemorySpace{}); + check_memory_space(create_mirror(view_alloc(DefaultExecutionSpace{}, DeviceMemorySpace{}), view), DeviceMemorySpace{}); // create_mirror_view view_alloc + execution space -#ifndef KOKKOS_ENABLE_CXX14 // FIXME DynamicView: HostMirror is the same type if constexpr (!is_dynamic_view::value) { - check_memory_space(create_mirror_view(view_alloc(DefaultExecutionSpace{}, WithoutInitializing), view), host_mirror_test_space(view)); - check_memory_space(create_mirror_view(view_alloc(DefaultHostExecutionSpace{}), view), host_mirror_test_space(view)); + check_memory_space(create_mirror_view(view_alloc(DefaultHostExecutionSpace{}, WithoutInitializing), view), host_mirror_test_space(view)); + check_memory_space(create_mirror_view(view_alloc(DefaultHostExecutionSpace{}), view), host_mirror_test_space(view)); } -#endif - check_memory_space(create_mirror_view(view_alloc(DefaultExecutionSpace{}, WithoutInitializing, DeviceMemorySpace{}), view), DeviceMemorySpace{}); - check_memory_space(create_mirror_view(view_alloc(DefaultExecutionSpace{}, DeviceMemorySpace{}), view), DeviceMemorySpace{}); + check_memory_space(create_mirror_view(view_alloc(DefaultExecutionSpace{}, WithoutInitializing, DeviceMemorySpace{}), view), DeviceMemorySpace{}); + check_memory_space(create_mirror_view(view_alloc(DefaultExecutionSpace{}, DeviceMemorySpace{}), view), DeviceMemorySpace{}); // create_mirror_view_and_copy check_memory_space(create_mirror_view_and_copy(HostSpace{}, view), HostSpace{}); diff --git a/lib/kokkos/containers/unit_tests/TestDualView.hpp b/lib/kokkos/containers/unit_tests/TestDualView.hpp index 3085f091ce..6e2e56c5cf 100644 --- a/lib/kokkos/containers/unit_tests/TestDualView.hpp +++ b/lib/kokkos/containers/unit_tests/TestDualView.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_DUALVIEW_HPP #define KOKKOS_TEST_DUALVIEW_HPP @@ -492,8 +464,8 @@ struct UVMSpaceFor { #ifdef KOKKOS_ENABLE_HIP // specific to HIP template <> -struct UVMSpaceFor { - using type = Kokkos::Experimental::HIPManagedSpace; +struct UVMSpaceFor { + using type = Kokkos::HIPManagedSpace; }; #endif diff --git a/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp b/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp index 5fbd329560..c7a5b13dbb 100644 --- a/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/containers/unit_tests/TestDynViewAPI_generic.hpp b/lib/kokkos/containers/unit_tests/TestDynViewAPI_generic.hpp index 90ca5df194..d4747538d9 100644 --- a/lib/kokkos/containers/unit_tests/TestDynViewAPI_generic.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynViewAPI_generic.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 namespace Test { diff --git a/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank12345.hpp b/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank12345.hpp index 050ebbe35c..d6019e8239 100644 --- a/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank12345.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank12345.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank67.hpp b/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank67.hpp index eb8df60a89..703811e0f4 100644 --- a/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank67.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank67.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 namespace Test { diff --git a/lib/kokkos/containers/unit_tests/TestDynamicView.hpp b/lib/kokkos/containers/unit_tests/TestDynamicView.hpp index 5345f8ea24..cd1511276f 100644 --- a/lib/kokkos/containers/unit_tests/TestDynamicView.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynamicView.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_DYNAMICVIEW_HPP #define KOKKOS_TEST_DYNAMICVIEW_HPP @@ -240,6 +212,83 @@ struct TestDynamicView { ASSERT_EQ(new_result_sum, (value_type)(da_resize * (da_resize - 1) / 2)); #endif } // end scope + + // Test: Reproducer to demonstrate compile-time error of deep_copy + // of DynamicView to/from on-host View. + // Case 4: + { + using device_view_type = Kokkos::View; + using host_view_type = typename Kokkos::View::HostMirror; + + view_type device_dynamic_view("on-device DynamicView", 1024, + arg_total_size); + device_view_type device_view("on-device View", arg_total_size); + host_view_type host_view("on-host View", arg_total_size); + + unsigned da_size = arg_total_size / 8; + device_dynamic_view.resize_serial(da_size); + + // Use parallel_for to populate device_dynamic_view and verify values +#if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) + Kokkos::parallel_for( + Kokkos::RangePolicy(0, da_size), + KOKKOS_LAMBDA(const int i) { device_dynamic_view(i) = Scalar(i); }); + + value_type result_sum = 0.0; + Kokkos::parallel_reduce( + Kokkos::RangePolicy(0, da_size), + KOKKOS_LAMBDA(const int i, value_type& partial_sum) { + partial_sum += (value_type)device_dynamic_view(i); + }, + result_sum); + + ASSERT_EQ(result_sum, (value_type)(da_size * (da_size - 1) / 2)); +#endif + + // Use an on-device View as intermediate to deep_copy the + // device_dynamic_view to host, zero out the device_dynamic_view, + // deep_copy from host back to the device_dynamic_view and verify + Kokkos::deep_copy(device_view, device_dynamic_view); + Kokkos::deep_copy(host_view, device_view); + Kokkos::deep_copy(device_view, host_view); +#if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) + Kokkos::parallel_for( + Kokkos::RangePolicy(0, da_size), + KOKKOS_LAMBDA(const int i) { device_dynamic_view(i) = Scalar(0); }); +#endif + Kokkos::deep_copy(device_dynamic_view, device_view); +#if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) + value_type new_result_sum = 0.0; + Kokkos::parallel_reduce( + Kokkos::RangePolicy(0, da_size), + KOKKOS_LAMBDA(const int i, value_type& partial_sum) { + partial_sum += (value_type)device_dynamic_view(i); + }, + new_result_sum); + + ASSERT_EQ(new_result_sum, (value_type)(da_size * (da_size - 1) / 2)); +#endif + + // Try to deep_copy device_dynamic_view directly to/from host. + // host-to-device currently fails to compile because DP and SP are + // swapped in the deep_copy implementation. + // Once that's fixed, both deep_copy's will fail at runtime because the + // destination execution space cannot access the source memory space. + try { + Kokkos::deep_copy(host_view, device_dynamic_view); + } catch (std::runtime_error const& error) { + std::string msg = error.what(); + std::cerr << "Copy from on-device DynamicView to on-host View failed:\n" + << msg << std::endl; + } + try { + Kokkos::deep_copy(device_dynamic_view, host_view); + } catch (std::runtime_error const& error) { + std::string msg = error.what(); + std::cerr << "Copy from on-host View to on-device DynamicView failed:\n" + << msg << std::endl; + } + } } }; diff --git a/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp b/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp index c5394d81a6..0003a29468 100644 --- a/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp +++ b/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_EXPERIMENTAL_ERROR_REPORTER_HPP #define KOKKOS_TEST_EXPERIMENTAL_ERROR_REPORTER_HPP @@ -170,16 +142,14 @@ struct ErrorReporterDriver : public ErrorReporterDriverBase { KOKKOS_INLINE_FUNCTION void operator()(const int work_idx) const { if (driver_base::error_condition(work_idx)) { - double val = - Kokkos::Experimental::pi_v * static_cast(work_idx); + double val = Kokkos::numbers::pi * static_cast(work_idx); typename driver_base::report_type report = {work_idx, -2 * work_idx, val}; driver_base::m_errorReporter.add_report(work_idx, report); } } }; -#if defined(KOKKOS_CLASS_LAMBDA) && \ - (!defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_CUDA_LAMBDA)) +#if !defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_CUDA_LAMBDA) template struct ErrorReporterDriverUseLambda : public ErrorReporterDriverBase { @@ -195,10 +165,10 @@ struct ErrorReporterDriverUseLambda void execute(int reporter_capacity, int test_size) { Kokkos::parallel_for( Kokkos::RangePolicy(0, test_size), + // NOLINTNEXTLINE(kokkos-implicit-this-capture) KOKKOS_CLASS_LAMBDA(const int work_idx) { if (driver_base::error_condition(work_idx)) { - double val = Kokkos::Experimental::pi_v * - static_cast(work_idx); + double val = Kokkos::numbers::pi * static_cast(work_idx); typename driver_base::report_type report = {work_idx, -2 * work_idx, val}; driver_base::m_errorReporter.add_report(work_idx, report); @@ -222,8 +192,7 @@ struct ErrorReporterDriverNativeOpenMP #pragma omp parallel for for (int work_idx = 0; work_idx < test_size; ++work_idx) { if (driver_base::error_condition(work_idx)) { - double val = - Kokkos::Experimental::pi_v * static_cast(work_idx); + double val = Kokkos::numbers::pi * static_cast(work_idx); typename driver_base::report_type report = {work_idx, -2 * work_idx, val}; driver_base::m_errorReporter.add_report(work_idx, report); @@ -234,7 +203,9 @@ struct ErrorReporterDriverNativeOpenMP }; #endif -#if defined(KOKKOS_CLASS_LAMBDA) && \ +// FIXME_MSVC MSVC just gets confused when using the base class in the +// KOKKOS_CLASS_LAMBDA +#if !defined(KOKKOS_COMPILER_MSVC) && \ (!defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_CUDA_LAMBDA)) TEST(TEST_CATEGORY, ErrorReporterViaLambda) { TestErrorReporter>(); diff --git a/lib/kokkos/containers/unit_tests/TestOffsetView.hpp b/lib/kokkos/containers/unit_tests/TestOffsetView.hpp index 9e9edc80b5..c133922e3d 100644 --- a/lib/kokkos/containers/unit_tests/TestOffsetView.hpp +++ b/lib/kokkos/containers/unit_tests/TestOffsetView.hpp @@ -1,43 +1,17 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 /* @@ -63,13 +37,8 @@ void test_offsetview_construction() { using offset_view_type = Kokkos::Experimental::OffsetView; using view_type = Kokkos::View; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - Kokkos::Experimental::index_list_type range0 = {-1, 3}; - Kokkos::Experimental::index_list_type range1 = {-2, 2}; -#else std::pair range0 = {-1, 3}; std::pair range1 = {-2, 2}; -#endif { offset_view_type o1; diff --git a/lib/kokkos/containers/unit_tests/TestScatterView.hpp b/lib/kokkos/containers/unit_tests/TestScatterView.hpp index b2f5c5a913..347e914ea5 100644 --- a/lib/kokkos/containers/unit_tests/TestScatterView.hpp +++ b/lib/kokkos/containers/unit_tests/TestScatterView.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_SCATTER_VIEW_HPP #define KOKKOS_TEST_SCATTER_VIEW_HPP @@ -106,51 +78,11 @@ struct test_scatter_view_impl_cls::value) { using device_device_type = diff --git a/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp b/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp index 907a2d61d6..acff5d0be0 100644 --- a/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp +++ b/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp b/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp index 3f5f97d6bb..989779b53a 100644 --- a/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp +++ b/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp @@ -1,43 +1,17 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_UNORDERED_MAP_HPP @@ -293,6 +267,12 @@ void test_deep_copy(uint32_t num_nodes) { #if !defined(_WIN32) TEST(TEST_CATEGORY, UnorderedMap_insert) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "unit test is hanging from index 0"; + } +#endif for (int i = 0; i < 500; ++i) { test_insert(100000, 90000, 100, true); test_insert(100000, 90000, 100, false); @@ -305,6 +285,12 @@ TEST(TEST_CATEGORY, UnorderedMap_failed_insert) { } TEST(TEST_CATEGORY, UnorderedMap_deep_copy) { +#if defined(KOKKOS_ENABLE_CUDA) && \ + defined(KOKKOS_COMPILER_NVHPC) // FIXME_NVHPC + if constexpr (std::is_same_v) { + GTEST_SKIP() << "unit test is hanging from index 0"; + } +#endif for (int i = 0; i < 2; ++i) test_deep_copy(10000); } diff --git a/lib/kokkos/containers/unit_tests/TestVector.hpp b/lib/kokkos/containers/unit_tests/TestVector.hpp index efb21fe131..fa59607484 100644 --- a/lib/kokkos/containers/unit_tests/TestVector.hpp +++ b/lib/kokkos/containers/unit_tests/TestVector.hpp @@ -1,43 +1,17 @@ //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_VECTOR_HPP diff --git a/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp b/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp index d402160ef4..0246f11ddf 100644 --- a/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp +++ b/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/containers/unit_tests/TestWithoutInitializing.hpp b/lib/kokkos/containers/unit_tests/TestWithoutInitializing.hpp index 174773f198..d3bb05195c 100644 --- a/lib/kokkos/containers/unit_tests/TestWithoutInitializing.hpp +++ b/lib/kokkos/containers/unit_tests/TestWithoutInitializing.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -442,12 +414,16 @@ TEST(TEST_CATEGORY, create_mirror_no_init_dynrankview) { [&]() { auto mirror_device = Kokkos::create_mirror(Kokkos::WithoutInitializing, device_view); + ASSERT_EQ(device_view.size(), mirror_device.size()); auto mirror_host = Kokkos::create_mirror(Kokkos::WithoutInitializing, TEST_EXECSPACE{}, host_view); + ASSERT_EQ(host_view.size(), mirror_host.size()); auto mirror_device_view = Kokkos::create_mirror_view( Kokkos::WithoutInitializing, device_view); + ASSERT_EQ(device_view.size(), mirror_device_view.size()); auto mirror_host_view = Kokkos::create_mirror_view( Kokkos::WithoutInitializing, TEST_EXECSPACE{}, host_view); + ASSERT_EQ(host_view.size(), mirror_host_view.size()); }, [&](BeginParallelForEvent) { return MatchDiagnostic{true, {"Found begin event"}}; @@ -469,16 +445,20 @@ TEST(TEST_CATEGORY, create_mirror_no_init_dynrankview_viewctor) { [&]() { auto mirror_device = Kokkos::create_mirror( Kokkos::view_alloc(Kokkos::WithoutInitializing), device_view); + ASSERT_EQ(device_view.size(), mirror_device.size()); auto mirror_host = Kokkos::create_mirror( Kokkos::view_alloc(Kokkos::WithoutInitializing, - Kokkos::DefaultExecutionSpace{}), + Kokkos::DefaultHostExecutionSpace{}), host_view); + ASSERT_EQ(host_view.size(), mirror_host.size()); auto mirror_device_view = Kokkos::create_mirror_view( Kokkos::view_alloc(Kokkos::WithoutInitializing), device_view); + ASSERT_EQ(device_view.size(), mirror_device_view.size()); auto mirror_host_view = Kokkos::create_mirror_view( Kokkos::view_alloc(Kokkos::WithoutInitializing, Kokkos::DefaultExecutionSpace{}), host_view); + ASSERT_EQ(host_view.size(), mirror_host_view.size()); }, [&](BeginParallelForEvent) { return MatchDiagnostic{true, {"Found begin event"}}; @@ -509,6 +489,7 @@ TEST(TEST_CATEGORY, create_mirror_view_and_copy_dynrankview) { Kokkos::view_alloc(TEST_EXECSPACE{}, typename TEST_EXECSPACE::memory_space{}), host_view); + ASSERT_EQ(host_view.size(), mirror_device.size()); // Avoid fences for deallocation when mirror_device goes out of scope. device_view = mirror_device; }, @@ -531,14 +512,24 @@ TEST(TEST_CATEGORY, create_mirror_no_init_offsetview) { auto success = validate_absence( [&]() { + device_view = Kokkos::Experimental::OffsetView( + Kokkos::view_alloc(Kokkos::WithoutInitializing, "device view"), + {0, 10}); + auto mirror_device = Kokkos::create_mirror(Kokkos::WithoutInitializing, device_view); - auto mirror_host = Kokkos::create_mirror(Kokkos::WithoutInitializing, - TEST_EXECSPACE{}, host_view); + ASSERT_EQ(device_view.size(), mirror_device.size()); + auto mirror_host = Kokkos::create_mirror( + Kokkos::WithoutInitializing, Kokkos::DefaultHostExecutionSpace{}, + host_view); + ASSERT_EQ(host_view.size(), mirror_host.size()); auto mirror_device_view = Kokkos::create_mirror_view( Kokkos::WithoutInitializing, device_view); + ASSERT_EQ(device_view.size(), mirror_device_view.size()); auto mirror_host_view = Kokkos::create_mirror_view( - Kokkos::WithoutInitializing, TEST_EXECSPACE{}, host_view); + Kokkos::WithoutInitializing, Kokkos::DefaultHostExecutionSpace{}, + host_view); + ASSERT_EQ(host_view.size(), mirror_host_view.size()); }, [&](BeginParallelForEvent) { return MatchDiagnostic{true, {"Found begin event"}}; @@ -561,16 +552,20 @@ TEST(TEST_CATEGORY, create_mirror_no_init_offsetview_view_ctor) { [&]() { auto mirror_device = Kokkos::create_mirror( Kokkos::view_alloc(Kokkos::WithoutInitializing), device_view); + ASSERT_EQ(device_view.size(), mirror_device.size()); auto mirror_host = Kokkos::create_mirror( Kokkos::view_alloc(Kokkos::WithoutInitializing, - Kokkos::DefaultExecutionSpace{}), + Kokkos::DefaultHostExecutionSpace{}), host_view); + ASSERT_EQ(host_view.size(), mirror_host.size()); auto mirror_device_view = Kokkos::create_mirror_view( Kokkos::view_alloc(Kokkos::WithoutInitializing), device_view); + ASSERT_EQ(device_view.size(), mirror_device_view.size()); auto mirror_host_view = Kokkos::create_mirror_view( Kokkos::view_alloc(Kokkos::WithoutInitializing, - Kokkos::DefaultExecutionSpace{}), + Kokkos::DefaultHostExecutionSpace{}), host_view); + ASSERT_EQ(host_view.size(), mirror_host_view.size()); }, [&](BeginParallelForEvent) { return MatchDiagnostic{true, {"Found begin event"}}; @@ -602,12 +597,14 @@ TEST(TEST_CATEGORY, create_mirror_view_and_copy_offsetview) { Kokkos::view_alloc(TEST_EXECSPACE{}, typename TEST_EXECSPACE::memory_space{}), host_view); + ASSERT_EQ(host_view.size(), mirror_device.size()); // Avoid fences for deallocation when mirror_device goes out of scope. device_view = mirror_device; auto mirror_device_mirror = Kokkos::create_mirror_view_and_copy( Kokkos::view_alloc(TEST_EXECSPACE{}, typename TEST_EXECSPACE::memory_space{}), mirror_device); + ASSERT_EQ(mirror_device_mirror.size(), mirror_device.size()); }, [&](BeginParallelForEvent) { return MatchDiagnostic{true, {"Found parallel_for event"}}; @@ -625,19 +622,25 @@ TEST(TEST_CATEGORY, create_mirror_no_init_dynamicview) { listen_tool_events(Config::DisableAll(), Config::EnableKernels()); Kokkos::Experimental::DynamicView device_view( "device view", 2, 10); + device_view.resize_serial(10); Kokkos::Experimental::DynamicView host_view( "host view", 2, 10); + host_view.resize_serial(10); auto success = validate_absence( [&]() { auto mirror_device = Kokkos::create_mirror(Kokkos::WithoutInitializing, device_view); + ASSERT_EQ(device_view.size(), mirror_device.size()); auto mirror_host = Kokkos::create_mirror(Kokkos::WithoutInitializing, TEST_EXECSPACE{}, host_view); + ASSERT_EQ(host_view.size(), mirror_host.size()); auto mirror_device_view = Kokkos::create_mirror_view( Kokkos::WithoutInitializing, device_view); + ASSERT_EQ(device_view.size(), mirror_device_view.size()); auto mirror_host_view = Kokkos::create_mirror_view( Kokkos::WithoutInitializing, TEST_EXECSPACE{}, host_view); + ASSERT_EQ(host_view.size(), mirror_host_view.size()); }, [&](BeginParallelForEvent) { return MatchDiagnostic{true, {"Found begin event"}}; @@ -660,6 +663,7 @@ TEST(TEST_CATEGORY, create_mirror_view_and_copy_dynamicview) { Kokkos::Experimental::DynamicView host_view( "host view", 2, 10); + host_view.resize_serial(10); decltype(Kokkos::create_mirror_view_and_copy(TEST_EXECSPACE{}, host_view)) device_view; @@ -669,12 +673,14 @@ TEST(TEST_CATEGORY, create_mirror_view_and_copy_dynamicview) { Kokkos::view_alloc(TEST_EXECSPACE{}, typename TEST_EXECSPACE::memory_space{}), host_view); + ASSERT_EQ(host_view.size(), mirror_device.size()); // Avoid fences for deallocation when mirror_device goes out of scope. device_view = mirror_device; auto mirror_device_mirror = Kokkos::create_mirror_view_and_copy( Kokkos::view_alloc(TEST_EXECSPACE{}, typename TEST_EXECSPACE::memory_space{}), mirror_device); + ASSERT_EQ(mirror_device_mirror.size(), mirror_device.size()); }, [&](BeginFenceEvent event) { if (event.descriptor().find("DynamicView::resize_serial: Fence after " @@ -698,23 +704,29 @@ TEST(TEST_CATEGORY, create_mirror_no_init_dynamicview_view_ctor) { listen_tool_events(Config::DisableAll(), Config::EnableKernels()); Kokkos::Experimental::DynamicView device_view("device view", 2, 10); + device_view.resize_serial(10); Kokkos::Experimental::DynamicView host_view( "host view", 2, 10); + host_view.resize_serial(10); auto success = validate_absence( [&]() { auto mirror_device = Kokkos::create_mirror( Kokkos::view_alloc(Kokkos::WithoutInitializing), device_view); + ASSERT_EQ(device_view.size(), mirror_device.size()); auto mirror_host = Kokkos::create_mirror( Kokkos::view_alloc(Kokkos::WithoutInitializing, Kokkos::DefaultExecutionSpace{}), host_view); + ASSERT_EQ(host_view.size(), mirror_host.size()); auto mirror_device_view = Kokkos::create_mirror_view( Kokkos::view_alloc(Kokkos::WithoutInitializing), device_view); + ASSERT_EQ(device_view.size(), mirror_device_view.size()); auto mirror_host_view = Kokkos::create_mirror_view( Kokkos::view_alloc(Kokkos::WithoutInitializing, Kokkos::DefaultExecutionSpace{}), host_view); + ASSERT_EQ(host_view.size(), mirror_host_view.size()); }, [&](BeginFenceEvent event) { if (event.descriptor().find("DynamicView::resize_serial: Fence after " diff --git a/lib/kokkos/containers/unit_tests/UnitTestMain.cpp b/lib/kokkos/containers/unit_tests/UnitTestMain.cpp index e245aad35f..11a1cb717a 100644 --- a/lib/kokkos/containers/unit_tests/UnitTestMain.cpp +++ b/lib/kokkos/containers/unit_tests/UnitTestMain.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/core/CMakeLists.txt b/lib/kokkos/core/CMakeLists.txt index bb60c368f7..5d9fde56d2 100644 --- a/lib/kokkos/core/CMakeLists.txt +++ b/lib/kokkos/core/CMakeLists.txt @@ -7,6 +7,9 @@ IF (NOT Kokkos_INSTALL_TESTING) ENDIF() KOKKOS_ADD_TEST_DIRECTORIES(unit_test) -KOKKOS_ADD_TEST_DIRECTORIES(perf_test) +IF (NOT KOKKOS_HAS_TRILINOS) + # We are using the githash etc in here, which does not work correct in Trilinos + KOKKOS_ADD_TEST_DIRECTORIES(perf_test) +ENDIF() KOKKOS_SUBPACKAGE_POSTPROCESS() diff --git a/lib/kokkos/core/perf_test/BenchmarkMain.cpp b/lib/kokkos/core/perf_test/BenchmarkMain.cpp new file mode 100644 index 0000000000..bba2bca36d --- /dev/null +++ b/lib/kokkos/core/perf_test/BenchmarkMain.cpp @@ -0,0 +1,33 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#include + +#include +#include + +int main(int argc, char** argv) { + Kokkos::initialize(argc, argv); + benchmark::Initialize(&argc, argv); + benchmark::SetDefaultTimeUnit(benchmark::kSecond); + KokkosBenchmark::add_benchmark_context(true); + + benchmark::RunSpecifiedBenchmarks(); + + benchmark::Shutdown(); + Kokkos::finalize(); + return 0; +} diff --git a/lib/kokkos/core/perf_test/Benchmark_Context.hpp b/lib/kokkos/core/perf_test/Benchmark_Context.hpp new file mode 100644 index 0000000000..ba6eff6646 --- /dev/null +++ b/lib/kokkos/core/perf_test/Benchmark_Context.hpp @@ -0,0 +1,89 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_CORE_PERFTEST_BENCHMARK_CONTEXT_HPP +#define KOKKOS_CORE_PERFTEST_BENCHMARK_CONTEXT_HPP + +#include + +#include + +#include +#include + +namespace KokkosBenchmark { + +/// \brief Remove unwanted spaces and colon signs from input string. In case of +/// invalid input it will return an empty string. +std::string remove_unwanted_characters(std::string str) { + auto from = str.find_first_not_of(" :"); + auto to = str.find_last_not_of(" :"); + + if (from == std::string::npos || to == std::string::npos) { + return ""; + } + + // return extracted part of string without unwanted spaces and colon signs + return str.substr(from, to + 1); +} + +/// \brief Extract all key:value pairs from kokkos configuration and add it to +/// the benchmark context +void add_kokkos_configuration(bool verbose) { + std::ostringstream msg; + Kokkos::print_configuration(msg, verbose); + + // Iterate over lines returned from kokkos and extract key:value pairs + std::stringstream ss{msg.str()}; + for (std::string line; std::getline(ss, line, '\n');) { + auto found = line.find_first_of(':'); + if (found != std::string::npos) { + auto val = remove_unwanted_characters(line.substr(found + 1)); + // Ignore line without value, for example a category name + if (!val.empty()) { + benchmark::AddCustomContext( + remove_unwanted_characters(line.substr(0, found)), val); + } + } + } +} + +/// \brief Add all data related to git to benchmark context +void add_git_info() { + if (!Kokkos::Impl::GIT_BRANCH.empty()) { + benchmark::AddCustomContext("GIT_BRANCH", Kokkos::Impl::GIT_BRANCH); + benchmark::AddCustomContext("GIT_COMMIT_HASH", + Kokkos::Impl::GIT_COMMIT_HASH); + benchmark::AddCustomContext("GIT_CLEAN_STATUS", + Kokkos::Impl::GIT_CLEAN_STATUS); + benchmark::AddCustomContext("GIT_COMMIT_DESCRIPTION", + Kokkos::Impl::GIT_COMMIT_DESCRIPTION); + benchmark::AddCustomContext("GIT_COMMIT_DATE", + Kokkos::Impl::GIT_COMMIT_DATE); + } +} + +/// \brief Gather all context information and add it to benchmark context data +void add_benchmark_context(bool verbose = false) { + // Add Kokkos configuration to benchmark context data + add_kokkos_configuration(verbose); + // Add git information to benchmark context data + add_git_info(); +} + +} // namespace KokkosBenchmark + +#endif diff --git a/lib/kokkos/core/perf_test/CMakeLists.txt b/lib/kokkos/core/perf_test/CMakeLists.txt index 7ba97dbfbb..814102975f 100644 --- a/lib/kokkos/core/perf_test/CMakeLists.txt +++ b/lib/kokkos/core/perf_test/CMakeLists.txt @@ -10,7 +10,8 @@ #INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../../algorithms/src") # FIXME_OPENMPTARGET - the NVIDIA HPC compiler nvc++ in the OpenMPTarget backend does not pass the perf_tests. -IF (KOKKOS_ENABLE_OPENMPTARGET AND KOKKOS_CXX_COMPILER_ID STREQUAL NVHPC) +# FIXME_OPENACC - temporarily disabled due to unimplemented features +IF ((KOKKOS_ENABLE_OPENMPTARGET OR KOKKOS_ENABLE_OPENACC) AND KOKKOS_CXX_COMPILER_ID STREQUAL NVHPC) RETURN() ENDIF() @@ -21,26 +22,6 @@ SET(SOURCES PerfTestHexGrad.cpp PerfTest_CustomReduction.cpp PerfTest_ExecSpacePartitioning.cpp - PerfTest_ViewCopy_a123.cpp - PerfTest_ViewCopy_b123.cpp - PerfTest_ViewCopy_c123.cpp - PerfTest_ViewCopy_d123.cpp - PerfTest_ViewCopy_a45.cpp - PerfTest_ViewCopy_b45.cpp - PerfTest_ViewCopy_c45.cpp - PerfTest_ViewCopy_d45.cpp - PerfTest_ViewCopy_a6.cpp - PerfTest_ViewCopy_b6.cpp - PerfTest_ViewCopy_c6.cpp - PerfTest_ViewCopy_d6.cpp - PerfTest_ViewCopy_a7.cpp - PerfTest_ViewCopy_b7.cpp - PerfTest_ViewCopy_c7.cpp - PerfTest_ViewCopy_d7.cpp - PerfTest_ViewCopy_a8.cpp - PerfTest_ViewCopy_b8.cpp - PerfTest_ViewCopy_c8.cpp - PerfTest_ViewCopy_d8.cpp PerfTest_ViewAllocate.cpp PerfTest_ViewFill_123.cpp PerfTest_ViewFill_45.cpp @@ -63,6 +44,13 @@ IF(Kokkos_ENABLE_OPENMPTARGET) ) ENDIF() +IF(KOKKOS_ENABLE_CUDA OR KOKKOS_ENABLE_HIP OR KOKKOS_ENABLE_SYCL) + KOKKOS_ADD_EXECUTABLE ( + PerformanceTest_SharedSpace + SOURCES test_sharedSpace.cpp + ) +ENDIF() + # Per #374, we always want to build this test, but we only want to run # it as a PERFORMANCE test. That's why we separate building the test # from running the test. @@ -113,3 +101,118 @@ IF(NOT Kokkos_ENABLE_OPENMPTARGET) CATEGORIES PERFORMANCE ) ENDIF() + + +IF(NOT Kokkos_ENABLE_BENCHMARKS) + RETURN() +ENDIF() + +IF (KOKKOS_HAS_TRILINOS) + message(FATAL_ERROR "Benchmarks are not supported when building as part of Trilinos") +ENDIF() + +find_package(benchmark QUIET) +IF(benchmark_FOUND) + MESSAGE(STATUS "Using google benchmark found in ${benchmark_DIR}") +ELSE() + message(STATUS "No installed google benchmark found, fetching from GitHub") + include(FetchContent) + SET(BENCHMARK_ENABLE_TESTING OFF) + + list(APPEND CMAKE_MESSAGE_INDENT " ") + FetchContent_Declare( + googlebenchmark + URL https://github.com/google/benchmark/archive/refs/tags/v1.6.2.tar.gz + URL_HASH MD5=14d14849e075af116143a161bc3b927b + ) + FetchContent_MakeAvailable(googlebenchmark) + list(POP_BACK CMAKE_MESSAGE_INDENT) + + include_directories(${benchmark_SOURCE_DIR}/include) + + # Suppress clang-tidy diagnostics on code that we do not have control over + IF(CMAKE_CXX_CLANG_TIDY) + SET_TARGET_PROPERTIES(benchmark PROPERTIES CXX_CLANG_TIDY "") + ENDIF() + + target_compile_options(benchmark PRIVATE -w) + target_compile_options(benchmark_main PRIVATE -w) +ENDIF() + + +FUNCTION(KOKKOS_ADD_BENCHMARK NAME) + CMAKE_PARSE_ARGUMENTS( + BENCHMARK + "" + "" + "SOURCES" + ${ARGN} + ) + IF(DEFINED BENCHMARK_UNPARSED_ARGUMENTS) + MESSAGE( + WARNING + "Unexpected arguments when adding a benchmark: " + ${BENCHMARK_UNPARSED_ARGUMENTS} + ) + ENDIF() + + SET(BENCHMARK_NAME ${PACKAGE_NAME}_${NAME}) + + ADD_EXECUTABLE( + ${BENCHMARK_NAME} + ${BENCHMARK_SOURCES} + ) + TARGET_LINK_LIBRARIES( + ${BENCHMARK_NAME} + PRIVATE benchmark::benchmark Kokkos::kokkos impl_git_version + ) + FOREACH(SOURCE_FILE ${BENCHMARK_SOURCES}) + SET_SOURCE_FILES_PROPERTIES( + ${SOURCE_FILE} + PROPERTIES LANGUAGE ${KOKKOS_COMPILE_LANGUAGE} + ) + ENDFOREACH() + + STRING(TIMESTAMP BENCHMARK_TIME "%Y-%m-%d_T%H-%M-%S" UTC) + SET( + BENCHMARK_ARGS + --benchmark_counters_tabular=true + --benchmark_out=${BENCHMARK_NAME}_${BENCHMARK_TIME}.json + ) + + ADD_TEST( + NAME ${BENCHMARK_NAME} + COMMAND ${BENCHMARK_NAME} ${BENCHMARK_ARGS} + ) +ENDFUNCTION() + +SET( + BENCHMARK_SOURCES + BenchmarkMain.cpp + PerfTest_ViewCopy_a123.cpp + PerfTest_ViewCopy_b123.cpp + PerfTest_ViewCopy_c123.cpp + PerfTest_ViewCopy_d123.cpp + PerfTest_ViewCopy_a45.cpp + PerfTest_ViewCopy_b45.cpp + PerfTest_ViewCopy_c45.cpp + PerfTest_ViewCopy_d45.cpp + PerfTest_ViewCopy_a6.cpp + PerfTest_ViewCopy_b6.cpp + PerfTest_ViewCopy_c6.cpp + PerfTest_ViewCopy_d6.cpp + PerfTest_ViewCopy_a7.cpp + PerfTest_ViewCopy_b7.cpp + PerfTest_ViewCopy_c7.cpp + PerfTest_ViewCopy_d7.cpp + PerfTest_ViewCopy_a8.cpp + PerfTest_ViewCopy_b8.cpp + PerfTest_ViewCopy_c8.cpp + PerfTest_ViewCopy_d8.cpp + PerfTest_ViewCopy_Raw.cpp +) + +KOKKOS_ADD_BENCHMARK( + PerformanceTest_Benchmark + SOURCES ${BENCHMARK_SOURCES} +) diff --git a/lib/kokkos/core/perf_test/Makefile b/lib/kokkos/core/perf_test/Makefile index ac06c89757..396387c622 100644 --- a/lib/kokkos/core/perf_test/Makefile +++ b/lib/kokkos/core/perf_test/Makefile @@ -34,11 +34,6 @@ OBJ_PERF += PerfTest_ExecSpacePartitioning.o OBJ_PERF += PerfTestGramSchmidt.o OBJ_PERF += PerfTestHexGrad.o OBJ_PERF += PerfTest_CustomReduction.o -OBJ_PERF += PerfTest_ViewCopy_a123.o PerfTest_ViewCopy_b123.o PerfTest_ViewCopy_c123.o PerfTest_ViewCopy_d123.o -OBJ_PERF += PerfTest_ViewCopy_a45.o PerfTest_ViewCopy_b45.o PerfTest_ViewCopy_c45.o PerfTest_ViewCopy_d45.o -OBJ_PERF += PerfTest_ViewCopy_a6.o PerfTest_ViewCopy_b6.o PerfTest_ViewCopy_c6.o PerfTest_ViewCopy_d6.o -OBJ_PERF += PerfTest_ViewCopy_a7.o PerfTest_ViewCopy_b7.o PerfTest_ViewCopy_c7.o PerfTest_ViewCopy_d7.o -OBJ_PERF += PerfTest_ViewCopy_a8.o PerfTest_ViewCopy_b8.o PerfTest_ViewCopy_c8.o PerfTest_ViewCopy_d8.o OBJ_PERF += PerfTest_ViewAllocate.o OBJ_PERF += PerfTest_ViewFill_123.o PerfTest_ViewFill_45.o PerfTest_ViewFill_6.o PerfTest_ViewFill_7.o PerfTest_ViewFill_8.o OBJ_PERF += PerfTest_ViewResize_123.o PerfTest_ViewResize_45.o PerfTest_ViewResize_6.o PerfTest_ViewResize_7.o PerfTest_ViewResize_8.o diff --git a/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp b/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp index 5be29e65d7..1d7073fe5a 100644 --- a/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp +++ b/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_BLAS_KERNELS_HPP #define KOKKOS_BLAS_KERNELS_HPP diff --git a/lib/kokkos/core/perf_test/PerfTestDriver.hpp b/lib/kokkos/core/perf_test/PerfTestDriver.hpp index 95d5128abf..ea54f31902 100644 --- a/lib/kokkos/core/perf_test/PerfTestDriver.hpp +++ b/lib/kokkos/core/perf_test/PerfTestDriver.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp b/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp index 31a01184c1..c8f8487ffc 100644 --- a/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp +++ b/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp b/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp index 24c1898e0a..ef92de7ce1 100644 --- a/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp +++ b/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/core/perf_test/PerfTestMDRange.hpp b/lib/kokkos/core/perf_test/PerfTestMDRange.hpp index ec0452d5f1..7ec1cd6996 100644 --- a/lib/kokkos/core/perf_test/PerfTestMDRange.hpp +++ b/lib/kokkos/core/perf_test/PerfTestMDRange.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ namespace Test { template #include diff --git a/lib/kokkos/core/perf_test/PerfTest_Category.hpp b/lib/kokkos/core/perf_test/PerfTest_Category.hpp index 0f24490bfe..126c961147 100644 --- a/lib/kokkos/core/perf_test/PerfTest_Category.hpp +++ b/lib/kokkos/core/perf_test/PerfTest_Category.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_TEST_PERFTEST_CAT_HPP #define KOKKOS_TEST_PERFTEST_CAT_HPP diff --git a/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp b/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp index 1ab76d6e54..049301f9a7 100644 --- a/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -58,8 +30,8 @@ void custom_reduction_test(int N, int R, int num_trials) { Scalar max; int team_size = 32; - if (team_size > Kokkos::DefaultExecutionSpace::concurrency()) - team_size = Kokkos::DefaultExecutionSpace::concurrency(); + if (team_size > Kokkos::DefaultExecutionSpace().concurrency()) + team_size = Kokkos::DefaultExecutionSpace().concurrency(); // Warm up Kokkos::parallel_reduce( Kokkos::TeamPolicy<>(N / 1024, team_size), diff --git a/lib/kokkos/core/perf_test/PerfTest_ExecSpacePartitioning.cpp b/lib/kokkos/core/perf_test/PerfTest_ExecSpacePartitioning.cpp index b1a7bf1e83..48419c7ec6 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ExecSpacePartitioning.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ExecSpacePartitioning.cpp @@ -1,3 +1,19 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + #include #include #include @@ -26,8 +42,7 @@ bool is_overlapping(const Kokkos::Cuda&) { #ifdef KOKKOS_ENABLE_HIP template <> -bool is_overlapping( - const Kokkos::Experimental::HIP&) { +bool is_overlapping(const Kokkos::HIP&) { // FIXME_HIP This doesn't pass yet in CI. return false; // bool value = true; diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewAllocate.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewAllocate.cpp index 555a05ea27..c1d9895847 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewAllocate.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewAllocate.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy.hpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy.hpp index 8e7bf25e80..b0216ca6fc 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy.hpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy.hpp @@ -1,261 +1,168 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CORE_PERFTEST_BENCHMARK_VIEW_COPY_HPP +#define KOKKOS_CORE_PERFTEST_BENCHMARK_VIEW_COPY_HPP #include -#include -#include -#include +#include +#include namespace Test { +/** + * \brief Mark the label as a figure of merit. + */ +inline std::string benchmark_fom(const std::string& label) { + return "FOM: " + label; +} + +inline void report_results(benchmark::State& state, std::size_t num_elems, + double time) { + state.SetIterationTime(time); + + // data size in megabytes + const auto size = 1.0 * num_elems * sizeof(double) / 1000 / 1000; + // data processed in gigabytes + const auto data_processed = 2 * size / 1000; + + state.counters["MB"] = + benchmark::Counter(size, benchmark::Counter::kDefaults); + state.counters[benchmark_fom("GB/s")] = benchmark::Counter( + data_processed, benchmark::Counter::kIsIterationInvariantRate); +} + template -double deepcopy_view(ViewTypeA& a, ViewTypeB& b, int repeat) { - Kokkos::Timer timer; - for (int i = 0; i < repeat; i++) { +void deepcopy_view(ViewTypeA& a, ViewTypeB& b, benchmark::State& state) { + for (auto _ : state) { + Kokkos::fence(); + Kokkos::Timer timer; Kokkos::deep_copy(a, b); + report_results(state, a.size(), timer.seconds()); } - Kokkos::fence(); - return timer.seconds(); } template -void run_deepcopyview_tests123(int N, int R) { - const int N1 = N; +static void ViewDeepCopy_Rank1(benchmark::State& state) { + const int N8 = std::pow(state.range(0), 8); + + Kokkos::View a("A1", N8); + Kokkos::View b("B1", N8); + + deepcopy_view(a, b, state); +} + +template +static void ViewDeepCopy_Rank2(benchmark::State& state) { + const int N1 = state.range(0); + const int N2 = N1 * N1; + const int N4 = N2 * N2; + + Kokkos::View a("A2", N4, N4); + Kokkos::View b("B2", N4, N4); + + deepcopy_view(a, b, state); +} + +template +static void ViewDeepCopy_Rank3(benchmark::State& state) { + const int N1 = state.range(0); const int N2 = N1 * N1; const int N3 = N2 * N1; - const int N4 = N2 * N2; - const int N8 = N4 * N4; - double time1, time2, time3, time_raw = 100000.0; - { - Kokkos::View a("A1", N8); - Kokkos::View b("B1", N8); - time1 = deepcopy_view(a, b, R) / R; - } - { - Kokkos::View a("A2", N4, N4); - Kokkos::View b("B2", N4, N4); - time2 = deepcopy_view(a, b, R) / R; - } - { - Kokkos::View a("A3", N3, N3, N2); - Kokkos::View b("B3", N3, N3, N2); - time3 = deepcopy_view(a, b, R) / R; - } -#if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) - { - Kokkos::View a("A1", N8); - Kokkos::View 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]; }); - } - Kokkos::fence(); - 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); + Kokkos::View a("A3", N3, N3, N2); + Kokkos::View b("B3", N3, N3, N2); + + deepcopy_view(a, b, state); } template -void run_deepcopyview_tests45(int N, int R) { - const int N1 = N; +static void ViewDeepCopy_Rank4(benchmark::State& state) { + const int N1 = state.range(0); const int N2 = N1 * N1; - const int N4 = N2 * N2; - const int N8 = N4 * N4; - double time4, time5, time_raw = 100000.0; - { - Kokkos::View a("A4", N2, N2, N2, N2); - Kokkos::View b("B4", N2, N2, N2, N2); - time4 = deepcopy_view(a, b, R) / R; - } - { - Kokkos::View a("A5", N2, N2, N1, N1, N2); - Kokkos::View b("B5", N2, N2, N1, N1, N2); - time5 = deepcopy_view(a, b, R) / R; - } -#if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) - { - Kokkos::View a("A1", N8); - Kokkos::View 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]; }); - } - Kokkos::fence(); - 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(" 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); + Kokkos::View a("A4", N2, N2, N2, N2); + Kokkos::View b("B4", N2, N2, N2, N2); + + deepcopy_view(a, b, state); } template -void run_deepcopyview_tests6(int N, int R) { - const int N1 = N; +static void ViewDeepCopy_Rank5(benchmark::State& state) { + const int N1 = state.range(0); const int N2 = N1 * N1; - const int N4 = N2 * N2; - const int N8 = N4 * N4; - double time6, time_raw = 100000.0; - { - Kokkos::View a("A6", N2, N1, N1, N1, N1, N2); - Kokkos::View b("B6", N2, N1, N1, N1, N1, N2); - time6 = deepcopy_view(a, b, R) / R; - } -#if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) - { - Kokkos::View a("A1", N8); - Kokkos::View 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]; }); - } - Kokkos::fence(); - 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(" Rank6: %lf s %lf MB %lf GB/s\n", time6, size, - 2.0 * size / 1024 / time6); + Kokkos::View a("A5", N2, N2, N1, N1, N2); + Kokkos::View b("B5", N2, N2, N1, N1, N2); + + deepcopy_view(a, b, state); } template -void run_deepcopyview_tests7(int N, int R) { - const int N1 = N; +static void ViewDeepCopy_Rank6(benchmark::State& state) { + const int N1 = state.range(0); const int N2 = N1 * N1; - const int N4 = N2 * N2; - const int N8 = N4 * N4; - double time7, time_raw = 100000.0; - { - Kokkos::View a("A7", N2, N1, N1, N1, N1, N1, N1); - Kokkos::View b("B7", N2, N1, N1, N1, N1, N1, N1); - time7 = deepcopy_view(a, b, R) / R; - } -#if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) - { - Kokkos::View a("A1", N8); - Kokkos::View 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]; }); - } - Kokkos::fence(); - 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(" Rank7: %lf s %lf MB %lf GB/s\n", time7, size, - 2.0 * size / 1024 / time7); + Kokkos::View a("A6", N2, N1, N1, N1, N1, N2); + Kokkos::View b("B6", N2, N1, N1, N1, N1, N2); + + deepcopy_view(a, b, state); } template -void run_deepcopyview_tests8(int N, int R) { - const int N1 = N; +static void ViewDeepCopy_Rank7(benchmark::State& state) { + const int N1 = state.range(0); const int N2 = N1 * N1; - const int N4 = N2 * N2; - const int N8 = N4 * N4; - double time8, time_raw = 100000.0; - { - Kokkos::View a("A8", N1, N1, N1, N1, N1, N1, N1, - N1); - Kokkos::View 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 a("A1", N8); - Kokkos::View 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]; }); - } + Kokkos::View a("A7", N2, N1, N1, N1, N1, N1, N1); + Kokkos::View b("B7", N2, N1, N1, N1, N1, N1, N1); + + deepcopy_view(a, b, state); +} + +template +static void ViewDeepCopy_Rank8(benchmark::State& state) { + const int N1 = state.range(0); + + Kokkos::View a("A8", N1, N1, N1, N1, N1, N1, N1, N1); + Kokkos::View b("B8", N1, N1, N1, N1, N1, N1, N1, N1); + + deepcopy_view(a, b, state); +} + +template +static void ViewDeepCopy_Raw(benchmark::State& state) { + const int N8 = std::pow(state.range(0), 8); + + Kokkos::View a("A1", N8); + Kokkos::View b("B1", N8); + double* const a_ptr = a.data(); + const double* const b_ptr = b.data(); + + for (auto _ : state) { Kokkos::fence(); - time_raw = timer.seconds() / R; + Kokkos::Timer timer; + Kokkos::parallel_for( + N8, KOKKOS_LAMBDA(const int& i) { a_ptr[i] = b_ptr[i]; }); + Kokkos::fence(); + + report_results(state, a.size(), timer.seconds()); } -#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(" Rank8: %lf s %lf MB %lf GB/s\n", time8, size, - 2.0 * size / 1024 / time8); } } // namespace Test + +#endif diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_Raw.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_Raw.cpp new file mode 100644 index 0000000000..976f800487 --- /dev/null +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_Raw.cpp @@ -0,0 +1,43 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#include + +namespace Test { + +#if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) +BENCHMARK(ViewDeepCopy_Raw) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Raw) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Raw) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Raw) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); +#endif + +} // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a123.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a123.cpp index dceef801aa..3fc1c2480c 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a123.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a123.cpp @@ -1,51 +1,36 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_LeftLeft_Rank123) { - printf("DeepCopy Performance for LayoutLeft to LayoutLeft:\n"); - run_deepcopyview_tests123(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank1) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank2) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank3) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a45.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a45.cpp index 3f9b694461..542f5534be 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a45.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a45.cpp @@ -1,51 +1,31 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_LeftLeft_Rank45) { - printf("DeepCopy Performance for LayoutLeft to LayoutLeft:\n"); - run_deepcopyview_tests45(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank4) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank5) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a6.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a6.cpp index ac364c31cb..782628072d 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a6.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a6.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_LeftLeft_Rank6) { - printf("DeepCopy Performance for LayoutLeft to LayoutLeft:\n"); - run_deepcopyview_tests6(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank6) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a7.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a7.cpp index 94f30bac9f..000c8b401c 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a7.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a7.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_LeftLeft_Rank7) { - printf("DeepCopy Performance for LayoutLeft to LayoutLeft:\n"); - run_deepcopyview_tests7(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank7) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a8.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a8.cpp index b916169f1b..f7d7c6040a 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a8.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_a8.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_LeftLeft_Rank8) { - printf("DeepCopy Performance for LayoutLeft to LayoutLeft:\n"); - run_deepcopyview_tests8(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank8) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b123.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b123.cpp index f314cb0ff4..7820e89973 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b123.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b123.cpp @@ -1,51 +1,36 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_RightRight_Rank123) { - printf("DeepCopy Performance for LayoutRight to LayoutRight:\n"); - run_deepcopyview_tests123(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank1) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank2) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank3) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b45.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b45.cpp index 5d06f060af..58f58314b0 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b45.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b45.cpp @@ -1,51 +1,31 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_RightRight_Rank45) { - printf("DeepCopy Performance for LayoutRight to LayoutRight:\n"); - run_deepcopyview_tests45(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank4) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank5) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b6.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b6.cpp index 0e28fee631..920bf1222f 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b6.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b6.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_RightRight_Rank6) { - printf("DeepCopy Performance for LayoutRight to LayoutRight:\n"); - run_deepcopyview_tests6(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank6) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b7.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b7.cpp index 37e1325fc4..11b7a0d0d1 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b7.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b7.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_RightRight_Rank7) { - printf("DeepCopy Performance for LayoutRight to LayoutRight:\n"); - run_deepcopyview_tests7(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank7) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b8.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b8.cpp index 986c39aaf4..56a3d8d4c3 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b8.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_b8.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_RightRight_Rank8) { - printf("DeepCopy Performance for LayoutRight to LayoutRight:\n"); - run_deepcopyview_tests8(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank8) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c123.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c123.cpp index b98563ee42..375f7c8985 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c123.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c123.cpp @@ -1,51 +1,36 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_LeftRight_Rank123) { - printf("DeepCopy Performance for LayoutLeft to LayoutRight:\n"); - run_deepcopyview_tests123(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank1) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank2) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank3) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c45.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c45.cpp index a0ef11e09b..3625631617 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c45.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c45.cpp @@ -1,51 +1,31 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_LeftRight_Rank45) { - printf("DeepCopy Performance for LayoutLeft to LayoutRight:\n"); - run_deepcopyview_tests45(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank4) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank5) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c6.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c6.cpp index fea5dde73a..bcb70b6764 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c6.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c6.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_LeftRight_Rank6) { - printf("DeepCopy Performance for LayoutLeft to LayoutRight:\n"); - run_deepcopyview_tests6(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank6) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c7.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c7.cpp index a8c8d866f9..055d0e344c 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c7.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c7.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_LeftRight_Rank7) { - printf("DeepCopy Performance for LayoutLeft to LayoutRight:\n"); - run_deepcopyview_tests7(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank7) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c8.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c8.cpp index e5abdaa5d8..1e5342ef52 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c8.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_c8.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_LeftRight_Rank8) { - printf("DeepCopy Performance for LayoutLeft to LayoutRight:\n"); - run_deepcopyview_tests8(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank8) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d123.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d123.cpp index 2b58f8dd1f..d61e01f9f6 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d123.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d123.cpp @@ -1,51 +1,36 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_RightLeft_Rank123) { - printf("DeepCopy Performance for LayoutRight to LayoutLeft:\n"); - run_deepcopyview_tests123(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank1) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank2) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank3) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d45.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d45.cpp index fe34e4fd1a..385d5b48ae 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d45.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d45.cpp @@ -1,51 +1,31 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_RightLeft_Rank45) { - printf("DeepCopy Performance for LayoutRight to LayoutLeft:\n"); - run_deepcopyview_tests45(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank4) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + +BENCHMARK(ViewDeepCopy_Rank5) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d6.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d6.cpp index 115b223e68..0ae16012d6 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d6.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d6.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_RightLeft_Rank6) { - printf("DeepCopy Performance for LayoutRight to LayoutLeft:\n"); - run_deepcopyview_tests6(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank6) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d7.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d7.cpp index 51e88795e7..4ebbb6359b 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d7.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d7.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_RightLeft_Rank7) { - printf("DeepCopy Performance for LayoutRight to LayoutLeft:\n"); - run_deepcopyview_tests7(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank7) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d8.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d8.cpp index 2a53cdef21..3a888b6155 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d8.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewCopy_d8.cpp @@ -1,51 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 + namespace Test { -TEST(default_exec, ViewDeepCopy_RightLeft_Rank8) { - printf("DeepCopy Performance for LayoutRight to LayoutLeft:\n"); - run_deepcopyview_tests8(10, 1); -} + +BENCHMARK(ViewDeepCopy_Rank8) + ->ArgName("N") + ->Arg(10) + ->UseManualTime(); + } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewFill.hpp b/lib/kokkos/core/perf_test/PerfTest_ViewFill.hpp index 38be4bb212..7f76ed0ff7 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewFill.hpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewFill.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewFill_123.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewFill_123.cpp index 0bf8a28329..1e050e2311 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewFill_123.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewFill_123.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewFill_45.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewFill_45.cpp index 53ac509da8..2bf93b2048 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewFill_45.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewFill_45.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewFill_6.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewFill_6.cpp index f0a2e248f2..588a1e2293 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewFill_6.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewFill_6.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewFill_7.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewFill_7.cpp index 675d9e636f..fffeb951c9 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewFill_7.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewFill_7.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewFill_8.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewFill_8.cpp index 35e1e81c43..b2188af1a3 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewFill_8.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewFill_8.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewResize.hpp b/lib/kokkos/core/perf_test/PerfTest_ViewResize.hpp index 66a631e389..dfcd3f1347 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewResize.hpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewResize.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewResize_123.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewResize_123.cpp index 1dc4f285f5..ed2e58192c 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewResize_123.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewResize_123.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewResize_45.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewResize_45.cpp index 3754a5bb14..69028fab08 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewResize_45.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewResize_45.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewResize_6.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewResize_6.cpp index 1b8d6fbc8a..486b44a0c1 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewResize_6.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewResize_6.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewResize_7.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewResize_7.cpp index f8efa195fc..84c2a79ad6 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewResize_7.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewResize_7.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/perf_test/PerfTest_ViewResize_8.cpp b/lib/kokkos/core/perf_test/PerfTest_ViewResize_8.cpp index b0562f2fd1..25910fb575 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ViewResize_8.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ViewResize_8.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/perf_test/test_atomic.cpp b/lib/kokkos/core/perf_test/test_atomic.cpp index 54824e5b39..5f10afc45a 100644 --- a/lib/kokkos/core/perf_test/test_atomic.cpp +++ b/lib/kokkos/core/perf_test/test_atomic.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include @@ -73,7 +45,7 @@ void textcolor(int attr, int fg, int bg) { char command[40]; /* Command is the control command to the terminal */ - sprintf(command, "%c[%d;%d;%dm", 0x1B, attr, fg + 30, bg + 40); + snprintf(command, 40, "%c[%d;%d;%dm", 0x1B, attr, fg + 30, bg + 40); printf("%s", command); } void textcolor_standard() { textcolor(RESET, BLACK, WHITE); } diff --git a/lib/kokkos/core/perf_test/test_atomic_minmax_simple.cpp b/lib/kokkos/core/perf_test/test_atomic_minmax_simple.cpp index 4086ef5816..4c2ae5c2d1 100644 --- a/lib/kokkos/core/perf_test/test_atomic_minmax_simple.cpp +++ b/lib/kokkos/core/perf_test/test_atomic_minmax_simple.cpp @@ -1,3 +1,19 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + // export OMP_PROC_BIND=spread ; export OMP_PLACES=threads // c++ -O2 -g -DNDEBUG -fopenmp // ../core/perf_test/test_atomic_minmax_simple.cpp -I../core/src/ -I. -o diff --git a/lib/kokkos/core/perf_test/test_mempool.cpp b/lib/kokkos/core/perf_test/test_mempool.cpp index 7887d4ba55..e4e1b4c9a3 100644 --- a/lib/kokkos/core/perf_test/test_mempool.cpp +++ b/lib/kokkos/core/perf_test/test_mempool.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 #include diff --git a/lib/kokkos/core/perf_test/test_sharedSpace.cpp b/lib/kokkos/core/perf_test/test_sharedSpace.cpp new file mode 100644 index 0000000000..4f140c9409 --- /dev/null +++ b/lib/kokkos/core/perf_test/test_sharedSpace.cpp @@ -0,0 +1,311 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER +#include + +#if defined _WIN32 +#include +unsigned getBytesPerPage() { + SYSTEM_INFO si; + GetSystemInfo(&si); + return si.dwPageSize; +} +#else // unix/posix system +#include +unsigned getBytesPerPage() { return sysconf(_SC_PAGESIZE); } +#endif + +#include +#include +#include + +namespace { +void printTimings(std::ostream& out, std::vector const& tr, + size_t numBytes, + double threshold = (std::numeric_limits::max)()) { + out << "TimingResult contains " << tr.size() << " results:\n"; + for (auto it = tr.begin(); it != tr.end(); ++it) { + out << "Duration of loop " << it - tr.begin() << " is " << *it + << " seconds."; + if ((*it) > threshold) { + out << " Marked as page migation."; + } + out << " The transfer rate is " + << (double)numBytes / std::pow(1000.0, 3) / (*it) * + 2.0 // as we read and write + << " GB/s \n"; + } +} + +template +T computeMean(std::vector const& results) { + return std::accumulate(results.begin(), results.end(), T{}) / results.size(); +} + +template +class IncrementFunctor { + private: + using index_type = decltype(std::declval().size()); + ViewType view_; + + public: + IncrementFunctor() = delete; + + explicit IncrementFunctor(ViewType view) : view_(view) {} + + KOKKOS_INLINE_FUNCTION + void operator()(const index_type idx) const { ++view_(idx); } +}; + +// TIMING CAPTURED KERNEL +// PREMISE: This kernel should always be memory bound, as we are measuring +// memory access times. The compute load of an increment is small enough on +// current hardware but this could be different for new hardware. As we count +// the wall-clock time in the kernel, the core frequency of the device has to be +// at the maximum to guarantee accurate masurements. +template +std::vector incrementInLoop(ViewType& view, + unsigned int numRepetitions) { + using index_type = decltype(view.size()); + Kokkos::Timer timer; + std::vector results; + + Kokkos::fence(); + for (unsigned i = 0; i < numRepetitions; ++i) { + IncrementFunctor func(view); + timer.reset(); + Kokkos::parallel_for( + "increment", + Kokkos::RangePolicy>{ + 0, view.size()}, + func); + Kokkos::fence(); + results.push_back(timer.seconds()); + } + return results; +} + +size_t getDeviceMemorySize() { +#if defined KOKKOS_ENABLE_CUDA + return Kokkos::Cuda{}.cuda_device_prop().totalGlobalMem; +#elif defined KOKKOS_ENABLE_HIP + return Kokkos::HIP{}.hip_device_prop().totalGlobalMem; +#elif defined KOKKOS_ENABLE_SYCL + auto device = Kokkos::Experimental::SYCL{}.sycl_queue().get_device(); + return device.get_info(); +#else +#error \ + "The sharedMemory test is only defined for Kokkos::Cuda, Kokkos::HIP, and Kokkos::SYCL" + return 0; +#endif +} + +struct Arguments { + unsigned int numRepetitions = 10; + unsigned int numWarmupRepetitions = 100; + unsigned int numDeviceHostCycles = 3; + double fractionOfDeviceMemory = 0.4; + double threshold = 2.0; +}; + +void test_sharedSpace(Arguments args) { + const unsigned int numRepetitions = args.numRepetitions; + const unsigned int numWarmupRepetitions = args.numWarmupRepetitions; + const unsigned int numDeviceHostCycles = args.numDeviceHostCycles; + double fractionOfDeviceMemory = args.fractionOfDeviceMemory; + double threshold = args.threshold; + size_t numBytes = fractionOfDeviceMemory * getDeviceMemorySize(); + size_t numPages = numBytes / getBytesPerPage(); + + // ALLOCATION + Kokkos::View migratableData( + "migratableData", numPages * getBytesPerPage() / sizeof(int)); + Kokkos::View deviceData( + "deviceData", numPages * getBytesPerPage() / sizeof(int)); + Kokkos::View hostData( + "hostData", numPages * getBytesPerPage() / sizeof(int)); + Kokkos::fence(); + + // WARMUP GPU + incrementInLoop( + deviceData, + numWarmupRepetitions); // warming up gpu + + // GET DEVICE LOCAL TIMINGS + auto deviceLocalResults = incrementInLoop( + deviceData, numRepetitions); + + // WARMUP HOST + incrementInLoop( + hostData, + numWarmupRepetitions); // warming up host + // GET HOST LOCAL TIMINGS + auto hostLocalResults = incrementInLoop( + hostData, numRepetitions); + + // GET PAGE MIGRATING TIMINGS DATA + std::vector deviceResults{}; + std::vector hostResults{}; + for (unsigned i = 0; i < numDeviceHostCycles; ++i) { + // WARMUP GPU + incrementInLoop( + deviceData, + numWarmupRepetitions); // warming up gpu without touching the + // migratableData to get measurements of initial + // position + // GET RESULTS DEVICE + deviceResults.push_back(incrementInLoop( + migratableData, numRepetitions)); + + // WARMUP HOST + incrementInLoop( + hostData, + numWarmupRepetitions); // warming up host without touching the + // migratableData to get measurements of initial + // position + // GET RESULTS HOST + hostResults.push_back(incrementInLoop( + migratableData, numRepetitions)); + } + + // COMPUTE STATISTICS OF HOST AND DEVICE LOCAL KERNELS + auto hostLocalMean = computeMean(hostLocalResults); + auto deviceLocalMean = computeMean(deviceLocalResults); + + // ASSESS PAGE MIGRATIONS + bool initialPlacementOnDevice = false; + bool migratesOnEverySpaceAccess = true; + bool migratesOnlyOncePerAccess = true; + + for (unsigned cycle = 0; cycle < numDeviceHostCycles; ++cycle) { + unsigned int indicatedPageMigrationsDevice = std::count_if( + deviceResults[cycle].begin(), deviceResults[cycle].end(), + [&](auto const& val) { return val > (threshold * deviceLocalMean); }); + + if (cycle == 0 && indicatedPageMigrationsDevice == 0) + initialPlacementOnDevice = true; + else { + if (indicatedPageMigrationsDevice != 1) migratesOnlyOncePerAccess = false; + } + + unsigned int indicatedPageMigrationsHost = std::count_if( + hostResults[cycle].begin(), hostResults[cycle].end(), + [&](auto const& val) { return val > (threshold * hostLocalMean); }); + + if (indicatedPageMigrationsHost != 1) migratesOnlyOncePerAccess = false; + + if (cycle != 0 && indicatedPageMigrationsDevice != 1 && + indicatedPageMigrationsHost != 1) + migratesOnEverySpaceAccess = false; + } + + std::cout << "Page size as reported by os: " << getBytesPerPage() + << " bytes \n"; + std::cout << "Allocating " << numPages + << " pages of memory in pageMigratingMemorySpace.\n" + << "This corresponds to " << fractionOfDeviceMemory * 100 + << " % of the device memory.\n" + << "The view size is " << migratableData.size() << "\n"; + + std::cout << "Behavior found: \n"; + std::cout << "Initial placement on device is " << initialPlacementOnDevice + << "\n"; + std::cout << "Memory migrates on every space access is " + << migratesOnEverySpaceAccess << "\n"; + std::cout << "Memory migrates only once per access " + << migratesOnlyOncePerAccess << "\n\n"; + + std::cout << "Please look at the following timings. A migration was " + "marked detected if the time was larger than " + << threshold * hostLocalMean << " for the host and " + << threshold * deviceLocalMean << " for the device\n\n"; + + std::cout << "#############TIMINGS WITH SHAREDSPACE##################\n"; + + for (unsigned cycle = 0; cycle < numDeviceHostCycles; ++cycle) { + std::cout << "device timings of run " << cycle << ":\n"; + printTimings(std::cout, deviceResults[cycle], numBytes, + threshold * deviceLocalMean); + std::cout << "host timings of run " << cycle << ":\n"; + printTimings(std::cout, hostResults[cycle], numBytes, + threshold * hostLocalMean); + } + std::cout << "\n#############TIMINGS WITH LOCALSPACE##################\n"; + std::cout << "Device local memory timings for comparison:\n"; + printTimings(std::cout, deviceLocalResults, numBytes); + std::cout << "Host local memory timings for comparison:\n"; + printTimings(std::cout, hostLocalResults, numBytes); +} +} // namespace + +int main(int argc, char* argv[]) { + static const char help_flag[] = "--help"; + static const char numRepetitions_flag[] = "--numRepetitions="; + static const char numWarmupRepetitions_flag[] = "--numWarmupRepetitions="; + static const char numDeviceHostCycles_flag[] = "--numDeviceHostCycles="; + static const char fractionOfDeviceMemory_flag[] = "--fractionOfDeviceMemory="; + static const char threshold_flag[] = "--threshold="; + + int ask_help = 0; + Arguments args; + + for (int i = 1; i < argc; i++) { + const char* const a = argv[i]; + + if (!strncmp(a, help_flag, strlen(help_flag))) ask_help = 1; + + if (!strncmp(a, numRepetitions_flag, strlen(numRepetitions_flag))) + args.numRepetitions = std::stoi(a + strlen(numRepetitions_flag)); + + if (!strncmp(a, numWarmupRepetitions_flag, + strlen(numWarmupRepetitions_flag))) + args.numWarmupRepetitions = + std::stoi(a + strlen(numWarmupRepetitions_flag)); + + if (!strncmp(a, numDeviceHostCycles_flag, strlen(numDeviceHostCycles_flag))) + args.numDeviceHostCycles = + std::stoi(a + strlen(numDeviceHostCycles_flag)); + + if (!strncmp(a, fractionOfDeviceMemory_flag, + strlen(fractionOfDeviceMemory_flag))) + args.fractionOfDeviceMemory = + std::stod(a + strlen(fractionOfDeviceMemory_flag)); + + if (!strncmp(a, threshold_flag, strlen(threshold_flag))) + args.threshold = std::stod(a + strlen(threshold_flag)); + } + + if (ask_help) { + std::cout << "command line options:" + << " " << help_flag << " " << numRepetitions_flag << "##" + << " " << numWarmupRepetitions_flag << "##" + << " " << numDeviceHostCycles_flag << "##" + << " " << fractionOfDeviceMemory_flag << "##" + << " " << threshold_flag << "##" + << " any given Kokkos args are passed to Kokkos::initialize ##" + << std::endl; + return 0; + } + + Kokkos::initialize(argc, argv); + if constexpr (Kokkos::has_shared_space) + test_sharedSpace(args); + else + std::cout + << "The used Kokkos configuration does not support SharedSpace \n"; + Kokkos::finalize(); + + return 0; +} diff --git a/lib/kokkos/core/perf_test/test_taskdag.cpp b/lib/kokkos/core/perf_test/test_taskdag.cpp index 49957ae932..bbb48af6c4 100644 --- a/lib/kokkos/core/perf_test/test_taskdag.cpp +++ b/lib/kokkos/core/perf_test/test_taskdag.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 diff --git a/lib/kokkos/core/src/CMakeLists.txt b/lib/kokkos/core/src/CMakeLists.txt index 684ea353ae..862c0c47dd 100644 --- a/lib/kokkos/core/src/CMakeLists.txt +++ b/lib/kokkos/core/src/CMakeLists.txt @@ -4,12 +4,27 @@ KOKKOS_INCLUDE_DIRECTORIES( ${KOKKOS_TOP_BUILD_DIR} ) IF (Kokkos_ENABLE_IMPL_DESUL_ATOMICS AND NOT desul_FOUND) + IF(KOKKOS_ENABLE_CUDA) + SET(DESUL_ATOMICS_ENABLE_CUDA ON) + ENDIF() + IF(KOKKOS_ENABLE_HIP) + SET(DESUL_ATOMICS_ENABLE_HIP ON) + ENDIF() + IF(KOKKOS_ENABLE_SYCL) + SET(DESUL_ATOMICS_ENABLE_SYCL ON) + ENDIF() + IF(KOKKOS_ENABLE_OPENMPTARGET) + SET(DESUL_ATOMICS_ENABLE_OPENMP ON) # not a typo Kokkos OpenMPTarget -> Desul OpenMP + ENDIF() + CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/desul/Config.hpp.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/desul/atomics/Config.hpp + ) KOKKOS_INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/desul/include ) ENDIF() - INSTALL (DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" DESTINATION ${KOKKOS_HEADER_DIR} @@ -79,15 +94,18 @@ IF (Kokkos_ENABLE_IMPL_DESUL_ATOMICS AND NOT desul_FOUND) APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/desul/include/desul/*/*.hpp) APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/desul/include/desul/*/*/*.hpp) APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/desul/include/*/*/*.inc*) + APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/desul/*.hpp) INSTALL (DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/desul/include/desul" + "${CMAKE_CURRENT_BINARY_DIR}/desul" DESTINATION ${KOKKOS_HEADER_DIR} FILES_MATCHING PATTERN "*.inc" PATTERN "*.inc_*" PATTERN "*.hpp" ) + MESSAGE(STATUS "Using internal desul_atomics copy") ELSE() MESSAGE(STATUS "Using external desul_atomics install found at:") @@ -113,6 +131,42 @@ IF (Kokkos_ENABLE_IMPL_DESUL_ATOMICS AND NOT desul_FOUND) ) ENDIF() +IF (Kokkos_ENABLE_IMPL_MDSPAN) + MESSAGE(STATUS "Experimental mdspan support is enabled") + + # Some compilers now include mdspan... we just flag on their version + # for now until we can get some compiler detection support + include(CheckIncludeFileCXX) + check_include_file_cxx(experimental/mdspan KOKKOS_COMPILER_SUPPORTS_EXPERIMENTAL_MDSPAN) + check_include_file_cxx(mdspan KOKKOS_COMPILER_SUPPORTS_MDSPAN) + + if (Kokkos_ENABLE_MDSPAN_EXTERNAL) + MESSAGE(STATUS "Using external mdspan") + target_link_libraries(kokkoscore PUBLIC std::mdspan) + elseif(KOKKOS_COMPILER_SUPPORTS_MDSPAN AND NOT Kokkos_ENABLE_IMPL_SKIP_COMPILER_MDSPAN) + message(STATUS "Using compiler-supplied mdspan") + elseif(KOKKOS_COMPILER_SUPPORTS_EXPERIMENTAL_MDSPAN AND NOT Kokkos_ENABLE_IMPL_SKIP_COMPILER_MDSPAN) + message(STATUS "Using compiler-supplied experimental/mdspan") + else() + KOKKOS_LIB_INCLUDE_DIRECTORIES( + kokkoscore + ${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/mdspan/include + ) + + APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/mdspan/include/experimental/__p0009_bits/*.hpp) + APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/mdspan/include/experimental/mdspan) + + INSTALL (DIRECTORY + "${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/mdspan/include/" + DESTINATION ${KOKKOS_HEADER_DIR} + FILES_MATCHING + PATTERN "mdspan" + PATTERN "*.hpp" + ) + MESSAGE(STATUS "Using internal mdspan directory ${CMAKE_CURRENT_SOURCE_DIR}/../../tpls/mdspan/include") + endif() +ENDIF() + KOKKOS_LINK_TPL(kokkoscore PUBLIC HWLOC) KOKKOS_LINK_TPL(kokkoscore PUBLIC MEMKIND) IF (NOT KOKKOS_ENABLE_COMPILE_AS_CMAKE_LANGUAGE) @@ -125,14 +179,15 @@ KOKKOS_LINK_TPL(kokkoscore PUBLIC LIBRT) IF (NOT WIN32) KOKKOS_LINK_TPL(kokkoscore PUBLIC THREADS) ENDIF() -KOKKOS_LINK_TPL(kokkoscore PUBLIC ROCM) +IF (NOT KOKKOS_ENABLE_COMPILE_AS_CMAKE_LANGUAGE) + KOKKOS_LINK_TPL(kokkoscore PUBLIC ROCM) +ENDIF() # FIXME: We need a proper solution to figure out whether to enable # libatomic -# XL requires libatomic even for 64 bit CAS, most others only for 128 +# Most compilers only require libatomic for 128-bit CAS # I (CT) had removed 128bit CAS from desul to not need libatomic. -IF (Kokkos_ENABLE_IMPL_DESUL_ATOMICS AND - (KOKKOS_ENABLE_OPENMPTARGET OR (CMAKE_CXX_COMPILER_ID STREQUAL XLClang))) +IF (Kokkos_ENABLE_IMPL_DESUL_ATOMICS AND KOKKOS_ENABLE_OPENMPTARGET) target_link_libraries(kokkoscore PUBLIC atomic) ENDIF() @@ -140,4 +195,11 @@ IF (Kokkos_ENABLE_IMPL_DESUL_ATOMICS AND desul_FOUND) target_link_libraries(kokkoscore PUBLIC desul_atomics) ENDIF() +# FIXME_TRILINOS Trilinos doesn't allow for Kokkos to use find_dependency so we +# just append the flags in cmake/kokkos_tpls.cmake instead of linking with the +# OpenMP target. +IF(Kokkos_ENABLE_OPENMP AND NOT KOKKOS_HAS_TRILINOS) + target_link_libraries(kokkoscore PUBLIC OpenMP::OpenMP_CXX) +ENDIF() + KOKKOS_LINK_TPL(kokkoscore PUBLIC LIBQUADMATH) diff --git a/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp b/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp index b2161bc1fa..87b4c8c00c 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #define KOKKOS_IMPL_PUBLIC_INCLUDE @@ -122,40 +94,12 @@ void DeepCopyAsyncCuda(void *dst, const void *src, size_t n) { namespace Kokkos { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -KOKKOS_DEPRECATED void CudaSpace::access_error() { - const std::string msg( - "Kokkos::CudaSpace::access_error attempt to execute Cuda function from " - "non-Cuda space"); - Kokkos::Impl::throw_runtime_exception(msg); -} - -KOKKOS_DEPRECATED void CudaSpace::access_error(const void *const) { - const std::string msg( - "Kokkos::CudaSpace::access_error attempt to execute Cuda function from " - "non-Cuda space"); - Kokkos::Impl::throw_runtime_exception(msg); -} +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4 +bool CudaUVMSpace::available() { return true; } #endif /*--------------------------------------------------------------------------*/ -bool CudaUVMSpace::available() { -#if defined(CUDA_VERSION) && !defined(__APPLE__) - enum : bool { UVM_available = true }; -#else - enum : bool { UVM_available = false }; -#endif - return UVM_available; -} - -/*--------------------------------------------------------------------------*/ - -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -int CudaUVMSpace::number_of_allocations() { - return Kokkos::Impl::num_uvm_allocations.load(); -} -#endif #ifdef KOKKOS_IMPL_DEBUG_CUDA_PIN_UVM_TO_HOST // The purpose of the following variable is to allow a state-based choice // for pinning UVM allocations to the CPU. For now this is considered @@ -674,11 +618,7 @@ void cuda_prefetch_pointer(const Cuda &space, const void *ptr, size_t bytes, // DualView syncs down. Probably because the latency is not too bad in the // first place for the pull down. If we want to change that provde // cudaCpuDeviceId as the device if to_device is false -#if CUDA_VERSION < 10000 - bool is_managed = attr.isManaged; -#else bool is_managed = attr.type == cudaMemoryTypeManaged; -#endif if (to_device && is_managed && space.cuda_device_prop().concurrentManagedAccess) { KOKKOS_IMPL_CUDA_SAFE_CALL(cudaMemPrefetchAsync( diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp deleted file mode 100644 index e76133fae8..0000000000 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp +++ /dev/null @@ -1,153 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// 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 NTESS "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 NTESS 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_CUDA_ALLOCATION_TRACKING_HPP -#define KOKKOS_CUDA_ALLOCATION_TRACKING_HPP - -#include -#ifdef KOKKOS_ENABLE_CUDA - -#include - -namespace Kokkos { -namespace Impl { - -template -SharedAllocationRecord* shared_allocation_record( - Kokkos::CudaSpace const& arg_space, void* const arg_alloc_ptr, - DestructFunctor const& arg_destruct) { - SharedAllocationRecord* const record = - SharedAllocationRecord::get_record(arg_alloc_ptr); - - // assert: record != 0 - - // assert: sizeof(DestructFunctor) <= record->m_destruct_size - - // assert: record->m_destruct_function == 0 - - DestructFunctor* const functor = reinterpret_cast( - reinterpret_cast(record) + sizeof(SharedAllocationRecord)); - - new (functor) DestructFunctor(arg_destruct); - - record->m_destruct_functor = &shared_allocation_destroy; - - return record; -} - -/// class CudaUnmanagedAllocator -/// does nothing when deallocate(ptr,size) is called -struct CudaUnmanagedAllocator { - static const char* name() { return "Cuda Unmanaged Allocator"; } - - static void deallocate(void* /*ptr*/, size_t /*size*/) {} - - static bool support_texture_binding() { return true; } -}; - -/// class CudaUnmanagedAllocator -/// does nothing when deallocate(ptr,size) is called -struct CudaUnmanagedUVMAllocator { - static const char* name() { return "Cuda Unmanaged UVM Allocator"; } - - static void deallocate(void* /*ptr*/, size_t /*size*/) {} - - static bool support_texture_binding() { return true; } -}; - -/// class CudaUnmanagedHostAllocator -/// does nothing when deallocate(ptr,size) is called -class CudaUnmanagedHostAllocator { - public: - static const char* name() { return "Cuda Unmanaged Host Allocator"; } - // Unmanaged deallocate does nothing - static void deallocate(void* /*ptr*/, size_t /*size*/) {} -}; - -/// class CudaMallocAllocator -class CudaMallocAllocator { - public: - static const char* name() { return "Cuda Malloc Allocator"; } - - static void* allocate(size_t size); - - static void deallocate(void* ptr, size_t); - - static void* reallocate(void* old_ptr, size_t old_size, size_t new_size); - - static bool support_texture_binding() { return true; } -}; - -/// class CudaUVMAllocator -class CudaUVMAllocator { - public: - static const char* name() { return "Cuda UVM Allocator"; } - - static void* allocate(size_t size); - - static void deallocate(void* ptr, size_t); - - static void* reallocate(void* old_ptr, size_t old_size, size_t new_size); - - static bool support_texture_binding() { return true; } -}; - -/// class CudaHostAllocator -class CudaHostAllocator { - public: - static const char* name() { return "Cuda Host Allocator"; } - - static void* allocate(size_t size); - - static void deallocate(void* ptr, size_t); - - static void* reallocate(void* old_ptr, size_t old_size, size_t new_size); -}; - -} // namespace Impl -} // namespace Kokkos - -#endif // KOKKOS_ENABLE_CUDA - -#endif // #ifndef KOKKOS_CUDA_ALLOCATION_TRACKING_HPP diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Atomic_Intrinsics.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Atomic_Intrinsics.hpp index 8e8dff6776..cb196f6e8f 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Atomic_Intrinsics.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Atomic_Intrinsics.hpp @@ -32,40 +32,16 @@ LICENSE ASSOCIATED WITH SUBSEQUENT MODIFICATIONS // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2019) Sandia Corporation +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. // -// 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 NTESS "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 NTESS 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) +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // ************************************************************************ @HEADER diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Atomic_Intrinsics_Restore_Builtins.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Atomic_Intrinsics_Restore_Builtins.hpp index d7cd1bab13..a7dfc15d7a 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Atomic_Intrinsics_Restore_Builtins.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Atomic_Intrinsics_Restore_Builtins.hpp @@ -1,45 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2019) Sandia Corporation +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ #ifdef KOKKOS_SIMT_ATOMIC_BUILTIN_REPLACEMENTS_DEFINED diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_BlockSize_Deduction.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_BlockSize_Deduction.hpp index 70f5b70fc0..75c1686dc2 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_BlockSize_Deduction.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_BlockSize_Deduction.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_INTERNAL_HPP #define KOKKOS_CUDA_INTERNAL_HPP @@ -108,11 +80,9 @@ inline int cuda_max_active_blocks_per_sm(cudaDeviceProp const& properties, int const max_warps_per_sm_registers = cuda_max_warps_per_sm_registers(properties, attributes); - // Constrain the number of blocks to respect the maximum number of warps per - // SM On face value this should be an equality, but due to the warp - // granularity constraints noted in `cuda_max_warps_per_sm_registers` the - // left-hand-side of this comparison can overshoot what the hardware allows - // based on register counts alone + // Correct the number of blocks to respect the maximum number of warps per + // SM, which is constrained to be a multiple of the warp allocation + // granularity defined in `cuda_warp_per_sm_allocation_granularity`. while ((max_blocks_regs * block_size / properties.warpSize) > max_warps_per_sm_registers) max_blocks_regs--; @@ -259,17 +229,14 @@ int cuda_get_opt_block_size(const CudaInternal* cuda_instance, LaunchBounds{}); } +// Thin version of cuda_get_opt_block_size for cases where there is no shared +// memory template -int cuda_get_opt_block_size_no_shmem(const cudaFuncAttributes& attr, +int cuda_get_opt_block_size_no_shmem(const cudaDeviceProp& prop, + const cudaFuncAttributes& attr, LaunchBounds) { - auto const& prop = Kokkos::Cuda().cuda_device_prop(); - - // Thin version of cuda_get_opt_block_size for cases where there is no shared - // memory - auto const block_size_to_no_shmem = [&](int /*block_size*/) { return 0; }; - - return cuda_deduce_block_size(false, prop, attr, block_size_to_no_shmem, - LaunchBounds{}); + return cuda_deduce_block_size( + false, prop, attr, [](int /*block_size*/) { return 0; }, LaunchBounds{}); } } // namespace Impl diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp index e28e964d36..f68e05f780 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_ERROR_HPP #define KOKKOS_CUDA_ERROR_HPP @@ -100,21 +72,6 @@ inline void cuda_internal_safe_call(cudaError e, const char* name, #define KOKKOS_IMPL_CUDA_SAFE_CALL(call) \ Kokkos::Impl::cuda_internal_safe_call(call, #call, __FILE__, __LINE__) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - -KOKKOS_DEPRECATED -inline void cuda_internal_safe_call_deprecated(cudaError e, const char* name, - const char* file = nullptr, - const int line = 0) { - cuda_internal_safe_call(e, name, file, line); -} - -#define CUDA_SAFE_CALL(call) \ - Kokkos::Impl::cuda_internal_safe_call_deprecated(call, #call, __FILE__, \ - __LINE__) - -#endif - } // namespace Impl namespace Experimental { diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_GraphNodeKernel.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_GraphNodeKernel.hpp index d6fadd82c0..8e5d4a0706 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_GraphNodeKernel.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_GraphNodeKernel.hpp @@ -1,53 +1,25 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_KOKKOS_CUDA_GRAPHNODEKERNEL_IMPL_HPP #define KOKKOS_KOKKOS_CUDA_GRAPHNODEKERNEL_IMPL_HPP #include -#if defined(KOKKOS_ENABLE_CUDA) && defined(KOKKOS_CUDA_ENABLE_GRAPHS) +#if defined(KOKKOS_ENABLE_CUDA) #include @@ -154,14 +126,15 @@ template ::type> struct get_graph_node_kernel_type - : identity> {}; + : type_identity< + GraphNodeKernelImpl> {}; template struct get_graph_node_kernel_type - : identity> {}; + : type_identity> {}; //============================================================================== // {{{1 diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_GraphNode_Impl.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_GraphNode_Impl.hpp index f4539cd2ca..a586d30147 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_GraphNode_Impl.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_GraphNode_Impl.hpp @@ -1,53 +1,25 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_KOKKOS_CUDA_GRAPHNODE_IMPL_HPP #define KOKKOS_KOKKOS_CUDA_GRAPHNODE_IMPL_HPP #include -#if defined(KOKKOS_ENABLE_CUDA) && defined(KOKKOS_CUDA_ENABLE_GRAPHS) +#if defined(KOKKOS_ENABLE_CUDA) #include diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Graph_Impl.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Graph_Impl.hpp index bd514f5e88..26face64c9 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Graph_Impl.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Graph_Impl.hpp @@ -1,53 +1,25 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_KOKKOS_CUDA_GRAPH_IMPL_HPP #define KOKKOS_KOKKOS_CUDA_GRAPH_IMPL_HPP #include -#if defined(KOKKOS_ENABLE_CUDA) && defined(KOKKOS_CUDA_ENABLE_GRAPHS) +#if defined(KOKKOS_ENABLE_CUDA) #include diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Half_Conversion.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Half_Conversion.hpp index f25d7bd124..eaa6263c40 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Half_Conversion.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Half_Conversion.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_HALF_HPP_ #define KOKKOS_CUDA_HALF_HPP_ @@ -48,7 +20,7 @@ #ifdef KOKKOS_IMPL_CUDA_HALF_TYPE_DEFINED #include -#include // reduction_identity +#include #if CUDA_VERSION >= 11000 #include diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Half_Impl_Type.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Half_Impl_Type.hpp index e296a9239a..79d3322da2 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Half_Impl_Type.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Half_Impl_Type.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_HALF_IMPL_TYPE_HPP_ #define KOKKOS_CUDA_HALF_IMPL_TYPE_HPP_ diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.cpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.cpp index e22eb3b842..3dbe179d66 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ /*--------------------------------------------------------------------------*/ /* Kokkos interfaces */ @@ -202,7 +174,9 @@ void cuda_internal_error_abort(cudaError e, const char *name, const char *file, if (file) { out << " " << file << ":" << line; } - abort(out.str().c_str()); + // FIXME Call Kokkos::Impl::host_abort instead of Kokkos::abort to avoid a + // warning about Kokkos::abort returning in some cases. + host_abort(out.str().c_str()); } //---------------------------------------------------------------------------- @@ -291,12 +265,14 @@ const CudaInternalDevices &CudaInternalDevices::singleton() { } // namespace -unsigned long *CudaInternal::constantMemHostStaging = nullptr; -cudaEvent_t CudaInternal::constantMemReusable = nullptr; -std::mutex CudaInternal::constantMemMutex; - //---------------------------------------------------------------------------- +int Impl::CudaInternal::concurrency() { + static int const concurrency = m_deviceProp.maxThreadsPerMultiProcessor * + m_deviceProp.multiProcessorCount; + return concurrency; +} + void CudaInternal::print_configuration(std::ostream &s) const { const CudaInternalDevices &dev_info = CudaInternalDevices::singleton(); @@ -328,22 +304,13 @@ CudaInternal::~CudaInternal() { << std::endl; } - m_cudaDev = -1; - m_cudaArch = -1; - m_multiProcCount = 0; - m_maxWarpCount = 0; - m_maxBlock = {0, 0, 0}; - m_maxSharedWords = 0; - m_maxConcurrency = 0; - m_scratchSpaceCount = 0; - m_scratchFlagsCount = 0; - m_scratchUnifiedCount = 0; - m_scratchUnifiedSupported = 0; - m_streamCount = 0; - m_scratchSpace = nullptr; - m_scratchFlags = nullptr; - m_scratchUnified = nullptr; - m_stream = nullptr; + m_scratchSpaceCount = 0; + m_scratchFlagsCount = 0; + m_scratchUnifiedCount = 0; + m_scratchSpace = nullptr; + m_scratchFlags = nullptr; + m_scratchUnified = nullptr; + m_stream = nullptr; for (int i = 0; i < m_n_team_scratch; ++i) { m_team_scratch_current_size[i] = 0; m_team_scratch_ptr[i] = nullptr; @@ -370,15 +337,12 @@ void CudaInternal::fence() const { fence("Kokkos::CudaInternal::fence(): Unnamed Instance Fence"); } -void CudaInternal::initialize(int cuda_device_id, cudaStream_t stream, - bool manage_stream) { +void CudaInternal::initialize(cudaStream_t stream, bool manage_stream) { if (was_finalized) Kokkos::abort("Calling Cuda::initialize after Cuda::finalize is illegal\n"); was_initialized = true; if (is_initialized()) return; - enum { WordSize = sizeof(size_type) }; - #ifndef KOKKOS_IMPL_TURN_OFF_CUDA_HOST_INIT_CHECK if (!HostSpace::execution_space::impl_is_initialized()) { const std::string msg( @@ -388,107 +352,9 @@ void CudaInternal::initialize(int cuda_device_id, cudaStream_t stream, } #endif - const CudaInternalDevices &dev_info = CudaInternalDevices::singleton(); - const bool ok_init = nullptr == m_scratchSpace || nullptr == m_scratchFlags; - const bool ok_id = - 0 <= cuda_device_id && cuda_device_id < dev_info.m_cudaDevCount; - - // Need device capability 3.0 or better - - const bool ok_dev = - ok_id && (3 <= dev_info.m_cudaProp[cuda_device_id].major && - 0 <= dev_info.m_cudaProp[cuda_device_id].minor); - - if (ok_init && ok_dev) { - const struct cudaDeviceProp &cudaProp = dev_info.m_cudaProp[cuda_device_id]; - - m_cudaDev = cuda_device_id; - m_deviceProp = cudaProp; - - KOKKOS_IMPL_CUDA_SAFE_CALL(cudaSetDevice(m_cudaDev)); - Kokkos::Impl::cuda_device_synchronize( - "Kokkos::CudaInternal::initialize: Fence on space initialization"); - - // Query what compute capability architecture a kernel executes: - m_cudaArch = cuda_kernel_arch(); - - if (m_cudaArch == 0) { - std::stringstream ss; - ss << "Kokkos::Cuda::initialize ERROR: likely mismatch of architecture\n"; - std::string msg = ss.str(); - Kokkos::abort(msg.c_str()); - } - - int compiled_major = m_cudaArch / 100; - int compiled_minor = (m_cudaArch % 100) / 10; - - if (compiled_major != cudaProp.major || compiled_minor > cudaProp.minor) { - std::stringstream ss; - ss << "Kokkos::Cuda::initialize ERROR: running kernels compiled for " - "compute capability " - << compiled_major << "." << compiled_minor - << " on device with compute capability " << cudaProp.major << "." - << cudaProp.minor << " is not supported by CUDA!\n"; - std::string msg = ss.str(); - Kokkos::abort(msg.c_str()); - } - if (Kokkos::show_warnings() && (compiled_major != cudaProp.major || - compiled_minor != cudaProp.minor)) { - std::cerr << "Kokkos::Cuda::initialize WARNING: running kernels compiled " - "for compute capability " - << compiled_major << "." << compiled_minor - << " on device with compute capability " << cudaProp.major - << "." << cudaProp.minor - << " , this will likely reduce potential performance." - << std::endl; - } - - // number of multiprocessors - - m_multiProcCount = cudaProp.multiProcessorCount; - - //---------------------------------- - // Maximum number of warps, - // at most one warp per thread in a warp for reduction. - - m_maxWarpCount = cudaProp.maxThreadsPerBlock / Impl::CudaTraits::WarpSize; - - if (Impl::CudaTraits::WarpSize < m_maxWarpCount) { - m_maxWarpCount = Impl::CudaTraits::WarpSize; - } - - m_maxSharedWords = cudaProp.sharedMemPerBlock / WordSize; - - //---------------------------------- - // Maximum number of blocks: - - m_maxBlock[0] = cudaProp.maxGridSize[0]; - m_maxBlock[1] = cudaProp.maxGridSize[1]; - m_maxBlock[2] = cudaProp.maxGridSize[2]; - - m_shmemPerSM = cudaProp.sharedMemPerMultiprocessor; - m_maxShmemPerBlock = cudaProp.sharedMemPerBlock; - m_regsPerSM = cudaProp.regsPerMultiprocessor; - m_maxBlocksPerSM = - m_cudaArch < 500 - ? 16 - : (m_cudaArch < 750 ? 32 : (m_cudaArch == 750 ? 16 : 32)); - m_maxThreadsPerSM = cudaProp.maxThreadsPerMultiProcessor; - m_maxThreadsPerBlock = cudaProp.maxThreadsPerBlock; - - //---------------------------------- - - m_scratchUnifiedSupported = cudaProp.unifiedAddressing; - - if (Kokkos::show_warnings() && !m_scratchUnifiedSupported) { - std::cerr << "Kokkos::Cuda device " << cudaProp.name << " capability " - << cudaProp.major << "." << cudaProp.minor - << " does not support unified virtual address space" - << std::endl; - } - + if (ok_init) { //---------------------------------- // Multiblock reduction uses scratch flags for counters // and scratch space for partial reduction values. @@ -502,45 +368,10 @@ void CudaInternal::initialize(int cuda_device_id, cudaStream_t stream, (void)scratch_flags(reduce_block_count * 2 * sizeof(size_type)); (void)scratch_space(reduce_block_count * 16 * sizeof(size_type)); } - //---------------------------------- - // Concurrent bitset for obtaining unique tokens from within - // an executing kernel. - { - m_maxConcurrency = m_maxThreadsPerSM * cudaProp.multiProcessorCount; - - const int32_t buffer_bound = - Kokkos::Impl::concurrent_bitset::buffer_bound(m_maxConcurrency); - - // Allocate and initialize uint32_t[ buffer_bound ] - - using Record = - Kokkos::Impl::SharedAllocationRecord; - - Record *const r = - Record::allocate(Kokkos::CudaSpace(), "Kokkos::InternalScratchBitset", - sizeof(uint32_t) * buffer_bound); - - Record::increment(r); - } - //---------------------------------- - } else { std::ostringstream msg; - msg << "Kokkos::Cuda::initialize(" << cuda_device_id << ") FAILED"; - - if (!ok_init) { - msg << " : Already initialized"; - } - if (!ok_id) { - msg << " : Device identifier out of range " - << "[0.." << dev_info.m_cudaDevCount << "]"; - } else if (!ok_dev) { - msg << " : Device "; - msg << dev_info.m_cudaProp[cuda_device_id].major; - msg << "."; - msg << dev_info.m_cudaProp[cuda_device_id].minor; - msg << " has insufficient capability, required 3.0 or better"; - } + msg << "Kokkos::Cuda::initialize(" << m_cudaDev + << ") FAILED : Already initialized"; Kokkos::Impl::throw_runtime_exception(msg.str()); } @@ -570,11 +401,11 @@ Kokkos::Cuda::initialize WARNING: Cuda is allocating into UVMSpace by default #endif // Init the array for used for arbitrarily sized atomics - if (stream == nullptr) Impl::initialize_host_cuda_lock_arrays(); + if (this == &singleton()) Impl::initialize_host_cuda_lock_arrays(); // Allocate a staging buffer for constant mem in pinned host memory // and an event to avoid overwriting driver for previous kernel launches - if (stream == nullptr) { + if (this == &singleton()) { KOKKOS_IMPL_CUDA_SAFE_CALL( cudaMallocHost(reinterpret_cast(&constantMemHostStaging), CudaTraits::ConstantMemoryUsage)); @@ -590,9 +421,9 @@ Kokkos::Cuda::initialize WARNING: Cuda is allocating into UVMSpace by default } KOKKOS_IMPL_CUDA_SAFE_CALL( - cudaMalloc(&m_scratch_locks, sizeof(int32_t) * m_maxConcurrency)); + cudaMalloc(&m_scratch_locks, sizeof(int32_t) * concurrency())); KOKKOS_IMPL_CUDA_SAFE_CALL( - cudaMemset(m_scratch_locks, 0, sizeof(int32_t) * m_maxConcurrency)); + cudaMemset(m_scratch_locks, 0, sizeof(int32_t) * concurrency())); } //---------------------------------------------------------------------------- @@ -692,37 +523,44 @@ Cuda::size_type *CudaInternal::scratch_functor(const std::size_t size) const { return m_scratchFunctor; } -std::pair CudaInternal::resize_team_scratch_space( - std::int64_t bytes, bool force_shrink) { +int CudaInternal::acquire_team_scratch_space() { + int current_team_scratch = 0; + int zero = 0; + while (!m_team_scratch_pool[current_team_scratch].compare_exchange_weak( + zero, 1, std::memory_order_release, std::memory_order_relaxed)) { + current_team_scratch = (current_team_scratch + 1) % m_n_team_scratch; + } + + return current_team_scratch; +} + +void *CudaInternal::resize_team_scratch_space(int scratch_pool_id, + std::int64_t bytes, + bool force_shrink) { // Multiple ParallelFor/Reduce Teams can call this function at the same time // and invalidate the m_team_scratch_ptr. We use a pool to avoid any race // condition. - - int current_team_scratch = 0; - int zero = 0; - int one = 1; - while (!m_team_scratch_pool[current_team_scratch].compare_exchange_weak( - zero, one, std::memory_order_release, std::memory_order_relaxed)) { - current_team_scratch = (current_team_scratch + 1) % m_n_team_scratch; - } - if (m_team_scratch_current_size[current_team_scratch] == 0) { - m_team_scratch_current_size[current_team_scratch] = bytes; - m_team_scratch_ptr[current_team_scratch] = + if (m_team_scratch_current_size[scratch_pool_id] == 0) { + m_team_scratch_current_size[scratch_pool_id] = bytes; + m_team_scratch_ptr[scratch_pool_id] = Kokkos::kokkos_malloc( "Kokkos::CudaSpace::TeamScratchMemory", - m_team_scratch_current_size[current_team_scratch]); + m_team_scratch_current_size[scratch_pool_id]); } - if ((bytes > m_team_scratch_current_size[current_team_scratch]) || - ((bytes < m_team_scratch_current_size[current_team_scratch]) && + if ((bytes > m_team_scratch_current_size[scratch_pool_id]) || + ((bytes < m_team_scratch_current_size[scratch_pool_id]) && (force_shrink))) { - m_team_scratch_current_size[current_team_scratch] = bytes; - m_team_scratch_ptr[current_team_scratch] = + m_team_scratch_current_size[scratch_pool_id] = bytes; + m_team_scratch_ptr[scratch_pool_id] = Kokkos::kokkos_realloc( - m_team_scratch_ptr[current_team_scratch], - m_team_scratch_current_size[current_team_scratch]); + m_team_scratch_ptr[scratch_pool_id], + m_team_scratch_current_size[scratch_pool_id]); } - return std::make_pair(m_team_scratch_ptr[current_team_scratch], - current_team_scratch); + return m_team_scratch_ptr[scratch_pool_id]; +} + +void CudaInternal::release_team_scratch_space(int scratch_pool_id) { + m_team_scratch_pool[scratch_pool_id] = 0; } //---------------------------------------------------------------------------- @@ -767,15 +605,9 @@ void CudaInternal::finalize() { if (m_manage_stream && m_stream != nullptr) KOKKOS_IMPL_CUDA_SAFE_CALL(cudaStreamDestroy(m_stream)); - m_cudaDev = -1; - m_multiProcCount = 0; - m_maxWarpCount = 0; - m_maxBlock = {0, 0, 0}; - m_maxSharedWords = 0; m_scratchSpaceCount = 0; m_scratchFlagsCount = 0; m_scratchUnifiedCount = 0; - m_streamCount = 0; m_scratchSpace = nullptr; m_scratchFlags = nullptr; m_scratchUnified = nullptr; @@ -845,8 +677,12 @@ Cuda::size_type Cuda::detect_device_count() { return Impl::CudaInternalDevices::singleton().m_cudaDevCount; } +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4 int Cuda::concurrency() { - return Impl::CudaInternal::singleton().m_maxConcurrency; +#else +int Cuda::concurrency() const { +#endif + return Impl::CudaInternal::concurrency(); } int Cuda::impl_is_initialized() { @@ -854,15 +690,120 @@ int Cuda::impl_is_initialized() { } void Cuda::impl_initialize(InitializationSettings const &settings) { - Impl::CudaInternal::singleton().initialize(Impl::get_gpu(settings)); + const int cuda_device_id = Impl::get_gpu(settings); + const auto &dev_info = Impl::CudaInternalDevices::singleton(); - // In order to support setting an atexit hook for Kokkos::finalize - // We need to ensure that the Cuda deep_copy instance is not destroyed - // before that atexit hook is getting called. - // Thus we create the static instance here, so that it will be deallocated - // after the potential atexit call. - // This is neccessary since we will access that instance in Kokkos::finalize - (void)::Kokkos::Impl::cuda_get_deep_copy_space(true); + // Need device capability 3.0 or better + const bool ok_dev = 3 <= dev_info.m_cudaProp[cuda_device_id].major && + 0 <= dev_info.m_cudaProp[cuda_device_id].minor; + if (ok_dev) { + const struct cudaDeviceProp &cudaProp = dev_info.m_cudaProp[cuda_device_id]; + + Impl::CudaInternal::m_cudaDev = cuda_device_id; + Impl::CudaInternal::m_deviceProp = cudaProp; + + KOKKOS_IMPL_CUDA_SAFE_CALL(cudaSetDevice(cuda_device_id)); + Kokkos::Impl::cuda_device_synchronize( + "Kokkos::CudaInternal::initialize: Fence on space initialization"); + + // Query what compute capability architecture a kernel executes: + Impl::CudaInternal::m_cudaArch = Impl::cuda_kernel_arch(); + + if (Impl::CudaInternal::m_cudaArch == 0) { + std::stringstream ss; + ss << "Kokkos::Cuda::initialize ERROR: likely mismatch of architecture\n"; + std::string msg = ss.str(); + Kokkos::abort(msg.c_str()); + } + + int compiled_major = Impl::CudaInternal::m_cudaArch / 100; + int compiled_minor = (Impl::CudaInternal::m_cudaArch % 100) / 10; + + if ((compiled_major > cudaProp.major) || + ((compiled_major == cudaProp.major) && + (compiled_minor > cudaProp.minor))) { + std::stringstream ss; + ss << "Kokkos::Cuda::initialize ERROR: running kernels compiled for " + "compute capability " + << compiled_major << "." << compiled_minor + << " on device with compute capability " << cudaProp.major << "." + << cudaProp.minor << " is not supported by CUDA!\n"; + std::string msg = ss.str(); + Kokkos::abort(msg.c_str()); + } + if (Kokkos::show_warnings() && (compiled_major != cudaProp.major || + compiled_minor != cudaProp.minor)) { + std::cerr << "Kokkos::Cuda::initialize WARNING: running kernels compiled " + "for compute capability " + << compiled_major << "." << compiled_minor + << " on device with compute capability " << cudaProp.major + << "." << cudaProp.minor + << " , this will likely reduce potential performance." + << std::endl; + } + + // number of multiprocessors + Impl::CudaInternal::m_multiProcCount = cudaProp.multiProcessorCount; + + //---------------------------------- + // Maximum number of warps, + // at most one warp per thread in a warp for reduction. + Impl::CudaInternal::m_maxWarpCount = + cudaProp.maxThreadsPerBlock / Impl::CudaTraits::WarpSize; + + if (Impl::CudaTraits::WarpSize < Impl::CudaInternal::m_maxWarpCount) { + Impl::CudaInternal::m_maxWarpCount = Impl::CudaTraits::WarpSize; + } + + constexpr auto WordSize = sizeof(size_type); + Impl::CudaInternal::m_maxSharedWords = + cudaProp.sharedMemPerBlock / WordSize; + + //---------------------------------- + // Maximum number of blocks: + + Impl::CudaInternal::m_maxBlock[0] = cudaProp.maxGridSize[0]; + Impl::CudaInternal::m_maxBlock[1] = cudaProp.maxGridSize[1]; + Impl::CudaInternal::m_maxBlock[2] = cudaProp.maxGridSize[2]; + + Impl::CudaInternal::m_shmemPerSM = cudaProp.sharedMemPerMultiprocessor; + Impl::CudaInternal::m_maxShmemPerBlock = cudaProp.sharedMemPerBlock; + Impl::CudaInternal::m_maxBlocksPerSM = + Impl::CudaInternal::m_cudaArch < 500 + ? 16 + : (Impl::CudaInternal::m_cudaArch < 750 + ? 32 + : (Impl::CudaInternal::m_cudaArch == 750 ? 16 : 32)); + Impl::CudaInternal::m_maxThreadsPerSM = + cudaProp.maxThreadsPerMultiProcessor; + Impl::CudaInternal::m_maxThreadsPerBlock = cudaProp.maxThreadsPerBlock; + + //---------------------------------- + + Impl::CudaInternal::m_scratchUnifiedSupported = cudaProp.unifiedAddressing; + + if (Kokkos::show_warnings() && + !Impl::CudaInternal::m_scratchUnifiedSupported) { + std::cerr << "Kokkos::Cuda device " << cudaProp.name << " capability " + << cudaProp.major << "." << cudaProp.minor + << " does not support unified virtual address space" + << std::endl; + } + } else { + std::ostringstream msg; + msg << "Kokkos::Cuda::initialize(" << cuda_device_id << ") FAILED: Device "; + msg << dev_info.m_cudaProp[cuda_device_id].major; + msg << "."; + msg << dev_info.m_cudaProp[cuda_device_id].minor; + msg << " has insufficient capability, required 3.0 or better"; + Kokkos::Impl::throw_runtime_exception(msg.str()); + } + + cudaStream_t singleton_stream; + KOKKOS_IMPL_CUDA_SAFE_CALL(cudaStreamCreate(&singleton_stream)); + + auto &cuda_singleton = Impl::CudaInternal::singleton(); + cuda_singleton.initialize(singleton_stream, /*manage*/ true); } std::vector Cuda::detect_device_arch() { @@ -908,8 +849,7 @@ Cuda::Cuda(cudaStream_t stream, bool manage_stream) }) { Impl::CudaInternal::singleton().verify_is_initialized( "Cuda instance constructor"); - m_space_instance->initialize(Impl::CudaInternal::singleton().m_cudaDev, - stream, manage_stream); + m_space_instance->initialize(stream, manage_stream); } void Cuda::print_configuration(std::ostream &os, bool /*verbose*/) const { @@ -931,11 +871,9 @@ void Cuda::print_configuration(std::ostream &os, bool /*verbose*/) const { #else os << "no\n"; #endif +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4 os << " KOKKOS_ENABLE_CUDA_LDG_INTRINSIC: "; -#ifdef KOKKOS_ENABLE_CUDA_LDG_INTRINSIC os << "yes\n"; -#else - os << "no\n"; #endif os << " KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE: "; #ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE @@ -987,14 +925,6 @@ int g_cuda_space_factory_initialized = } // namespace Impl -#ifdef KOKKOS_ENABLE_CXX14 -namespace Tools { -namespace Experimental { -constexpr DeviceType DeviceTypeTraits::id; -} -} // namespace Tools -#endif - } // namespace Kokkos #else diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.hpp index 62b1f09cd5..af34a5b9db 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.hpp @@ -1,3 +1,19 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + #ifndef KOKKOS_CUDA_INSTANCE_HPP_ #define KOKKOS_CUDA_INSTANCE_HPP_ @@ -85,23 +101,22 @@ class CudaInternal { public: using size_type = Cuda::size_type; - int m_cudaDev; + inline static int m_cudaDev = -1; // Device Properties - int m_cudaArch; - unsigned m_multiProcCount; - unsigned m_maxWarpCount; - std::array m_maxBlock; - unsigned m_maxSharedWords; - uint32_t m_maxConcurrency; - int m_shmemPerSM; - int m_maxShmemPerBlock; - int m_regsPerSM; - int m_maxBlocksPerSM; - int m_maxThreadsPerSM; - int m_maxThreadsPerBlock; + inline static int m_cudaArch = -1; + inline static unsigned m_multiProcCount = 0; + inline static unsigned m_maxWarpCount = 0; + inline static std::array m_maxBlock = {0, 0, 0}; + inline static unsigned m_maxSharedWords = 0; + inline static int m_shmemPerSM = 0; + inline static int m_maxShmemPerBlock = 0; + inline static int m_maxBlocksPerSM = 0; + inline static int m_maxThreadsPerSM = 0; + inline static int m_maxThreadsPerBlock = 0; + static int concurrency(); - cudaDeviceProp m_deviceProp; + inline static cudaDeviceProp m_deviceProp; // Scratch Spaces for Reductions mutable std::size_t m_scratchSpaceCount; @@ -109,8 +124,7 @@ class CudaInternal { mutable std::size_t m_scratchUnifiedCount; mutable std::size_t m_scratchFunctorSize; - size_type m_scratchUnifiedSupported; - size_type m_streamCount; + inline static size_type m_scratchUnifiedSupported = 0; mutable size_type* m_scratchSpace; mutable size_type* m_scratchFlags; mutable size_type* m_scratchUnified; @@ -131,9 +145,9 @@ class CudaInternal { // FIXME_CUDA: these want to be per-device, not per-stream... use of 'static' // here will break once there are multiple devices though - static unsigned long* constantMemHostStaging; - static cudaEvent_t constantMemReusable; - static std::mutex constantMemMutex; + inline static unsigned long* constantMemHostStaging = nullptr; + inline static cudaEvent_t constantMemReusable = nullptr; + inline static std::mutex constantMemMutex; static CudaInternal& singleton(); @@ -143,8 +157,7 @@ class CudaInternal { return nullptr != m_scratchSpace && nullptr != m_scratchFlags; } - void initialize(int cuda_device_id, cudaStream_t stream = nullptr, - bool manage_stream = false); + void initialize(cudaStream_t stream, bool manage_stream); void finalize(); void print_configuration(std::ostream&) const; @@ -160,25 +173,10 @@ class CudaInternal { ~CudaInternal(); CudaInternal() - : m_cudaDev(-1), - m_cudaArch(-1), - m_multiProcCount(0), - m_maxWarpCount(0), - m_maxBlock({0, 0, 0}), - m_maxSharedWords(0), - m_maxConcurrency(0), - m_shmemPerSM(0), - m_maxShmemPerBlock(0), - m_regsPerSM(0), - m_maxBlocksPerSM(0), - m_maxThreadsPerSM(0), - m_maxThreadsPerBlock(0), - m_scratchSpaceCount(0), + : m_scratchSpaceCount(0), m_scratchFlagsCount(0), m_scratchUnifiedCount(0), m_scratchFunctorSize(0), - m_scratchUnifiedSupported(0), - m_streamCount(0), m_scratchSpace(nullptr), m_scratchFlags(nullptr), m_scratchUnified(nullptr), @@ -200,9 +198,11 @@ class CudaInternal { size_type* scratch_unified(const std::size_t size) const; size_type* scratch_functor(const std::size_t size) const; uint32_t impl_get_instance_id() const; + int acquire_team_scratch_space(); // Resizing of team level 1 scratch - std::pair resize_team_scratch_space(std::int64_t bytes, - bool force_shrink = false); + void* resize_team_scratch_space(int scratch_pool_id, std::int64_t bytes, + bool force_shrink = false); + void release_team_scratch_space(int scratch_pool_id); }; } // Namespace Impl @@ -225,11 +225,9 @@ inline void create_Cuda_instances(std::vector& instances) { template std::vector partition_space(const Cuda&, Args...) { -#ifdef __cpp_fold_expressions static_assert( (... && std::is_arithmetic_v), "Kokkos Error: partitioning arguments must be integers or floats"); -#endif std::vector instances(sizeof...(Args)); Impl::create_Cuda_instances(instances); return instances; diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_KernelLaunch.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_KernelLaunch.hpp index ba43e362bb..5afad7a6a3 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_KernelLaunch.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_KernelLaunch.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDAEXEC_HPP #define KOKKOS_CUDAEXEC_HPP @@ -154,7 +126,7 @@ inline void check_shmem_request(CudaInternal const* cuda_instance, int shmem) { } } -// These functions needs to be template on DriverType and LaunchBounds +// These functions need to be templated on DriverType and LaunchBounds // so that the static bool is unique for each type combo // KernelFuncPtr does not necessarily contain that type information. @@ -196,11 +168,9 @@ inline void configure_shmem_preference(const KernelFuncPtr& func, const size_t max_warps_per_sm_registers = cuda_max_warps_per_sm_registers(device_props, func_attr); - // Constrain the number of blocks to respect the maximum number of warps per - // SM On face value this should be an equality, but due to the warp - // granularity constraints noted in `cuda_max_warps_per_sm_registers` the - // left-hand-side of this comparison can overshoot what the hardware allows - // based on register counts alone + // Correct the number of blocks to respect the maximum number of warps per + // SM, which is constrained to be a multiple of the warp allocation + // granularity defined in `cuda_warp_per_sm_allocation_granularity`. while ((max_blocks_regs * block_size / device_props.warpSize) > max_warps_per_sm_registers) max_blocks_regs--; @@ -397,7 +367,6 @@ struct CudaParallelLaunchKernelInvoker< driver); } -#ifdef KOKKOS_CUDA_ENABLE_GRAPHS inline static void create_parallel_launch_graph_node( DriverType const& driver, dim3 const& grid, dim3 const& block, int shmem, CudaInternal const* cuda_instance) { @@ -410,18 +379,14 @@ struct CudaParallelLaunchKernelInvoker< if (!Impl::is_empty_launch(grid, block)) { Impl::check_shmem_request(cuda_instance, shmem); - if (DriverType::Policy:: + if constexpr (DriverType::Policy:: experimental_contains_desired_occupancy) { - /* int desired_occupancy = driver.get_policy().impl_get_desired_occupancy().value(); size_t block_size = block.x * block.y * block.z; Impl::configure_shmem_preference( base_t::get_kernel_func(), cuda_instance->m_deviceProp, block_size, - shmem, desired_occupancy);*/ - Kokkos::Impl::throw_runtime_exception( - std::string("Cuda graph node creation FAILED:" - " occupancy requests are currently broken.")); + shmem, desired_occupancy); } void const* args[] = {&driver}; @@ -447,7 +412,6 @@ struct CudaParallelLaunchKernelInvoker< } KOKKOS_ENSURES(bool(graph_node)) } -#endif }; // end local memory }}}2 @@ -502,7 +466,6 @@ struct CudaParallelLaunchKernelInvoker< driver_ptr); } -#ifdef KOKKOS_CUDA_ENABLE_GRAPHS inline static void create_parallel_launch_graph_node( DriverType const& driver, dim3 const& grid, dim3 const& block, int shmem, CudaInternal const* cuda_instance) { @@ -515,17 +478,14 @@ struct CudaParallelLaunchKernelInvoker< if (!Impl::is_empty_launch(grid, block)) { Impl::check_shmem_request(cuda_instance, shmem); - if (DriverType::Policy:: + if constexpr (DriverType::Policy:: experimental_contains_desired_occupancy) { - /*int desired_occupancy = + int desired_occupancy = driver.get_policy().impl_get_desired_occupancy().value(); size_t block_size = block.x * block.y * block.z; Impl::configure_shmem_preference( base_t::get_kernel_func(), cuda_instance->m_deviceProp, block_size, - shmem, desired_occupancy);*/ - Kokkos::Impl::throw_runtime_exception( - std::string("Cuda graph node creation FAILED:" - " occupancy requests are currently broken.")); + shmem, desired_occupancy); } auto* driver_ptr = Impl::allocate_driver_storage_for_kernel(driver); @@ -561,7 +521,6 @@ struct CudaParallelLaunchKernelInvoker< } KOKKOS_ENSURES(bool(graph_node)) } -#endif }; // end Global Memory }}}2 @@ -636,7 +595,6 @@ struct CudaParallelLaunchKernelInvoker< cudaStream_t(cuda_instance->m_stream))); } -#ifdef KOKKOS_CUDA_ENABLE_GRAPHS inline static void create_parallel_launch_graph_node( DriverType const& driver, dim3 const& grid, dim3 const& block, int shmem, CudaInternal const* cuda_instance) { @@ -655,7 +613,6 @@ struct CudaParallelLaunchKernelInvoker< global_launch_impl_t::create_parallel_launch_graph_node( driver, grid, block, shmem, cuda_instance); } -#endif }; // end Constant Memory }}}2 @@ -695,22 +652,19 @@ struct CudaParallelLaunchImpl< Impl::check_shmem_request(cuda_instance, shmem); - if (DriverType::Policy:: + if constexpr (DriverType::Policy:: experimental_contains_desired_occupancy) { - /*int desired_occupancy = + int desired_occupancy = driver.get_policy().impl_get_desired_occupancy().value(); size_t block_size = block.x * block.y * block.z; Impl::configure_shmem_preference< DriverType, Kokkos::LaunchBounds>( base_t::get_kernel_func(), cuda_instance->m_deviceProp, block_size, - shmem, desired_occupancy);*/ - Kokkos::Impl::throw_runtime_exception( - std::string("Cuda graph node creation FAILED:" - " occupancy requests are currently broken.")); + shmem, desired_occupancy); } - KOKKOS_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE(); + ensure_cuda_lock_arrays_on_device(); // Invoke the driver function on the device base_t::invoke_kernel(driver, grid, block, shmem, cuda_instance); @@ -739,11 +693,7 @@ struct CudaParallelLaunchImpl< template , Experimental::CudaLaunchMechanism LaunchMechanism = DeduceCudaLaunchMechanism::launch_mechanism, - bool DoGraph = DriverType::Policy::is_graph_kernel::value -#ifndef KOKKOS_CUDA_ENABLE_GRAPHS - && false -#endif - > + bool DoGraph = DriverType::Policy::is_graph_kernel::value> struct CudaParallelLaunch; // General launch mechanism @@ -760,7 +710,6 @@ struct CudaParallelLaunch @@ -774,7 +723,6 @@ struct CudaParallelLaunch end CudaParallelLaunch }}}1 //============================================================================== diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.cpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.cpp index 84d4307cfd..b18fda80f0 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #define KOKKOS_IMPL_PUBLIC_INCLUDE @@ -79,8 +51,7 @@ CudaLockArrays g_host_cuda_lock_arrays = {nullptr, 0}; void initialize_host_cuda_lock_arrays() { #ifdef KOKKOS_ENABLE_IMPL_DESUL_ATOMICS desul::Impl::init_lock_arrays(); - - DESUL_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE(); + desul::ensure_cuda_lock_arrays_on_device(); #endif if (g_host_cuda_lock_arrays.atomic != nullptr) return; KOKKOS_IMPL_CUDA_SAFE_CALL( @@ -88,8 +59,8 @@ void initialize_host_cuda_lock_arrays() { sizeof(int) * (CUDA_SPACE_ATOMIC_MASK + 1))); Impl::cuda_device_synchronize( "Kokkos::Impl::initialize_host_cuda_lock_arrays: Pre Init Lock Arrays"); - g_host_cuda_lock_arrays.n = Cuda::concurrency(); - KOKKOS_COPY_CUDA_LOCK_ARRAYS_TO_DEVICE(); + g_host_cuda_lock_arrays.n = CudaInternal::concurrency(); + copy_cuda_lock_arrays_to_device(); init_lock_array_kernel_atomic<<<(CUDA_SPACE_ATOMIC_MASK + 1 + 255) / 256, 256>>>(); Impl::cuda_device_synchronize( @@ -106,7 +77,7 @@ void finalize_host_cuda_lock_arrays() { g_host_cuda_lock_arrays.atomic = nullptr; g_host_cuda_lock_arrays.n = 0; #ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE - KOKKOS_COPY_CUDA_LOCK_ARRAYS_TO_DEVICE(); + copy_cuda_lock_arrays_to_device(); #endif } diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp index bdb7723985..3916ae2c53 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Locks.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_LOCKS_HPP #define KOKKOS_CUDA_LOCKS_HPP @@ -54,7 +26,7 @@ #include #ifdef KOKKOS_ENABLE_IMPL_DESUL_ATOMICS -#include +#include #endif namespace Kokkos { @@ -67,7 +39,7 @@ struct CudaLockArrays { /// \brief This global variable in Host space is the central definition /// of these arrays. -extern Kokkos::Impl::CudaLockArrays g_host_cuda_lock_arrays; +extern CudaLockArrays g_host_cuda_lock_arrays; /// \brief After this call, the g_host_cuda_lock_arrays variable has /// valid, initialized arrays. @@ -105,12 +77,12 @@ namespace Impl { /// instances in other translation units, we must update this CUDA global /// 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. +/// That is the purpose of the ensure_cuda_lock_arrays_on_device function. __device__ #ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE __constant__ extern #endif - Kokkos::Impl::CudaLockArrays g_device_cuda_lock_arrays; + CudaLockArrays g_device_cuda_lock_arrays; #define CUDA_SPACE_ATOMIC_MASK 0x1FFFF @@ -123,9 +95,7 @@ __device__ inline bool lock_address_cuda_space(void* ptr) { size_t offset = size_t(ptr); offset = offset >> 2; offset = offset & CUDA_SPACE_ATOMIC_MASK; - return ( - 0 == - atomicCAS(&Kokkos::Impl::g_device_cuda_lock_arrays.atomic[offset], 0, 1)); + return (0 == atomicCAS(&g_device_cuda_lock_arrays.atomic[offset], 0, 1)); } /// \brief Release lock for the address @@ -138,7 +108,7 @@ __device__ inline void unlock_address_cuda_space(void* ptr) { size_t offset = size_t(ptr); offset = offset >> 2; offset = offset & CUDA_SPACE_ATOMIC_MASK; - atomicExch(&Kokkos::Impl::g_device_cuda_lock_arrays.atomic[offset], 0); + atomicExch(&g_device_cuda_lock_arrays.atomic[offset], 0); } } // namespace Impl @@ -151,45 +121,49 @@ namespace { static int lock_array_copied = 0; inline int eliminate_warning_for_lock_array() { return lock_array_copied; } } // namespace -} // namespace Impl -} // namespace Kokkos -/* 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() \ - { \ - if (::Kokkos::Impl::lock_array_copied == 0) { \ - KOKKOS_IMPL_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 +inline +#else +inline static +#endif + void + copy_cuda_lock_arrays_to_device() { + if (lock_array_copied == 0) { + KOKKOS_IMPL_CUDA_SAFE_CALL(cudaMemcpyToSymbol(g_device_cuda_lock_arrays, + &g_host_cuda_lock_arrays, + sizeof(CudaLockArrays))); } + lock_array_copied = 1; +} #ifndef KOKKOS_ENABLE_IMPL_DESUL_ATOMICS #ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE -#define KOKKOS_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE() +inline void ensure_cuda_lock_arrays_on_device() {} #else -#define KOKKOS_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE() \ - KOKKOS_COPY_CUDA_LOCK_ARRAYS_TO_DEVICE() +inline static void ensure_cuda_lock_arrays_on_device() { + copy_cuda_lock_arrays_to_device(); +} #endif #else #ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE -#define KOKKOS_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE() +inline void ensure_cuda_lock_arrays_on_device() {} #else // Still Need COPY_CUDA_LOCK_ARRAYS for team scratch etc. -#define KOKKOS_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE() \ - KOKKOS_COPY_CUDA_LOCK_ARRAYS_TO_DEVICE() \ - DESUL_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE() +inline static void ensure_cuda_lock_arrays_on_device() { + copy_cuda_lock_arrays_to_device(); + desul::ensure_cuda_lock_arrays_on_device(); +} #endif #endif /* defined( KOKKOS_ENABLE_IMPL_DESUL_ATOMICS ) */ +} // namespace Impl +} // namespace Kokkos + #endif /* defined( KOKKOS_ENABLE_CUDA ) */ #endif /* #ifndef KOKKOS_CUDA_LOCKS_HPP */ diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_MDRangePolicy.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_MDRangePolicy.hpp index 12b7f70a97..7492ab49e5 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_MDRangePolicy.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_MDRangePolicy.hpp @@ -1,3 +1,19 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + #ifndef KOKKOS_CUDA_MDRANGEPOLICY_HPP_ #define KOKKOS_CUDA_MDRANGEPOLICY_HPP_ @@ -32,6 +48,11 @@ inline TileSizeProperties get_tile_size_properties( return properties; } +// Settings for TeamMDRangePolicy +template +struct ThreadAndVectorNestLevel + : AcceleratorBasedNestLevel {}; + } // Namespace Impl } // Namespace Kokkos #endif diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_MDRange.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_MDRange.hpp index 7e4f62f12e..0015d1ea14 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_MDRange.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_MDRange.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_PARALLEL_MD_RANGE_HPP #define KOKKOS_CUDA_PARALLEL_MD_RANGE_HPP @@ -77,7 +49,7 @@ int max_tile_size_product_helper(const Policy& pol, const LaunchBounds&) { // Limits due to registers/SM, MDRange doesn't have // shared memory constraints int const optimal_block_size = - Kokkos::Impl::cuda_get_opt_block_size_no_shmem(attr, LaunchBounds{}); + cuda_get_opt_block_size_no_shmem(prop, attr, LaunchBounds{}); // Compute how many blocks of this size we can launch, based on warp // constraints @@ -408,7 +380,7 @@ class ParallelReduce, ReducerType, CudaParallelLaunch( *this, grid, block, shmem, m_policy.space() - .impl_internal_space_instance()); // copy to device and execute + .impl_internal_space_instance()); // copy to device and execute if (!m_result_ptr_device_accessible) { if (m_result_ptr) { diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_Range.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_Range.hpp index d1031751c2..c5e89fc3da 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_Range.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_Range.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_PARALLEL_RANGE_HPP #define KOKKOS_CUDA_PARALLEL_RANGE_HPP @@ -325,9 +297,7 @@ class ParallelReduce, ReducerType, const bool need_device_set = Analysis::has_init_member_function || Analysis::has_final_member_function || !m_result_ptr_host_accessible || -#ifdef KOKKOS_CUDA_ENABLE_GRAPHS Policy::is_graph_kernel::value || -#endif !std::is_same::value; if ((nwork > 0) || need_device_set) { const int block_size = local_block_size(m_functor); @@ -375,7 +345,7 @@ class ParallelReduce, ReducerType, CudaParallelLaunch( *this, grid, block, shmem, m_policy.space() - .impl_internal_space_instance()); // copy to device and execute + .impl_internal_space_instance()); // copy to device and execute if (!m_result_ptr_device_accessible) { if (m_result_ptr) { @@ -726,7 +696,7 @@ class ParallelScan, Kokkos::Cuda> { CudaParallelLaunch( *this, grid, block, shmem, m_policy.space() - .impl_internal_space_instance()); // copy to device and execute + .impl_internal_space_instance()); // copy to device and execute #ifdef KOKKOS_IMPL_DEBUG_CUDA_SERIAL_EXECUTION } #endif @@ -734,7 +704,7 @@ class ParallelScan, Kokkos::Cuda> { CudaParallelLaunch( *this, grid, block, shmem, m_policy.space() - .impl_internal_space_instance()); // copy to device and execute + .impl_internal_space_instance()); // copy to device and execute } } @@ -802,7 +772,9 @@ class ParallelScanWithTotal, word_size_type* m_scratch_space; size_type* m_scratch_flags; size_type m_final; - ReturnType& m_returnvalue; + const pointer_type m_result_ptr; + const bool m_result_ptr_device_accessible; + #ifdef KOKKOS_IMPL_DEBUG_CUDA_SERIAL_EXECUTION bool m_run_serial; #endif @@ -943,6 +915,9 @@ class ParallelScanWithTotal, reinterpret_cast(shared_prefix)), true); } + if (iwork + 1 == m_policy.end() && m_policy.end() == range.end() && + m_result_ptr_device_accessible) + *m_result_ptr = *reinterpret_cast(shared_prefix); } } @@ -1031,17 +1006,15 @@ class ParallelScanWithTotal, if (m_run_serial) { block = dim3(1, 1, 1); grid = dim3(1, 1, 1); - } else { + } else #endif - + { m_final = false; CudaParallelLaunch( *this, grid, block, shmem, m_policy.space() - .impl_internal_space_instance()); // copy to device and execute -#ifdef KOKKOS_IMPL_DEBUG_CUDA_SERIAL_EXECUTION + .impl_internal_space_instance()); // copy to device and execute } -#endif m_final = true; CudaParallelLaunch( *this, grid, block, shmem, @@ -1055,21 +1028,29 @@ class ParallelScanWithTotal, m_scratch_space, size); else #endif - DeepCopy( - m_policy.space(), &m_returnvalue, - m_scratch_space + (grid_x - 1) * size / sizeof(word_size_type), - size); + { + if (!m_result_ptr_device_accessible) + DeepCopy( + m_policy.space(), m_result_ptr, + m_scratch_space + (grid_x - 1) * size / sizeof(word_size_type), + size); + } } } + template ParallelScanWithTotal(const FunctorType& arg_functor, - const Policy& arg_policy, ReturnType& arg_returnvalue) + const Policy& arg_policy, + const ViewType& arg_result_view) : m_functor(arg_functor), m_policy(arg_policy), m_scratch_space(nullptr), m_scratch_flags(nullptr), m_final(false), - m_returnvalue(arg_returnvalue) + m_result_ptr(arg_result_view.data()), + m_result_ptr_device_accessible( + MemorySpaceAccess::accessible) #ifdef KOKKOS_IMPL_DEBUG_CUDA_SERIAL_EXECUTION , m_run_serial(Kokkos::Impl::CudaInternal::cuda_use_serial_execution()) diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_Team.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_Team.hpp index ea9430b812..cdff86ccfc 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_Team.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel_Team.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_PARALLEL_TEAM_HPP #define KOKKOS_CUDA_PARALLEL_TEAM_HPP @@ -226,21 +198,25 @@ class TeamPolicyInternal } inline static int scratch_size_max(int level) { - return ( - level == 0 ? 1024 * 40 : // 48kB is the max for CUDA, but we need some - // for team_member.reduce etc. - 20 * 1024 * - 1024); // arbitrarily setting this to 20MB, for a Volta V100 - // that would give us about 3.2GB for 2 teams per SM + // Cuda Teams use (team_size + 2)*sizeof(double) shared memory for team + // reductions. They also use one int64_t in static shared memory for a + // shared ID. Furthermore, they use additional scratch memory in some + // reduction scenarios, which depend on the size of the value_type and is + // NOT captured here. + constexpr size_t max_possible_team_size = 1024; + constexpr size_t max_reserved_shared_mem_per_team = + (max_possible_team_size + 2) * sizeof(double) + sizeof(int64_t); + // arbitrarily setting level 1 scratch limit to 20MB, for a + // Volta V100 that would give us about 3.2GB for 2 teams per SM + constexpr size_t max_l1_scratch_size = 20 * 1024 * 1024; + + size_t max_shmem = Cuda().cuda_device_prop().sharedMemPerBlock; + return (level == 0 ? max_shmem - max_reserved_shared_mem_per_team + : max_l1_scratch_size); } //---------------------------------------- -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - KOKKOS_DEPRECATED inline int vector_length() const { - return impl_vector_length(); - } -#endif inline int impl_vector_length() const { return m_vector_length; } inline int team_size() const { return m_team_size; } inline int league_size() const { return m_league_size; } @@ -553,7 +529,7 @@ class ParallelFor, CudaParallelLaunch( *this, grid, block, shmem_size_total, m_policy.space() - .impl_internal_space_instance()); // copy to device and execute + .impl_internal_space_instance()); // copy to device and execute } ParallelFor(const FunctorType& arg_functor, const Policy& arg_policy) @@ -562,6 +538,8 @@ class ParallelFor, m_league_size(arg_policy.league_size()), m_team_size(arg_policy.team_size()), m_vector_size(arg_policy.impl_vector_length()) { + auto internal_space_instance = + m_policy.space().impl_internal_space_instance(); cudaFuncAttributes attr = CudaParallelLaunch::get_cuda_func_attributes(); @@ -569,8 +547,8 @@ class ParallelFor, m_team_size >= 0 ? m_team_size : Kokkos::Impl::cuda_get_opt_block_size( - m_policy.space().impl_internal_space_instance(), attr, - m_functor, m_vector_size, m_policy.team_scratch_size(0), + internal_space_instance, attr, m_functor, m_vector_size, + m_policy.team_scratch_size(0), m_policy.thread_scratch_size(0)) / m_vector_size; @@ -580,8 +558,7 @@ class ParallelFor, FunctorTeamShmemSize::value(m_functor, m_team_size)); m_scratch_size[0] = m_policy.scratch_size(0, m_team_size); m_scratch_size[1] = m_policy.scratch_size(1, m_team_size); - m_scratch_locks = - m_policy.space().impl_internal_space_instance()->m_scratch_locks; + m_scratch_locks = internal_space_instance->m_scratch_locks; // Functor's reduce memory, team scan memory, and team shared memory depend // upon team size. @@ -589,34 +566,28 @@ class ParallelFor, if (m_team_size <= 0) { m_scratch_ptr[1] = nullptr; } else { - auto scratch_ptr_id = - m_policy.space() - .impl_internal_space_instance() - ->resize_team_scratch_space( - static_cast(m_scratch_size[1]) * - (std::min( - static_cast(Cuda::concurrency() / - (m_team_size * m_vector_size)), - static_cast(m_league_size)))); - m_scratch_ptr[1] = scratch_ptr_id.first; - m_scratch_pool_id = scratch_ptr_id.second; + m_scratch_pool_id = internal_space_instance->acquire_team_scratch_space(); + m_scratch_ptr[1] = internal_space_instance->resize_team_scratch_space( + m_scratch_pool_id, + static_cast(m_scratch_size[1]) * + (std::min( + static_cast(Cuda().concurrency() / + (m_team_size * m_vector_size)), + static_cast(m_league_size)))); } const int shmem_size_total = m_shmem_begin + m_shmem_size; - if (m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock < - shmem_size_total) { - printf( - "%i %i\n", - m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock, - shmem_size_total); + if (internal_space_instance->m_maxShmemPerBlock < shmem_size_total) { + printf("%i %i\n", internal_space_instance->m_maxShmemPerBlock, + shmem_size_total); Kokkos::Impl::throw_runtime_exception(std::string( "Kokkos::Impl::ParallelFor< Cuda > insufficient shared memory")); } if (int(m_team_size) > int(Kokkos::Impl::cuda_get_max_block_size( - m_policy.space().impl_internal_space_instance(), attr, - arg_functor, arg_policy.impl_vector_length(), + internal_space_instance, attr, arg_functor, + arg_policy.impl_vector_length(), arg_policy.team_scratch_size(0), arg_policy.thread_scratch_size(0)) / arg_policy.impl_vector_length())) { @@ -629,7 +600,7 @@ class ParallelFor, if (m_scratch_pool_id >= 0) { m_policy.space() .impl_internal_space_instance() - ->m_team_scratch_pool[m_scratch_pool_id] = 0; + ->release_team_scratch_space(m_scratch_pool_id); } } }; @@ -844,9 +815,7 @@ class ParallelReduce, const bool need_device_set = Analysis::has_init_member_function || Analysis::has_final_member_function || !m_result_ptr_host_accessible || -#ifdef KOKKOS_CUDA_ENABLE_GRAPHS Policy::is_graph_kernel::value || -#endif !std::is_same::value; if (!is_empty_range || need_device_set) { const int block_count = std::max( @@ -879,7 +848,7 @@ class ParallelReduce, CudaParallelLaunch( *this, grid, block, shmem_size_total, m_policy.space() - .impl_internal_space_instance()); // copy to device and execute + .impl_internal_space_instance()); // copy to device and execute if (!m_result_ptr_device_accessible) { m_policy.space().fence( @@ -933,6 +902,8 @@ class ParallelReduce, m_league_size(arg_policy.league_size()), m_team_size(arg_policy.team_size()), m_vector_size(arg_policy.impl_vector_length()) { + auto internal_space_instance = + m_policy.space().impl_internal_space_instance(); cudaFuncAttributes attr = CudaParallelLaunch::get_cuda_func_attributes(); @@ -940,8 +911,8 @@ class ParallelReduce, m_team_size >= 0 ? m_team_size : Kokkos::Impl::cuda_get_opt_block_size( - m_policy.space().impl_internal_space_instance(), attr, - m_functor, m_vector_size, m_policy.team_scratch_size(0), + internal_space_instance, attr, m_functor, m_vector_size, + m_policy.team_scratch_size(0), m_policy.thread_scratch_size(0)) / m_vector_size; @@ -957,22 +928,18 @@ class ParallelReduce, FunctorTeamShmemSize::value(arg_functor, m_team_size); m_scratch_size[0] = m_shmem_size; m_scratch_size[1] = m_policy.scratch_size(1, m_team_size); - m_scratch_locks = - m_policy.space().impl_internal_space_instance()->m_scratch_locks; + m_scratch_locks = internal_space_instance->m_scratch_locks; if (m_team_size <= 0) { m_scratch_ptr[1] = nullptr; } else { - auto scratch_ptr_id = - m_policy.space() - .impl_internal_space_instance() - ->resize_team_scratch_space( - static_cast(m_scratch_size[1]) * - (std::min( - static_cast(Cuda::concurrency() / - (m_team_size * m_vector_size)), - static_cast(m_league_size)))); - m_scratch_ptr[1] = scratch_ptr_id.first; - m_scratch_pool_id = scratch_ptr_id.second; + m_scratch_pool_id = internal_space_instance->acquire_team_scratch_space(); + m_scratch_ptr[1] = internal_space_instance->resize_team_scratch_space( + m_scratch_pool_id, + static_cast(m_scratch_size[1]) * + (std::min( + static_cast(Cuda().concurrency() / + (m_team_size * m_vector_size)), + static_cast(m_league_size)))); } // The global parallel_reduce does not support vector_length other than 1 at @@ -1000,8 +967,7 @@ class ParallelReduce, std::string("Kokkos::Impl::ParallelReduce< Cuda > bad team size")); } - if (m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock < - shmem_size_total) { + if (internal_space_instance->m_maxShmemPerBlock < shmem_size_total) { Kokkos::Impl::throw_runtime_exception( std::string("Kokkos::Impl::ParallelReduce< Cuda > requested too much " "L0 scratch memory")); @@ -1039,6 +1005,8 @@ class ParallelReduce, m_league_size(arg_policy.league_size()), m_team_size(arg_policy.team_size()), m_vector_size(arg_policy.impl_vector_length()) { + auto internal_space_instance = + m_policy.space().impl_internal_space_instance(); cudaFuncAttributes attr = CudaParallelLaunch::get_cuda_func_attributes(); @@ -1048,8 +1016,8 @@ class ParallelReduce, m_team_size >= 0 ? m_team_size : Kokkos::Impl::cuda_get_opt_block_size( - m_policy.space().impl_internal_space_instance(), attr, - m_functor, m_vector_size, m_policy.team_scratch_size(0), + internal_space_instance, attr, m_functor, m_vector_size, + m_policy.team_scratch_size(0), m_policy.thread_scratch_size(0)) / m_vector_size; @@ -1065,22 +1033,18 @@ class ParallelReduce, FunctorTeamShmemSize::value(arg_functor, m_team_size); m_scratch_size[0] = m_shmem_size; m_scratch_size[1] = m_policy.scratch_size(1, m_team_size); - m_scratch_locks = - m_policy.space().impl_internal_space_instance()->m_scratch_locks; + m_scratch_locks = internal_space_instance->m_scratch_locks; if (m_team_size <= 0) { m_scratch_ptr[1] = nullptr; } else { - auto scratch_ptr_id = - m_policy.space() - .impl_internal_space_instance() - ->resize_team_scratch_space( - static_cast(m_scratch_size[1]) * - (std::min( - static_cast(Cuda::concurrency() / - (m_team_size * m_vector_size)), - static_cast(m_league_size)))); - m_scratch_ptr[1] = scratch_ptr_id.first; - m_scratch_pool_id = scratch_ptr_id.second; + m_scratch_pool_id = internal_space_instance->acquire_team_scratch_space(); + m_scratch_ptr[1] = internal_space_instance->resize_team_scratch_space( + m_scratch_pool_id, + static_cast(m_scratch_size[1]) * + (std::min( + static_cast(Cuda().concurrency() / + (m_team_size * m_vector_size)), + static_cast(m_league_size)))); } // The global parallel_reduce does not support vector_length other than 1 at @@ -1104,17 +1068,15 @@ class ParallelReduce, if ((!Kokkos::Impl::is_integral_power_of_two(m_team_size) && !UseShflReduction) || - m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock < - shmem_size_total) { + internal_space_instance->m_maxShmemPerBlock < shmem_size_total) { Kokkos::Impl::throw_runtime_exception( std::string("Kokkos::Impl::ParallelReduce< Cuda > bad team size")); } size_type team_size_max = Kokkos::Impl::cuda_get_max_block_size( - m_policy.space().impl_internal_space_instance(), attr, m_functor, - m_vector_size, m_policy.team_scratch_size(0), - m_policy.thread_scratch_size(0)) / + internal_space_instance, attr, m_functor, m_vector_size, + m_policy.team_scratch_size(0), m_policy.thread_scratch_size(0)) / m_vector_size; if ((int)m_team_size > (int)team_size_max) { @@ -1128,7 +1090,7 @@ class ParallelReduce, if (m_scratch_pool_id >= 0) { m_policy.space() .impl_internal_space_instance() - ->m_team_scratch_pool[m_scratch_pool_id] = 0; + ->release_team_scratch_space(m_scratch_pool_id); } } }; diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp index 178012431c..59fdd13513 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_REDUCESCAN_HPP #define KOKKOS_CUDA_REDUCESCAN_HPP @@ -90,31 +62,31 @@ template __device__ inline void cuda_inter_warp_reduction( ValueType& value, const ReducerType& reducer, const int max_active_thread = blockDim.y) { -#define STEP_WIDTH 4 - // Depending on the ValueType _shared__ memory must be aligned up to 8byte - // boundaries The reason not to use ValueType directly is that for types with + constexpr int step_width = 4; + // Depending on the ValueType, __shared__ memory must be aligned up to 8byte + // boundaries. The reason not to use ValueType directly is that for types with // constructors it could lead to race conditions alignas(alignof(ValueType) > alignof(double) ? alignof(ValueType) : alignof(double)) - __shared__ double sh_result[(sizeof(ValueType) + 7) / 8 * STEP_WIDTH]; + __shared__ double sh_result[(sizeof(ValueType) + 7) / 8 * step_width]; ValueType* result = (ValueType*)&sh_result; const int step = 32 / blockDim.x; - int shift = STEP_WIDTH; + int shift = step_width; const int id = threadIdx.y % step == 0 ? threadIdx.y / step : 65000; - if (id < STEP_WIDTH) { + if (id < step_width) { result[id] = value; } __syncthreads(); while (shift <= max_active_thread / step) { - if (shift <= id && shift + STEP_WIDTH > id && threadIdx.x == 0) { - reducer.join(&result[id % STEP_WIDTH], &value); + if (shift <= id && shift + step_width > id && threadIdx.x == 0) { + reducer.join(&result[id % step_width], &value); } __syncthreads(); - shift += STEP_WIDTH; + shift += step_width; } value = result[0]; - for (int i = 1; (i * step < max_active_thread) && i < STEP_WIDTH; i++) + for (int i = 1; (i * step < max_active_thread) && i < step_width; i++) reducer.join(&value, &result[i]); __syncthreads(); } diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp index 8f05448b17..e401c9f74b 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #define KOKKOS_IMPL_PUBLIC_INCLUDE diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp index 1f2e394f1e..76e4122af2 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_CUDA_TASK_HPP #define KOKKOS_IMPL_CUDA_TASK_HPP diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp index ffafc47f01..fc3f46bce6 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_TEAM_HPP #define KOKKOS_CUDA_TEAM_HPP @@ -101,6 +73,7 @@ class CudaTeamMember { public: using execution_space = Kokkos::Cuda; using scratch_memory_space = execution_space::scratch_memory_space; + using team_handle = CudaTeamMember; private: mutable void* m_team_reduce; diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp index 6da2cad011..1ade4c34b6 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_UNIQUE_TOKEN_HPP #define KOKKOS_CUDA_UNIQUE_TOKEN_HPP diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp index d3d881424c..a3f4f2f4cc 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_VECTORIZATION_HPP #define KOKKOS_CUDA_VECTORIZATION_HPP diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp index a175820825..a18661f2f2 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_EXPERIMENTAL_CUDA_VIEW_HPP #define KOKKOS_EXPERIMENTAL_CUDA_VIEW_HPP @@ -54,89 +26,12 @@ namespace Kokkos { namespace Impl { -// Cuda Texture fetches can be performed for 4, 8 and 16 byte objects -// (int,int2,int4) Via reinterpret_case this can be used to support all scalar -// types of those sizes. Any other scalar type falls back to either normal reads -// out of global memory, or using the __ldg intrinsic on Kepler GPUs or newer -// (Compute Capability >= 3.0) - -template -struct CudaTextureFetch { - ::cudaTextureObject_t m_obj; - const ValueType* m_ptr; - int m_offset; - - // Deference operator pulls through texture object and returns by value - template - KOKKOS_INLINE_FUNCTION ValueType operator[](const iType& i) const { - KOKKOS_IF_ON_DEVICE( - (AliasType v = tex1Dfetch(m_obj, i + m_offset); - return *(reinterpret_cast(&v));)) - KOKKOS_IF_ON_HOST((return m_ptr[i];)) - } - - // Pointer to referenced memory - KOKKOS_INLINE_FUNCTION - operator const ValueType*() const { return m_ptr; } - - KOKKOS_INLINE_FUNCTION - CudaTextureFetch() : m_obj(), m_ptr(), m_offset() {} - - KOKKOS_DEFAULTED_FUNCTION - ~CudaTextureFetch() = default; - - KOKKOS_INLINE_FUNCTION - CudaTextureFetch(const CudaTextureFetch& rhs) - : m_obj(rhs.m_obj), m_ptr(rhs.m_ptr), m_offset(rhs.m_offset) {} - - KOKKOS_INLINE_FUNCTION - CudaTextureFetch(CudaTextureFetch&& rhs) - : m_obj(rhs.m_obj), m_ptr(rhs.m_ptr), m_offset(rhs.m_offset) {} - - KOKKOS_INLINE_FUNCTION - CudaTextureFetch& operator=(const CudaTextureFetch& rhs) { - m_obj = rhs.m_obj; - m_ptr = rhs.m_ptr; - m_offset = rhs.m_offset; - return *this; - } - - KOKKOS_INLINE_FUNCTION - CudaTextureFetch& operator=(CudaTextureFetch&& rhs) { - m_obj = rhs.m_obj; - m_ptr = rhs.m_ptr; - m_offset = rhs.m_offset; - return *this; - } - - // Texture object spans the entire allocation. - // This handle may view a subset of the allocation, so an offset is required. - template - inline explicit CudaTextureFetch( - const ValueType* const arg_ptr, - Kokkos::Impl::SharedAllocationRecord* record) - : m_obj(record->template attach_texture_object()), - m_ptr(arg_ptr), - m_offset(record->attach_texture_object_offset( - reinterpret_cast(arg_ptr))) {} - - // Texture object spans the entire allocation. - // This handle may view a subset of the allocation, so an offset is required. - KOKKOS_INLINE_FUNCTION - CudaTextureFetch(const CudaTextureFetch& rhs, size_t offset) - : m_obj(rhs.m_obj), - m_ptr(rhs.m_ptr + offset), - m_offset(offset + rhs.m_offset) {} -}; - -#if defined(KOKKOS_ENABLE_CUDA_LDG_INTRINSIC) - template struct CudaLDGFetch { const ValueType* m_ptr; template - KOKKOS_INLINE_FUNCTION ValueType operator[](const iType& i) const { + KOKKOS_FUNCTION ValueType operator[](const iType& i) const { #if defined(KOKKOS_ARCH_KEPLER30) || defined(KOKKOS_ARCH_KEPLER32) return m_ptr[i]; #else @@ -147,46 +42,20 @@ struct CudaLDGFetch { #endif } - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION operator const ValueType*() const { return m_ptr; } - KOKKOS_INLINE_FUNCTION - CudaLDGFetch() : m_ptr() {} - KOKKOS_DEFAULTED_FUNCTION - ~CudaLDGFetch() = default; + CudaLDGFetch() = default; - KOKKOS_INLINE_FUNCTION - CudaLDGFetch(const CudaLDGFetch& rhs) : m_ptr(rhs.m_ptr) {} + KOKKOS_FUNCTION + explicit CudaLDGFetch(const ValueType* const arg_ptr) : m_ptr(arg_ptr) {} - KOKKOS_INLINE_FUNCTION - CudaLDGFetch(CudaLDGFetch&& rhs) : m_ptr(rhs.m_ptr) {} - - KOKKOS_INLINE_FUNCTION - CudaLDGFetch& operator=(const CudaLDGFetch& rhs) { - m_ptr = rhs.m_ptr; - return *this; - } - - KOKKOS_INLINE_FUNCTION - CudaLDGFetch& operator=(CudaLDGFetch&& rhs) { - m_ptr = rhs.m_ptr; - return *this; - } - - template - inline explicit CudaLDGFetch( - const ValueType* const arg_ptr, - Kokkos::Impl::SharedAllocationRecord*) - : m_ptr(arg_ptr) {} - - KOKKOS_INLINE_FUNCTION + KOKKOS_FUNCTION CudaLDGFetch(CudaLDGFetch const rhs, size_t offset) : m_ptr(rhs.m_ptr + offset) {} }; -#endif - } // namespace Impl } // namespace Kokkos @@ -196,7 +65,7 @@ struct CudaLDGFetch { namespace Kokkos { namespace Impl { -/** \brief Replace Default ViewDataHandle with Cuda texture fetch +/** \brief Replace Default ViewDataHandle with CudaLDGFetch * specialization if 'const' value type, CudaSpace and random access. */ template @@ -228,11 +97,7 @@ class ViewDataHandle< (sizeof(value_type) == 8), ::int2, std::conditional_t<(sizeof(value_type) == 16), ::int4, void>>>; -#if defined(KOKKOS_ENABLE_CUDA_LDG_INTRINSIC) using handle_type = Kokkos::Impl::CudaLDGFetch; -#else - using handle_type = Kokkos::Impl::CudaTextureFetch; -#endif KOKKOS_INLINE_FUNCTION static handle_type const& assign(handle_type const& arg_handle, @@ -248,48 +113,9 @@ class ViewDataHandle< KOKKOS_INLINE_FUNCTION static handle_type assign(value_type* arg_data_ptr, - track_type const& arg_tracker) { + track_type const& /*arg_tracker*/) { if (arg_data_ptr == nullptr) return handle_type(); - -#if !defined(KOKKOS_ENABLE_CUDA_LDG_INTRINSIC) - KOKKOS_IF_ON_HOST(( - // Assignment of texture = non-texture requires creation of a texture - // object which can only occur on the host. In addition, 'get_record' - // is only valid if called in a host execution space - - using memory_space = typename Traits::memory_space; - using record = - typename Impl::SharedAllocationRecord; - - record* const r = arg_tracker.template get_record(); - - if (0 == r) { - Kokkos::abort( - "Cuda const random access View using Cuda texture memory " - "requires " - "Kokkos to allocate the View's memory"); - } - - return handle_type(arg_data_ptr, r);)) -#else - KOKKOS_IF_ON_HOST(( - // Assignment of texture = non-texture requires creation of a texture - // object which can only occur on the host. In addition, 'get_record' - // is only valid if called in a host execution space - - using memory_space = typename Traits::memory_space; - using record = - typename Impl::SharedAllocationRecord; - - record* const r = arg_tracker.template get_record(); - - return handle_type(arg_data_ptr, r);)) -#endif - - KOKKOS_IF_ON_DEVICE( - ((void)arg_tracker; Kokkos::Impl::cuda_abort( - "Cannot create Cuda texture object from within a Cuda kernel"); - return handle_type();)) + return handle_type(arg_data_ptr); } }; diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp index a12378a891..d5d11f499a 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_WORKGRAPHPOLICY_HPP #define KOKKOS_CUDA_WORKGRAPHPOLICY_HPP @@ -79,7 +51,11 @@ class ParallelFor, Policy const& get_policy() const { return m_policy; } __device__ inline void operator()() const noexcept { - if (0 == (threadIdx.y % 16)) { + // The following makes most threads idle, + // which helps significantly with throughput due to reducing conflict rates + // on the work acquisition, updated based on perf experiments of the + // static Fibonacci experiment on Volta + if (0 == (threadIdx.y % 4)) { // Spin until COMPLETED_TOKEN. // END_TOKEN indicates no work is currently available. @@ -89,6 +65,12 @@ class ParallelFor, exec_one(w); m_policy.completed_work(w); } +// On pre-volta architectures we need a __syncwarp here to prevent +// infinite loops depending on the scheduling order above +#if defined(KOKKOS_ARCH_KEPLER) || defined(KOKKOS_ARCH_MAXWELL) || \ + defined(KOKKOS_ARCH_PASCAL) + __syncwarp(__activemask()); +#endif } } } diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp index c0daa274f8..c8d6641d1e 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CUDA_ABORT_HPP #define KOKKOS_CUDA_ABORT_HPP @@ -64,7 +36,6 @@ extern __device__ void __assertfail(const void *message, const void *file, namespace Kokkos { namespace Impl { -#if !defined(__APPLE__) // required to workaround failures in random number generator unit tests with // pre-volta architectures #if defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK) @@ -87,11 +58,6 @@ __device__ inline void cuda_abort(const char *const message) { ; #endif } -#else -__device__ inline void cuda_abort(const char *const message) { - // __assertfail is not supported on MAC -} -#endif } // namespace Impl } // namespace Kokkos diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP.cpp new file mode 100644 index 0000000000..766f815c72 --- /dev/null +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP.cpp @@ -0,0 +1,165 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_IMPL_PUBLIC_INCLUDE +#define KOKKOS_IMPL_PUBLIC_INCLUDE +#endif + +#include +#include +#include + +#include +#include + +#include + +namespace Kokkos { + +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4 +int HIP::concurrency() { +#else +int HIP::concurrency() const { +#endif + return Impl::HIPInternal::concurrency(); +} + +int HIP::impl_is_initialized() { + return Impl::HIPInternal::singleton().is_initialized(); +} + +void HIP::impl_initialize(InitializationSettings const& settings) { + const int hip_device_id = Impl::get_gpu(settings); + + Impl::HIPInternal::m_hipDev = hip_device_id; + KOKKOS_IMPL_HIP_SAFE_CALL( + hipGetDeviceProperties(&Impl::HIPInternal::m_deviceProp, hip_device_id)); + const auto& hipProp = Impl::HIPInternal::m_deviceProp; + KOKKOS_IMPL_HIP_SAFE_CALL(hipSetDevice(hip_device_id)); + + // number of multiprocessors + Impl::HIPInternal::m_multiProcCount = hipProp.multiProcessorCount; + + //---------------------------------- + // Maximum number of warps, + // at most one warp per thread in a warp for reduction. + Impl::HIPInternal::m_maxWarpCount = + hipProp.maxThreadsPerBlock / Impl::HIPTraits::WarpSize; + if (Impl::HIPTraits::WarpSize < Impl::HIPInternal::m_maxWarpCount) { + Impl::HIPInternal::m_maxWarpCount = Impl::HIPTraits::WarpSize; + } + int constexpr WordSize = sizeof(size_type); + Impl::HIPInternal::m_maxSharedWords = hipProp.sharedMemPerBlock / WordSize; + + //---------------------------------- + // Maximum number of blocks + Impl::HIPInternal::m_maxBlock[0] = hipProp.maxGridSize[0]; + Impl::HIPInternal::m_maxBlock[1] = hipProp.maxGridSize[1]; + Impl::HIPInternal::m_maxBlock[2] = hipProp.maxGridSize[2]; + + // theoretically, we can get 40 WF's / CU, but only can sustain 32 see + // https://github.com/ROCm-Developer-Tools/HIP/blob/a0b5dfd625d99af7e288629747b40dd057183173/vdi/hip_platform.cpp#L742 + Impl::HIPInternal::m_maxWavesPerCU = 32; + Impl::HIPInternal::m_shmemPerSM = hipProp.maxSharedMemoryPerMultiProcessor; + Impl::HIPInternal::m_maxShmemPerBlock = hipProp.sharedMemPerBlock; + Impl::HIPInternal::m_maxThreadsPerSM = + Impl::HIPInternal::m_maxWavesPerCU * Impl::HIPTraits::WarpSize; + + // Init the array for used for arbitrarily sized atomics + Impl::initialize_host_hip_lock_arrays(); + + // Allocate a staging buffer for constant mem in pinned host memory + // and an event to avoid overwriting driver for previous kernel launches + KOKKOS_IMPL_HIP_SAFE_CALL( + hipHostMalloc((void**)&Impl::HIPInternal::constantMemHostStaging, + Impl::HIPTraits::ConstantMemoryUsage)); + + KOKKOS_IMPL_HIP_SAFE_CALL( + hipEventCreate(&Impl::HIPInternal::constantMemReusable)); + + hipStream_t singleton_stream; + KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamCreate(&singleton_stream)); + Impl::HIPInternal::singleton().initialize(singleton_stream, /*manage*/ true); +} + +void HIP::impl_finalize() { Impl::HIPInternal::singleton().finalize(); } + +HIP::HIP() + : m_space_instance(&Impl::HIPInternal::singleton(), + [](Impl::HIPInternal*) {}) { + Impl::HIPInternal::singleton().verify_is_initialized( + "HIP instance constructor"); +} + +HIP::HIP(hipStream_t const stream, bool manage_stream) + : m_space_instance(new Impl::HIPInternal, [](Impl::HIPInternal* ptr) { + ptr->finalize(); + delete ptr; + }) { + Impl::HIPInternal::singleton().verify_is_initialized( + "HIP instance constructor"); + m_space_instance->initialize(stream, manage_stream); +} + +void HIP::print_configuration(std::ostream& os, bool /*verbose*/) const { + os << "Device Execution Space:\n"; + os << " KOKKOS_ENABLE_HIP: yes\n"; + + os << "HIP Options:\n"; + os << " KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE: "; +#ifdef KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE + os << "yes\n"; +#else + os << "no\n"; +#endif + + os << "\nRuntime Configuration:\n"; + + m_space_instance->print_configuration(os); +} + +uint32_t HIP::impl_instance_id() const noexcept { + return m_space_instance->impl_get_instance_id(); +} +void HIP::impl_static_fence(const std::string& name) { + Kokkos::Tools::Experimental::Impl::profile_fence_event( + name, + Kokkos::Tools::Experimental::SpecialSynchronizationCases:: + GlobalDeviceSynchronization, + [&]() { KOKKOS_IMPL_HIP_SAFE_CALL(hipDeviceSynchronize()); }); +} + +void HIP::fence(const std::string& name) const { + m_space_instance->fence(name); +} + +hipStream_t HIP::hip_stream() const { return m_space_instance->m_stream; } + +int HIP::hip_device() const { return impl_internal_space_instance()->m_hipDev; } + +hipDeviceProp_t const& HIP::hip_device_prop() { + return Impl::HIPInternal::singleton().m_deviceProp; +} + +const char* HIP::name() { return "HIP"; } + +namespace Impl { + +int g_hip_space_factory_initialized = initialize_space_factory("150_HIP"); + +} // namespace Impl + +} // namespace Kokkos diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP.hpp new file mode 100644 index 0000000000..d48be32280 --- /dev/null +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP.hpp @@ -0,0 +1,162 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_HIP_HPP +#define KOKKOS_HIP_HPP + +#include + +#include +#include + +#include + +namespace Kokkos { +namespace Impl { +class HIPInternal; +} +/// \class HIP +/// \brief Kokkos device for multicore processors in the host memory space. +class HIP { + public: + //------------------------------------ + //! \name Type declarations that all Kokkos devices must provide. + //@{ + + //! Tag this class as a kokkos execution space + using execution_space = HIP; + using memory_space = HIPSpace; + using device_type = Kokkos::Device; + + using array_layout = LayoutLeft; + using size_type = HIPSpace::size_type; + + using scratch_memory_space = ScratchMemorySpace; + + HIP(); + HIP(hipStream_t stream, bool manage_stream = false); + + //@} + //------------------------------------ + //! \name Functions that all Kokkos devices must implement. + //@{ + + KOKKOS_INLINE_FUNCTION static int in_parallel() { +#if defined(__HIP_DEVICE_COMPILE__) + return true; +#else + return false; +#endif + } + + /** \brief Wait until all dispatched functors complete. + * + * The parallel_for or parallel_reduce dispatch of a functor may return + * asynchronously, before the functor completes. This method does not return + * until all dispatched functors on this device have completed. + */ + static void impl_static_fence(const std::string& name); + + void fence(const std::string& name = + "Kokkos::HIP::fence(): Unnamed Instance Fence") const; + + hipStream_t hip_stream() const; + + /// \brief Print configuration information to the given output stream. + void print_configuration(std::ostream& os, bool verbose = false) const; + + /// \brief Free any resources being consumed by the device. + static void impl_finalize(); + + /** \brief Initialize the device. + * + */ + int hip_device() const; + static hipDeviceProp_t const& hip_device_prop(); + + static void impl_initialize(InitializationSettings const&); + + static int impl_is_initialized(); + + // static size_type device_arch(); + + static size_type detect_device_count(); + +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4 + static int concurrency(); +#else + int concurrency() const; +#endif + static const char* name(); + + inline Impl::HIPInternal* impl_internal_space_instance() const { + return m_space_instance.get(); + } + + uint32_t impl_instance_id() const noexcept; + + private: + friend bool operator==(HIP const& lhs, HIP const& rhs) { + return lhs.impl_internal_space_instance() == + rhs.impl_internal_space_instance(); + } + friend bool operator!=(HIP const& lhs, HIP const& rhs) { + return !(lhs == rhs); + } + Kokkos::Impl::HostSharedPtr m_space_instance; +}; + +namespace Impl { +template <> +struct MemorySpaceAccess { + enum : bool { assignable = false }; + enum : bool { accessible = true }; + enum : bool { deepcopy = false }; +}; +} // namespace Impl + +namespace Tools { +namespace Experimental { +template <> +struct DeviceTypeTraits { + static constexpr DeviceType id = DeviceType::HIP; + static int device_id(const HIP& exec) { return exec.hip_device(); } +}; +} // namespace Experimental +} // namespace Tools + +namespace Impl { +template +struct ZeroMemset { + ZeroMemset(const HIP& exec_space, const View& dst, + typename View::const_value_type&) { + KOKKOS_IMPL_HIP_SAFE_CALL(hipMemsetAsync( + dst.data(), 0, + dst.size() * sizeof(typename View::value_type), + exec_space.hip_stream())); + } + + ZeroMemset(const View& dst, + typename View::const_value_type&) { + KOKKOS_IMPL_HIP_SAFE_CALL( + hipMemset(dst.data(), 0, + dst.size() * sizeof(typename View::value_type))); + } +}; +} // namespace Impl +} // namespace Kokkos + +#endif diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Abort.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Abort.hpp index dcc5863721..fdf688fdad 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Abort.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Abort.hpp @@ -1,67 +1,26 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_ABORT_HPP #define KOKKOS_HIP_ABORT_HPP #include -#if defined(KOKKOS_ENABLE_HIP) #include -// FIXME_HIP ROCm 4.5 version header include would be -#if __has_include() -#include -#define KOKKOS_IMPL_ROCM_VERSION \ - ROCM_VERSION_MAJOR * 10000 + ROCM_VERSION_MINOR * 100 + ROCM_VERSION_PATCH -#endif - -// FIXME_HIP workaround for ROCm version less than 5.0.2 -#if KOKKOS_IMPL_ROCM_VERSION < 50002 -#define KOKKOS_IMPL_HIP_ABORT_DOES_NOT_PRINT_MESSAGE -#endif - namespace Kokkos { namespace Impl { @@ -82,4 +41,3 @@ namespace Impl { } // namespace Kokkos #endif -#endif diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Atomic.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Atomic.hpp index 88bcab6264..49f89ed332 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Atomic.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Atomic.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_ATOMIC_HPP #define KOKKOS_HIP_ATOMIC_HPP diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_BlockSize_Deduction.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_BlockSize_Deduction.hpp index 87551ae508..1f084c41e5 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_BlockSize_Deduction.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_BlockSize_Deduction.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_BLOCKSIZE_DEDUCTION_HPP #define KOKKOS_HIP_BLOCKSIZE_DEDUCTION_HPP @@ -54,7 +26,6 @@ #include namespace Kokkos { -namespace Experimental { namespace Impl { enum class BlockType { Max, Preferred }; @@ -63,9 +34,8 @@ template , HIPLaunchMechanism LaunchMechanism = DeduceHIPLaunchMechanism::launch_mechanism> unsigned get_preferred_blocksize_impl() { - // FIXME_HIP - could be if constexpr for c++17 - if (!HIPParallelLaunch::default_launchbounds()) { + if constexpr (!HIPParallelLaunch::default_launchbounds()) { // use the user specified value return LaunchBounds::maxTperB; } else { @@ -77,14 +47,12 @@ unsigned get_preferred_blocksize_impl() { } } -// FIXME_HIP - entire function could be constexpr for c++17 template , HIPLaunchMechanism LaunchMechanism = DeduceHIPLaunchMechanism::launch_mechanism> -unsigned get_max_blocksize_impl() { - // FIXME_HIP - could be if constexpr for c++17 - if (!HIPParallelLaunch::default_launchbounds()) { +constexpr unsigned get_max_blocksize_impl() { + if constexpr (!HIPParallelLaunch::default_launchbounds()) { // use the user specified value return LaunchBounds::maxTperB; } else { @@ -105,15 +73,13 @@ hipFuncAttributes get_hip_func_attributes_impl() { return HIPParallelLaunch::get_hip_func_attributes(); #else - // FIXME_HIP - could be if constexpr for c++17 - if (!HIPParallelLaunch::default_launchbounds()) { + if constexpr (!HIPParallelLaunch::default_launchbounds()) { // for user defined, we *always* honor the request return HIPParallelLaunch::get_hip_func_attributes(); } else { - // FIXME_HIP - could be if constexpr for c++17 - if (BlockSize == BlockType::Max) { + if constexpr (BlockSize == BlockType::Max) { return HIPParallelLaunch< DriverType, Kokkos::LaunchBounds, LaunchMechanism>::get_hip_func_attributes(); @@ -154,8 +120,7 @@ unsigned hip_internal_get_block_size(const HIPInternal *hip_instance, // find how many threads we can fit with this blocksize based on LDS usage unsigned tperb_shmem = total_shmem > shmem_per_sm ? 0 : block_size; - // FIXME_HIP - could be if constexpr for c++17 - if (BlockSize == BlockType::Max) { + if constexpr (BlockSize == BlockType::Max) { // we want the maximum blocksize possible // just wait until we get a case where we can fit the LDS per SM if (tperb_shmem) return block_size; @@ -296,7 +261,6 @@ unsigned hip_get_max_team_blocksize(HIPInternal const *hip_instance, } } // namespace Impl -} // namespace Experimental } // namespace Kokkos #endif diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_DeepCopy.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_DeepCopy.cpp new file mode 100644 index 0000000000..d1f3d95adf --- /dev/null +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_DeepCopy.cpp @@ -0,0 +1,58 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_IMPL_PUBLIC_INCLUDE +#define KOKKOS_IMPL_PUBLIC_INCLUDE +#endif + +#include +#include // HIP_SAFE_CALL +#include + +namespace Kokkos { +namespace Impl { +namespace { +hipStream_t get_deep_copy_stream() { + static hipStream_t s = nullptr; + if (s == nullptr) { + KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamCreate(&s)); + } + return s; +} +} // namespace + +void DeepCopyHIP(void* dst, void const* src, size_t n) { + KOKKOS_IMPL_HIP_SAFE_CALL(hipMemcpyAsync(dst, src, n, hipMemcpyDefault)); +} + +void DeepCopyAsyncHIP(const HIP& instance, void* dst, void const* src, + size_t n) { + KOKKOS_IMPL_HIP_SAFE_CALL( + hipMemcpyAsync(dst, src, n, hipMemcpyDefault, instance.hip_stream())); +} + +void DeepCopyAsyncHIP(void* dst, void const* src, size_t n) { + hipStream_t s = get_deep_copy_stream(); + KOKKOS_IMPL_HIP_SAFE_CALL(hipMemcpyAsync(dst, src, n, hipMemcpyDefault, s)); + Kokkos::Tools::Experimental::Impl::profile_fence_event( + "Kokkos::Impl::DeepCopyAsyncHIP: Post Deep Copy Fence on Deep-Copy " + "stream", + Kokkos::Tools::Experimental::SpecialSynchronizationCases:: + DeepCopyResourceSynchronization, + [&]() { KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamSynchronize(s)); }); +} +} // namespace Impl +} // namespace Kokkos diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_DeepCopy.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_DeepCopy.hpp new file mode 100644 index 0000000000..206ce4bb67 --- /dev/null +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_DeepCopy.hpp @@ -0,0 +1,134 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_HIP_DEEP_COPY_HPP +#define KOKKOS_HIP_DEEP_COPY_HPP + +#include +#include // HIP_SAFE_CALL + +#include + +namespace Kokkos { +namespace Impl { + +void DeepCopyHIP(void* dst, const void* src, size_t n); +void DeepCopyAsyncHIP(const HIP& instance, void* dst, const void* src, + size_t n); +void DeepCopyAsyncHIP(void* dst, const void* src, size_t n); + +template +struct DeepCopy::value>> { + DeepCopy(void* dst, const void* src, size_t n) { DeepCopyHIP(dst, src, n); } + DeepCopy(const HIP& instance, void* dst, const void* src, size_t n) { + DeepCopyAsyncHIP(instance, dst, src, n); + } +}; + +template +struct DeepCopy::value>> { + DeepCopy(void* dst, const void* src, size_t n) { DeepCopyHIP(dst, src, n); } + DeepCopy(const HIP& instance, void* dst, const void* src, size_t n) { + DeepCopyAsyncHIP(instance, dst, src, n); + } +}; + +template +struct DeepCopy::value && + is_hip_type_space::value>> { + DeepCopy(void* dst, const void* src, size_t n) { DeepCopyHIP(dst, src, n); } + DeepCopy(const HIP& instance, void* dst, const void* src, size_t n) { + DeepCopyAsyncHIP(instance, dst, src, n); + } +}; + +template +struct DeepCopy::value && + is_hip_type_space::value && + !std::is_same::value>> { + inline DeepCopy(void* dst, const void* src, size_t n) { + DeepCopyHIP(dst, src, n); + } + + inline DeepCopy(const ExecutionSpace& exec, void* dst, const void* src, + size_t n) { + exec.fence(fence_string()); + DeepCopyAsyncHIP(dst, src, n); + } + + private: + static const std::string& fence_string() { + static const std::string string = + std::string("Kokkos::Impl::DeepCopy<") + MemSpace1::name() + "Space, " + + MemSpace2::name() + + "Space, ExecutionSpace>::DeepCopy: fence before copy"; + return string; + } +}; + +template +struct DeepCopy::value && + !std::is_same::value>> { + inline DeepCopy(void* dst, const void* src, size_t n) { + DeepCopyHIP(dst, src, n); + } + + inline DeepCopy(const ExecutionSpace& exec, void* dst, const void* src, + size_t n) { + exec.fence(fence_string()); + DeepCopyAsyncHIP(dst, src, n); + } + + private: + static const std::string& fence_string() { + static const std::string string = + std::string("Kokkos::Impl::DeepCopy<") + MemSpace::name() + + "Space, HostSpace, ExecutionSpace>::DeepCopy: fence before copy"; + return string; + } +}; + +template +struct DeepCopy::value && + !std::is_same::value>> { + inline DeepCopy(void* dst, const void* src, size_t n) { + DeepCopyHIP(dst, src, n); + } + + inline DeepCopy(const ExecutionSpace& exec, void* dst, const void* src, + size_t n) { + exec.fence(fence_string()); + DeepCopyAsyncHIP(dst, src, n); + } + + private: + static const std::string& fence_string() { + static const std::string string = + std::string("Kokkos::Impl::DeepCopy::DeepCopy: fence before copy"; + return string; + } +}; +} // namespace Impl +} // namespace Kokkos + +#endif diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Error.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Error.hpp index a75e7a4a6c..e09382c705 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Error.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Error.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_ERROR_HPP #define KOKKOS_HIP_ERROR_HPP @@ -66,30 +38,12 @@ inline void hip_internal_safe_call(hipError_t e, const char* name, } } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - -KOKKOS_DEPRECATED -inline void hip_internal_safe_call_deprecated(hipError_t e, const char* name, - const char* file = nullptr, - const int line = 0) { - hip_internal_safe_call(e, name, file, line); -} - -#endif - } // namespace Impl } // namespace Kokkos #define KOKKOS_IMPL_HIP_SAFE_CALL(call) \ Kokkos::Impl::hip_internal_safe_call(call, #call, __FILE__, __LINE__) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -#define HIP_SAFE_CALL(call) \ - Kokkos::Impl::hip_internal_safe_call_deprecated(call, #call, __FILE__, \ - __LINE__) - -#endif - namespace Kokkos { namespace Experimental { diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Half_Conversion.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Half_Conversion.hpp index d04fe2051a..fa0373a87e 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Half_Conversion.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Half_Conversion.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_HALF_HPP_ #define KOKKOS_HIP_HALF_HPP_ @@ -48,7 +20,7 @@ #ifdef KOKKOS_IMPL_HALF_TYPE_DEFINED #include -#include // reduction_identity +#include namespace Kokkos { namespace Experimental { diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Half_Impl_Type.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Half_Impl_Type.hpp index 728a229c1a..64c7706f94 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Half_Impl_Type.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Half_Impl_Type.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_HALF_IMPL_TYPE_HPP_ #define KOKKOS_HIP_HALF_IMPL_TYPE_HPP_ diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.cpp index 3785cfe80b..28c9c1cb6a 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ /*--------------------------------------------------------------------------*/ /* Kokkos interfaces */ @@ -52,8 +24,8 @@ #include #include -#include -#include +#include +#include #include /*--------------------------------------------------------------------------*/ @@ -68,71 +40,37 @@ #ifdef KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE __device__ __constant__ unsigned long kokkos_impl_hip_constant_memory_buffer - [Kokkos::Experimental::Impl::HIPTraits::ConstantMemoryUsage / - sizeof(unsigned long)]; + [Kokkos::Impl::HIPTraits::ConstantMemoryUsage / sizeof(unsigned long)]; #endif namespace Kokkos { namespace Impl { -Kokkos::View -hip_global_unique_token_locks(bool deallocate) { - static Kokkos::View locks = - Kokkos::View(); +Kokkos::View hip_global_unique_token_locks( + bool deallocate) { + static Kokkos::View locks = + Kokkos::View(); if (!deallocate && locks.extent(0) == 0) - locks = Kokkos::View( - "Kokkos::UniqueToken::m_locks", - Kokkos::Experimental::HIP().concurrency()); - if (deallocate) - locks = Kokkos::View(); + locks = Kokkos::View( + "Kokkos::UniqueToken::m_locks", HIPInternal::concurrency()); + if (deallocate) locks = Kokkos::View(); return locks; } } // namespace Impl } // namespace Kokkos namespace Kokkos { -namespace Experimental { -namespace { -class HIPInternalDevices { - public: - enum { MAXIMUM_DEVICE_COUNT = 64 }; - struct hipDeviceProp_t m_hipProp[MAXIMUM_DEVICE_COUNT]; - int m_hipDevCount; - - HIPInternalDevices(); - - static HIPInternalDevices const &singleton(); -}; - -HIPInternalDevices::HIPInternalDevices() { - KOKKOS_IMPL_HIP_SAFE_CALL(hipGetDeviceCount(&m_hipDevCount)); - - if (m_hipDevCount > MAXIMUM_DEVICE_COUNT) { - Kokkos::abort( - "Sorry, you have more GPUs per node than we thought anybody would ever " - "have. Please report this to github.com/kokkos/kokkos."); - } - for (int i = 0; i < m_hipDevCount; ++i) { - KOKKOS_IMPL_HIP_SAFE_CALL(hipGetDeviceProperties(m_hipProp + i, i)); - } -} - -const HIPInternalDevices &HIPInternalDevices::singleton() { - static HIPInternalDevices self; - return self; -} -} // namespace - -unsigned long *Impl::HIPInternal::constantMemHostStaging = nullptr; -hipEvent_t Impl::HIPInternal::constantMemReusable = nullptr; -std::mutex Impl::HIPInternal::constantMemMutex; namespace Impl { //---------------------------------------------------------------------------- -void HIPInternal::print_configuration(std::ostream &s) const { - const HIPInternalDevices &dev_info = HIPInternalDevices::singleton(); +int HIPInternal::concurrency() { + static int const concurrency = m_deviceProp.maxThreadsPerMultiProcessor * + m_deviceProp.multiProcessorCount; + return concurrency; +} +void HIPInternal::print_configuration(std::ostream &s) const { s << "macro KOKKOS_ENABLE_HIP : defined" << '\n'; #if defined(HIP_VERSION) s << "macro HIP_VERSION = " << HIP_VERSION << " = version " @@ -140,15 +78,18 @@ void HIPInternal::print_configuration(std::ostream &s) const { << '\n'; #endif - for (int i = 0; i < dev_info.m_hipDevCount; ++i) { - s << "Kokkos::Experimental::HIP[ " << i << " ] " - << dev_info.m_hipProp[i].name << " version " - << (dev_info.m_hipProp[i].major) << "." << dev_info.m_hipProp[i].minor - << ", Total Global Memory: " - << ::Kokkos::Impl::human_memory_size(dev_info.m_hipProp[i].totalGlobalMem) + int hipDevCount; + KOKKOS_IMPL_HIP_SAFE_CALL(hipGetDeviceCount(&hipDevCount)); + + for (int i = 0; i < hipDevCount; ++i) { + hipDeviceProp_t hipProp; + KOKKOS_IMPL_HIP_SAFE_CALL(hipGetDeviceProperties(&hipProp, i)); + + s << "Kokkos::HIP[ " << i << " ] " + << "gcnArch " << hipProp.gcnArch << ", Total Global Memory: " + << ::Kokkos::Impl::human_memory_size(hipProp.totalGlobalMem) << ", Shared Memory per Block: " - << ::Kokkos::Impl::human_memory_size( - dev_info.m_hipProp[i].sharedMemPerBlock); + << ::Kokkos::Impl::human_memory_size(hipProp.sharedMemPerBlock); if (m_hipDev == i) s << " : Selected"; s << '\n'; } @@ -158,18 +99,12 @@ void HIPInternal::print_configuration(std::ostream &s) const { HIPInternal::~HIPInternal() { if (m_scratchSpace || m_scratchFlags) { - std::cerr << "Kokkos::Experimental::HIP ERROR: Failed to call " - "Kokkos::Experimental::HIP::finalize()" + std::cerr << "Kokkos::HIP ERROR: Failed to call " + "Kokkos::HIP::finalize()" << std::endl; std::cerr.flush(); } - m_hipDev = -1; - m_hipArch = -1; - m_multiProcCount = 0; - m_maxWarpCount = 0; - m_maxSharedWords = 0; - m_maxShmemPerBlock = 0; m_scratchSpaceCount = 0; m_scratchFlagsCount = 0; m_scratchSpace = nullptr; @@ -179,7 +114,7 @@ HIPInternal::~HIPInternal() { int HIPInternal::verify_is_initialized(const char *const label) const { if (m_hipDev < 0) { - Kokkos::abort((std::string("Kokkos::Experimental::HIP::") + label + + Kokkos::abort((std::string("Kokkos::HIP::") + label + " : ERROR device not initialized\n") .c_str()); } @@ -201,27 +136,19 @@ void HIPInternal::fence() const { fence("Kokkos::HIPInternal::fence: Unnamed Internal Fence"); } void HIPInternal::fence(const std::string &name) const { - Kokkos::Tools::Experimental::Impl::profile_fence_event< - Kokkos::Experimental::HIP>( + Kokkos::Tools::Experimental::Impl::profile_fence_event( name, Kokkos::Tools::Experimental::Impl::DirectFenceIDHandle{ impl_get_instance_id()}, - [&]() { - KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamSynchronize(m_stream)); - // can reset our cycle id now as well - m_cycleId = 0; - }); + [&]() { KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamSynchronize(m_stream)); }); } -void HIPInternal::initialize(int hip_device_id, hipStream_t stream, - bool manage_stream) { +void HIPInternal::initialize(hipStream_t stream, bool manage_stream) { if (was_finalized) Kokkos::abort("Calling HIP::initialize after HIP::finalize is illegal\n"); if (is_initialized()) return; - int constexpr WordSize = sizeof(size_type); - if (!HostSpace::execution_space::impl_is_initialized()) { const std::string msg( "HIP::initialize ERROR : HostSpace::execution_space " @@ -229,59 +156,12 @@ void HIPInternal::initialize(int hip_device_id, hipStream_t stream, Kokkos::Impl::throw_runtime_exception(msg); } - const HIPInternalDevices &dev_info = HIPInternalDevices::singleton(); - const bool ok_init = nullptr == m_scratchSpace || nullptr == m_scratchFlags; - // Need at least a GPU device - const bool ok_id = - 0 <= hip_device_id && hip_device_id < dev_info.m_hipDevCount; + if (ok_init) { + m_stream = stream; + m_manage_stream = manage_stream; - if (ok_init && ok_id) { - const struct hipDeviceProp_t &hipProp = dev_info.m_hipProp[hip_device_id]; - - m_hipDev = hip_device_id; - m_deviceProp = hipProp; - - KOKKOS_IMPL_HIP_SAFE_CALL(hipSetDevice(m_hipDev)); - - m_stream = stream; - m_manage_stream = manage_stream; - m_team_scratch_current_size = 0; - m_team_scratch_ptr = nullptr; - - // number of multiprocessors - m_multiProcCount = hipProp.multiProcessorCount; - - //---------------------------------- - // Maximum number of warps, - // at most one warp per thread in a warp for reduction. - m_maxWarpCount = hipProp.maxThreadsPerBlock / Impl::HIPTraits::WarpSize; - if (HIPTraits::WarpSize < m_maxWarpCount) { - m_maxWarpCount = Impl::HIPTraits::WarpSize; - } - m_maxSharedWords = hipProp.sharedMemPerBlock / WordSize; - - //---------------------------------- - // Maximum number of blocks - m_maxBlock[0] = hipProp.maxGridSize[0]; - m_maxBlock[1] = hipProp.maxGridSize[1]; - m_maxBlock[2] = hipProp.maxGridSize[2]; - - // theoretically, we can get 40 WF's / CU, but only can sustain 32 - // see - // https://github.com/ROCm-Developer-Tools/HIP/blob/a0b5dfd625d99af7e288629747b40dd057183173/vdi/hip_platform.cpp#L742 - m_maxWavesPerCU = 32; - // FIXME_HIP - Nick to implement this upstream - // Register count comes from Sec. 2.2. "Data Sharing" of the - // Vega 7nm ISA document (see the diagram) - // https://developer.amd.com/wp-content/resources/Vega_7nm_Shader_ISA.pdf - // VGPRS = 4 (SIMD/CU) * 256 VGPR/SIMD * 64 registers / VGPR = - // 65536 VGPR/CU - m_regsPerSM = 65536; - m_shmemPerSM = hipProp.maxSharedMemoryPerMultiProcessor; - m_maxShmemPerBlock = hipProp.sharedMemPerBlock; - m_maxThreadsPerSM = m_maxWavesPerCU * HIPTraits::WarpSize; //---------------------------------- // Multiblock reduction uses scratch flags for counters // and scratch space for partial reduction values. @@ -293,81 +173,36 @@ void HIPInternal::initialize(int hip_device_id, hipStream_t stream, (void)scratch_flags(reduce_block_count * 2 * sizeof(size_type)); (void)scratch_space(reduce_block_count * 16 * sizeof(size_type)); } - //---------------------------------- - // Concurrent bitset for obtaining unique tokens from within - // an executing kernel. - { - const int32_t buffer_bound = - Kokkos::Impl::concurrent_bitset::buffer_bound(HIP::concurrency()); - - // Allocate and initialize uint32_t[ buffer_bound ] - - using Record = - Kokkos::Impl::SharedAllocationRecord; - - Record *const r = Record::allocate(Kokkos::Experimental::HIPSpace(), - "Kokkos::InternalScratchBitset", - sizeof(uint32_t) * buffer_bound); - - Record::increment(r); - } - //---------------------------------- - } else { std::ostringstream msg; - msg << "Kokkos::Experimental::HIP::initialize(" << hip_device_id - << ") FAILED"; - - if (!ok_init) { - msg << " : Already initialized"; - } - if (!ok_id) { - msg << " : Device identifier out of range " - << "[0.." << dev_info.m_hipDevCount - 1 << "]"; - } + msg << "Kokkos::HIP::initialize(" << m_hipDev + << ") FAILED : Already initialized"; Kokkos::Impl::throw_runtime_exception(msg.str()); } - // Init the array for used for arbitrarily sized atomics - if (m_stream == nullptr) ::Kokkos::Impl::initialize_host_hip_lock_arrays(); - - // Allocate a staging buffer for constant mem in pinned host memory - // and an event to avoid overwriting driver for previous kernel launches - if (m_stream == nullptr) { - KOKKOS_IMPL_HIP_SAFE_CALL(hipHostMalloc((void **)&constantMemHostStaging, - HIPTraits::ConstantMemoryUsage)); - - KOKKOS_IMPL_HIP_SAFE_CALL(hipEventCreate(&constantMemReusable)); - } - KOKKOS_IMPL_HIP_SAFE_CALL( - hipMalloc(&m_scratch_locks, sizeof(int32_t) * HIP::concurrency())); + hipMalloc(&m_scratch_locks, sizeof(int32_t) * concurrency())); KOKKOS_IMPL_HIP_SAFE_CALL( - hipMemset(m_scratch_locks, 0, sizeof(int32_t) * HIP::concurrency())); + hipMemset(m_scratch_locks, 0, sizeof(int32_t) * concurrency())); } //---------------------------------------------------------------------------- -using ScratchGrain = - Kokkos::Experimental::HIP::size_type[Impl::HIPTraits::WarpSize]; +using ScratchGrain = Kokkos::HIP::size_type[Impl::HIPTraits::WarpSize]; enum { sizeScratchGrain = sizeof(ScratchGrain) }; -Kokkos::Experimental::HIP::size_type *HIPInternal::scratch_space( - const std::size_t size) { +Kokkos::HIP::size_type *HIPInternal::scratch_space(const std::size_t size) { if (verify_is_initialized("scratch_space") && m_scratchSpaceCount * sizeScratchGrain < size) { m_scratchSpaceCount = (size + sizeScratchGrain - 1) / sizeScratchGrain; - using Record = - Kokkos::Impl::SharedAllocationRecord; + using Record = Kokkos::Impl::SharedAllocationRecord; if (m_scratchSpace) Record::decrement(Record::get_record(m_scratchSpace)); - Record *const r = Record::allocate( - Kokkos::Experimental::HIPSpace(), "Kokkos::InternalScratchSpace", - (sizeScratchGrain * m_scratchSpaceCount)); + Record *const r = + Record::allocate(Kokkos::HIPSpace(), "Kokkos::InternalScratchSpace", + (sizeScratchGrain * m_scratchSpaceCount)); Record::increment(r); @@ -377,21 +212,18 @@ Kokkos::Experimental::HIP::size_type *HIPInternal::scratch_space( return m_scratchSpace; } -Kokkos::Experimental::HIP::size_type *HIPInternal::scratch_flags( - const std::size_t size) { +Kokkos::HIP::size_type *HIPInternal::scratch_flags(const std::size_t size) { if (verify_is_initialized("scratch_flags") && m_scratchFlagsCount * sizeScratchGrain < size) { m_scratchFlagsCount = (size + sizeScratchGrain - 1) / sizeScratchGrain; - using Record = - Kokkos::Impl::SharedAllocationRecord; + using Record = Kokkos::Impl::SharedAllocationRecord; if (m_scratchFlags) Record::decrement(Record::get_record(m_scratchFlags)); - Record *const r = Record::allocate( - Kokkos::Experimental::HIPSpace(), "Kokkos::InternalScratchFlags", - (sizeScratchGrain * m_scratchFlagsCount)); + Record *const r = + Record::allocate(Kokkos::HIPSpace(), "Kokkos::InternalScratchFlags", + (sizeScratchGrain * m_scratchFlagsCount)); Record::increment(r); @@ -404,20 +236,86 @@ Kokkos::Experimental::HIP::size_type *HIPInternal::scratch_flags( return m_scratchFlags; } -void *HIPInternal::resize_team_scratch_space(std::int64_t bytes, +Kokkos::HIP::size_type *HIPInternal::stage_functor_for_execution( + void const *driver, std::size_t const size) const { + if (verify_is_initialized("scratch_functor") && m_scratchFunctorSize < size) { + m_scratchFunctorSize = size; + + using Record = Kokkos::Impl::SharedAllocationRecord; + using RecordHost = + Kokkos::Impl::SharedAllocationRecord; + + if (m_scratchFunctor) { + Record::decrement(Record::get_record(m_scratchFunctor)); + RecordHost::decrement(RecordHost::get_record(m_scratchFunctorHost)); + } + + Record *const r = + Record::allocate(Kokkos::HIPSpace(), "Kokkos::InternalScratchFunctor", + m_scratchFunctorSize); + RecordHost *const r_host = RecordHost::allocate( + Kokkos::HIPHostPinnedSpace(), "Kokkos::InternalScratchFunctorHost", + m_scratchFunctorSize); + + Record::increment(r); + RecordHost::increment(r_host); + + m_scratchFunctor = reinterpret_cast(r->data()); + m_scratchFunctorHost = reinterpret_cast(r_host->data()); + } + + // When using HSA_XNACK=1, it is necessary to copy the driver to the host to + // ensure that the driver is not destroyed before the computation is done. + // Without this fix, all the atomic tests fail. It is not obvious that this + // problem is limited to HSA_XNACK=1 even if all the tests pass when + // HSA_XNACK=0. That's why we always copy the driver. + KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamSynchronize(m_stream)); + std::memcpy(m_scratchFunctorHost, driver, size); + KOKKOS_IMPL_HIP_SAFE_CALL(hipMemcpyAsync(m_scratchFunctor, + m_scratchFunctorHost, size, + hipMemcpyDefault, m_stream)); + + return m_scratchFunctor; +} + +int HIPInternal::acquire_team_scratch_space() { + int current_team_scratch = 0; + int zero = 0; + while (!m_team_scratch_pool[current_team_scratch].compare_exchange_weak( + zero, 1, std::memory_order_release, std::memory_order_relaxed)) { + current_team_scratch = (current_team_scratch + 1) % m_n_team_scratch; + } + + return current_team_scratch; +} + +void *HIPInternal::resize_team_scratch_space(int scratch_pool_id, + std::int64_t bytes, bool force_shrink) { - if (m_team_scratch_current_size == 0) { - m_team_scratch_current_size = bytes; - m_team_scratch_ptr = Kokkos::kokkos_malloc( - "Kokkos::HIPSpace::TeamScratchMemory", m_team_scratch_current_size); + // Multiple ParallelFor/Reduce Teams can call this function at the same time + // and invalidate the m_team_scratch_ptr. We use a pool to avoid any race + // condition. + if (m_team_scratch_current_size[scratch_pool_id] == 0) { + m_team_scratch_current_size[scratch_pool_id] = bytes; + m_team_scratch_ptr[scratch_pool_id] = + Kokkos::kokkos_malloc( + "Kokkos::HIPSpace::TeamScratchMemory", + m_team_scratch_current_size[scratch_pool_id]); } - if ((bytes > m_team_scratch_current_size) || - ((bytes < m_team_scratch_current_size) && (force_shrink))) { - m_team_scratch_current_size = bytes; - m_team_scratch_ptr = Kokkos::kokkos_realloc( - m_team_scratch_ptr, m_team_scratch_current_size); + if ((bytes > m_team_scratch_current_size[scratch_pool_id]) || + ((bytes < m_team_scratch_current_size[scratch_pool_id]) && + (force_shrink))) { + m_team_scratch_current_size[scratch_pool_id] = bytes; + m_team_scratch_ptr[scratch_pool_id] = + Kokkos::kokkos_realloc( + m_team_scratch_ptr[scratch_pool_id], + m_team_scratch_current_size[scratch_pool_id]); } - return m_team_scratch_ptr; + return m_team_scratch_ptr[scratch_pool_id]; +} + +void HIPInternal::release_team_scratch_space(int scratch_pool_id) { + m_team_scratch_pool[scratch_pool_id] = 0; } //---------------------------------------------------------------------------- @@ -428,108 +326,71 @@ void HIPInternal::finalize() { if (this == &singleton()) { (void)Kokkos::Impl::hip_global_unique_token_locks(true); + Impl::finalize_host_hip_lock_arrays(); + KOKKOS_IMPL_HIP_SAFE_CALL(hipHostFree(constantMemHostStaging)); KOKKOS_IMPL_HIP_SAFE_CALL(hipEventDestroy(constantMemReusable)); } if (nullptr != m_scratchSpace || nullptr != m_scratchFlags) { - using RecordHIP = - Kokkos::Impl::SharedAllocationRecord; + using RecordHIP = Kokkos::Impl::SharedAllocationRecord; RecordHIP::decrement(RecordHIP::get_record(m_scratchFlags)); RecordHIP::decrement(RecordHIP::get_record(m_scratchSpace)); - if (m_team_scratch_current_size > 0) - Kokkos::kokkos_free(m_team_scratch_ptr); - - if (m_manage_stream && m_stream != nullptr) - KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamDestroy(m_stream)); + if (m_scratchFunctorSize > 0) { + RecordHIP::decrement(RecordHIP::get_record(m_scratchFunctor)); + RecordHIP::decrement(RecordHIP::get_record(m_scratchFunctorHost)); + } } - m_hipDev = -1; - m_hipArch = -1; - m_multiProcCount = 0; - m_maxWarpCount = 0; - m_maxBlock = {0, 0, 0}; - m_maxSharedWords = 0; - m_maxShmemPerBlock = 0; - m_scratchSpaceCount = 0; - m_scratchFlagsCount = 0; - m_scratchSpace = nullptr; - m_scratchFlags = nullptr; - m_stream = nullptr; - m_team_scratch_current_size = 0; - m_team_scratch_ptr = nullptr; + for (int i = 0; i < m_n_team_scratch; ++i) { + if (m_team_scratch_current_size[i] > 0) + Kokkos::kokkos_free(m_team_scratch_ptr[i]); + } + + if (m_manage_stream && m_stream != nullptr) + KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamDestroy(m_stream)); + + m_scratchSpaceCount = 0; + m_scratchFlagsCount = 0; + m_scratchSpace = nullptr; + m_scratchFlags = nullptr; + m_stream = nullptr; + for (int i = 0; i < m_n_team_scratch; ++i) { + m_team_scratch_current_size[i] = 0; + m_team_scratch_ptr[i] = nullptr; + } KOKKOS_IMPL_HIP_SAFE_CALL(hipFree(m_scratch_locks)); m_scratch_locks = nullptr; - - if (nullptr != d_driverWorkArray) { - KOKKOS_IMPL_HIP_SAFE_CALL(hipHostFree(d_driverWorkArray)); - d_driverWorkArray = nullptr; - } -} - -char *HIPInternal::get_next_driver(size_t driverTypeSize) const { - if (d_driverWorkArray == nullptr) { - KOKKOS_IMPL_HIP_SAFE_CALL( - hipHostMalloc(&d_driverWorkArray, - m_maxDriverCycles * m_maxDriverTypeSize * sizeof(char), - hipHostMallocNonCoherent)); - } - if (driverTypeSize > m_maxDriverTypeSize) { - // fence handles the cycle id reset for us - fence( - "Kokkos::HIPInternal::get_next_driver: fence before reallocating " - "resources"); - KOKKOS_IMPL_HIP_SAFE_CALL(hipHostFree(d_driverWorkArray)); - m_maxDriverTypeSize = driverTypeSize; - if (m_maxDriverTypeSize % 128 != 0) - m_maxDriverTypeSize = - m_maxDriverTypeSize + 128 - m_maxDriverTypeSize % 128; - KOKKOS_IMPL_HIP_SAFE_CALL( - hipHostMalloc(&d_driverWorkArray, - m_maxDriverCycles * m_maxDriverTypeSize * sizeof(char), - hipHostMallocNonCoherent)); - } else { - m_cycleId = (m_cycleId + 1) % m_maxDriverCycles; - if (m_cycleId == 0) { - // ensure any outstanding kernels are completed before we wrap around - fence( - "Kokkos::HIPInternal::get_next_driver: fence before reusing first " - "driver"); - } - } - return &d_driverWorkArray[m_maxDriverTypeSize * m_cycleId]; } //---------------------------------------------------------------------------- -Kokkos::Experimental::HIP::size_type hip_internal_multiprocessor_count() { +Kokkos::HIP::size_type hip_internal_multiprocessor_count() { return HIPInternal::singleton().m_multiProcCount; } -Kokkos::Experimental::HIP::size_type hip_internal_maximum_warp_count() { +Kokkos::HIP::size_type hip_internal_maximum_warp_count() { return HIPInternal::singleton().m_maxWarpCount; } -std::array -hip_internal_maximum_grid_count() { +std::array hip_internal_maximum_grid_count() { return HIPInternal::singleton().m_maxBlock; } -Kokkos::Experimental::HIP::size_type *hip_internal_scratch_space( - const HIP &instance, const std::size_t size) { +Kokkos::HIP::size_type *hip_internal_scratch_space(const HIP &instance, + const std::size_t size) { return instance.impl_internal_space_instance()->scratch_space(size); } -Kokkos::Experimental::HIP::size_type *hip_internal_scratch_flags( - const HIP &instance, const std::size_t size) { +Kokkos::HIP::size_type *hip_internal_scratch_flags(const HIP &instance, + const std::size_t size) { return instance.impl_internal_space_instance()->scratch_flags(size); } } // namespace Impl -} // namespace Experimental } // namespace Kokkos //---------------------------------------------------------------------------- @@ -537,8 +398,7 @@ Kokkos::Experimental::HIP::size_type *hip_internal_scratch_flags( namespace Kokkos { namespace Impl { void hip_device_synchronize(const std::string &name) { - Kokkos::Tools::Experimental::Impl::profile_fence_event< - Kokkos::Experimental::HIP>( + Kokkos::Tools::Experimental::Impl::profile_fence_event( name, Kokkos::Tools::Experimental::SpecialSynchronizationCases:: GlobalDeviceSynchronization, @@ -561,9 +421,9 @@ void hip_internal_error_throw(hipError_t e, const char *name, const char *file, //---------------------------------------------------------------------------- namespace Kokkos { -namespace Experimental { HIP::size_type HIP::detect_device_count() { - return HIPInternalDevices::singleton().m_hipDevCount; + int hipDevCount; + KOKKOS_IMPL_HIP_SAFE_CALL(hipGetDeviceCount(&hipDevCount)); + return hipDevCount; } -} // namespace Experimental } // namespace Kokkos diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.hpp index d8f265834a..06fab84b56 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.hpp @@ -1,65 +1,42 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_INSTANCE_HPP #define KOKKOS_HIP_INSTANCE_HPP -#include +#include #include #include namespace Kokkos { -namespace Experimental { namespace Impl { struct HIPTraits { +#if defined(KOKKOS_ARCH_VEGA) static int constexpr WarpSize = 64; static int constexpr WarpIndexMask = 0x003f; /* hexadecimal for 63 */ static int constexpr WarpIndexShift = 6; /* WarpSize == 1 << WarpShift*/ +#elif defined(KOKKOS_ARCH_NAVI) + static int constexpr WarpSize = 32; + static int constexpr WarpIndexMask = 0x001f; /* hexadecimal for 31 */ + static int constexpr WarpIndexShift = 5; /* WarpSize == 1 << WarpShift*/ +#endif static int constexpr ConservativeThreadsPerBlock = 256; // conservative fallback blocksize in case of spills static int constexpr MaxThreadsPerBlock = @@ -88,70 +65,64 @@ class HIPInternal { HIPInternal &operator=(const HIPInternal &); public: - using size_type = ::Kokkos::Experimental::HIP::size_type; + using size_type = ::Kokkos::HIP::size_type; - int m_hipDev = -1; - int m_hipArch = -1; - unsigned m_multiProcCount = 0; - unsigned m_maxWarpCount = 0; - std::array m_maxBlock = {0, 0, 0}; - unsigned m_maxWavesPerCU = 0; - unsigned m_maxSharedWords = 0; - int m_regsPerSM; - int m_shmemPerSM = 0; - int m_maxShmemPerBlock = 0; - int m_maxThreadsPerSM = 0; + inline static int m_hipDev = -1; + inline static int m_hipArch = -1; + inline static unsigned m_multiProcCount = 0; + inline static unsigned m_maxWarpCount = 0; + inline static std::array m_maxBlock = {0, 0, 0}; + inline static unsigned m_maxWavesPerCU = 0; + inline static unsigned m_maxSharedWords = 0; + inline static int m_shmemPerSM = 0; + inline static int m_maxShmemPerBlock = 0; + inline static int m_maxThreadsPerSM = 0; - // array of DriverTypes to be allocated in host-pinned memory for async - // kernel launches - mutable char *d_driverWorkArray = nullptr; - // number of kernel launches that can be in-flight w/o synchronization - const int m_maxDriverCycles = 100; - // max size of a DriverType [bytes] - mutable size_t m_maxDriverTypeSize = 1024 * 10; - // the current index in the driverWorkArray - mutable int m_cycleId = 0; - // mutex to access d_driverWorkArray - mutable std::mutex m_mutexWorkArray; - // mutex to access shared memory - mutable std::mutex m_mutexSharedMemory; + inline static hipDeviceProp_t m_deviceProp; + + static int concurrency(); // Scratch Spaces for Reductions - std::size_t m_scratchSpaceCount = 0; - std::size_t m_scratchFlagsCount = 0; + std::size_t m_scratchSpaceCount = 0; + std::size_t m_scratchFlagsCount = 0; + mutable std::size_t m_scratchFunctorSize = 0; - size_type *m_scratchSpace = nullptr; - size_type *m_scratchFlags = nullptr; + size_type *m_scratchSpace = nullptr; + size_type *m_scratchFlags = nullptr; + mutable size_type *m_scratchFunctor = nullptr; + mutable size_type *m_scratchFunctorHost = nullptr; + inline static std::mutex scratchFunctorMutex; - hipDeviceProp_t m_deviceProp; - - hipStream_t m_stream = nullptr; - uint32_t m_instance_id = Kokkos::Tools::Experimental::Impl::idForInstance< - Kokkos::Experimental::HIP>(reinterpret_cast(this)); + hipStream_t m_stream = nullptr; + uint32_t m_instance_id = + Kokkos::Tools::Experimental::Impl::idForInstance( + reinterpret_cast(this)); bool m_manage_stream = false; // Team Scratch Level 1 Space - mutable int64_t m_team_scratch_current_size = 0; - mutable void *m_team_scratch_ptr = nullptr; - mutable std::mutex m_team_scratch_mutex; + int m_n_team_scratch = 10; + mutable int64_t m_team_scratch_current_size[10] = {}; + mutable void *m_team_scratch_ptr[10] = {}; + mutable std::atomic_int m_team_scratch_pool[10] = {}; std::int32_t *m_scratch_locks; bool was_finalized = false; // FIXME_HIP: these want to be per-device, not per-stream... use of 'static' // here will break once there are multiple devices though - static unsigned long *constantMemHostStaging; - static hipEvent_t constantMemReusable; - static std::mutex constantMemMutex; + inline static unsigned long *constantMemHostStaging = nullptr; + inline static hipEvent_t constantMemReusable = nullptr; + inline static std::mutex constantMemMutex; static HIPInternal &singleton(); int verify_is_initialized(const char *const label) const; - int is_initialized() const { return m_hipDev >= 0; } + int is_initialized() const { + return nullptr != m_scratchSpace && nullptr != m_scratchFlags; + } - void initialize(int hip_device_id, hipStream_t stream = nullptr, - bool manage_stream = false); + void initialize(hipStream_t stream, bool manage_stream); void finalize(); void print_configuration(std::ostream &) const; @@ -159,24 +130,26 @@ class HIPInternal { void fence() const; void fence(const std::string &) const; - // returns the next driver type pointer in our work array - char *get_next_driver(size_t driverTypeSize) const; - ~HIPInternal(); HIPInternal() = default; // Resizing of reduction related scratch spaces - size_type *scratch_space(const std::size_t size); - size_type *scratch_flags(const std::size_t size); + size_type *scratch_space(std::size_t const size); + size_type *scratch_flags(std::size_t const size); + size_type *stage_functor_for_execution(void const *driver, + std::size_t const size) const; uint32_t impl_get_instance_id() const noexcept; + int acquire_team_scratch_space(); // Resizing of team level 1 scratch - void *resize_team_scratch_space(std::int64_t bytes, + void *resize_team_scratch_space(int scratch_pool_id, std::int64_t bytes, bool force_shrink = false); + void release_team_scratch_space(int scratch_pool_id); }; } // namespace Impl +namespace Experimental { // Partitioning an Execution Space: expects space and integer arguments for // relative weight // Customization point for backends @@ -194,11 +167,9 @@ inline void create_HIP_instances(std::vector &instances) { template std::vector partition_space(const HIP &, Args...) { -#ifdef __cpp_fold_expressions static_assert( (... && std::is_arithmetic_v), "Kokkos Error: partitioning arguments must be integers or floats"); -#endif std::vector instances(sizeof...(Args)); Impl::create_HIP_instances(instances); diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_KernelLaunch.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_KernelLaunch.hpp index 70b979e00a..e2fe5a6d83 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_KernelLaunch.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_KernelLaunch.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_KERNEL_LAUNCH_HPP #define KOKKOS_HIP_KERNEL_LAUNCH_HPP @@ -51,7 +23,7 @@ #include #include -#include +#include #include // Must use global variable on the device with HIP-Clang @@ -61,23 +33,19 @@ __device__ __constant__ extern unsigned long kokkos_impl_hip_constant_memory_buffer[]; #else __device__ __constant__ unsigned long kokkos_impl_hip_constant_memory_buffer - [Kokkos::Experimental::Impl::HIPTraits::ConstantMemoryUsage / - sizeof(unsigned long)]; + [Kokkos::Impl::HIPTraits::ConstantMemoryUsage / sizeof(unsigned long)]; #endif #endif namespace Kokkos { -namespace Experimental { template inline __device__ T *kokkos_impl_hip_shared_memory() { - extern __shared__ Kokkos::Experimental::HIPSpace::size_type sh[]; + extern __shared__ Kokkos::HIPSpace::size_type sh[]; return (T *)sh; } -} // namespace Experimental } // namespace Kokkos namespace Kokkos { -namespace Experimental { namespace Impl { // The hip_parallel_launch_*_memory code is identical to the cuda code @@ -100,18 +68,16 @@ __global__ __launch_bounds__( template __global__ static void hip_parallel_launch_local_memory( - const DriverType *driver) { - // FIXME_HIP driver() pass by copy - driver->operator()(); + const DriverType driver) { + driver(); } template __global__ __launch_bounds__( maxTperB, minBperSM) static void hip_parallel_launch_local_memory(const DriverType - *driver) { - // FIXME_HIP driver() pass by copy - driver->operator()(); + driver) { + driver(); } template @@ -161,6 +127,9 @@ struct DeduceHIPLaunchMechanism { light_weight = Kokkos::Experimental::WorkItemProperty::HintLightWeight; static constexpr Kokkos::Experimental::WorkItemProperty::HintHeavyWeight_t heavy_weight = Kokkos::Experimental::WorkItemProperty::HintHeavyWeight; + static constexpr Kokkos::Experimental::WorkItemProperty:: + ImplForceGlobalLaunch_t force_global_launch = + Kokkos::Experimental::WorkItemProperty::ImplForceGlobalLaunch; static constexpr typename DriverType::Policy::work_item_property property = typename DriverType::Policy::work_item_property(); @@ -194,15 +163,17 @@ struct DeduceHIPLaunchMechanism { // Kal; - static void invoke_kernel(DriverType const *driver, dim3 const &grid, + static void invoke_kernel(DriverType const &driver, dim3 const &grid, dim3 const &block, int shmem, HIPInternal const *hip_instance) { (base_t::get_kernel_func())<<m_stream>>>( @@ -408,13 +379,16 @@ struct HIPParallelLaunchKernelInvoker; - // FIXME_HIP the code is different than cuda because driver cannot be passed - // by copy - static void invoke_kernel(DriverType const *driver, dim3 const &grid, + static void invoke_kernel(DriverType const &driver, dim3 const &grid, dim3 const &block, int shmem, HIPInternal const *hip_instance) { + // Wait until the previous kernel that uses m_scratchFuntor is done + std::lock_guard lock(HIPInternal::scratchFunctorMutex); + DriverType *driver_ptr = reinterpret_cast( + hip_instance->stage_functor_for_execution( + reinterpret_cast(&driver), sizeof(DriverType))); (base_t::get_kernel_func())<<m_stream>>>( - driver); + driver_ptr); } }; @@ -431,7 +405,7 @@ struct HIPParallelLaunchKernelInvokerconstantMemHostStaging; - std::memcpy((void *)staging, (void *)driver, sizeof(DriverType)); + std::memcpy(staging, &driver, sizeof(DriverType)); // Copy functor asynchronously from there to constant memory on the device KOKKOS_IMPL_HIP_SAFE_CALL(hipMemcpyToSymbolAsync( @@ -490,18 +464,13 @@ struct HIPParallelLaunch< KOKKOS_ENSURE_HIP_LOCK_ARRAYS_ON_DEVICE(); - std::lock_guard const lock(hip_instance->m_mutexWorkArray); - // Invoke the driver function on the device - DriverType *d_driver = reinterpret_cast( - hip_instance->get_next_driver(sizeof(DriverType))); - std::memcpy((void *)d_driver, (void *)&driver, sizeof(DriverType)); - base_t::invoke_kernel(d_driver, grid, block, shmem, hip_instance); + base_t::invoke_kernel(driver, grid, block, shmem, hip_instance); #if defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK) KOKKOS_IMPL_HIP_SAFE_CALL(hipGetLastError()); hip_instance->fence( - "Kokkos::Experimental::Impl::HIParallelLaunch: Debug Only Check for " + "Kokkos::Impl::HIParallelLaunch: Debug Only Check for " "Execution Error"); #endif } @@ -521,9 +490,8 @@ void hip_parallel_launch(const DriverType &driver, const dim3 &grid, HIPParallelLaunch( driver, grid, block, shmem, hip_instance, prefer_shmem); #else - // FIXME_HIP - could be if constexpr for c++17 - if (!HIPParallelLaunch::default_launchbounds()) { + if constexpr (!HIPParallelLaunch::default_launchbounds()) { // for user defined, we *always* honor the request HIPParallelLaunch( driver, grid, block, shmem, hip_instance, prefer_shmem); @@ -547,7 +515,6 @@ void hip_parallel_launch(const DriverType &driver, const dim3 &grid, #endif } } // namespace Impl -} // namespace Experimental } // namespace Kokkos #endif diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.cpp index f1ffaf3753..76d3f6f5c8 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #define KOKKOS_IMPL_PUBLIC_INCLUDE @@ -50,7 +22,8 @@ #include #include -#include +#include +#include #include @@ -91,7 +64,7 @@ void initialize_host_hip_lock_arrays() { &g_host_hip_lock_arrays.atomic, sizeof(std::int32_t) * (KOKKOS_IMPL_HIP_SPACE_ATOMIC_MASK + 1))); - g_host_hip_lock_arrays.n = ::Kokkos::Experimental::HIP::concurrency(); + g_host_hip_lock_arrays.n = HIPInternal::concurrency(); KOKKOS_COPY_HIP_LOCK_ARRAYS_TO_DEVICE(); init_lock_array_kernel_atomic<<< diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.hpp index c72616dab1..fbed4afd3f 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_LOCKS_HPP #define KOKKOS_HIP_LOCKS_HPP diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_MDRangePolicy.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_MDRangePolicy.hpp index acb538e1cb..58e13cf3e8 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_MDRangePolicy.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_MDRangePolicy.hpp @@ -1,3 +1,19 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + #ifndef KOKKOS_HIP_MDRANGEPOLICY_HPP_ #define KOKKOS_HIP_MDRANGEPOLICY_HPP_ @@ -6,13 +22,13 @@ namespace Kokkos { template <> -struct default_outer_direction { +struct default_outer_direction { using type = Iterate; static constexpr Iterate value = Iterate::Left; }; template <> -struct default_inner_direction { +struct default_inner_direction { using type = Iterate; static constexpr Iterate value = Iterate::Left; }; @@ -21,18 +37,21 @@ namespace Impl { // Settings for MDRangePolicy template <> -inline TileSizeProperties get_tile_size_properties( - const Kokkos::Experimental::HIP& space) { +inline TileSizeProperties get_tile_size_properties(const HIP& space) { TileSizeProperties properties; properties.max_threads = space.impl_internal_space_instance()->m_maxThreadsPerSM; properties.default_largest_tile_size = 16; properties.default_tile_size = 4; - properties.max_total_tile_size = - Kokkos::Experimental::Impl::HIPTraits::MaxThreadsPerBlock; + properties.max_total_tile_size = HIPTraits::MaxThreadsPerBlock; return properties; } +// Settings for TeamMDRangePolicy +template +struct ThreadAndVectorNestLevel + : AcceleratorBasedNestLevel {}; + } // Namespace Impl } // Namespace Kokkos #endif diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_MDRange.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_MDRange.hpp index 212bbb9ecd..10ec301d15 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_MDRange.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_MDRange.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_PARALLEL_MDRANGE_HPP #define KOKKOS_HIP_PARALLEL_MDRANGE_HPP @@ -56,8 +28,7 @@ namespace Kokkos { namespace Impl { // ParallelFor template -class ParallelFor, - Kokkos::Experimental::HIP> { +class ParallelFor, HIP> { public: using Policy = Kokkos::MDRangePolicy; @@ -81,11 +52,9 @@ class ParallelFor, } inline void execute() const { - using ClosureType = - ParallelFor; + using ClosureType = ParallelFor; if (m_policy.m_num_tiles == 0) return; - auto const maxblocks = - Kokkos::Experimental::Impl::hip_internal_maximum_grid_count(); + auto const maxblocks = hip_internal_maximum_grid_count(); if (Policy::rank == 2) { dim3 const block(m_policy.m_tile[0], m_policy.m_tile[1], 1); dim3 const grid( @@ -98,8 +67,7 @@ class ParallelFor, block.y, maxblocks[1]), 1); - Kokkos::Experimental::Impl::hip_parallel_launch( + hip_parallel_launch( *this, grid, block, 0, m_policy.space().impl_internal_space_instance(), false); } else if (Policy::rank == 3) { @@ -118,8 +86,7 @@ class ParallelFor, (m_policy.m_upper[2] - m_policy.m_lower[2] + block.z - 1) / block.z, maxblocks[2])); - Kokkos::Experimental::Impl::hip_parallel_launch( + hip_parallel_launch( *this, grid, block, 0, m_policy.space().impl_internal_space_instance(), false); } else if (Policy::rank == 4) { @@ -138,8 +105,7 @@ class ParallelFor, (m_policy.m_upper[3] - m_policy.m_lower[3] + block.z - 1) / block.z, maxblocks[2])); - Kokkos::Experimental::Impl::hip_parallel_launch( + hip_parallel_launch( *this, grid, block, 0, m_policy.space().impl_internal_space_instance(), false); } else if (Policy::rank == 5) { @@ -157,8 +123,7 @@ class ParallelFor, (m_policy.m_upper[4] - m_policy.m_lower[4] + block.z - 1) / block.z, maxblocks[2])); - Kokkos::Experimental::Impl::hip_parallel_launch( + hip_parallel_launch( *this, grid, block, 0, m_policy.space().impl_internal_space_instance(), false); } else if (Policy::rank == 6) { @@ -174,8 +139,7 @@ class ParallelFor, m_policy.m_tile_end[2] * m_policy.m_tile_end[3], maxblocks[1]), std::min( m_policy.m_tile_end[4] * m_policy.m_tile_end[5], maxblocks[2])); - Kokkos::Experimental::Impl::hip_parallel_launch( + hip_parallel_launch( *this, grid, block, 0, m_policy.space().impl_internal_space_instance(), false); } else { @@ -190,11 +154,8 @@ class ParallelFor, template static int max_tile_size_product(const Policy&, const Functor&) { using closure_type = - ParallelFor, - Kokkos::Experimental::HIP>; - unsigned block_size = - Kokkos::Experimental::Impl::hip_get_max_blocksize(); + ParallelFor, HIP>; + unsigned block_size = hip_get_max_blocksize(); if (block_size == 0) Kokkos::Impl::throw_runtime_exception( std::string("Kokkos::Impl::ParallelFor< HIP > could not find a valid " @@ -206,7 +167,7 @@ class ParallelFor, // ParallelReduce template class ParallelReduce, ReducerType, - Kokkos::Experimental::HIP> { + HIP> { public: using Policy = Kokkos::MDRangePolicy; @@ -235,7 +196,7 @@ class ParallelReduce, ReducerType, using value_type = typename Analysis::value_type; using reference_type = typename Analysis::reference_type; using functor_type = FunctorType; - using size_type = Experimental::HIP::size_type; + using size_type = HIP::size_type; // Algorithmic constraints: blockSize is a power of two AND blockDim.y == // blockDim.z == 1 @@ -247,9 +208,6 @@ class ParallelReduce, ReducerType, const bool m_result_ptr_device_accessible; size_type* m_scratch_space; size_type* m_scratch_flags; - // Only let one Parallel/Scan modify the shared memory. The - // constructor acquires the mutex which is released in the destructor. - std::lock_guard m_shared_memory_lock; using DeviceIteratePattern = typename Kokkos::Impl::Reduce::DeviceIterateTile< Policy::rank, Policy, FunctorType, WorkTag, reference_type>; @@ -271,7 +229,7 @@ class ParallelReduce, ReducerType, { reference_type value = final_reducer.init(reinterpret_cast( - Experimental::kokkos_impl_hip_shared_memory() + + kokkos_impl_hip_shared_memory() + threadIdx.y * word_count.value)); // Number of blocks is bounded so that the reduction can be limited to two @@ -287,13 +245,12 @@ class ParallelReduce, ReducerType, // Problem: non power-of-two blockDim if (::Kokkos::Impl::hip_single_inter_block_reduce_scan( final_reducer, blockIdx.x, gridDim.x, - Experimental::kokkos_impl_hip_shared_memory(), - m_scratch_space, m_scratch_flags)) { + kokkos_impl_hip_shared_memory(), m_scratch_space, + m_scratch_flags)) { // This is the final block with the final result at the final threads' // location - size_type* const shared = - Experimental::kokkos_impl_hip_shared_memory() + - (blockDim.y - 1) * word_count.value; + size_type* const shared = kokkos_impl_hip_shared_memory() + + (blockDim.y - 1) * word_count.value; size_type* const global = m_result_ptr_device_accessible ? reinterpret_cast(m_result_ptr) : m_scratch_space; @@ -302,7 +259,7 @@ class ParallelReduce, ReducerType, final_reducer.final(reinterpret_cast(shared)); } - if (Experimental::Impl::HIPTraits::WarpSize < word_count.value) { + if (Impl::HIPTraits::WarpSize < word_count.value) { __syncthreads(); } @@ -320,12 +277,10 @@ class ParallelReduce, ReducerType, return hip_single_inter_block_reduce_scan_shmem(f, n); }; - using closure_type = ParallelReduce; + using closure_type = ParallelReduce; unsigned block_size = - Kokkos::Experimental::Impl::hip_get_preferred_blocksize( + Kokkos::Impl::hip_get_preferred_blocksize( instance, shmem_functor); if (block_size == 0) { Kokkos::Impl::throw_runtime_exception( @@ -339,9 +294,9 @@ class ParallelReduce, ReducerType, typename Analysis::Reducer final_reducer( &ReducerConditional::select(m_functor, m_reducer)); - using ClosureType = ParallelReduce; - const auto nwork = m_policy.m_num_tiles; + using ClosureType = + ParallelReduce; + const auto nwork = m_policy.m_num_tiles; if (nwork) { int block_size = m_policy.m_prod_tile_dims; // CONSTRAINT: Algorithm requires block_size >= product of tile dimensions @@ -355,15 +310,12 @@ class ParallelReduce, ReducerType, : suggested_blocksize; // Note: block_size must be less // than or equal to 512 - m_scratch_space = - ::Kokkos::Experimental::Impl::hip_internal_scratch_space( - m_policy.space(), - Analysis::value_size( - ReducerConditional::select(m_functor, m_reducer)) * - block_size /* block_size == max block_count */); + m_scratch_space = hip_internal_scratch_space( + m_policy.space(), Analysis::value_size(ReducerConditional::select( + m_functor, m_reducer)) * + block_size /* block_size == max block_count */); m_scratch_flags = - ::Kokkos::Experimental::Impl::hip_internal_scratch_flags( - m_policy.space(), sizeof(size_type)); + hip_internal_scratch_flags(m_policy.space(), sizeof(size_type)); // REQUIRED ( 1 , N , 1 ) const dim3 block(1, block_size, 1); @@ -376,8 +328,7 @@ class ParallelReduce, ReducerType, ::Kokkos::Impl::hip_single_inter_block_reduce_scan_shmem< false, FunctorType, WorkTag>(m_functor, block.y); - Kokkos::Experimental::Impl::hip_parallel_launch( + hip_parallel_launch( *this, grid, block, shmem, m_policy.space().impl_internal_space_instance(), false); // copy to device and execute @@ -385,8 +336,8 @@ class ParallelReduce, ReducerType, if (!m_result_ptr_device_accessible && m_result_ptr) { const int size = Analysis::value_size( ReducerConditional::select(m_functor, m_reducer)); - DeepCopy( - m_policy.space(), m_result_ptr, m_scratch_space, size); + DeepCopy(m_policy.space(), m_result_ptr, + m_scratch_space, size); } } else { if (m_result_ptr) { @@ -405,13 +356,10 @@ class ParallelReduce, ReducerType, m_reducer(InvalidType()), m_result_ptr(arg_result.data()), m_result_ptr_device_accessible( - MemorySpaceAccess::accessible), m_scratch_space(nullptr), - m_scratch_flags(nullptr), - m_shared_memory_lock(m_policy.space() - .impl_internal_space_instance() - ->m_mutexSharedMemory) {} + m_scratch_flags(nullptr) {} ParallelReduce(const FunctorType& arg_functor, const Policy& arg_policy, const ReducerType& reducer) @@ -420,23 +368,17 @@ class ParallelReduce, ReducerType, m_reducer(reducer), m_result_ptr(reducer.view().data()), m_result_ptr_device_accessible( - MemorySpaceAccess::accessible), + MemorySpaceAccess::accessible), m_scratch_space(nullptr), - m_scratch_flags(nullptr), - m_shared_memory_lock(m_policy.space() - .impl_internal_space_instance() - ->m_mutexSharedMemory) {} + m_scratch_flags(nullptr) {} template static int max_tile_size_product(const Policy&, const Functor&) { using closure_type = ParallelReduce, - ReducerType, Kokkos::Experimental::HIP>; - unsigned block_size = - Kokkos::Experimental::Impl::hip_get_max_blocksize(); + ReducerType, HIP>; + unsigned block_size = hip_get_max_blocksize(); if (block_size == 0) { Kokkos::Impl::throw_runtime_exception( std::string("Kokkos::Impl::ParallelReduce< HIP > could not find a " diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Range.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Range.hpp index dca1fb9073..d8c52aa95f 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Range.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Range.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 KOKKO_HIP_PARALLEL_RANGE_HPP #define KOKKO_HIP_PARALLEL_RANGE_HPP @@ -59,8 +31,7 @@ namespace Kokkos { namespace Impl { template -class ParallelFor, - Kokkos::Experimental::HIP> { +class ParallelFor, Kokkos::HIP> { public: using Policy = Kokkos::RangePolicy; @@ -106,11 +77,9 @@ class ParallelFor, inline void execute() const { const typename Policy::index_type nwork = m_policy.end() - m_policy.begin(); - using DriverType = - ParallelFor; + using DriverType = ParallelFor; const int block_size = - Kokkos::Experimental::Impl::hip_get_preferred_blocksize(); + Kokkos::Impl::hip_get_preferred_blocksize(); const dim3 block(1, block_size, 1); const dim3 grid( typename Policy::index_type((nwork + block.y - 1) / block.y), 1, 1); @@ -120,7 +89,7 @@ class ParallelFor, std::string("Kokkos::Impl::ParallelFor< HIP > could not find a " "valid execution configuration.")); } - Kokkos::Experimental::Impl::hip_parallel_launch( + Kokkos::Impl::hip_parallel_launch( *this, grid, block, 0, m_policy.space().impl_internal_space_instance(), false); } @@ -134,7 +103,7 @@ class ParallelFor, template class ParallelReduce, ReducerType, - Kokkos::Experimental::HIP> { + Kokkos::HIP> { public: using Policy = Kokkos::RangePolicy; @@ -161,7 +130,7 @@ class ParallelReduce, ReducerType, using value_type = typename Analysis::value_type; using reference_type = typename Analysis::reference_type; using functor_type = FunctorType; - using size_type = Kokkos::Experimental::HIP::size_type; + using size_type = Kokkos::HIP::size_type; using index_type = typename Policy::index_type; // Algorithmic constraints: blockSize is a power of two AND blockDim.y == @@ -175,9 +144,6 @@ class ParallelReduce, ReducerType, const bool m_result_ptr_host_accessible; size_type* m_scratch_space = nullptr; size_type* m_scratch_flags = nullptr; - // Only let one ParallelReduce/Scan modify the shared memory. The - // constructor acquires the mutex which is released in the destructor. - std::lock_guard m_shared_memory_lock; static bool constexpr UseShflReduction = static_cast(Analysis::StaticValueSize); @@ -217,7 +183,7 @@ class ParallelReduce, ReducerType, &ReducerConditional::select(m_functor, m_reducer)); { reference_type value = final_reducer.init(reinterpret_cast( - ::Kokkos::Experimental::kokkos_impl_hip_shared_memory() + + ::Kokkos::kokkos_impl_hip_shared_memory() + threadIdx.y * word_count.value)); // Number of blocks is bounded so that the reduction can be limited to two @@ -240,14 +206,14 @@ class ParallelReduce, ReducerType, if (!do_final_reduction) do_final_reduction = hip_single_inter_block_reduce_scan( final_reducer, blockIdx.x, gridDim.x, - ::Kokkos::Experimental::kokkos_impl_hip_shared_memory(), - m_scratch_space, m_scratch_flags); + ::Kokkos::kokkos_impl_hip_shared_memory(), m_scratch_space, + m_scratch_flags); if (do_final_reduction) { // This is the final block with the final result at the final threads' // location size_type* const shared = - ::Kokkos::Experimental::kokkos_impl_hip_shared_memory() + + ::Kokkos::kokkos_impl_hip_shared_memory() + (blockDim.y - 1) * word_count.value; size_type* const global = m_result_ptr_device_accessible ? reinterpret_cast(m_result_ptr) @@ -257,8 +223,7 @@ class ParallelReduce, ReducerType, final_reducer.final(reinterpret_cast(shared)); } - if (::Kokkos::Experimental::Impl::HIPTraits::WarpSize < - word_count.value) { + if (::Kokkos::Impl::HIPTraits::WarpSize < word_count.value) { __syncthreads(); } @@ -323,10 +288,10 @@ class ParallelReduce, ReducerType, return hip_single_inter_block_reduce_scan_shmem(f, n); }; - using DriverType = ParallelReduce; - return Kokkos::Experimental::Impl::hip_get_preferred_blocksize< - DriverType, LaunchBounds>(instance, shmem_functor); + using DriverType = + ParallelReduce; + return Kokkos::Impl::hip_get_preferred_blocksize( + instance, shmem_functor); } inline void execute() { @@ -346,15 +311,12 @@ class ParallelReduce, ReducerType, "valid execution configuration.")); } - m_scratch_space = - ::Kokkos::Experimental::Impl::hip_internal_scratch_space( - m_policy.space(), - Analysis::value_size( - ReducerConditional::select(m_functor, m_reducer)) * - block_size /* block_size == max block_count */); - m_scratch_flags = - ::Kokkos::Experimental::Impl::hip_internal_scratch_flags( - m_policy.space(), sizeof(size_type)); + m_scratch_space = ::Kokkos::Impl::hip_internal_scratch_space( + m_policy.space(), Analysis::value_size(ReducerConditional::select( + m_functor, m_reducer)) * + block_size /* block_size == max block_count */); + m_scratch_flags = ::Kokkos::Impl::hip_internal_scratch_flags( + m_policy.space(), sizeof(size_type)); // REQUIRED ( 1 , N , 1 ) dim3 block(1, block_size, 1); @@ -374,9 +336,9 @@ class ParallelReduce, ReducerType, WorkTag>(m_functor, block.y); - using DriverType = ParallelReduce; - Kokkos::Experimental::Impl::hip_parallel_launch( + using DriverType = + ParallelReduce; + Kokkos::Impl::hip_parallel_launch( *this, grid, block, shmem, m_policy.space().impl_internal_space_instance(), false); // copy to device and execute @@ -384,9 +346,8 @@ class ParallelReduce, ReducerType, if (!m_result_ptr_device_accessible && m_result_ptr) { const int size = Analysis::value_size( ReducerConditional::select(m_functor, m_reducer)); - DeepCopy(m_policy.space(), m_result_ptr, - m_scratch_space, size); + DeepCopy(m_policy.space(), m_result_ptr, + m_scratch_space, size); } } else { if (m_result_ptr) { @@ -405,14 +366,11 @@ class ParallelReduce, ReducerType, m_reducer(InvalidType()), m_result_ptr(arg_result.data()), m_result_ptr_device_accessible( - MemorySpaceAccess::accessible), m_result_ptr_host_accessible( MemorySpaceAccess::accessible), - m_shared_memory_lock(m_policy.space() - .impl_internal_space_instance() - ->m_mutexSharedMemory) {} + typename ViewType::memory_space>::accessible) {} ParallelReduce(const FunctorType& arg_functor, const Policy& arg_policy, const ReducerType& reducer) @@ -421,16 +379,12 @@ class ParallelReduce, ReducerType, m_reducer(reducer), m_result_ptr(reducer.view().data()), m_result_ptr_device_accessible( - MemorySpaceAccess::accessible), + MemorySpaceAccess::accessible), m_result_ptr_host_accessible( MemorySpaceAccess::accessible), - m_shared_memory_lock(m_policy.space() - .impl_internal_space_instance() - ->m_mutexSharedMemory) {} + memory_space>::accessible) {} }; template @@ -452,7 +406,7 @@ class ParallelScanHIPBase { using pointer_type = typename Analysis::pointer_type; using reference_type = typename Analysis::reference_type; using functor_type = FunctorType; - using size_type = Kokkos::Experimental::HIP::size_type; + using size_type = HIP::size_type; using index_type = typename Policy::index_type; // Conditionally set word_size_type to int16_t or int8_t if value_type is // smaller than int32_t (Kokkos::HIP::size_type) @@ -479,13 +433,12 @@ class ParallelScanHIPBase { const FunctorType m_functor; const Policy m_policy; + const pointer_type m_result_ptr; + const bool m_result_ptr_device_accessible; word_size_type* m_scratch_space = nullptr; size_type* m_scratch_flags = nullptr; size_type m_final = false; int m_grid_x = 0; - // Only let one ParallelReduce/Scan modify the shared memory. The - // constructor acquires the mutex which is released in the destructor. - std::lock_guard m_shared_memory_lock; private: template @@ -510,7 +463,7 @@ class ParallelScanHIPBase { word_count(Analysis::value_size(m_functor) / sizeof(word_size_type)); pointer_type const shared_value = reinterpret_cast( - Kokkos::Experimental::kokkos_impl_hip_shared_memory() + + kokkos_impl_hip_shared_memory() + word_count.value * threadIdx.y); final_reducer.init(shared_value); @@ -534,8 +487,8 @@ class ParallelScanHIPBase { // gridDim.x hip_single_inter_block_reduce_scan( final_reducer, blockIdx.x, gridDim.x, - Kokkos::Experimental::kokkos_impl_hip_shared_memory(), - m_scratch_space, m_scratch_flags); + kokkos_impl_hip_shared_memory(), m_scratch_space, + m_scratch_flags); } //---------------------------------------- @@ -550,7 +503,7 @@ class ParallelScanHIPBase { // Use shared memory as an exclusive scan: { 0 , value[0] , value[1] , // value[2] , ... } word_size_type* const shared_data = - Kokkos::Experimental::kokkos_impl_hip_shared_memory(); + kokkos_impl_hip_shared_memory(); word_size_type* const shared_prefix = shared_data + word_count.value * threadIdx.y; word_size_type* const shared_accum = @@ -619,6 +572,9 @@ class ParallelScanHIPBase { reinterpret_cast(shared_prefix)), true); } + if (iwork + 1 == m_policy.end() && m_policy.end() == range.end() && + m_result_ptr_device_accessible) + *m_result_ptr = *reinterpret_cast(shared_prefix); } } @@ -633,23 +589,13 @@ class ParallelScanHIPBase { } } - // Determine block size constrained by shared memory: - virtual inline unsigned local_block_size(const FunctorType& f) = 0; - - inline void impl_execute() { + inline void impl_execute(int block_size) { const index_type nwork = m_policy.end() - m_policy.begin(); if (nwork) { // FIXME_HIP we cannot choose it larger for large work sizes to work // correctly, the unit tests fail with wrong results const int gridMaxComputeCapability_2x = 0x01fff; - const int block_size = static_cast(local_block_size(m_functor)); - if (block_size == 0) { - Kokkos::Impl::throw_runtime_exception( - std::string("Kokkos::Impl::ParallelScan< HIP > could not find a " - "valid execution configuration.")); - } - const int grid_max = std::min(block_size * block_size, gridMaxComputeCapability_2x); @@ -663,11 +609,11 @@ class ParallelScanHIPBase { // How many block are really needed for this much work: m_grid_x = (nwork + work_per_block - 1) / work_per_block; - m_scratch_space = reinterpret_cast( - Kokkos::Experimental::Impl::hip_internal_scratch_space( + m_scratch_space = + reinterpret_cast(Impl::hip_internal_scratch_space( m_policy.space(), Analysis::value_size(m_functor) * m_grid_x)); - m_scratch_flags = Kokkos::Experimental::Impl::hip_internal_scratch_flags( - m_policy.space(), sizeof(size_type) * 1); + m_scratch_flags = Impl::hip_internal_scratch_flags(m_policy.space(), + sizeof(size_type) * 1); dim3 grid(m_grid_x, 1, 1); dim3 block(1, block_size, 1); // REQUIRED DIMENSIONS ( 1 , N , 1 ) @@ -677,40 +623,49 @@ class ParallelScanHIPBase { // these ones are OK to be just the base because the specializations // do not modify the kernel at all using DriverType = ParallelScanHIPBase; - Kokkos::Experimental::Impl::hip_parallel_launch( + Impl::hip_parallel_launch( *this, grid, block, shmem, m_policy.space().impl_internal_space_instance(), false); // copy to device and execute m_final = true; - Kokkos::Experimental::Impl::hip_parallel_launch( + Impl::hip_parallel_launch( *this, grid, block, shmem, m_policy.space().impl_internal_space_instance(), false); // copy to device and execute } } - ParallelScanHIPBase(const FunctorType& arg_functor, const Policy& arg_policy) + ParallelScanHIPBase(const FunctorType& arg_functor, const Policy& arg_policy, + pointer_type arg_result_ptr, + bool arg_result_ptr_device_accessible) : m_functor(arg_functor), m_policy(arg_policy), - m_shared_memory_lock(m_policy.space() - .impl_internal_space_instance() - ->m_mutexSharedMemory) {} + m_result_ptr(arg_result_ptr), + m_result_ptr_device_accessible(arg_result_ptr_device_accessible) {} }; template -class ParallelScan, - Kokkos::Experimental::HIP> +class ParallelScan, HIP> : public ParallelScanHIPBase { public: using Base = ParallelScanHIPBase; using Base::operator(); - inline void execute() { Base::impl_execute(); } + inline void execute() { + const int block_size = static_cast(local_block_size(Base::m_functor)); + if (block_size == 0) { + Kokkos::Impl::throw_runtime_exception( + std::string("Kokkos::Impl::ParallelScan< HIP > could not find a " + "valid execution configuration.")); + } + + Base::impl_execute(block_size); + } ParallelScan(const FunctorType& arg_functor, const typename Base::Policy& arg_policy) - : Base(arg_functor, arg_policy) {} + : Base(arg_functor, arg_policy, nullptr, false) {} inline unsigned local_block_size(const FunctorType& f) { // blockDim.y must be power of two = 128 (2 warps) or 256 (4 warps) or @@ -723,10 +678,10 @@ class ParallelScan, typename Base::WorkTag>( f, n); }; - using DriverType = ParallelScan; - return Kokkos::Experimental::Impl::hip_get_preferred_blocksize< - DriverType, typename Base::LaunchBounds>(instance, shmem_functor); + using DriverType = ParallelScan; + return Impl::hip_get_preferred_blocksize( + instance, shmem_functor); } }; @@ -734,33 +689,40 @@ class ParallelScan, template class ParallelScanWithTotal, - ReturnType, Kokkos::Experimental::HIP> + ReturnType, HIP> : public ParallelScanHIPBase { public: using Base = ParallelScanHIPBase; using Base::operator(); - ReturnType& m_returnvalue; - inline void execute() { - Base::impl_execute(); + const int block_size = static_cast(local_block_size(Base::m_functor)); + if (block_size == 0) { + Kokkos::Impl::throw_runtime_exception( + std::string("Kokkos::Impl::ParallelScan< HIP > could not find a " + "valid execution configuration.")); + } + + Base::impl_execute(block_size); const auto nwork = Base::m_policy.end() - Base::m_policy.begin(); - if (nwork) { + if (nwork && !Base::m_result_ptr_device_accessible) { const int size = Base::Analysis::value_size(Base::m_functor); - DeepCopy( - Base::m_policy.space(), &m_returnvalue, + DeepCopy( + Base::m_policy.space(), Base::m_result_ptr, Base::m_scratch_space + (Base::m_grid_x - 1) * size / sizeof(typename Base::word_size_type), size); } } + template ParallelScanWithTotal(const FunctorType& arg_functor, const typename Base::Policy& arg_policy, - ReturnType& arg_returnvalue) - : Base(arg_functor, arg_policy), m_returnvalue(arg_returnvalue) {} + const ViewType& arg_result_view) + : Base(arg_functor, arg_policy, arg_result_view.data(), + MemorySpaceAccess::accessible) {} inline unsigned local_block_size(const FunctorType& f) { // blockDim.y must be power of two = 128 (2 warps) or 256 (4 warps) or @@ -773,11 +735,10 @@ class ParallelScanWithTotal, typename Base::WorkTag>( f, n); }; - using DriverType = - ParallelScanWithTotal; - return Kokkos::Experimental::Impl::hip_get_preferred_blocksize< - DriverType, typename Base::LaunchBounds>(instance, shmem_functor); + using DriverType = ParallelScanWithTotal; + return hip_get_preferred_blocksize( + instance, shmem_functor); } }; diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Team.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Team.hpp index 69ced48a9b..442ca8aef2 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Team.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Team.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 KOKKO_HIP_PARALLEL_TEAM_HPP #define KOKKO_HIP_PARALLEL_TEAM_HPP @@ -59,13 +31,12 @@ namespace Kokkos { namespace Impl { template -class TeamPolicyInternal +class TeamPolicyInternal : public PolicyTraits { public: using execution_policy = TeamPolicyInternal; - using traits = PolicyTraits; - using BlockType = Kokkos::Experimental::Impl::BlockType; + using traits = PolicyTraits; template friend class TeamPolicyInternal; @@ -82,7 +53,7 @@ class TeamPolicyInternal bool m_tune_vector_length; public: - using execution_space = Kokkos::Experimental::HIP; + using execution_space = HIP; template TeamPolicyInternal(TeamPolicyInternal const& p) { @@ -119,7 +90,7 @@ class TeamPolicyInternal using closure_type = Impl::ParallelReduce, reducer_type>; - return internal_team_size_max(f); + return internal_team_size_common(f); } template @@ -128,7 +99,7 @@ class TeamPolicyInternal using closure_type = Impl::ParallelReduce, ReducerType>; - return internal_team_size_max(f); + return internal_team_size_common(f); } template @@ -151,7 +122,7 @@ class TeamPolicyInternal using closure_type = Impl::ParallelReduce, reducer_type>; - return internal_team_size_recommended(f); + return internal_team_size_common(f); } template @@ -160,14 +131,12 @@ class TeamPolicyInternal using closure_type = Impl::ParallelReduce, ReducerType>; - return internal_team_size_recommended(f); + return internal_team_size_common(f); } inline bool impl_auto_vector_length() const { return m_tune_vector_length; } inline bool impl_auto_team_size() const { return m_tune_team_size; } - static int vector_length_max() { - return ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; - } + static int vector_length_max() { return HIPTraits::WarpSize; } static int verify_requested_vector_length(int requested_vector_length) { int test_vector_length = @@ -176,7 +145,7 @@ class TeamPolicyInternal // Allow only power-of-two vector_length if (!(is_integral_power_of_two(test_vector_length))) { int test_pow2 = 1; - int constexpr warp_size = Experimental::Impl::HIPTraits::WarpSize; + int constexpr warp_size = HIPTraits::WarpSize; while (test_pow2 < warp_size) { test_pow2 <<= 1; if (test_pow2 > test_vector_length) { @@ -189,19 +158,28 @@ class TeamPolicyInternal return test_vector_length; } - static int scratch_size_max(int level) { - return ( - level == 0 ? 1024 * 40 : // FIXME_HIP arbitrarily setting this to 48kB - 20 * 1024 * 1024); // FIXME_HIP arbitrarily setting this to 20MB + inline static int scratch_size_max(int level) { + // HIP Teams use (team_size + 2)*sizeof(double) shared memory for team + // reductions. They also use one int64_t in static shared memory for a + // shared ID. Furthermore, they use additional scratch memory in some + // reduction scenarios, which depend on the size of the value_type and is + // NOT captured here + constexpr size_t max_possible_team_size = 1024; + constexpr size_t max_reserved_shared_mem_per_team = + (max_possible_team_size + 2) * sizeof(double) + sizeof(int64_t); + // arbitrarily setting level 1 scratch limit to 20MB, for a + // MI250 that would give us about 4.4GB for 2 teams per CU + constexpr size_t max_l1_scratch_size = 20 * 1024 * 1024; + + size_t max_shmem = HIP().hip_device_prop().sharedMemPerBlock; + return (level == 0 ? max_shmem - max_reserved_shared_mem_per_team + : max_l1_scratch_size); } + inline void impl_set_vector_length(size_t size) { m_vector_length = size; } inline void impl_set_team_size(size_t size) { m_team_size = size; } int impl_vector_length() const { return m_vector_length; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - KOKKOS_DEPRECATED int vector_length() const { return impl_vector_length(); } -#endif - int team_size() const { return m_team_size; } int league_size() const { return m_league_size; } @@ -229,7 +207,7 @@ class TeamPolicyInternal m_vector_length(0), m_team_scratch_size{0, 0}, m_thread_scratch_size{0, 0}, - m_chunk_size(::Kokkos::Experimental::Impl::HIPTraits::WarpSize), + m_chunk_size(HIPTraits::WarpSize), m_tune_team_size(false), m_tune_vector_length(false) {} @@ -245,20 +223,17 @@ class TeamPolicyInternal : (verify_requested_vector_length(1))), m_team_scratch_size{0, 0}, m_thread_scratch_size{0, 0}, - m_chunk_size(::Kokkos::Experimental::Impl::HIPTraits::WarpSize), + m_chunk_size(HIPTraits::WarpSize), m_tune_team_size(bool(team_size_request <= 0)), m_tune_vector_length(bool(vector_length_request <= 0)) { // Make sure league size is permissible - if (league_size_ >= - static_cast( - ::Kokkos::Experimental::Impl::hip_internal_maximum_grid_count()[0])) + if (league_size_ >= static_cast(hip_internal_maximum_grid_count()[0])) Impl::throw_runtime_exception( "Requested too large league_size for TeamPolicy on HIP execution " "space."); // Make sure total block size is permissible - if (m_team_size * m_vector_length > - ::Kokkos::Experimental::Impl::HIPTraits::MaxThreadsPerBlock) { + if (m_team_size * m_vector_length > HIPTraits::MaxThreadsPerBlock) { Impl::throw_runtime_exception( std::string("Kokkos::TeamPolicy< HIP > the team size is too large. " "Team size x vector length must be smaller than 1024.")); @@ -356,57 +331,19 @@ class TeamPolicyInternal protected: template - int internal_team_size_common(const FunctorType& f) const { - // FIXME_HIP: this could be unified with the - // internal_team_size_common_reduce - // once we can turn c++17 constexpr on by default. - // The problem right now is that we can't turn off the evaluation - // of the Analysis' valuesize / StaticValueSize - - const unsigned shmem_block = team_scratch_size(0) + 2 * sizeof(double); - const unsigned shmem_thread = thread_scratch_size(0) + sizeof(double); - const int vector_length = impl_vector_length(); - - const auto functor = [&f, shmem_block, shmem_thread, vector_length]( - const hipFuncAttributes& attr, int block_size) { - int functor_shmem = - ::Kokkos::Impl::FunctorTeamShmemSize::value( - f, block_size / vector_length); - return shmem_block + shmem_thread * (block_size / vector_length) + - functor_shmem + attr.sharedSizeBytes; - }; - int block_size; - // FIXME_HIP - could be if constexpr for c++17 - if (BlockSize == BlockType::Max) { - block_size = ::Kokkos::Experimental::Impl::hip_get_max_team_blocksize< - ClosureType, typename traits::launch_bounds>( - space().impl_internal_space_instance(), functor); - } else { - block_size = - ::Kokkos::Experimental::Impl::hip_get_preferred_team_blocksize< - ClosureType, typename traits::launch_bounds>( - space().impl_internal_space_instance(), functor); - } - if (block_size == 0) { - Kokkos::Impl::throw_runtime_exception( - std::string("Kokkos::Impl::ParallelFor< HIP > could not find a valid " - "team size.")); - } - return block_size / impl_vector_length(); - } - - template - int internal_team_size_common_reduce(const FunctorType& f) const { - using Interface = - typename Impl::DeduceFunctorPatternInterface::type; - using Analysis = - Impl::FunctorAnalysis; - + int internal_team_size_common(FunctorType const& f) const { const unsigned shmem_block = team_scratch_size(0) + 2 * sizeof(double); - const unsigned shmem_thread = - thread_scratch_size(0) + sizeof(double) + - ((Analysis::StaticValueSize != 0) ? 0 : Analysis::value_size(f)); + unsigned shmem_thread = thread_scratch_size(0) + sizeof(double); + using Tag = typename PatternTagFromImplSpecialization::type; + if constexpr (std::is_same_v) { + using Interface = + typename Impl::DeduceFunctorPatternInterface::type; + using Analysis = + Impl::FunctorAnalysis; + shmem_thread += + ((Analysis::StaticValueSize != 0) ? 0 : Analysis::value_size(f)); + } const int vector_length = impl_vector_length(); const auto functor = [&f, shmem_block, shmem_thread, vector_length]( @@ -418,44 +355,36 @@ class TeamPolicyInternal functor_shmem + attr.sharedSizeBytes; }; int block_size; - // FIXME_HIP - could be if constexpr for c++17 - if (BlockSize == BlockType::Max) { - block_size = ::Kokkos::Experimental::Impl::hip_get_max_team_blocksize< - ClosureType, typename traits::launch_bounds>( + if constexpr (BlockSize == BlockType::Max) { + block_size = hip_get_max_team_blocksize( space().impl_internal_space_instance(), functor); } else { block_size = - ::Kokkos::Experimental::Impl::hip_get_preferred_team_blocksize< - ClosureType, typename traits::launch_bounds>( + hip_get_preferred_team_blocksize( space().impl_internal_space_instance(), functor); } if (block_size == 0) { - Kokkos::Impl::throw_runtime_exception( - std::string("Kokkos::Impl::ParallelReduce< HIP > could not find a " - "valid team size.")); + Kokkos::Impl::throw_runtime_exception(std::string( + "Kokkos::Impl::ParallelFor/Reduce< HIP > could not find a valid " + "team size.")); + } + if constexpr (std::is_same_v) { + return block_size / impl_vector_length(); + } else { + // Currently we require Power-of-2 team size for reductions. + int p2 = 1; + while (p2 <= block_size) p2 *= 2; + p2 /= 2; + return p2 / impl_vector_length(); } - // Currently we require Power-of-2 team size for reductions. - int p2 = 1; - while (p2 <= block_size) p2 *= 2; - p2 /= 2; - return p2 / impl_vector_length(); - } - - template - int internal_team_size_max(const FunctorType& f) const { - return internal_team_size_common_reduce(f); - } - - template - int internal_team_size_recommended(const FunctorType& f) const { - return internal_team_size_common_reduce( - f); } }; -__device__ inline int64_t hip_get_scratch_index( - Experimental::HIP::size_type league_size, int32_t* scratch_locks) { +__device__ inline int64_t hip_get_scratch_index(HIP::size_type league_size, + int32_t* scratch_locks) { int64_t threadid = 0; __shared__ int64_t base_thread_id; if (threadIdx.x == 0 && threadIdx.y == 0) { @@ -491,12 +420,11 @@ __device__ inline void hip_release_scratch_index(int32_t* scratch_locks, } template -class ParallelFor, - Kokkos::Experimental::HIP> { +class ParallelFor, HIP> { public: - using Policy = TeamPolicyInternal; + using Policy = TeamPolicyInternal; using functor_type = FunctorType; - using size_type = ::Kokkos::Experimental::HIP::size_type; + using size_type = HIP::size_type; private: using member_type = typename Policy::member_type; @@ -518,10 +446,8 @@ class ParallelFor, int m_shmem_size; void* m_scratch_ptr[2]; size_t m_scratch_size[2]; + int m_scratch_pool_id = -1; int32_t* m_scratch_locks; - // Only let one ParallelFor/Reduce modify the team scratch memory. The - // constructor acquires the mutex which is released in the destructor. - std::lock_guard m_scratch_lock_guard; template __device__ inline std::enable_if_t::value> exec_team( @@ -547,8 +473,7 @@ class ParallelFor, for (int league_rank = blockIdx.x; league_rank < int_league_size; league_rank += gridDim.x) { this->template exec_team(typename Policy::member_type( - ::Kokkos::Experimental::kokkos_impl_hip_shared_memory(), - m_shmem_begin, m_shmem_size, + kokkos_impl_hip_shared_memory(), m_shmem_begin, m_shmem_size, static_cast(static_cast(m_scratch_ptr[1]) + ptrdiff_t(threadid / (blockDim.x * blockDim.y)) * m_scratch_size[1]), @@ -566,10 +491,8 @@ class ParallelFor, static_cast(m_team_size), 1); using closure_type = - ParallelFor, - Kokkos::Experimental::HIP>; - ::Kokkos::Experimental::Impl::hip_parallel_launch( + ParallelFor, HIP>; + Impl::hip_parallel_launch( *this, grid, block, shmem_size_total, m_policy.space().impl_internal_space_instance(), true); // copy to device and execute @@ -580,10 +503,9 @@ class ParallelFor, m_policy(arg_policy), m_league_size(arg_policy.league_size()), m_team_size(arg_policy.team_size()), - m_vector_size(arg_policy.impl_vector_length()), - m_scratch_lock_guard(m_policy.space() - .impl_internal_space_instance() - ->m_team_scratch_mutex) { + m_vector_size(arg_policy.impl_vector_length()) { + auto internal_space_instance = + m_policy.space().impl_internal_space_instance(); m_team_size = m_team_size >= 0 ? m_team_size : arg_policy.team_size_recommended( arg_functor, ParallelForTag()); @@ -594,27 +516,26 @@ class ParallelFor, FunctorTeamShmemSize::value(m_functor, m_team_size)); m_scratch_size[0] = m_policy.scratch_size(0, m_team_size); m_scratch_size[1] = m_policy.scratch_size(1, m_team_size); - m_scratch_locks = - m_policy.space().impl_internal_space_instance()->m_scratch_locks; + m_scratch_locks = internal_space_instance->m_scratch_locks; // Functor's reduce memory, team scan memory, and team shared memory depend // upon team size. m_scratch_ptr[0] = nullptr; - m_scratch_ptr[1] = - m_team_size <= 0 - ? nullptr - : m_policy.space() - .impl_internal_space_instance() - ->resize_team_scratch_space( - static_cast(m_scratch_size[1]) * - (std::min(static_cast( - Kokkos::Experimental::HIP::concurrency() / - (m_team_size * m_vector_size)), - static_cast(m_league_size)))); + if (m_team_size <= 0) { + m_scratch_ptr[1] = nullptr; + } else { + m_scratch_pool_id = internal_space_instance->acquire_team_scratch_space(); + m_scratch_ptr[1] = internal_space_instance->resize_team_scratch_space( + m_scratch_pool_id, + static_cast(m_scratch_size[1]) * + (std::min( + static_cast(HIP().concurrency() / + (m_team_size * m_vector_size)), + static_cast(m_league_size)))); + } int const shmem_size_total = m_shmem_begin + m_shmem_size; - if (m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock < - shmem_size_total) { + if (internal_space_instance->m_maxShmemPerBlock < shmem_size_total) { Kokkos::Impl::throw_runtime_exception(std::string( "Kokkos::Impl::ParallelFor< HIP > insufficient shared memory")); } @@ -625,6 +546,14 @@ class ParallelFor, "Kokkos::Impl::ParallelFor< HIP > requested too large team size.")); } } + + ~ParallelFor() { + if (m_scratch_pool_id >= 0) { + m_policy.space() + .impl_internal_space_instance() + ->release_team_scratch_space(m_scratch_pool_id); + } + } }; //---------------------------------------------------------------------------- @@ -632,9 +561,9 @@ class ParallelFor, template class ParallelReduce, - ReducerType, Kokkos::Experimental::HIP> { + ReducerType, HIP> { public: - using Policy = TeamPolicyInternal; + using Policy = TeamPolicyInternal; private: using member_type = typename Policy::member_type; @@ -658,7 +587,7 @@ class ParallelReduce, public: using functor_type = FunctorType; - using size_type = Kokkos::Experimental::HIP::size_type; + using size_type = HIP::size_type; static int constexpr UseShflReduction = (analysis::StaticValueSize != 0); @@ -687,13 +616,11 @@ class ParallelReduce, size_type m_shmem_size; void* m_scratch_ptr[2]; size_t m_scratch_size[2]; + int m_scratch_pool_id = -1; int32_t* m_scratch_locks; const size_type m_league_size; int m_team_size; const size_type m_vector_size; - // Only let one ParallelFor/Reduce modify the team scratch memory. The - // constructor acquires the mutex which is released in the destructor. - std::lock_guard m_scratch_lock_guard; template __device__ inline std::enable_if_t::value> exec_team( @@ -714,8 +641,7 @@ class ParallelReduce, league_rank += gridDim.x) { this->template exec_team( member_type( - Kokkos::Experimental::kokkos_impl_hip_shared_memory() + - m_team_begin, + kokkos_impl_hip_shared_memory() + m_team_begin, m_shmem_begin, m_shmem_size, reinterpret_cast( reinterpret_cast(m_scratch_ptr[1]) + @@ -752,9 +678,9 @@ class ParallelReduce, reducer_conditional::select(m_functor, m_reducer)) / sizeof(size_type)); - reference_type value = final_reducer.init( - Kokkos::Experimental::kokkos_impl_hip_shared_memory() + - threadIdx.y * word_count.value); + reference_type value = + final_reducer.init(kokkos_impl_hip_shared_memory() + + threadIdx.y * word_count.value); // Iterate this block through the league iterate_through_league(threadid, value); @@ -765,16 +691,14 @@ class ParallelReduce, do_final_reduce = hip_single_inter_block_reduce_scan( reducer_conditional::select(m_functor, m_reducer), blockIdx.x, - gridDim.x, - Kokkos::Experimental::kokkos_impl_hip_shared_memory(), + gridDim.x, kokkos_impl_hip_shared_memory(), m_scratch_space, m_scratch_flags); if (do_final_reduce) { // This is the final block with the final result at the final threads' // location - size_type* const shared = - Kokkos::Experimental::kokkos_impl_hip_shared_memory() + - (blockDim.y - 1) * word_count.value; + size_type* const shared = kokkos_impl_hip_shared_memory() + + (blockDim.y - 1) * word_count.value; size_type* const global = m_result_ptr_device_accessible ? reinterpret_cast(m_result_ptr) : m_scratch_space; @@ -783,7 +707,7 @@ class ParallelReduce, final_reducer.final(reinterpret_cast(shared)); } - if (Kokkos::Experimental::Impl::HIPTraits::WarpSize < word_count.value) { + if (HIPTraits::WarpSize < word_count.value) { __syncthreads(); } @@ -836,18 +760,15 @@ class ParallelReduce, if (!is_empty_range || need_device_set) { const int block_count = UseShflReduction - ? std::min( - m_league_size, - size_type(1024 * - Kokkos::Experimental::Impl::HIPTraits::WarpSize)) + ? std::min(m_league_size, size_type(1024 * HIPTraits::WarpSize)) : std::min(static_cast(m_league_size), m_team_size); - m_scratch_space = Kokkos::Experimental::Impl::hip_internal_scratch_space( + m_scratch_space = hip_internal_scratch_space( m_policy.space(), analysis::value_size(reducer_conditional::select( m_functor, m_reducer)) * block_count); - m_scratch_flags = Kokkos::Experimental::Impl::hip_internal_scratch_flags( - m_policy.space(), sizeof(size_type)); + m_scratch_flags = + hip_internal_scratch_flags(m_policy.space(), sizeof(size_type)); dim3 block(m_vector_size, m_team_size, 1); dim3 grid(block_count, 1, 1); @@ -859,9 +780,8 @@ class ParallelReduce, using closure_type = ParallelReduce, - ReducerType, Kokkos::Experimental::HIP>; - Kokkos::Experimental::Impl::hip_parallel_launch( + ReducerType, HIP>; + Impl::hip_parallel_launch( *this, grid, block, shmem_size_total, m_policy.space().impl_internal_space_instance(), true); // copy to device and execute @@ -872,8 +792,7 @@ class ParallelReduce, if (m_result_ptr) { const int size = analysis::value_size( reducer_conditional::select(m_functor, m_reducer)); - DeepCopy( - m_result_ptr, m_scratch_space, size); + DeepCopy(m_result_ptr, m_scratch_space, size); } } } else { @@ -893,7 +812,7 @@ class ParallelReduce, m_reducer(InvalidType()), m_result_ptr(arg_result.data()), m_result_ptr_device_accessible( - MemorySpaceAccess::accessible), m_result_ptr_host_accessible( MemorySpaceAccess, m_scratch_ptr{nullptr, nullptr}, m_league_size(arg_policy.league_size()), m_team_size(arg_policy.team_size()), - m_vector_size(arg_policy.impl_vector_length()), - m_scratch_lock_guard(m_policy.space() - .impl_internal_space_instance() - ->m_team_scratch_mutex) { + m_vector_size(arg_policy.impl_vector_length()) { + auto internal_space_instance = + m_policy.space().impl_internal_space_instance(); m_team_size = m_team_size >= 0 ? m_team_size : arg_policy.team_size_recommended( arg_functor, ParallelReduceTag()); @@ -926,19 +844,19 @@ class ParallelReduce, FunctorTeamShmemSize::value(arg_functor, m_team_size); m_scratch_size[0] = m_shmem_size; m_scratch_size[1] = m_policy.scratch_size(1, m_team_size); - m_scratch_locks = - m_policy.space().impl_internal_space_instance()->m_scratch_locks; - m_scratch_ptr[1] = - m_team_size <= 0 - ? nullptr - : m_policy.space() - .impl_internal_space_instance() - ->resize_team_scratch_space( - static_cast(m_scratch_size[1]) * - (std::min(static_cast( - Kokkos::Experimental::HIP::concurrency() / - (m_team_size * m_vector_size)), - static_cast(m_league_size)))); + m_scratch_locks = internal_space_instance->m_scratch_locks; + if (m_team_size <= 0) { + m_scratch_ptr[1] = nullptr; + } else { + m_scratch_pool_id = internal_space_instance->acquire_team_scratch_space(); + m_scratch_ptr[1] = internal_space_instance->resize_team_scratch_space( + m_scratch_pool_id, + static_cast(m_scratch_size[1]) * + (std::min( + static_cast(HIP().concurrency() / + (m_team_size * m_vector_size)), + static_cast(m_league_size)))); + } // The global parallel_reduce does not support vector_length other than 1 at // the moment @@ -948,8 +866,7 @@ class ParallelReduce, "greater than 1 is not currently supported for HIP for dynamic " "sized reduction types."); - if ((m_team_size < Kokkos::Experimental::Impl::HIPTraits::WarpSize) && - !UseShflReduction) + if ((m_team_size < HIPTraits::WarpSize) && !UseShflReduction) Impl::throw_runtime_exception( "Kokkos::parallel_reduce with a TeamPolicy using a team_size smaller " "than 64 is not currently supported with HIP for dynamic sized " @@ -966,8 +883,7 @@ class ParallelReduce, std::string("Kokkos::Impl::ParallelReduce< HIP > bad team size")); } - if (m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock < - shmem_size_total) { + if (internal_space_instance->m_maxShmemPerBlock < shmem_size_total) { Kokkos::Impl::throw_runtime_exception( std::string("Kokkos::Impl::ParallelReduce< HIP > requested too much " "L0 scratch memory")); @@ -989,9 +905,8 @@ class ParallelReduce, m_reducer(reducer), m_result_ptr(reducer.view().data()), m_result_ptr_device_accessible( - MemorySpaceAccess::accessible), + MemorySpaceAccess::accessible), m_result_ptr_host_accessible( MemorySpaceAccess, m_scratch_ptr{nullptr, nullptr}, m_league_size(arg_policy.league_size()), m_team_size(arg_policy.team_size()), - m_vector_size(arg_policy.impl_vector_length()), - m_scratch_lock_guard(m_policy.space() - .impl_internal_space_instance() - ->m_team_scratch_mutex) { + m_vector_size(arg_policy.impl_vector_length()) { + auto internal_space_instance = + m_policy.space().impl_internal_space_instance(); m_team_size = m_team_size >= 0 ? m_team_size : arg_policy.team_size_recommended(arg_functor, reducer, @@ -1024,19 +938,19 @@ class ParallelReduce, FunctorTeamShmemSize::value(arg_functor, m_team_size); m_scratch_size[0] = m_shmem_size; m_scratch_size[1] = m_policy.scratch_size(1, m_team_size); - m_scratch_locks = - m_policy.space().impl_internal_space_instance()->m_scratch_locks; - m_scratch_ptr[1] = - m_team_size <= 0 - ? nullptr - : m_policy.space() - .impl_internal_space_instance() - ->resize_team_scratch_space( - static_cast(m_scratch_size[1]) * - (std::min(static_cast( - Kokkos::Experimental::HIP::concurrency() / - (m_team_size * m_vector_size)), - static_cast(m_league_size)))); + m_scratch_locks = internal_space_instance->m_scratch_locks; + if (m_team_size <= 0) { + m_scratch_ptr[1] = nullptr; + } else { + m_scratch_pool_id = internal_space_instance->acquire_team_scratch_space(); + m_scratch_ptr[1] = internal_space_instance->resize_team_scratch_space( + m_scratch_pool_id, + static_cast(m_scratch_size[1]) * + (std::min( + static_cast(HIP().concurrency() / + (m_team_size * m_vector_size)), + static_cast(m_league_size)))); + } // The global parallel_reduce does not support vector_length other than 1 at // the moment @@ -1046,8 +960,7 @@ class ParallelReduce, "greater than 1 is not currently supported for HIP for dynamic " "sized reduction types."); - if ((m_team_size < Kokkos::Experimental::Impl::HIPTraits::WarpSize) && - !UseShflReduction) + if ((m_team_size < HIPTraits::WarpSize) && !UseShflReduction) Impl::throw_runtime_exception( "Kokkos::parallel_reduce with a TeamPolicy using a team_size smaller " "than 64 is not currently supported with HIP for dynamic sized " @@ -1059,8 +972,7 @@ class ParallelReduce, const int shmem_size_total = m_team_begin + m_shmem_begin + m_shmem_size; if ((!Kokkos::Impl::is_integral_power_of_two(m_team_size) && !UseShflReduction) || - m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock < - shmem_size_total) { + internal_space_instance->m_maxShmemPerBlock < shmem_size_total) { Kokkos::Impl::throw_runtime_exception( std::string("Kokkos::Impl::ParallelReduce< HIP > bad team size")); } @@ -1073,6 +985,14 @@ class ParallelReduce, "large team size.")); } } + + ~ParallelReduce() { + if (m_scratch_pool_id >= 0) { + m_policy.space() + .impl_internal_space_instance() + ->release_team_scratch_space(m_scratch_pool_id); + } + } }; } // namespace Impl } // namespace Kokkos diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_ReduceScan.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_ReduceScan.hpp index 9002f69589..9de26b63a7 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_ReduceScan.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_ReduceScan.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_REDUCESCAN_HPP #define KOKKOS_HIP_REDUCESCAN_HPP @@ -49,6 +21,7 @@ #if defined(__HIPCC__) +#include #include namespace Kokkos { @@ -74,20 +47,19 @@ struct HIPReductionsFunctor { int const width, // How much of the warp participates Scalar& result) { for (int delta = skip_vector ? blockDim.x : 1; delta < width; delta *= 2) { - Scalar tmp = Kokkos::Experimental::shfl_down(value, delta, width); + Scalar tmp = shfl_down(value, delta, width); functor.join(&value, &tmp); } - Experimental::Impl::in_place_shfl(result, value, 0, width); + in_place_shfl(result, value, 0, width); } __device__ static inline void scalar_intra_block_reduction( FunctorType const& functor, Scalar value, bool const skip, Scalar* my_global_team_buffer_element, int const shared_elements, Scalar* shared_team_buffer_element) { - unsigned int constexpr warp_size = - Kokkos::Experimental::Impl::HIPTraits::WarpSize; - int const warp_id = (threadIdx.y * blockDim.x) / warp_size; + unsigned int constexpr warp_size = HIPTraits::WarpSize; + int const warp_id = (threadIdx.y * blockDim.x) / warp_size; Scalar* const my_shared_team_buffer_element = shared_team_buffer_element + warp_id % shared_elements; @@ -122,22 +94,19 @@ struct HIPReductionsFunctor { } __device__ static inline bool scalar_inter_block_reduction( - FunctorType const& functor, - ::Kokkos::Experimental::HIP::size_type const block_count, - ::Kokkos::Experimental::HIP::size_type* const shared_data, - ::Kokkos::Experimental::HIP::size_type* const global_data, - ::Kokkos::Experimental::HIP::size_type* const global_flags) { + FunctorType const& functor, HIP::size_type const block_count, + HIP::size_type* const shared_data, HIP::size_type* const global_data, + HIP::size_type* const global_flags) { Scalar* const global_team_buffer_element = reinterpret_cast(global_data); Scalar* const my_global_team_buffer_element = global_team_buffer_element + blockIdx.x; Scalar* shared_team_buffer_elements = reinterpret_cast(shared_data); - Scalar value = shared_team_buffer_elements[threadIdx.y]; - unsigned int constexpr warp_size = - Kokkos::Experimental::Impl::HIPTraits::WarpSize; - int shared_elements = blockDim.x * blockDim.y / warp_size; - int global_elements = block_count; + Scalar value = shared_team_buffer_elements[threadIdx.y]; + unsigned int constexpr warp_size = Impl::HIPTraits::WarpSize; + int shared_elements = blockDim.x * blockDim.y / warp_size; + int global_elements = block_count; __syncthreads(); scalar_intra_block_reduction(functor, value, true, @@ -185,10 +154,10 @@ struct HIPReductionsFunctor { // part of the reduction int const width) // How much of the warp participates { - int const lane_id = (threadIdx.y * blockDim.x + threadIdx.x) % - ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; + int const lane_id = + (threadIdx.y * blockDim.x + threadIdx.x) % HIPTraits::WarpSize; for (int delta = skip_vector ? blockDim.x : 1; delta < width; delta *= 2) { - if (lane_id + delta < ::Kokkos::Experimental::Impl::HIPTraits::WarpSize) { + if (lane_id + delta < HIPTraits::WarpSize) { functor.join(value, value + delta); } } @@ -198,39 +167,34 @@ struct HIPReductionsFunctor { __device__ static inline void scalar_intra_block_reduction( FunctorType const& functor, Scalar value, bool const skip, Scalar* result, int const /*shared_elements*/, Scalar* shared_team_buffer_element) { - int const warp_id = (threadIdx.y * blockDim.x) / - ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; + int const warp_id = (threadIdx.y * blockDim.x) / HIPTraits::WarpSize; Scalar* const my_shared_team_buffer_element = shared_team_buffer_element + threadIdx.y * blockDim.x + threadIdx.x; *my_shared_team_buffer_element = value; // Warp Level Reduction, ignoring Kokkos vector entries - scalar_intra_warp_reduction( - functor, my_shared_team_buffer_element, skip, - ::Kokkos::Experimental::Impl::HIPTraits::WarpSize); + scalar_intra_warp_reduction(functor, my_shared_team_buffer_element, skip, + HIPTraits::WarpSize); // Wait for every warp to be done before using one warp to do final cross // warp reduction __syncthreads(); if (warp_id == 0) { const unsigned int delta = - (threadIdx.y * blockDim.x + threadIdx.x) * - ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; + (threadIdx.y * blockDim.x + threadIdx.x) * HIPTraits::WarpSize; if (delta < blockDim.x * blockDim.y) *my_shared_team_buffer_element = shared_team_buffer_element[delta]; scalar_intra_warp_reduction( functor, my_shared_team_buffer_element, false, - blockDim.x * blockDim.y / - ::Kokkos::Experimental::Impl::HIPTraits::WarpSize); + blockDim.x * blockDim.y / HIPTraits::WarpSize); if (threadIdx.x + threadIdx.y == 0) *result = *shared_team_buffer_element; } } template __device__ static inline bool scalar_inter_block_reduction( - FunctorType const& functor, - ::Kokkos::Experimental::HIP::size_type const block_count, + FunctorType const& functor, HIP::size_type const block_count, SizeType* const shared_data, SizeType* const global_data, - ::Kokkos::Experimental::HIP::size_type* const global_flags) { + HIP::size_type* const global_flags) { Scalar* const global_team_buffer_element = reinterpret_cast(global_data); Scalar* const my_global_team_buffer_element = @@ -238,8 +202,7 @@ struct HIPReductionsFunctor { Scalar* shared_team_buffer_elements = reinterpret_cast(shared_data); Scalar value = shared_team_buffer_elements[threadIdx.y]; - int shared_elements = (blockDim.x * blockDim.y) / - ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; + int shared_elements = (blockDim.x * blockDim.y) / HIPTraits::WarpSize; int global_elements = block_count; __syncthreads(); @@ -300,9 +263,8 @@ __device__ void hip_intra_block_reduce_scan( // For that warp, we shift all indices logically to the end and ignore join // operations with unassigned indices in the warp when performing the intra // warp reduction/scan. - const bool is_full_warp = - (((threadIdx.y >> Experimental::Impl::HIPTraits::WarpIndexShift) + 1) - << Experimental::Impl::HIPTraits::WarpIndexShift) <= blockDim.y; + const bool is_full_warp = (((threadIdx.y >> HIPTraits::WarpIndexShift) + 1) + << HIPTraits::WarpIndexShift) <= blockDim.y; auto block_reduce_step = [&functor, value_count]( int const R, pointer_type const TD, int const S, @@ -314,24 +276,19 @@ __device__ void hip_intra_block_reduce_scan( }; // Intra-warp reduction: + int bit_shift = 0; { const unsigned mapped_idx = - threadIdx.y + (is_full_warp - ? 0 - : (not_less_power_of_two - blockDim.y) & - (Experimental::Impl::HIPTraits::WarpSize - 1)); + threadIdx.y + (is_full_warp ? 0 + : (not_less_power_of_two - blockDim.y) & + (HIPTraits::WarpSize - 1)); const pointer_type tdata_intra = base_data + value_count * threadIdx.y; const pointer_type warp_start = - base_data + - value_count * - ((threadIdx.y >> Experimental::Impl::HIPTraits::WarpIndexShift) - << Experimental::Impl::HIPTraits::WarpIndexShift); - block_reduce_step(mapped_idx, tdata_intra, 0, warp_start, 0); - block_reduce_step(mapped_idx, tdata_intra, 1, warp_start, 0); - block_reduce_step(mapped_idx, tdata_intra, 2, warp_start, 0); - block_reduce_step(mapped_idx, tdata_intra, 3, warp_start, 0); - block_reduce_step(mapped_idx, tdata_intra, 4, warp_start, 0); - block_reduce_step(mapped_idx, tdata_intra, 5, warp_start, 0); + base_data + value_count * ((threadIdx.y >> HIPTraits::WarpIndexShift) + << HIPTraits::WarpIndexShift); + for (; (1 << bit_shift) < HIPTraits::WarpSize; ++bit_shift) { + block_reduce_step(mapped_idx, tdata_intra, bit_shift, warp_start, 0); + } } __syncthreads(); // Wait for all warps to reduce @@ -343,42 +300,26 @@ __device__ void hip_intra_block_reduce_scan( // following reduction, we shift all indices logically to the end of the // next power-of-two to the number of warps. const unsigned n_active_warps = - ((blockDim.y - 1) >> Experimental::Impl::HIPTraits::WarpIndexShift) + 1; + ((blockDim.y - 1) >> HIPTraits::WarpIndexShift) + 1; if (threadIdx.y < n_active_warps) { const bool is_full_warp_inter = - threadIdx.y < - (blockDim.y >> Experimental::Impl::HIPTraits::WarpIndexShift); + threadIdx.y < (blockDim.y >> HIPTraits::WarpIndexShift); pointer_type const tdata_inter = base_data + - value_count * - (is_full_warp_inter - ? (threadIdx.y - << Experimental::Impl::HIPTraits::WarpIndexShift) + - (Experimental::Impl::HIPTraits::WarpSize - 1) - : blockDim.y - 1); + value_count * (is_full_warp_inter + ? (threadIdx.y << HIPTraits::WarpIndexShift) + + (HIPTraits::WarpSize - 1) + : blockDim.y - 1); const unsigned index_shift = is_full_warp_inter ? 0 - : blockDim.y - (threadIdx.y - << Experimental::Impl::HIPTraits::WarpIndexShift); - const int rtid_inter = - (threadIdx.y << Experimental::Impl::HIPTraits::WarpIndexShift) + - (Experimental::Impl::HIPTraits::WarpSize - 1) - index_shift; + : blockDim.y - (threadIdx.y << HIPTraits::WarpIndexShift); + const int rtid_inter = (threadIdx.y << HIPTraits::WarpIndexShift) + + (HIPTraits::WarpSize - 1) - index_shift; - if ((1 << 6) < BlockSizeMask) { - block_reduce_step(rtid_inter, tdata_inter, 6, base_data, index_shift); - } - if ((1 << 7) < BlockSizeMask) { - block_reduce_step(rtid_inter, tdata_inter, 7, base_data, index_shift); - } - if ((1 << 8) < BlockSizeMask) { - block_reduce_step(rtid_inter, tdata_inter, 8, base_data, index_shift); - } - if ((1 << 9) < BlockSizeMask) { - block_reduce_step(rtid_inter, tdata_inter, 9, base_data, index_shift); - } - if ((1 << 10) < BlockSizeMask) { - block_reduce_step(rtid_inter, tdata_inter, 10, base_data, index_shift); + for (; (1 << bit_shift) < BlockSizeMask; ++bit_shift) { + block_reduce_step(rtid_inter, tdata_inter, bit_shift, base_data, + index_shift); } } } @@ -388,13 +329,11 @@ __device__ void hip_intra_block_reduce_scan( if (DoScan) { // Update all the values for the respective warps (except for the last one) // by adding from the last value of the previous warp. - const unsigned int WarpMask = Experimental::Impl::HIPTraits::WarpSize - 1; + const unsigned int WarpMask = HIPTraits::WarpSize - 1; const int is_last_thread_in_warp = - is_full_warp ? ((threadIdx.y & WarpMask) == - Experimental::Impl::HIPTraits::WarpSize - 1) + is_full_warp ? ((threadIdx.y & WarpMask) == HIPTraits::WarpSize - 1) : (threadIdx.y == blockDim.y - 1); - if (threadIdx.y >= Experimental::Impl::HIPTraits::WarpSize && - !is_last_thread_in_warp) { + if (threadIdx.y >= HIPTraits::WarpSize && !is_last_thread_in_warp) { const int offset_to_previous_warp_total = (threadIdx.y & (~WarpMask)) - 1; functor.join(base_data + value_count * threadIdx.y, base_data + value_count * offset_to_previous_warp_total); @@ -413,11 +352,9 @@ __device__ void hip_intra_block_reduce_scan( template __device__ bool hip_single_inter_block_reduce_scan_impl( - FunctorType const& functor, - ::Kokkos::Experimental::HIP::size_type const block_id, - ::Kokkos::Experimental::HIP::size_type const block_count, - SizeType* const shared_data, SizeType* const global_data, - ::Kokkos::Experimental::HIP::size_type* const global_flags) { + FunctorType const& functor, HIP::size_type const block_id, + HIP::size_type const block_count, SizeType* const shared_data, + SizeType* const global_data, HIP::size_type* const global_flags) { using size_type = SizeType; using value_type = typename FunctorType::value_type; using pointer_type = typename FunctorType::pointer_type; @@ -518,11 +455,9 @@ __device__ bool hip_single_inter_block_reduce_scan_impl( template __device__ bool hip_single_inter_block_reduce_scan( - FunctorType const& functor, - ::Kokkos::Experimental::HIP::size_type const block_id, - ::Kokkos::Experimental::HIP::size_type const block_count, - SizeType* const shared_data, SizeType* const global_data, - ::Kokkos::Experimental::HIP::size_type* const global_flags) { + FunctorType const& functor, HIP::size_type const block_id, + HIP::size_type const block_count, SizeType* const shared_data, + SizeType* const global_data, HIP::size_type* const global_flags) { // If we are doing a reduction and we don't do an array reduction, we use the // reduction-only path. Otherwise, we use the common path between reduction // and scan. @@ -547,8 +482,7 @@ inline std::enable_if_t hip_single_inter_block_reduce_scan_shmem(const FunctorType& functor, const unsigned BlockSize) { using Analysis = Impl::FunctorAnalysis, - FunctorType>; + RangePolicy, FunctorType>; return (BlockSize + 2) * Analysis::value_size(functor); } @@ -558,8 +492,7 @@ inline std::enable_if_t hip_single_inter_block_reduce_scan_shmem(const FunctorType& functor, const unsigned BlockSize) { using Analysis = Impl::FunctorAnalysis, - FunctorType>; + RangePolicy, FunctorType>; return (BlockSize + 2) * Analysis::value_size(functor); } diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_SharedAllocationRecord.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_SharedAllocationRecord.cpp new file mode 100644 index 0000000000..ea599989e7 --- /dev/null +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_SharedAllocationRecord.cpp @@ -0,0 +1,155 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_IMPL_PUBLIC_INCLUDE +#define KOKKOS_IMPL_PUBLIC_INCLUDE +#endif + +#include +#include +#include + +namespace Kokkos { +namespace Impl { + +#ifdef KOKKOS_ENABLE_DEBUG +SharedAllocationRecord + SharedAllocationRecord::s_root_record; + +SharedAllocationRecord + SharedAllocationRecord::s_root_record; + +SharedAllocationRecord + SharedAllocationRecord::s_root_record; +#endif + +SharedAllocationRecord::~SharedAllocationRecord() { + auto alloc_size = SharedAllocationRecord::m_alloc_size; + m_space.deallocate(m_label.c_str(), + SharedAllocationRecord::m_alloc_ptr, + alloc_size, (alloc_size - sizeof(SharedAllocationHeader))); +} + +SharedAllocationRecord::~SharedAllocationRecord() { + m_space.deallocate(m_label.c_str(), + SharedAllocationRecord::m_alloc_ptr, + SharedAllocationRecord::m_alloc_size); +} + +SharedAllocationRecord::~SharedAllocationRecord() { + m_space.deallocate(m_label.c_str(), + SharedAllocationRecord::m_alloc_ptr, + SharedAllocationRecord::m_alloc_size); +} + +SharedAllocationRecord::SharedAllocationRecord( + const HIPSpace& arg_space, const std::string& arg_label, + const size_t arg_alloc_size, + const SharedAllocationRecord::function_type arg_dealloc) + // Pass through allocated [ SharedAllocationHeader , user_memory ] + // Pass through deallocation function + : base_t( +#ifdef KOKKOS_ENABLE_DEBUG + &SharedAllocationRecord::s_root_record, +#endif + Kokkos::Impl::checked_allocation_with_header(arg_space, arg_label, + arg_alloc_size), + sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc, + arg_label), + m_space(arg_space) { + + SharedAllocationHeader header; + + this->base_t::_fill_host_accessible_header_info(header, arg_label); + + // Copy to device memory + HIP exec; + Kokkos::Impl::DeepCopy( + exec, RecordBase::m_alloc_ptr, &header, sizeof(SharedAllocationHeader)); + exec.fence( + "SharedAllocationRecord::SharedAllocationRecord(): fence after copying header from " + "HostSpace"); +} + +SharedAllocationRecord::SharedAllocationRecord( + const HIP& arg_exec_space, const HIPSpace& arg_space, + const std::string& arg_label, const size_t arg_alloc_size, + const SharedAllocationRecord::function_type arg_dealloc) + // Pass through allocated [ SharedAllocationHeader , user_memory ] + // Pass through deallocation function + : base_t( +#ifdef KOKKOS_ENABLE_DEBUG + &SharedAllocationRecord::s_root_record, +#endif + Kokkos::Impl::checked_allocation_with_header(arg_space, arg_label, + arg_alloc_size), + sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc, + arg_label), + m_space(arg_space) { + + SharedAllocationHeader header; + + this->base_t::_fill_host_accessible_header_info(header, arg_label); + + // Copy to device memory + Kokkos::Impl::DeepCopy(arg_exec_space, + RecordBase::m_alloc_ptr, &header, + sizeof(SharedAllocationHeader)); +} + +SharedAllocationRecord::SharedAllocationRecord( + const HIPHostPinnedSpace& arg_space, const std::string& arg_label, + const size_t arg_alloc_size, + const SharedAllocationRecord::function_type arg_dealloc) + // Pass through allocated [ SharedAllocationHeader , user_memory ] + // Pass through deallocation function + : base_t( +#ifdef KOKKOS_ENABLE_DEBUG + &SharedAllocationRecord::s_root_record, +#endif + Kokkos::Impl::checked_allocation_with_header(arg_space, arg_label, + arg_alloc_size), + sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc, + arg_label), + m_space(arg_space) { + // Fill in the Header information, directly accessible via host pinned memory + this->base_t::_fill_host_accessible_header_info(*RecordBase::m_alloc_ptr, + arg_label); +} + +SharedAllocationRecord::SharedAllocationRecord( + const HIPManagedSpace& arg_space, const std::string& arg_label, + const size_t arg_alloc_size, + const SharedAllocationRecord::function_type arg_dealloc) + // Pass through allocated [ SharedAllocationHeader , user_memory ] + // Pass through deallocation function + : base_t( +#ifdef KOKKOS_ENABLE_DEBUG + &SharedAllocationRecord::s_root_record, +#endif + Kokkos::Impl::checked_allocation_with_header(arg_space, arg_label, + arg_alloc_size), + sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc, + arg_label), + m_space(arg_space) { + // Fill in the Header information, directly accessible via managed memory + this->base_t::_fill_host_accessible_header_info(*RecordBase::m_alloc_ptr, + arg_label); +} + +} // namespace Impl +} // namespace Kokkos diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_SharedAllocationRecord.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_SharedAllocationRecord.hpp new file mode 100644 index 0000000000..e68bad9723 --- /dev/null +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_SharedAllocationRecord.hpp @@ -0,0 +1,137 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_HIP_SHARED_ALLOCATION_RECORD_HPP +#define KOKKOS_HIP_SHARED_ALLOCATION_RECORD_HPP + +#include + +namespace Kokkos { +namespace Impl { + +template <> +class SharedAllocationRecord + : public HostInaccessibleSharedAllocationRecordCommon { + private: + friend class SharedAllocationRecordCommon; + friend class HostInaccessibleSharedAllocationRecordCommon; + using base_t = HostInaccessibleSharedAllocationRecordCommon; + using RecordBase = SharedAllocationRecord; + + SharedAllocationRecord(const SharedAllocationRecord&) = delete; + SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; + +#ifdef KOKKOS_ENABLE_DEBUG + static RecordBase s_root_record; +#endif + + const HIPSpace m_space; + + protected: + ~SharedAllocationRecord(); + + template + SharedAllocationRecord( + const ExecutionSpace& /*exec*/, const HIPSpace& arg_space, + const std::string& arg_label, const size_t arg_alloc_size, + const RecordBase::function_type arg_dealloc = &base_t::deallocate) + : SharedAllocationRecord(arg_space, arg_label, arg_alloc_size, + arg_dealloc) {} + + SharedAllocationRecord( + const HIP& exec_space, const HIPSpace& arg_space, + const std::string& arg_label, const size_t arg_alloc_size, + const RecordBase::function_type arg_dealloc = &base_t::deallocate); + + SharedAllocationRecord( + const HIPSpace& arg_space, const std::string& arg_label, + const size_t arg_alloc_size, + const RecordBase::function_type arg_dealloc = &base_t::deallocate); +}; + +template <> +class SharedAllocationRecord + : public SharedAllocationRecordCommon { + private: + friend class SharedAllocationRecordCommon; + using base_t = SharedAllocationRecordCommon; + using RecordBase = SharedAllocationRecord; + + SharedAllocationRecord(const SharedAllocationRecord&) = delete; + SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; + +#ifdef KOKKOS_ENABLE_DEBUG + static RecordBase s_root_record; +#endif + + const HIPHostPinnedSpace m_space; + + protected: + ~SharedAllocationRecord(); + SharedAllocationRecord() = default; + + template + SharedAllocationRecord( + const ExecutionSpace& /*exec_space*/, const HIPHostPinnedSpace& arg_space, + const std::string& arg_label, const size_t arg_alloc_size, + const RecordBase::function_type arg_dealloc = &base_t::deallocate) + : SharedAllocationRecord(arg_space, arg_label, arg_alloc_size, + arg_dealloc) {} + + SharedAllocationRecord( + const HIPHostPinnedSpace& arg_space, const std::string& arg_label, + const size_t arg_alloc_size, + const RecordBase::function_type arg_dealloc = &base_t::deallocate); +}; + +template <> +class SharedAllocationRecord + : public SharedAllocationRecordCommon { + private: + friend class SharedAllocationRecordCommon; + using base_t = SharedAllocationRecordCommon; + using RecordBase = SharedAllocationRecord; + + SharedAllocationRecord(const SharedAllocationRecord&) = delete; + SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; + +#ifdef KOKKOS_ENABLE_DEBUG + static RecordBase s_root_record; +#endif + + const HIPManagedSpace m_space; + + protected: + ~SharedAllocationRecord(); + SharedAllocationRecord() = default; + + template + SharedAllocationRecord( + const ExecutionSpace& /*exec_space*/, const HIPManagedSpace& arg_space, + const std::string& arg_label, const size_t arg_alloc_size, + const RecordBase::function_type arg_dealloc = &base_t::deallocate) + : SharedAllocationRecord(arg_space, arg_label, arg_alloc_size, + arg_dealloc) {} + + SharedAllocationRecord( + const HIPManagedSpace& arg_space, const std::string& arg_label, + const size_t arg_alloc_size, + const RecordBase::function_type arg_dealloc = &base_t::deallocate); +}; +} // namespace Impl +} // namespace Kokkos + +#endif diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Shuffle_Reduce.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Shuffle_Reduce.hpp index d0bbc18da8..cca5e9ff26 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Shuffle_Reduce.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Shuffle_Reduce.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_SHUFFLE_REDUCE_HPP #define KOKKOS_HIP_SHUFFLE_REDUCE_HPP @@ -68,11 +40,9 @@ __device__ inline void hip_intra_warp_shuffle_reduction( unsigned int shift = 1; // Reduce over values from threads with different threadIdx.y - unsigned int constexpr warp_size = - Kokkos::Experimental::Impl::HIPTraits::WarpSize; + unsigned int constexpr warp_size = HIPTraits::WarpSize; while (blockDim.x * shift < warp_size) { - ValueType const tmp = - Kokkos::Experimental::shfl_down(result, blockDim.x * shift, warp_size); + ValueType const tmp = shfl_down(result, blockDim.x * shift, warp_size); // Only join if upper thread is active (this allows non power of two for // blockDim.y) if (threadIdx.y + shift < max_active_thread) { @@ -82,16 +52,15 @@ __device__ inline void hip_intra_warp_shuffle_reduction( } // Broadcast the result to all the threads in the warp - result = Kokkos::Experimental::shfl(result, 0, warp_size); + result = shfl(result, 0, warp_size); } template __device__ inline void hip_inter_warp_shuffle_reduction( ValueType& value, const ReducerType& reducer, const int max_active_thread = blockDim.y) { - unsigned int constexpr warp_size = - Kokkos::Experimental::Impl::HIPTraits::WarpSize; - int constexpr step_width = 8; + unsigned int constexpr warp_size = HIPTraits::WarpSize; + int constexpr step_width = 8; // Depending on the ValueType __shared__ memory must be aligned up to 8 byte // boundaries. The reason not to use ValueType directly is that for types with // constructors it could lead to race conditions. @@ -131,9 +100,9 @@ template __device__ inline bool hip_inter_block_shuffle_reduction( typename FunctorType::reference_type value, typename FunctorType::reference_type neutral, FunctorType const& reducer, - Kokkos::Experimental::HIP::size_type* const m_scratch_space, + HIP::size_type* const m_scratch_space, typename FunctorType::pointer_type const /*result*/, - Kokkos::Experimental::HIP::size_type* const m_scratch_flags, + HIP::size_type* const m_scratch_flags, int const max_active_thread = blockDim.y) { using pointer_type = typename FunctorType::pointer_type; using value_type = typename FunctorType::value_type; @@ -155,13 +124,13 @@ __device__ inline bool hip_inter_block_shuffle_reduction( // block values from global scratch_memory bool last_block = false; __syncthreads(); - int constexpr warp_size = Kokkos::Experimental::Impl::HIPTraits::WarpSize; + int constexpr warp_size = HIPTraits::WarpSize; if (id < warp_size) { - Kokkos::Experimental::HIP::size_type count; + HIP::size_type count; // Figure out whether this is the last block if (id == 0) count = Kokkos::atomic_fetch_add(m_scratch_flags, 1); - count = Kokkos::Experimental::shfl(count, 0, warp_size); + count = shfl(count, 0, warp_size); // Last block does the inter block reduction if (count == gridDim.x - 1) { @@ -186,7 +155,7 @@ __device__ inline bool hip_inter_block_shuffle_reduction( // valid (allows gridDim.x non power of two and i) { - value_type tmp = Kokkos::Experimental::shfl_down(value, i, warp_size); + value_type tmp = shfl_down(value, i, warp_size); if (id + i < gridDim.x) reducer.join(&value, &tmp); } } diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp index aee9756af0..07b9382ab7 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #define KOKKOS_IMPL_PUBLIC_INCLUDE @@ -49,14 +21,18 @@ #include #include -#include -#include +#include + +#include +#include #include #include #include #include +#include + #include #include #include @@ -78,72 +54,11 @@ bool hip_driver_check_page_migration(int deviceId) { return static_cast(hasManagedMemory); } } // namespace -namespace Kokkos { -namespace Impl { - -namespace { -hipStream_t get_deep_copy_stream() { - static hipStream_t s = nullptr; - if (s == nullptr) { - KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamCreate(&s)); - } - return s; -} -} // namespace - -void DeepCopyHIP(void* dst, void const* src, size_t n) { - KOKKOS_IMPL_HIP_SAFE_CALL(hipMemcpyAsync(dst, src, n, hipMemcpyDefault)); -} - -void DeepCopyAsyncHIP(const Kokkos::Experimental::HIP& instance, void* dst, - void const* src, size_t n) { - KOKKOS_IMPL_HIP_SAFE_CALL( - hipMemcpyAsync(dst, src, n, hipMemcpyDefault, instance.hip_stream())); -} - -void DeepCopyAsyncHIP(void* dst, void const* src, size_t n) { - hipStream_t s = get_deep_copy_stream(); - KOKKOS_IMPL_HIP_SAFE_CALL(hipMemcpyAsync(dst, src, n, hipMemcpyDefault, s)); - Kokkos::Tools::Experimental::Impl::profile_fence_event< - Kokkos::Experimental::HIP>( - "Kokkos::Impl::DeepCopyAsyncHIP: Post Deep Copy Fence on Deep-Copy " - "stream", - Kokkos::Tools::Experimental::SpecialSynchronizationCases:: - DeepCopyResourceSynchronization, - [&]() { KOKKOS_IMPL_HIP_SAFE_CALL(hipStreamSynchronize(s)); }); -} - -} // namespace Impl -} // namespace Kokkos - -/*--------------------------------------------------------------------------*/ -/*--------------------------------------------------------------------------*/ - -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -namespace Kokkos { - -KOKKOS_DEPRECATED void Experimental::HIPSpace::access_error() { - const std::string msg( - "Kokkos::Experimental::HIPSpace::access_error attempt to execute " - "Experimental::HIP function from non-HIP space"); - Kokkos::Impl::throw_runtime_exception(msg); -} - -KOKKOS_DEPRECATED void Experimental::HIPSpace::access_error(const void* const) { - const std::string msg( - "Kokkos::Experimental::HIPSpace::access_error attempt to execute " - "Experimental::HIP function from non-HIP space"); - Kokkos::Impl::throw_runtime_exception(msg); -} - -} // namespace Kokkos -#endif /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ namespace Kokkos { -namespace Experimental { HIPSpace::HIPSpace() : m_device(HIP().hip_device()) {} @@ -172,9 +87,10 @@ void* HIPSpace::impl_allocate( // This is the only way to clear the last error, which we should do here // since we're turning it into an exception here (void)hipGetLastError(); - throw HIPRawMemoryAllocationFailure( + throw Experimental::HIPRawMemoryAllocationFailure( arg_alloc_size, error_code, - RawMemoryAllocationFailure::AllocationMechanism::HIPMalloc); + Experimental::RawMemoryAllocationFailure::AllocationMechanism:: + HIPMalloc); } if (Kokkos::Profiling::profileLibraryLoaded()) { const size_t reported_size = @@ -205,9 +121,10 @@ void* HIPHostPinnedSpace::impl_allocate( // This is the only way to clear the last error, which we should do here // since we're turning it into an exception here (void)hipGetLastError(); - throw HIPRawMemoryAllocationFailure( + throw Experimental::HIPRawMemoryAllocationFailure( arg_alloc_size, error_code, - RawMemoryAllocationFailure::AllocationMechanism::HIPHostMalloc); + Experimental::RawMemoryAllocationFailure::AllocationMechanism:: + HIPHostMalloc); } if (Kokkos::Profiling::profileLibraryLoaded()) { const size_t reported_size = @@ -235,41 +152,46 @@ void* HIPManagedSpace::impl_allocate( if (arg_alloc_size > 0) { if (is_first_hip_managed_allocation.exchange(false) && Kokkos::show_warnings()) { - if (!hip_driver_check_page_migration(m_device)) { - std::cerr << R"warning( + do { // hack to avoid spamming users with too many warnings + if (!hip_driver_check_page_migration(m_device)) { + std::cerr << R"warning( Kokkos::HIP::allocation WARNING: The combination of device and system configuration does not support page migration between device and host. HIPManagedSpace might not work as expected. Please refer to the ROCm documentation on unified/managed memory.)warning" - << std::endl; - } + << std::endl; + break; // do not warn about HSA_XNACK environement variable + } - // check for correct runtime environment - const char* hsa_xnack = std::getenv("HSA_XNACK"); - if (!hsa_xnack) - std::cerr << R"warning( + // check for correct runtime environment + const char* hsa_xnack = std::getenv("HSA_XNACK"); + if (!hsa_xnack) + std::cerr << R"warning( Kokkos::HIP::runtime WARNING: Kokkos did not find an environment variable 'HSA_XNACK' for the current process. Nevertheless, xnack is enabled for all processes if amdgpu.noretry=0 was set in the Linux kernel boot line. Without xnack enabled, Kokkos::HIPManaged might not behave as expected.)warning" - << std::endl; - else if (Kokkos::Impl::strcmp(hsa_xnack, "1") != 0) - std::cerr << "Kokkos::HIP::runtime WARNING: Kokkos detected the " - "environement variable " - << "'HSA_XNACK=" << hsa_xnack << "\n" - << "Kokkos advises to set it to '1' to enable it per process." - << std::endl; + << std::endl; + else if (Kokkos::Impl::strcmp(hsa_xnack, "1") != 0) + std::cerr + << "Kokkos::HIP::runtime WARNING: Kokkos detected the " + "environement variable " + << "'HSA_XNACK'=" << hsa_xnack << "\n" + << "Kokkos advises to set it to '1' to enable it per process." + << std::endl; + } while (false); } auto const error_code = hipMallocManaged(&ptr, arg_alloc_size); if (error_code != hipSuccess) { // This is the only way to clear the last error, which we should do here // since we're turning it into an exception here (void)hipGetLastError(); - throw HIPRawMemoryAllocationFailure( + throw Experimental::HIPRawMemoryAllocationFailure( arg_alloc_size, error_code, - RawMemoryAllocationFailure::AllocationMechanism::HIPMallocManaged); + Experimental::RawMemoryAllocationFailure::AllocationMechanism:: + HIPMallocManaged); } KOKKOS_IMPL_HIP_SAFE_CALL(hipMemAdvise( ptr, arg_alloc_size, hipMemAdviseSetCoarseGrain, m_device)); @@ -359,257 +281,10 @@ void HIPManagedSpace::impl_deallocate( KOKKOS_IMPL_HIP_SAFE_CALL(hipFree(arg_alloc_ptr)); } -} // namespace Experimental -} // namespace Kokkos - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -namespace Kokkos { -namespace Impl { - -#ifdef KOKKOS_ENABLE_DEBUG -SharedAllocationRecord - SharedAllocationRecord::s_root_record; - -SharedAllocationRecord SharedAllocationRecord< - Kokkos::Experimental::HIPHostPinnedSpace, void>::s_root_record; - -SharedAllocationRecord SharedAllocationRecord< - Kokkos::Experimental::HIPManagedSpace, void>::s_root_record; -#endif - -SharedAllocationRecord::~SharedAllocationRecord() { - auto alloc_size = SharedAllocationRecord::m_alloc_size; - m_space.deallocate(m_label.c_str(), - SharedAllocationRecord::m_alloc_ptr, - alloc_size, (alloc_size - sizeof(SharedAllocationHeader))); -} - -SharedAllocationRecord::~SharedAllocationRecord() { - m_space.deallocate(m_label.c_str(), - SharedAllocationRecord::m_alloc_ptr, - SharedAllocationRecord::m_alloc_size); -} - -SharedAllocationRecord::~SharedAllocationRecord() { - m_space.deallocate(m_label.c_str(), - SharedAllocationRecord::m_alloc_ptr, - SharedAllocationRecord::m_alloc_size); -} - -SharedAllocationRecord:: - SharedAllocationRecord( - const Kokkos::Experimental::HIPSpace& arg_space, - const std::string& arg_label, const size_t arg_alloc_size, - const SharedAllocationRecord::function_type arg_dealloc) - // Pass through allocated [ SharedAllocationHeader , user_memory ] - // Pass through deallocation function - : base_t( -#ifdef KOKKOS_ENABLE_DEBUG - &SharedAllocationRecord::s_root_record, -#endif - Kokkos::Impl::checked_allocation_with_header(arg_space, arg_label, - arg_alloc_size), - sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc, - arg_label), - m_space(arg_space) { - - SharedAllocationHeader header; - - this->base_t::_fill_host_accessible_header_info(header, arg_label); - - // Copy to device memory - Kokkos::Experimental::HIP exec; - Kokkos::Impl::DeepCopy( - exec, RecordBase::m_alloc_ptr, &header, sizeof(SharedAllocationHeader)); - exec.fence( - "SharedAllocationRecord::SharedAllocationRecord(): fence after copying header from " - "HostSpace"); -} - -SharedAllocationRecord:: - SharedAllocationRecord( - const Kokkos::Experimental::HIP& arg_exec_space, - const Kokkos::Experimental::HIPSpace& arg_space, - const std::string& arg_label, const size_t arg_alloc_size, - const SharedAllocationRecord::function_type arg_dealloc) - // Pass through allocated [ SharedAllocationHeader , user_memory ] - // Pass through deallocation function - : base_t( -#ifdef KOKKOS_ENABLE_DEBUG - &SharedAllocationRecord::s_root_record, -#endif - Kokkos::Impl::checked_allocation_with_header(arg_space, arg_label, - arg_alloc_size), - sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc, - arg_label), - m_space(arg_space) { - - SharedAllocationHeader header; - - this->base_t::_fill_host_accessible_header_info(header, arg_label); - - // Copy to device memory - Kokkos::Impl::DeepCopy( - arg_exec_space, RecordBase::m_alloc_ptr, &header, - sizeof(SharedAllocationHeader)); -} - -SharedAllocationRecord:: - SharedAllocationRecord( - const Kokkos::Experimental::HIPHostPinnedSpace& arg_space, - const std::string& arg_label, const size_t arg_alloc_size, - const SharedAllocationRecord::function_type arg_dealloc) - // Pass through allocated [ SharedAllocationHeader , user_memory ] - // Pass through deallocation function - : base_t( -#ifdef KOKKOS_ENABLE_DEBUG - &SharedAllocationRecord::s_root_record, -#endif - Kokkos::Impl::checked_allocation_with_header(arg_space, arg_label, - arg_alloc_size), - sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc, - arg_label), - m_space(arg_space) { - // Fill in the Header information, directly accessible via host pinned memory - this->base_t::_fill_host_accessible_header_info(*RecordBase::m_alloc_ptr, - arg_label); -} - -SharedAllocationRecord:: - SharedAllocationRecord( - const Kokkos::Experimental::HIPManagedSpace& arg_space, - const std::string& arg_label, const size_t arg_alloc_size, - const SharedAllocationRecord::function_type arg_dealloc) - // Pass through allocated [ SharedAllocationHeader , user_memory ] - // Pass through deallocation function - : base_t( -#ifdef KOKKOS_ENABLE_DEBUG - &SharedAllocationRecord::s_root_record, -#endif - Kokkos::Impl::checked_allocation_with_header(arg_space, arg_label, - arg_alloc_size), - sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc, - arg_label), - m_space(arg_space) { - // Fill in the Header information, directly accessible via managed memory - this->base_t::_fill_host_accessible_header_info(*RecordBase::m_alloc_ptr, - arg_label); -} - -} // namespace Impl } // namespace Kokkos /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ -namespace Kokkos { -namespace Experimental { - -int HIP::concurrency() { - auto const& prop = hip_device_prop(); - return prop.maxThreadsPerMultiProcessor * prop.multiProcessorCount; -} -int HIP::impl_is_initialized() { - return Impl::HIPInternal::singleton().is_initialized(); -} - -void HIP::impl_initialize(InitializationSettings const& settings) { - Impl::HIPInternal::singleton().initialize(::Kokkos::Impl::get_gpu(settings)); -} - -void HIP::impl_finalize() { Impl::HIPInternal::singleton().finalize(); } - -HIP::HIP() - : m_space_instance(&Impl::HIPInternal::singleton(), - [](Impl::HIPInternal*) {}) { - Impl::HIPInternal::singleton().verify_is_initialized( - "HIP instance constructor"); -} - -HIP::HIP(hipStream_t const stream, bool manage_stream) - : m_space_instance(new Impl::HIPInternal, [](Impl::HIPInternal* ptr) { - ptr->finalize(); - delete ptr; - }) { - Impl::HIPInternal::singleton().verify_is_initialized( - "HIP instance constructor"); - m_space_instance->initialize(Impl::HIPInternal::singleton().m_hipDev, stream, - manage_stream); -} - -void HIP::print_configuration(std::ostream& os, bool /*verbose*/) const { - os << "Device Execution Space:\n"; - os << " KOKKOS_ENABLE_HIP: yes\n"; - - os << "HIP Options:\n"; - os << " KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE: "; -#ifdef KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE - os << "yes\n"; -#else - os << "no\n"; -#endif - - os << "\nRuntime Configuration:\n"; - - m_space_instance->print_configuration(os); -} - -uint32_t HIP::impl_instance_id() const noexcept { - return m_space_instance->impl_get_instance_id(); -} -void HIP::impl_static_fence(const std::string& name) { - Kokkos::Tools::Experimental::Impl::profile_fence_event< - Kokkos::Experimental::HIP>( - name, - Kokkos::Tools::Experimental::SpecialSynchronizationCases:: - GlobalDeviceSynchronization, - [&]() { KOKKOS_IMPL_HIP_SAFE_CALL(hipDeviceSynchronize()); }); -} - -void HIP::fence(const std::string& name) const { - m_space_instance->fence(name); -} - -hipStream_t HIP::hip_stream() const { return m_space_instance->m_stream; } - -int HIP::hip_device() const { return impl_internal_space_instance()->m_hipDev; } - -hipDeviceProp_t const& HIP::hip_device_prop() { - return Impl::HIPInternal::singleton().m_deviceProp; -} - -const char* HIP::name() { return "HIP"; } - -} // namespace Experimental - -namespace Impl { - -int g_hip_space_factory_initialized = - initialize_space_factory<::Kokkos::Experimental::HIP>("150_HIP"); - -} // namespace Impl - -#ifdef KOKKOS_ENABLE_CXX14 -namespace Tools { -namespace Experimental { -constexpr DeviceType DeviceTypeTraits::id; -} -} // namespace Tools -#endif - -} // namespace Kokkos - -//============================================================================== -// {{{1 #include @@ -619,16 +294,10 @@ namespace Impl { // To avoid additional compilation cost for something that's (mostly?) not // performance sensitive, we explicity instantiate these CRTP base classes here, // where we have access to the associated *_timpl.hpp header files. -template class HostInaccessibleSharedAllocationRecordCommon< - Kokkos::Experimental::HIPSpace>; -template class SharedAllocationRecordCommon; -template class SharedAllocationRecordCommon< - Kokkos::Experimental::HIPHostPinnedSpace>; -template class SharedAllocationRecordCommon< - Kokkos::Experimental::HIPManagedSpace>; +template class HostInaccessibleSharedAllocationRecordCommon; +template class SharedAllocationRecordCommon; +template class SharedAllocationRecordCommon; +template class SharedAllocationRecordCommon; } // end namespace Impl } // end namespace Kokkos - -// end Explicit instantiations of CRTP Base classes }}}1 -//============================================================================== diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.hpp new file mode 100644 index 0000000000..902b6f0552 --- /dev/null +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.hpp @@ -0,0 +1,345 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_HIPSPACE_HPP +#define KOKKOS_HIPSPACE_HPP + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include // HIP_SAFE_CALL + +#include +#include + +#include + +/*--------------------------------------------------------------------------*/ + +namespace Kokkos { +namespace Impl { + +template +struct is_hip_type_space : public std::false_type {}; + +} // namespace Impl + +/** \brief HIP on-device memory management */ + +class HIPSpace { + public: + //! Tag this class as a kokkos memory space + using memory_space = HIPSpace; + using execution_space = HIP; + using device_type = Kokkos::Device; + + using size_type = unsigned int; + + /*--------------------------------*/ + + HIPSpace(); + HIPSpace(HIPSpace&& rhs) = default; + HIPSpace(const HIPSpace& rhs) = default; + HIPSpace& operator=(HIPSpace&& rhs) = default; + HIPSpace& operator=(const HIPSpace& rhs) = default; + ~HIPSpace() = default; + + /**\brief Allocate untracked memory in the hip space */ + void* allocate(const size_t arg_alloc_size) const; + void* allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; + + /**\brief Deallocate untracked memory in the hip space */ + void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; + void deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; + + private: + template + friend class LogicalMemorySpace; + void* impl_allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0, + const Kokkos::Tools::SpaceHandle = + Kokkos::Tools::make_space_handle(name())) const; + void impl_deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0, + const Kokkos::Tools::SpaceHandle = + Kokkos::Tools::make_space_handle(name())) const; + + public: + /**\brief Return Name of the MemorySpace */ + static constexpr const char* name() { return "HIP"; } + + private: + int m_device; ///< Which HIP device + + friend class Kokkos::Impl::SharedAllocationRecord; +}; + +template <> +struct Impl::is_hip_type_space : public std::true_type {}; + +} // namespace Kokkos + +/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ + +namespace Kokkos { +/** \brief Host memory that is accessible to HIP execution space + * through HIP's host-pinned memory allocation. + */ +class HIPHostPinnedSpace { + public: + //! Tag this class as a kokkos memory space + /** \brief Memory is in HostSpace so use the HostSpace::execution_space */ + using execution_space = HostSpace::execution_space; + using memory_space = HIPHostPinnedSpace; + using device_type = Kokkos::Device; + using size_type = unsigned int; + + /*--------------------------------*/ + + HIPHostPinnedSpace(); + HIPHostPinnedSpace(HIPHostPinnedSpace&& rhs) = default; + HIPHostPinnedSpace(const HIPHostPinnedSpace& rhs) = default; + HIPHostPinnedSpace& operator=(HIPHostPinnedSpace&& rhs) = default; + HIPHostPinnedSpace& operator=(const HIPHostPinnedSpace& rhs) = default; + ~HIPHostPinnedSpace() = default; + + /**\brief Allocate untracked memory in the space */ + void* allocate(const size_t arg_alloc_size) const; + void* allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; + + /**\brief Deallocate untracked memory in the space */ + void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; + void deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; + + private: + template + friend class LogicalMemorySpace; + void* impl_allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0, + const Kokkos::Tools::SpaceHandle = + Kokkos::Tools::make_space_handle(name())) const; + void impl_deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0, + const Kokkos::Tools::SpaceHandle = + Kokkos::Tools::make_space_handle(name())) const; + + public: + /**\brief Return Name of the MemorySpace */ + static constexpr const char* name() { return "HIPHostPinned"; } + + /*--------------------------------*/ +}; + +template <> +struct Impl::is_hip_type_space : public std::true_type {}; + +} // namespace Kokkos + +/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ + +namespace Kokkos { +/** \brief Memory that is accessible to HIP execution space + * and host through HIP's memory page migration. + */ +class HIPManagedSpace { + public: + //! Tag this class as a kokkos memory space + /** \brief Memory is unified to both device and host via page migration + * and therefore able to be used by HostSpace::execution_space and + * DeviceSpace::execution_space. + */ + //! tag this class as a kokkos memory space + using memory_space = HIPManagedSpace; + using execution_space = HIP; + using device_type = Kokkos::Device; + using size_type = unsigned int; + + /*--------------------------------*/ + + HIPManagedSpace(); + HIPManagedSpace(HIPManagedSpace&& rhs) = default; + HIPManagedSpace(const HIPManagedSpace& rhs) = default; + HIPManagedSpace& operator=(HIPManagedSpace&& rhs) = default; + HIPManagedSpace& operator=(const HIPManagedSpace& rhs) = default; + ~HIPManagedSpace() = default; + + /**\brief Allocate untracked memory in the space */ + void* allocate(const size_t arg_alloc_size) const; + void* allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; + + /**\brief Deallocate untracked memory in the space */ + void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; + void deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; + + private: + int m_device; ///< Which HIP device + template + friend class LogicalMemorySpace; + void* impl_allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0, + const Kokkos::Tools::SpaceHandle = + Kokkos::Tools::make_space_handle(name())) const; + void impl_deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0, + const Kokkos::Tools::SpaceHandle = + Kokkos::Tools::make_space_handle(name())) const; + + public: + /**\brief Return Name of the MemorySpace */ + static constexpr const char* name() { return "HIPManaged"; } + + /*--------------------------------*/ +}; + +template <> +struct Impl::is_hip_type_space : public std::true_type {}; + +} // namespace Kokkos + +/*--------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------*/ + +namespace Kokkos { +namespace Impl { + +static_assert(Kokkos::Impl::MemorySpaceAccess::assignable, + ""); + +//---------------------------------------- + +template <> +struct MemorySpaceAccess { + enum : bool { assignable = false }; + enum : bool { accessible = false }; + enum : bool { deepcopy = true }; +}; + +template <> +struct MemorySpaceAccess { + // HostSpace::execution_space == HIPHostPinnedSpace::execution_space + enum : bool { assignable = true }; + enum : bool { accessible = true }; + enum : bool { deepcopy = true }; +}; + +template <> +struct MemorySpaceAccess { + // HostSpace::execution_space != HIPManagedSpace::execution_space + enum : bool { assignable = false }; + enum : bool { accessible = true }; + enum : bool { deepcopy = true }; +}; + +//---------------------------------------- + +template <> +struct MemorySpaceAccess { + enum : bool { assignable = false }; + enum : bool { accessible = false }; + enum : bool { deepcopy = true }; +}; + +template <> +struct MemorySpaceAccess { + // HIPSpace::execution_space != HIPHostPinnedSpace::execution_space + enum : bool { assignable = false }; + enum : bool { accessible = true }; // HIPSpace::execution_space + enum : bool { deepcopy = true }; +}; + +template <> +struct MemorySpaceAccess { + // HIPSpace::execution_space == HIPManagedSpace::execution_space + enum : bool { assignable = true }; + enum : bool { accessible = true }; + enum : bool { deepcopy = true }; +}; + +//---------------------------------------- +// HIPHostPinnedSpace::execution_space == HostSpace::execution_space +// HIPHostPinnedSpace accessible to both HIP and Host + +template <> +struct MemorySpaceAccess { + enum : bool { assignable = false }; // Cannot access from HIP + enum : bool { accessible = true }; // HIPHostPinnedSpace::execution_space + enum : bool { deepcopy = true }; +}; + +template <> +struct MemorySpaceAccess { + enum : bool { assignable = false }; // Cannot access from Host + enum : bool { accessible = false }; + enum : bool { deepcopy = true }; +}; + +template <> +struct MemorySpaceAccess { + enum : bool { assignable = false }; // different exec_space + enum : bool { accessible = true }; + enum : bool { deepcopy = true }; +}; + +//---------------------------------------- +// HIPManagedSpace::execution_space != HostSpace::execution_space +// HIPManagedSpace accessible to both HIP and Host + +template <> +struct MemorySpaceAccess { + enum : bool { assignable = false }; + enum : bool { accessible = false }; // HIPHostPinnedSpace::execution_space + enum : bool { deepcopy = true }; +}; + +template <> +struct MemorySpaceAccess { + enum : bool { assignable = false }; + enum : bool { accessible = true }; + enum : bool { deepcopy = true }; +}; + +template <> +struct MemorySpaceAccess { + enum : bool { assignable = false }; // different exec_space + enum : bool { accessible = true }; + enum : bool { deepcopy = true }; +}; + +} // namespace Impl +} // namespace Kokkos + +#endif /* #define KOKKOS_HIPSPACE_HPP */ diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Team.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Team.hpp index 9ddfa5f651..5b9faba786 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Team.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Team.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_TEAM_HPP #define KOKKOS_HIP_TEAM_HPP @@ -94,8 +66,9 @@ struct HIPJoinFunctor { */ class HIPTeamMember { public: - using execution_space = Kokkos::Experimental::HIP; + using execution_space = HIP; using scratch_memory_space = execution_space::scratch_memory_space; + using team_handle = HIPTeamMember; private: mutable void* m_team_reduce; @@ -166,8 +139,7 @@ class HIPTeamMember { val = *(reinterpret_cast(m_team_reduce)); } else { // team <= warp ValueType tmp(val); // input might not be a register variable - ::Kokkos::Experimental::Impl::in_place_shfl( - val, tmp, blockDim.x * thread_id, blockDim.x * blockDim.y); + in_place_shfl(val, tmp, blockDim.x * thread_id, blockDim.x * blockDim.y); } #else (void)val; @@ -209,8 +181,8 @@ class HIPTeamMember { typename ReducerType::value_type& value) const noexcept { #ifdef __HIP_DEVICE_COMPILE__ typename Kokkos::Impl::FunctorAnalysis< - FunctorPatternInterface::REDUCE, TeamPolicy, - ReducerType>::Reducer wrapped_reducer(&reducer); + FunctorPatternInterface::REDUCE, TeamPolicy, ReducerType>::Reducer + wrapped_reducer(&reducer); hip_intra_block_shuffle_reduction(value, wrapped_reducer, blockDim.y); reducer.reference() = value; #else @@ -246,7 +218,7 @@ class HIPTeamMember { Impl::HIPJoinFunctor hip_join_functor; typename Kokkos::Impl::FunctorAnalysis< - FunctorPatternInterface::REDUCE, TeamPolicy, + FunctorPatternInterface::REDUCE, TeamPolicy, Impl::HIPJoinFunctor>::Reducer reducer(&hip_join_functor); Impl::hip_intra_block_reduce_scan(reducer, base_data + 1); @@ -297,8 +269,7 @@ class HIPTeamMember { typename ReducerType::value_type tmp2 = tmp; for (int i = blockDim.x; (i >>= 1);) { - ::Kokkos::Experimental::Impl::in_place_shfl_down(tmp2, tmp, i, - blockDim.x); + in_place_shfl_down(tmp2, tmp, i, blockDim.x); if (static_cast(threadIdx.x) < i) { reducer.join(tmp, tmp2); } @@ -309,7 +280,7 @@ class HIPTeamMember { // because floating point summation is not associative // and thus different threads could have different results. - ::Kokkos::Experimental::Impl::in_place_shfl(tmp2, tmp, 0, blockDim.x); + in_place_shfl(tmp2, tmp, 0, blockDim.x); value = tmp2; reducer.reference() = tmp2; #else @@ -824,7 +795,7 @@ parallel_scan(const Impl::ThreadVectorRangeBoundariesStruct< // inversion. for (int j = 1; j < static_cast(blockDim.x); j <<= 1) { value_type tmp = identity; - ::Kokkos::Experimental::Impl::in_place_shfl_up(tmp, val, j, blockDim.x); + Impl::in_place_shfl_up(tmp, val, j, blockDim.x); if (j <= static_cast(threadIdx.x)) { reducer.join(val, tmp); } @@ -836,8 +807,7 @@ parallel_scan(const Impl::ThreadVectorRangeBoundariesStruct< // Update i's contribution into the val // and add it to accum for next round if (i < loop_boundaries.end) closure(i, val, true); - ::Kokkos::Experimental::Impl::in_place_shfl(accum, val, blockDim.x - 1, - blockDim.x); + Impl::in_place_shfl(accum, val, blockDim.x - 1, blockDim.x); } #else (void)loop_boundaries; @@ -899,7 +869,7 @@ KOKKOS_INLINE_FUNCTION void single( const FunctorType& lambda, ValueType& val) { #ifdef __HIP_DEVICE_COMPILE__ if (threadIdx.x == 0) lambda(val); - ::Kokkos::Experimental::Impl::in_place_shfl(val, val, 0, blockDim.x); + Impl::in_place_shfl(val, val, 0, blockDim.x); #else (void)lambda; (void)val; diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_UniqueToken.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_UniqueToken.hpp index a0722f618b..13fc6216d6 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_UniqueToken.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_UniqueToken.hpp @@ -1,59 +1,31 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_UNIQUE_TOKEN_HPP #define KOKKOS_HIP_UNIQUE_TOKEN_HPP -#include +#include #include #include namespace Kokkos { namespace Impl { -Kokkos::View -hip_global_unique_token_locks(bool deallocate = false); +Kokkos::View hip_global_unique_token_locks( + bool deallocate = false); } namespace Experimental { @@ -164,11 +136,9 @@ class UniqueToken // The instance version will forward to protected constructor which creates // a lock array per instance UniqueToken() - : UniqueToken( - Kokkos::Experimental::HIP().concurrency()) {} + : UniqueToken(HIP().concurrency()) {} explicit UniqueToken(execution_space const& arg) - : UniqueToken( - Kokkos::Experimental::HIP().concurrency(), arg) {} + : UniqueToken(HIP().concurrency(), arg) {} explicit UniqueToken(size_type max_size) : UniqueToken(max_size) {} UniqueToken(size_type max_size, execution_space const& arg) diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Vectorization.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Vectorization.hpp index 18b5f57c22..e14b722f37 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Vectorization.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Vectorization.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_VECTORIZATION_HPP #define KOKKOS_HIP_VECTORIZATION_HPP @@ -48,7 +20,6 @@ #include namespace Kokkos { -namespace Experimental { namespace Impl { //---------------------------------------------------------------------------- @@ -196,7 +167,6 @@ __device__ inline T shfl_up(const T& val, int delta, int width) { return rv; } -} // namespace Experimental } // namespace Kokkos #endif diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_WorkGraphPolicy.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_WorkGraphPolicy.hpp index 081f6f4047..136dca1208 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_WorkGraphPolicy.hpp @@ -1,61 +1,34 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HIP_WORKGRAPHPOLICY_HPP #define KOKKOS_HIP_WORKGRAPHPOLICY_HPP -#include +#include +#include +#include namespace Kokkos { namespace Impl { template -class ParallelFor, - Kokkos::Experimental::HIP> { +class ParallelFor, HIP> { public: using Policy = Kokkos::WorkGraphPolicy; - using Self = ParallelFor; + using Self = ParallelFor; private: Policy m_policy; @@ -89,15 +62,12 @@ class ParallelFor, inline void execute() { const int warps_per_block = 4; - const dim3 grid( - Kokkos::Experimental::Impl::hip_internal_multiprocessor_count(), 1, 1); - const dim3 block(1, Kokkos::Experimental::Impl::HIPTraits::WarpSize, - warps_per_block); + const dim3 grid(hip_internal_multiprocessor_count(), 1, 1); + const dim3 block(1, HIPTraits::WarpSize, warps_per_block); const int shared = 0; - Kokkos::Experimental::Impl::HIPParallelLaunch( - *this, grid, block, shared, - Experimental::HIP().impl_internal_space_instance(), false); + HIPParallelLaunch(*this, grid, block, shared, + HIP().impl_internal_space_instance(), false); } inline ParallelFor(const FunctorType& arg_functor, const Policy& arg_policy) diff --git a/lib/kokkos/core/src/HPX/Kokkos_HPX.cpp b/lib/kokkos/core/src/HPX/Kokkos_HPX.cpp index 6027ead01b..2074123a15 100644 --- a/lib/kokkos/core/src/HPX/Kokkos_HPX.cpp +++ b/lib/kokkos/core/src/HPX/Kokkos_HPX.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #define KOKKOS_IMPL_PUBLIC_INCLUDE @@ -143,14 +115,6 @@ int g_hpx_space_factory_initialized = } // namespace Impl -#ifdef KOKKOS_ENABLE_CXX14 -namespace Tools { -namespace Experimental { -constexpr DeviceType DeviceTypeTraits::id; -} -} // namespace Tools -#endif - } // namespace Kokkos #else diff --git a/lib/kokkos/core/src/HPX/Kokkos_HPX_MDRangePolicy.hpp b/lib/kokkos/core/src/HPX/Kokkos_HPX_MDRangePolicy.hpp new file mode 100644 index 0000000000..cf0d1add12 --- /dev/null +++ b/lib/kokkos/core/src/HPX/Kokkos_HPX_MDRangePolicy.hpp @@ -0,0 +1,33 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_HPX_MDRANGEPOLICY_HPP_ +#define KOKKOS_HPX_MDRANGEPOLICY_HPP_ + +#include + +namespace Kokkos { +namespace Impl { + +// Settings for TeamMDRangePolicy +template +struct ThreadAndVectorNestLevel + : HostBasedNestLevel {}; + +} // namespace Impl +} // namespace Kokkos +#endif diff --git a/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.cpp b/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.cpp index e61ac728a9..ad540a203d 100644 --- a/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.cpp +++ b/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.cpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #define KOKKOS_IMPL_PUBLIC_INCLUDE diff --git a/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.hpp b/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.hpp index 67765a6ae0..e75b7be49d 100644 --- a/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.hpp +++ b/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HPX_TASK_HPP #define KOKKOS_HPX_TASK_HPP diff --git a/lib/kokkos/core/src/HPX/Kokkos_HPX_WorkGraphPolicy.hpp b/lib/kokkos/core/src/HPX/Kokkos_HPX_WorkGraphPolicy.hpp index 5f2eff5774..72a8019935 100644 --- a/lib/kokkos/core/src/HPX/Kokkos_HPX_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/HPX/Kokkos_HPX_WorkGraphPolicy.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_HPX_WORKGRAPHPOLICY_HPP #define KOKKOS_HPX_WORKGRAPHPOLICY_HPP diff --git a/lib/kokkos/core/src/KokkosExp_InterOp.hpp b/lib/kokkos/core/src/KokkosExp_InterOp.hpp index 0522ad7e8d..c46ba0de13 100644 --- a/lib/kokkos/core/src/KokkosExp_InterOp.hpp +++ b/lib/kokkos/core/src/KokkosExp_InterOp.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CORE_EXP_INTEROP_HPP #define KOKKOS_CORE_EXP_INTEROP_HPP diff --git a/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp b/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp index 64b31c7fea..c9080db01c 100644 --- a/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp +++ b/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp @@ -1,55 +1,23 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_CORE_EXP_MD_RANGE_POLICY_HPP #define KOKKOS_CORE_EXP_MD_RANGE_POLICY_HPP @@ -208,6 +176,7 @@ struct MDRangePolicy : public Kokkos::Impl::PolicyTraits { using member_type = typename range_policy::member_type; static constexpr int rank = iteration_pattern::rank; + static_assert(rank < 7, "Kokkos MDRangePolicy Error: Unsupported rank..."); using index_type = typename traits::index_type; using array_index_type = std::int64_t; @@ -391,18 +360,4 @@ struct MDRangePolicy : public Kokkos::Impl::PolicyTraits { } // namespace Kokkos -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -// For backward compatibility -namespace Kokkos { -namespace Experimental { -using Iterate KOKKOS_DEPRECATED = Kokkos::Iterate; -template -using MDRangePolicy KOKKOS_DEPRECATED = Kokkos::MDRangePolicy; -template -using Rank KOKKOS_DEPRECATED = Kokkos::Rank; -} // namespace Experimental -} // namespace Kokkos -#endif - #endif // KOKKOS_CORE_EXP_MD_RANGE_POLICY_HPP diff --git a/lib/kokkos/core/src/Kokkos_AcquireUniqueTokenImpl.hpp b/lib/kokkos/core/src/Kokkos_AcquireUniqueTokenImpl.hpp index 4a22aedd8c..660ee30b7d 100644 --- a/lib/kokkos/core/src/Kokkos_AcquireUniqueTokenImpl.hpp +++ b/lib/kokkos/core/src/Kokkos_AcquireUniqueTokenImpl.hpp @@ -1,55 +1,23 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_ACQUIRE_UNIQUE_TOKEN_IMPL_HPP #define KOKKOS_ACQUIRE_UNIQUE_TOKEN_IMPL_HPP diff --git a/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp b/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp index 6eed92be04..9f5deed5d6 100644 --- a/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp @@ -1,55 +1,23 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_ANONYMOUSSPACE_HPP #define KOKKOS_ANONYMOUSSPACE_HPP diff --git a/lib/kokkos/core/src/Kokkos_Array.hpp b/lib/kokkos/core/src/Kokkos_Array.hpp index e7fec4c449..1e3ab4741c 100644 --- a/lib/kokkos/core/src/Kokkos_Array.hpp +++ b/lib/kokkos/core/src/Kokkos_Array.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_ARRAY_HPP #define KOKKOS_ARRAY_HPP @@ -351,13 +323,6 @@ struct Array::strided> { } // namespace Kokkos // -// guarding against bogus error 'specialization in different namespace' with -// older GCC that do not support C++17 anyway -#if !defined(KOKKOS_COMPILER_GNU) || (KOKKOS_COMPILER_GNU >= 710) -#if defined(KOKKOS_COMPILER_CLANG) && KOKKOS_COMPILER_CLANG < 800 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wmismatched-tags" -#endif template struct std::tuple_size> : std::integral_constant {}; @@ -366,10 +331,6 @@ template struct std::tuple_element> { using type = T; }; -#if defined(KOKKOS_COMPILER_CLANG) && KOKKOS_COMPILER_CLANG < 800 -#pragma clang diagnostic pop -#endif -#endif namespace Kokkos { diff --git a/lib/kokkos/core/src/Kokkos_Atomic.hpp b/lib/kokkos/core/src/Kokkos_Atomic.hpp index 7a2d1c662c..1347e09ebd 100644 --- a/lib/kokkos/core/src/Kokkos_Atomic.hpp +++ b/lib/kokkos/core/src/Kokkos_Atomic.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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 -*/ /// \file Kokkos_Atomic.hpp /// \brief Atomic functions @@ -103,7 +75,7 @@ KOKKOS_INLINE_FUNCTION void desul_atomic_inc(T* dest, MemoryOrderSeqCst, template KOKKOS_INLINE_FUNCTION T -desul_atomic_exchange(T* dest, const Kokkos::Impl::identity_t val, +desul_atomic_exchange(T* dest, const Kokkos::Impl::type_identity_t val, MemoryOrderSeqCst, MemoryScopeDevice) { return desul::atomic_exchange(const_cast(dest), val, desul::MemoryOrderSeqCst(), @@ -112,8 +84,8 @@ desul_atomic_exchange(T* dest, const Kokkos::Impl::identity_t val, template KOKKOS_INLINE_FUNCTION T desul_atomic_compare_exchange( - T* dest, Kokkos::Impl::identity_t compare, - Kokkos::Impl::identity_t val, MemoryOrderSeqCst, + T* dest, Kokkos::Impl::type_identity_t compare, + Kokkos::Impl::type_identity_t val, MemoryOrderSeqCst, MemoryScopeDevice) { return desul::atomic_compare_exchange(dest, compare, val, desul::MemoryOrderSeqCst(), @@ -168,7 +140,7 @@ KOKKOS_INLINE_FUNCTION T desul_atomic_compare_exchange( #define KOKKOS_ENABLE_SERIAL_ATOMICS #elif defined(KOKKOS_COMPILER_GNU) || defined(KOKKOS_COMPILER_CLANG) || \ - (defined(KOKKOS_COMPILER_NVCC) || defined(KOKKOS_COMPILER_IBM)) + defined(KOKKOS_COMPILER_NVCC) #define KOKKOS_ENABLE_GNU_ATOMICS @@ -401,15 +373,15 @@ KOKKOS_INLINE_FUNCTION void desul_atomic_inc(T* dest, MemoryOrderSeqCst, template KOKKOS_INLINE_FUNCTION T -desul_atomic_exchange(T* dest, Kokkos::Impl::identity_t val, +desul_atomic_exchange(T* dest, Kokkos::Impl::type_identity_t val, MemoryOrderSeqCst, MemoryScopeDevice) { return Kokkos::atomic_exchange(dest, val); } template KOKKOS_INLINE_FUNCTION T desul_atomic_compare_exchange( - T* dest, Kokkos::Impl::identity_t compare, - Kokkos::Impl::identity_t val, MemoryOrderSeqCst, + T* dest, Kokkos::Impl::type_identity_t compare, + Kokkos::Impl::type_identity_t val, MemoryOrderSeqCst, MemoryScopeDevice) { return Kokkos::atomic_compare_exchange(dest, compare, val); } diff --git a/lib/kokkos/core/src/Kokkos_Atomics_Desul_Config.hpp b/lib/kokkos/core/src/Kokkos_Atomics_Desul_Config.hpp index ef576d74c3..4cf170f5f1 100644 --- a/lib/kokkos/core/src/Kokkos_Atomics_Desul_Config.hpp +++ b/lib/kokkos/core/src/Kokkos_Atomics_Desul_Config.hpp @@ -1,62 +1,30 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_ATOMICS_DESUL_CONFIG_HPP #define KOKKOS_ATOMICS_DESUL_CONFIG_HPP #include -#ifdef KOKKOS_ENABLE_OPENMPTARGET -#define DESUL_HAVE_OPENMP_ATOMICS +#if defined(KOKKOS_ARCH_KEPLER) || defined(KOKKOS_ARCH_MAXWELL) +#define DESUL_CUDA_ARCH_IS_PRE_PASCAL #endif #if defined(KOKKOS_ARCH_KEPLER) || defined(KOKKOS_ARCH_MAXWELL) || \ diff --git a/lib/kokkos/core/src/Kokkos_Atomics_Desul_Volatile_Wrapper.hpp b/lib/kokkos/core/src/Kokkos_Atomics_Desul_Volatile_Wrapper.hpp index b202ab8f83..9da4b06110 100644 --- a/lib/kokkos/core/src/Kokkos_Atomics_Desul_Volatile_Wrapper.hpp +++ b/lib/kokkos/core/src/Kokkos_Atomics_Desul_Volatile_Wrapper.hpp @@ -1,12 +1,23 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_DESUL_ATOMICS_VOLATILE_WRAPPER_HPP_ #define KOKKOS_DESUL_ATOMICS_VOLATILE_WRAPPER_HPP_ @@ -34,26 +45,6 @@ void atomic_store(volatile T* const dest, desul::Impl::dont_deduce_this_paramete template KOKKOS_INLINE_FUNCTION T atomic_fetch_add (volatile T* const dest, desul::Impl::dont_deduce_this_parameter_t val) { return desul::atomic_fetch_add (const_cast(dest), val, desul::MemoryOrderRelaxed(), KOKKOS_DESUL_MEM_SCOPE); } -#ifdef DESUL_IMPL_ATOMIC_CUDA_USE_DOUBLE_ATOMICADD -KOKKOS_INLINE_FUNCTION -double atomic_fetch_add(volatile double* const dest, double val) { - #ifdef __CUDA_ARCH__ - return atomicAdd(const_cast(dest),val); - #else - return desul::atomic_fetch_add (const_cast(dest), val, desul::MemoryOrderRelaxed(), KOKKOS_DESUL_MEM_SCOPE); - #endif -}; - -KOKKOS_INLINE_FUNCTION -double atomic_fetch_sub(volatile double* const dest, double val) { - #ifdef __CUDA_ARCH__ - return atomicAdd(const_cast(dest),-val); - #else - return desul::atomic_fetch_sub (const_cast(dest), val, desul::MemoryOrderRelaxed(), KOKKOS_DESUL_MEM_SCOPE); - #endif -}; -#endif - template KOKKOS_INLINE_FUNCTION T atomic_fetch_sub (volatile T* const dest, desul::Impl::dont_deduce_this_parameter_t val) { return desul::atomic_fetch_sub (const_cast(dest), val, desul::MemoryOrderRelaxed(), KOKKOS_DESUL_MEM_SCOPE); } diff --git a/lib/kokkos/core/src/Kokkos_Atomics_Desul_Wrapper.hpp b/lib/kokkos/core/src/Kokkos_Atomics_Desul_Wrapper.hpp index ed7e8d9ede..fdc5e123f6 100644 --- a/lib/kokkos/core/src/Kokkos_Atomics_Desul_Wrapper.hpp +++ b/lib/kokkos/core/src/Kokkos_Atomics_Desul_Wrapper.hpp @@ -1,12 +1,23 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_DESUL_ATOMICS_WRAPPER_HPP_ #define KOKKOS_DESUL_ATOMICS_WRAPPER_HPP_ @@ -70,26 +81,6 @@ void store_fence() { return desul::atomic_thread_fence(desul::MemoryOrderRelease template KOKKOS_INLINE_FUNCTION T atomic_fetch_add (T* const dest, desul::Impl::dont_deduce_this_parameter_t val) { return desul::atomic_fetch_add (dest, val, desul::MemoryOrderRelaxed(), KOKKOS_DESUL_MEM_SCOPE); } -#ifdef DESUL_IMPL_ATOMIC_CUDA_USE_DOUBLE_ATOMICADD -KOKKOS_INLINE_FUNCTION -double atomic_fetch_add(double* const dest, double val) { - #ifdef __CUDA_ARCH__ - return atomicAdd(dest,val); - #else - return desul::atomic_fetch_add (dest, val, desul::MemoryOrderRelaxed(), KOKKOS_DESUL_MEM_SCOPE); - #endif -}; - -KOKKOS_INLINE_FUNCTION -double atomic_fetch_sub(double* const dest, double val) { - #ifdef __CUDA_ARCH__ - return atomicAdd(dest,-val); - #else - return desul::atomic_fetch_sub (dest, val, desul::MemoryOrderRelaxed(), KOKKOS_DESUL_MEM_SCOPE); - #endif -}; -#endif - template KOKKOS_INLINE_FUNCTION T atomic_fetch_sub (T* const dest, desul::Impl::dont_deduce_this_parameter_t val) { return desul::atomic_fetch_sub (dest, val, desul::MemoryOrderRelaxed(), KOKKOS_DESUL_MEM_SCOPE); } diff --git a/lib/kokkos/core/src/Kokkos_Complex.hpp b/lib/kokkos/core/src/Kokkos_Complex.hpp index 009c73c900..4cecbe4cfe 100644 --- a/lib/kokkos/core/src/Kokkos_Complex.hpp +++ b/lib/kokkos/core/src/Kokkos_Complex.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_COMPLEX_HPP #define KOKKOS_COMPLEX_HPP #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE @@ -51,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -278,16 +251,13 @@ class return *this; } - //--------------------------------------------------------------------------- - // TODO: refactor Kokkos reductions to remove dependency on - // volatile member overloads since they are being deprecated in c++20 - //--------------------------------------------------------------------------- - +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4 //! Copy constructor from volatile. template < class RType, std::enable_if_t::value, int> = 0> - KOKKOS_INLINE_FUNCTION complex(const volatile complex& src) noexcept + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION + complex(const volatile complex& src) noexcept // Intentionally do the conversions implicitly here so that users don't // get any warnings about narrowing, etc., that they would expect to get // otherwise. @@ -315,7 +285,8 @@ class // vl = cr; template ::value, int> = 0> - KOKKOS_INLINE_FUNCTION void operator=(const Complex& src) volatile noexcept { + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION void operator=( + const Complex& src) volatile noexcept { re_ = src.re_; im_ = src.im_; // We deliberately do not return anything here. See explanation @@ -337,7 +308,7 @@ class // vl = cvr; template ::value, int> = 0> - KOKKOS_INLINE_FUNCTION volatile complex& operator=( + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION volatile complex& operator=( const volatile Complex& src) volatile noexcept { re_ = src.re_; im_ = src.im_; @@ -359,7 +330,7 @@ class // template ::value, int> = 0> - KOKKOS_INLINE_FUNCTION complex& operator=( + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION complex& operator=( const volatile Complex& src) noexcept { re_ = src.re_; im_ = src.im_; @@ -370,7 +341,8 @@ class // RealType RHS versions. //! Assignment operator (from a volatile real number). - KOKKOS_INLINE_FUNCTION void operator=(const volatile RealType& val) noexcept { + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION void operator=( + const volatile RealType& val) noexcept { re_ = val; im_ = RealType(0); // We deliberately do not return anything here. See explanation @@ -378,7 +350,7 @@ class } //! Assignment operator volatile LHS and non-volatile RHS - KOKKOS_INLINE_FUNCTION complex& operator=( + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION complex& operator=( const RealType& val) volatile noexcept { re_ = val; im_ = RealType(0); @@ -387,7 +359,7 @@ class //! Assignment operator volatile LHS and volatile RHS // TODO Should this return void like the other volatile assignment operators? - KOKKOS_INLINE_FUNCTION complex& operator=( + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION complex& operator=( const volatile RealType& val) volatile noexcept { re_ = val; im_ = RealType(0); @@ -395,33 +367,41 @@ class } //! The imaginary part of this complex number (volatile overload). - KOKKOS_INLINE_FUNCTION - volatile RealType& imag() volatile noexcept { return im_; } + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION volatile RealType& + imag() volatile noexcept { + return im_; + } //! The real part of this complex number (volatile overload). - KOKKOS_INLINE_FUNCTION - volatile RealType& real() volatile noexcept { return re_; } + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION volatile RealType& + real() volatile noexcept { + return re_; + } //! The imaginary part of this complex number (volatile overload). - KOKKOS_INLINE_FUNCTION - RealType imag() const volatile noexcept { return im_; } + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION RealType imag() const + volatile noexcept { + return im_; + } //! The real part of this complex number (volatile overload). - KOKKOS_INLINE_FUNCTION - RealType real() const volatile noexcept { return re_; } + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION RealType real() const + volatile noexcept { + return re_; + } - KOKKOS_INLINE_FUNCTION void operator+=( + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION void operator+=( const volatile complex& src) volatile noexcept { re_ += src.re_; im_ += src.im_; } - KOKKOS_INLINE_FUNCTION void operator+=( + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION void operator+=( const volatile RealType& src) volatile noexcept { re_ += src; } - KOKKOS_INLINE_FUNCTION void operator*=( + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION void operator*=( const volatile complex& src) volatile noexcept { const RealType realPart = re_ * src.re_ - im_ * src.im_; const RealType imagPart = re_ * src.im_ + im_ * src.re_; @@ -430,13 +410,12 @@ class im_ = imagPart; } - KOKKOS_INLINE_FUNCTION void operator*=( + KOKKOS_DEPRECATED KOKKOS_INLINE_FUNCTION void operator*=( const volatile RealType& src) volatile noexcept { re_ *= src; im_ *= src; } - - // TODO DSH 2019-10-7 why are there no volatile /= and friends? +#endif // KOKKOS_ENABLE_DEPRECATED_CODE_4 }; //============================================================================== diff --git a/lib/kokkos/core/src/Kokkos_Concepts.hpp b/lib/kokkos/core/src/Kokkos_Concepts.hpp index 63f2b896b5..2448efab04 100644 --- a/lib/kokkos/core/src/Kokkos_Concepts.hpp +++ b/lib/kokkos/core/src/Kokkos_Concepts.hpp @@ -1,55 +1,23 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_CORE_CONCEPTS_HPP #define KOKKOS_CORE_CONCEPTS_HPP @@ -106,11 +74,14 @@ struct WorkItemProperty { ImplWorkItemProperty<4>(); constexpr static const ImplWorkItemProperty<8> HintIrregular = ImplWorkItemProperty<8>(); - using None_t = ImplWorkItemProperty<0>; - using HintLightWeight_t = ImplWorkItemProperty<1>; - using HintHeavyWeight_t = ImplWorkItemProperty<2>; - using HintRegular_t = ImplWorkItemProperty<4>; - using HintIrregular_t = ImplWorkItemProperty<8>; + constexpr static const ImplWorkItemProperty<16> ImplForceGlobalLaunch = + ImplWorkItemProperty<16>(); + using None_t = ImplWorkItemProperty<0>; + using HintLightWeight_t = ImplWorkItemProperty<1>; + using HintHeavyWeight_t = ImplWorkItemProperty<2>; + using HintRegular_t = ImplWorkItemProperty<4>; + using HintIrregular_t = ImplWorkItemProperty<8>; + using ImplForceGlobalLaunch_t = ImplWorkItemProperty<16>; }; template @@ -171,7 +142,9 @@ namespace Kokkos { std::is_base_of, T>::value || \ std::is_base_of, T>::value; \ constexpr operator bool() const noexcept { return value; } \ - }; + }; \ + template \ + inline constexpr bool is_##CONCEPT##_v = is_##CONCEPT::value; // Public concept: @@ -181,6 +154,7 @@ KOKKOS_IMPL_IS_CONCEPT(execution_space) KOKKOS_IMPL_IS_CONCEPT(execution_policy) KOKKOS_IMPL_IS_CONCEPT(array_layout) KOKKOS_IMPL_IS_CONCEPT(reducer) +KOKKOS_IMPL_IS_CONCEPT(team_handle) namespace Experimental { KOKKOS_IMPL_IS_CONCEPT(work_item_property) KOKKOS_IMPL_IS_CONCEPT(hooks_policy) @@ -188,21 +162,6 @@ KOKKOS_IMPL_IS_CONCEPT(hooks_policy) namespace Impl { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -// For backward compatibility: - -template -using is_array_layout KOKKOS_DEPRECATED = Kokkos::is_array_layout; -template -using is_execution_policy KOKKOS_DEPRECATED = Kokkos::is_execution_policy; -template -using is_execution_space KOKKOS_DEPRECATED = Kokkos::is_execution_space; -template -using is_memory_space KOKKOS_DEPRECATED = Kokkos::is_memory_space; -template -using is_memory_traits KOKKOS_DEPRECATED = Kokkos::is_memory_traits; -#endif - // Implementation concept: KOKKOS_IMPL_IS_CONCEPT(thread_team_member) @@ -281,6 +240,9 @@ struct is_device_helper> : std::true_type { template using is_device = typename Impl::is_device_helper>::type; +template +inline constexpr bool is_device_v = is_device::value; + //---------------------------------------------------------------------------- template @@ -344,10 +306,8 @@ struct is_space { || std::is_same::value || std::is_same::value #elif defined(KOKKOS_ENABLE_HIP) - || std::is_same::value || - std::is_same::value + || std::is_same::value || + std::is_same::value #elif defined(KOKKOS_ENABLE_SYCL) || std::is_same::value || @@ -361,7 +321,7 @@ struct is_space { #if defined(KOKKOS_ENABLE_CUDA) std::is_same::value || #elif defined(KOKKOS_ENABLE_HIP) - std::is_same::value || + std::is_same::value || #elif defined(KOKKOS_ENABLE_SYCL) std::is_same::value || #elif defined(KOKKOS_ENABLE_OPENMPTARGET) @@ -370,32 +330,8 @@ struct is_space { #endif false, Kokkos::DefaultHostExecutionSpace, execution_space>; - - public: -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - using host_memory_space KOKKOS_DEPRECATED = do_not_use_host_memory_space; - using host_execution_space KOKKOS_DEPRECATED = - do_not_use_host_execution_space; - using host_mirror_space KOKKOS_DEPRECATED = std::conditional_t< - std::is_same::value && - std::is_same::value, - T, - Kokkos::Device>; -#endif }; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -// For backward compatibility - -namespace Impl { - -template -using is_space KOKKOS_DEPRECATED = Kokkos::is_space; - -} -#endif - } // namespace Kokkos //---------------------------------------------------------------------------- @@ -514,19 +450,6 @@ struct SpaceAccessibility { } // namespace Kokkos -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -namespace Kokkos { -namespace Impl { - -// For backward compatibility -template -using SpaceAccessibility KOKKOS_DEPRECATED = - Kokkos::SpaceAccessibility; - -} // namespace Impl -} // namespace Kokkos -#endif - //---------------------------------------------------------------------------- #endif // KOKKOS_CORE_CONCEPTS_HPP diff --git a/lib/kokkos/core/src/Kokkos_CopyViews.hpp b/lib/kokkos/core/src/Kokkos_CopyViews.hpp index d859a5d8ae..6d5d9548c7 100644 --- a/lib/kokkos/core/src/Kokkos_CopyViews.hpp +++ b/lib/kokkos/core/src/Kokkos_CopyViews.hpp @@ -1,55 +1,23 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_COPYVIEWS_HPP_ #define KOKKOS_COPYVIEWS_HPP_ @@ -3032,24 +3000,14 @@ impl_resize(const Impl::ViewCtorProp& arg_prop, const bool sizeMismatch = Impl::size_mismatch(v, v.rank_dynamic, new_extents); if (sizeMismatch) { - // Add execution space here to avoid the need for if constexpr below - using alloc_prop = Impl::ViewCtorProp< - ViewCtorArgs..., std::string, - std::conditional_t, - typename view_type::execution_space>>; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - v.label(); + auto prop_copy = Impl::with_properties_if_unset( + arg_prop, typename view_type::execution_space{}, v.label()); view_type v_resized(prop_copy, n0, n1, n2, n3, n4, n5, n6, n7); - if (alloc_prop_input::has_execution_space) + if constexpr (alloc_prop_input::has_execution_space) Kokkos::Impl::ViewRemap( - v_resized, v, - static_cast&>(prop_copy) - .value); + v_resized, v, Impl::get_property(prop_copy)); else { Kokkos::Impl::ViewRemap(v_resized, v); Kokkos::fence("Kokkos::resize(View)"); @@ -3142,24 +3100,13 @@ impl_resize(const Impl::ViewCtorProp& arg_prop, "not include a memory space instance!"); if (v.layout() != layout) { - // Add execution space here to avoid the need for if constexpr below - using alloc_prop = Impl::ViewCtorProp< - ViewCtorArgs..., std::string, - std::conditional_t, - typename view_type::execution_space>>; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - v.label(); + auto prop_copy = Impl::with_properties_if_unset(arg_prop, v.label()); view_type v_resized(prop_copy, layout); - if (alloc_prop::has_execution_space) + if constexpr (alloc_prop_input::has_execution_space) Kokkos::Impl::ViewRemap( - v_resized, v, - static_cast&>(prop_copy) - .value); + v_resized, v, Impl::get_property(arg_prop)); else { Kokkos::Impl::ViewRemap(v_resized, v); Kokkos::fence("Kokkos::resize(View)"); @@ -3199,24 +3146,13 @@ impl_resize(const Impl::ViewCtorProp& arg_prop, "The view constructor arguments passed to Kokkos::resize must " "not include a memory space instance!"); - // Add execution space here to avoid the need for if constexpr below - using alloc_prop = Impl::ViewCtorProp< - ViewCtorArgs..., std::string, - std::conditional_t, - typename view_type::execution_space>>; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - v.label(); + auto prop_copy = Impl::with_properties_if_unset(arg_prop, v.label()); view_type v_resized(prop_copy, layout); - if (alloc_prop::has_execution_space) + if constexpr (alloc_prop_input::has_execution_space) Kokkos::Impl::ViewRemap( - v_resized, v, - static_cast&>(prop_copy) - .value); + v_resized, v, Impl::get_property(arg_prop)); else { Kokkos::Impl::ViewRemap(v_resized, v); Kokkos::fence("Kokkos::resize(View)"); @@ -3282,24 +3218,14 @@ impl_realloc(Kokkos::View& v, const size_t n0, const size_t n1, const bool sizeMismatch = Impl::size_mismatch(v, v.rank_dynamic, new_extents); if (sizeMismatch) { - using alloc_prop = Impl::ViewCtorProp; - alloc_prop arg_prop_copy(arg_prop); - static_cast&>(arg_prop_copy) - .value = v.label(); + auto arg_prop_copy = Impl::with_properties_if_unset(arg_prop, v.label()); v = view_type(); // Best effort to deallocate in case no other view refers // to the shared allocation v = view_type(arg_prop_copy, n0, n1, n2, n3, n4, n5, n6, n7); } else if (alloc_prop_input::initialize) { - if (alloc_prop_input::has_execution_space) { - using alloc_prop = Impl::ViewCtorProp< - ViewCtorArgs..., - std::conditional_t, - typename view_type::execution_space>>; - alloc_prop arg_prop_copy(arg_prop); - auto const& exec_space = static_cast const&>(arg_prop_copy) - .value; + if constexpr (alloc_prop_input::has_execution_space) { + const auto& exec_space = + Impl::get_property(arg_prop); Kokkos::deep_copy(exec_space, v, typename view_type::value_type{}); } else Kokkos::deep_copy(v, typename view_type::value_type{}); @@ -3393,23 +3319,9 @@ impl_realloc(Kokkos::View& v, v = view_type(); // Deallocate first, if the only view to allocation v = view_type(arg_prop, layout); } else if (alloc_prop_input::initialize) { - if (alloc_prop_input::has_execution_space) { - // Add execution_space if not provided to avoid need for if constexpr - using alloc_prop = Impl::ViewCtorProp< - ViewCtorArgs..., - std::conditional_t, - typename view_type::execution_space>, - std::string>; - alloc_prop arg_prop_copy(arg_prop); - static_cast&>(arg_prop_copy) - .value = v.label(); - using execution_space_type = typename alloc_prop::execution_space; - const execution_space_type& exec_space = - static_cast< - Kokkos::Impl::ViewCtorProp const&>( - arg_prop_copy) - .value; + if constexpr (alloc_prop_input::has_execution_space) { + const auto& exec_space = + Impl::get_property(arg_prop); Kokkos::deep_copy(exec_space, v, typename view_type::value_type{}); } else Kokkos::deep_copy(v, typename view_type::value_type{}); @@ -3446,13 +3358,10 @@ impl_realloc(Kokkos::View& v, "The view constructor arguments passed to Kokkos::realloc must " "not include a memory space instance!"); - v = view_type(); // Deallocate first, if the only view to allocation + auto arg_prop_copy = Impl::with_properties_if_unset(arg_prop, v.label()); - using alloc_prop = Impl::ViewCtorProp; - alloc_prop arg_prop_copy(arg_prop); - static_cast&>(arg_prop_copy) - .value = v.label(); - v = view_type(arg_prop_copy, layout); + v = view_type(); // Deallocate first, if the only view to allocation + v = view_type(arg_prop_copy, layout); } template @@ -3531,11 +3440,8 @@ struct MirrorType { }; template -inline std::enable_if_t< - !std::is_same::array_layout, - Kokkos::LayoutStride>::value && - !Impl::ViewCtorProp::has_memory_space, - typename Kokkos::View::HostMirror> +inline std::enable_if_t::has_memory_space, + typename Kokkos::View::HostMirror> create_mirror(const Kokkos::View& src, const Impl::ViewCtorProp& arg_prop) { using src_type = View; @@ -3555,74 +3461,10 @@ create_mirror(const Kokkos::View& src, "The view constructor arguments passed to Kokkos::create_mirror must " "not explicitly allow padding!"); - using alloc_prop = Impl::ViewCtorProp; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - std::string(src.label()).append("_mirror"); + auto prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string(src.label()).append("_mirror")); - return dst_type( - prop_copy, - src.rank_dynamic > 0 ? src.extent(0) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 1 ? src.extent(1) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 2 ? src.extent(2) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 3 ? src.extent(3) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 4 ? src.extent(4) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 5 ? src.extent(5) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 6 ? src.extent(6) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 7 ? src.extent(7) : KOKKOS_IMPL_CTOR_DEFAULT_ARG); -} - -template -inline std::enable_if_t< - std::is_same::array_layout, - Kokkos::LayoutStride>::value && - !Impl::ViewCtorProp::has_memory_space, - typename Kokkos::View::HostMirror> -create_mirror(const Kokkos::View& src, - const Impl::ViewCtorProp& arg_prop) { - using src_type = View; - using dst_type = typename src_type::HostMirror; - using alloc_prop_input = Impl::ViewCtorProp; - - static_assert( - !alloc_prop_input::has_label, - "The view constructor arguments passed to Kokkos::create_mirror " - "must not include a label!"); - static_assert( - !alloc_prop_input::has_pointer, - "The view constructor arguments passed to Kokkos::create_mirror must " - "not include a pointer!"); - static_assert( - !alloc_prop_input::allow_padding, - "The view constructor arguments passed to Kokkos::create_mirror must " - "not explicitly allow padding!"); - - Kokkos::LayoutStride layout; - - 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(); - layout.stride[2] = src.stride_2(); - layout.stride[3] = src.stride_3(); - layout.stride[4] = src.stride_4(); - layout.stride[5] = src.stride_5(); - layout.stride[6] = src.stride_6(); - layout.stride[7] = src.stride_7(); - - using alloc_prop = Impl::ViewCtorProp; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - std::string(src.label()).append("_mirror"); - - return dst_type(prop_copy, layout); + return dst_type(prop_copy, src.layout()); } // Create a mirror in a new space (specialization for different space) @@ -3646,10 +3488,9 @@ auto create_mirror(const Kokkos::View& src, "The view constructor arguments passed to Kokkos::create_mirror must " "not explicitly allow padding!"); - using alloc_prop = Impl::ViewCtorProp; - alloc_prop prop_copy(arg_prop); - static_cast&>(prop_copy).value = - std::string(src.label()).append("_mirror"); + auto prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string(src.label()).append("_mirror")); + using alloc_prop = decltype(prop_copy); return typename Impl::MirrorType::view_type(prop_copy, src.layout()); @@ -3892,29 +3733,16 @@ auto create_mirror_view_and_copy( using Space = typename alloc_prop_input::memory_space; using Mirror = typename Impl::MirrorViewType::view_type; - // Add some properties if not provided to avoid need for if constexpr - using alloc_prop = Impl::ViewCtorProp< - ViewCtorArgs..., - std::conditional_t, std::string>, - std::conditional_t, - Impl::WithoutInitializing_t>, - std::conditional_t, - typename Space::execution_space>>; - alloc_prop arg_prop_copy(arg_prop); + auto arg_prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string{}, WithoutInitializing, + typename Space::execution_space{}); - std::string& label = - static_cast&>(arg_prop_copy).value; + std::string& label = Impl::get_property(arg_prop_copy); if (label.empty()) label = src.label(); auto mirror = typename Mirror::non_const_type{arg_prop_copy, src.layout()}; - if (alloc_prop_input::has_execution_space) { - using ExecutionSpace = typename alloc_prop::execution_space; - deep_copy( - static_cast&>(arg_prop_copy) - .value, - mirror, src); + if constexpr (alloc_prop_input::has_execution_space) { + deep_copy(Impl::get_property(arg_prop_copy), + mirror, src); } else deep_copy(mirror, src); return mirror; @@ -3936,35 +3764,6 @@ create_mirror_view_and_copy( Kokkos::view_alloc(typename Space::memory_space{}, name), src); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -// Create a mirror view in a new space without initializing (specialization for -// same space) -template -KOKKOS_DEPRECATED_WITH_COMMENT( - "Use the version taking WithoutInitializing as first argument") -typename Impl::MirrorViewType::view_type create_mirror_view( - const Space&, const Kokkos::View& src, - Kokkos::Impl::WithoutInitializing_t, - std::enable_if_t::is_same_memspace>* = - nullptr) { - return src; -} - -// Create a mirror view in a new space without initializing (specialization for -// different space) -template -KOKKOS_DEPRECATED_WITH_COMMENT( - "Use the version taking WithoutInitializing as first argument") -typename Impl::MirrorViewType::view_type create_mirror_view( - const Space&, const Kokkos::View& src, - Kokkos::Impl::WithoutInitializing_t, - std::enable_if_t::is_same_memspace>* = - nullptr) { - using Mirror = typename Impl::MirrorViewType::view_type; - return Mirror(view_alloc(WithoutInitializing, src.label()), src.layout()); -} -#endif - } /* namespace Kokkos */ //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/Kokkos_Core.hpp b/lib/kokkos/core/src/Kokkos_Core.hpp index 3a9aaafbc3..cf898a71e7 100644 --- a/lib/kokkos/core/src/Kokkos_Core.hpp +++ b/lib/kokkos/core/src/Kokkos_Core.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CORE_HPP #define KOKKOS_CORE_HPP @@ -49,6 +21,22 @@ #define KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_CORE #endif +//---------------------------------------------------------------------------- +// In the case windows.h is included before Kokkos_Core.hpp there might be +// errors due to the potentially defined macros with name "min" and "max" in +// windows.h. These collide with the use of "min" and "max" in names inside +// Kokkos. The macros will be redefined at the end of Kokkos_Core.hpp +#if defined(min) +#pragma push_macro("min") +#undef min +#define KOKKOS_IMPL_PUSH_MACRO_MIN +#endif +#if defined(max) +#pragma push_macro("max") +#undef max +#define KOKKOS_IMPL_PUSH_MACRO_MAX +#endif + //---------------------------------------------------------------------------- // Include the execution space header files for the enabled execution spaces. @@ -64,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -75,6 +64,7 @@ #include #include #include +#include #include #include #include @@ -96,14 +86,18 @@ void pre_initialize(const InitializationSettings& settings); void post_initialize(const InitializationSettings& settings); +void pre_finalize(); + +void post_finalize(); + void declare_configuration_metadata(const std::string& category, const std::string& key, const std::string& value); } // namespace Impl -KOKKOS_ATTRIBUTE_NODISCARD bool is_initialized() noexcept; -KOKKOS_ATTRIBUTE_NODISCARD bool is_finalized() noexcept; +[[nodiscard]] bool is_initialized() noexcept; +[[nodiscard]] bool is_finalized() noexcept; bool show_warnings() noexcept; bool tune_internals() noexcept; @@ -133,10 +127,7 @@ void finalize(); */ void push_finalize_hook(std::function f); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -/** \brief Finalize all known execution spaces */ -KOKKOS_DEPRECATED void finalize_all(); -#endif +void fence(const std::string& name /*= "Kokkos::fence: Unnamed Global Fence"*/); /** \brief Print "Bill of Materials" */ void print_configuration(std::ostream& os, bool verbose = false); @@ -226,82 +217,13 @@ inline std::string scopeguard_destruct_after_finalize_warning() { } // namespace Impl -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 class KOKKOS_ATTRIBUTE_NODISCARD ScopeGuard { public: + template #if defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard) >= 201907 - KOKKOS_ATTRIBUTE_NODISCARD + [[nodiscard]] #endif - ScopeGuard(int& argc, char* argv[]) { - sg_init = false; -#ifdef KOKKOS_ENABLE_DEPRECATION_WARNINGS - if (is_initialized()) { - std::cerr << Impl::scopeguard_create_while_initialized_warning() - << std::endl; - } - if (is_finalized()) { - std::cerr << Impl::scopeguard_create_after_finalize_warning() - << std::endl; - } -#endif - if (!is_initialized()) { - initialize(argc, argv); - sg_init = true; - } - } - -#if defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard) >= 201907 - KOKKOS_ATTRIBUTE_NODISCARD -#endif - explicit ScopeGuard( - const InitializationSettings& settings = InitializationSettings()) { - sg_init = false; -#ifdef KOKKOS_ENABLE_DEPRECATION_WARNINGS - if (is_initialized()) { - std::cerr << Impl::scopeguard_create_while_initialized_warning() - << std::endl; - } - if (is_finalized()) { - std::cerr << Impl::scopeguard_create_after_finalize_warning() - << std::endl; - } -#endif - if (!is_initialized()) { - initialize(settings); - sg_init = true; - } - } - - ~ScopeGuard() { -#ifdef KOKKOS_ENABLE_DEPRECATION_WARNINGS - if (is_finalized()) { - std::cerr << Impl::scopeguard_destruct_after_finalize_warning() - << std::endl; - } -#endif - if (is_initialized() && sg_init) { - finalize(); - } - } - - private: - bool sg_init; - - public: - ScopeGuard& operator=(const ScopeGuard&) = delete; - ScopeGuard& operator=(ScopeGuard&&) = delete; - ScopeGuard(const ScopeGuard&) = delete; - ScopeGuard(ScopeGuard&&) = delete; -}; - -#else // ifndef KOKKOS_ENABLE_DEPRECATED_CODE3 - -class KOKKOS_ATTRIBUTE_NODISCARD ScopeGuard { - public: -#if defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard) >= 201907 - KOKKOS_ATTRIBUTE_NODISCARD -#endif - ScopeGuard(int& argc, char* argv[]) { + ScopeGuard(Args&&... args) { if (is_initialized()) { Kokkos::abort( Impl::scopeguard_create_while_initialized_warning().c_str()); @@ -309,22 +231,7 @@ class KOKKOS_ATTRIBUTE_NODISCARD ScopeGuard { if (is_finalized()) { Kokkos::abort(Impl::scopeguard_create_after_finalize_warning().c_str()); } - initialize(argc, argv); - } - -#if defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard) >= 201907 - KOKKOS_ATTRIBUTE_NODISCARD -#endif - ScopeGuard( - const InitializationSettings& settings = InitializationSettings()) { - if (is_initialized()) { - Kokkos::abort( - Impl::scopeguard_create_while_initialized_warning().c_str()); - } - if (is_finalized()) { - Kokkos::abort(Impl::scopeguard_create_after_finalize_warning().c_str()); - } - initialize(settings); + initialize(static_cast(args)...); } ~ScopeGuard() { @@ -339,7 +246,6 @@ class KOKKOS_ATTRIBUTE_NODISCARD ScopeGuard { ScopeGuard(const ScopeGuard&) = delete; ScopeGuard(ScopeGuard&&) = delete; }; -#endif } // namespace Kokkos @@ -350,22 +256,20 @@ namespace Experimental { // Customization point for backends // Default behavior is to return the passed in instance template -std::vector partition_space(ExecSpace space, Args...) { +std::vector partition_space(ExecSpace const& space, Args...) { static_assert(is_execution_space::value, "Kokkos Error: partition_space expects an Execution Space as " "first argument"); -#ifdef __cpp_fold_expressions static_assert( (... && std::is_arithmetic_v), "Kokkos Error: partitioning arguments must be integers or floats"); -#endif std::vector instances(sizeof...(Args)); for (int s = 0; s < int(sizeof...(Args)); s++) instances[s] = space; return instances; } template -std::vector partition_space(ExecSpace space, +std::vector partition_space(ExecSpace const& space, std::vector& weights) { static_assert(is_execution_space::value, "Kokkos Error: partition_space expects an Execution Space as " @@ -395,6 +299,18 @@ std::vector partition_space(ExecSpace space, // Specializations required after core definitions #include +//---------------------------------------------------------------------------- +// Redefinition of the macros min and max if we pushed them at entry of +// Kokkos_Core.hpp +#if defined(KOKKOS_IMPL_PUSH_MACRO_MIN) +#pragma pop_macro("min") +#undef KOKKOS_IMPL_PUSH_MACRO_MIN +#endif +#if defined(KOKKOS_IMPL_PUSH_MACRO_MAX) +#pragma pop_macro("max") +#undef KOKKOS_IMPL_PUSH_MACRO_MAX +#endif + //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/Kokkos_Core_fwd.hpp b/lib/kokkos/core/src/Kokkos_Core_fwd.hpp index 2bb323b4a6..a0b4df0c4b 100644 --- a/lib/kokkos/core/src/Kokkos_Core_fwd.hpp +++ b/lib/kokkos/core/src/Kokkos_Core_fwd.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_CORE_FWD_HPP #define KOKKOS_CORE_FWD_HPP @@ -134,8 +106,7 @@ using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = Cuda; using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = Experimental::OpenMPTarget; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_HIP) -using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = - Experimental::HIP; +using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = HIP; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SYCL) using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = Experimental::SYCL; @@ -153,7 +124,7 @@ using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = Serial; #else #error \ - "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::Cuda, Kokkos::Experimental::HIP, Kokkos::Experimental::SYCL, Kokkos::Experimental::OpenMPTarget, Kokkos::Experimental::OpenACC, Kokkos::OpenMP, Kokkos::Threads, Kokkos::Experimental::HPX, or Kokkos::Serial." + "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::Cuda, Kokkos::HIP, Kokkos::Experimental::SYCL, Kokkos::Experimental::OpenMPTarget, Kokkos::Experimental::OpenACC, Kokkos::OpenMP, Kokkos::Threads, Kokkos::Experimental::HPX, or Kokkos::Serial." #endif #if defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP) @@ -185,6 +156,50 @@ using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION = "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::OpenMP, Kokkos::Threads, Kokkos::Experimental::HPX, or Kokkos::Serial." #endif +// check for devices that support sharedSpace +#if defined(KOKKOS_ENABLE_CUDA) +using SharedSpace = CudaUVMSpace; +#define KOKKOS_HAS_SHARED_SPACE +#elif defined(KOKKOS_ENABLE_HIP) +using SharedSpace = HIPManagedSpace; +#define KOKKOS_HAS_SHARED_SPACE +#elif defined(KOKKOS_ENABLE_SYCL) +using SharedSpace = Experimental::SYCLSharedUSMSpace; +#define KOKKOS_HAS_SHARED_SPACE +// if only host compile point to HostSpace +#elif !defined(KOKKOS_ENABLE_OPENACC) && !defined(KOKKOS_ENABLE_OPENMPTARGET) +using SharedSpace = HostSpace; +#define KOKKOS_HAS_SHARED_SPACE +#endif + +inline constexpr bool has_shared_space = +#if defined KOKKOS_HAS_SHARED_SPACE + true; +#else + false; +#endif + +#if defined(KOKKOS_ENABLE_CUDA) +using SharedHostPinnedSpace = CudaHostPinnedSpace; +#define KOKKOS_HAS_SHARED_HOST_PINNED_SPACE +#elif defined(KOKKOS_ENABLE_HIP) +using SharedHostPinnedSpace = HIPHostPinnedSpace; +#define KOKKOS_HAS_SHARED_HOST_PINNED_SPACE +#elif defined(KOKKOS_ENABLE_SYCL) + using SharedHostPinnedSpace = Experimental::SYCLHostUSMSpace; +#define KOKKOS_HAS_SHARED_HOST_PINNED_SPACE +#elif !defined(KOKKOS_ENABLE_OPENACC) && !defined(KOKKOS_ENABLE_OPENMPTARGET) + using SharedHostPinnedSpace = HostSpace; +#define KOKKOS_HAS_SHARED_HOST_PINNED_SPACE +#endif + +inline constexpr bool has_shared_host_pinned_space = +#if defined KOKKOS_HAS_SHARED_HOST_PINNED_SPACE + true; +#else + false; +#endif + } // namespace Kokkos //---------------------------------------------------------------------------- @@ -241,42 +256,6 @@ KOKKOS_FUNCTION void runtime_check_memory_access_violation( msg);)) } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - -#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA) && \ - defined(KOKKOS_ENABLE_CUDA) -using ActiveExecutionMemorySpace KOKKOS_DEPRECATED = Kokkos::CudaSpace; -#elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_SYCL) -using ActiveExecutionMemorySpace KOKKOS_DEPRECATED = - Kokkos::Experimental::SYCLDeviceUSMSpace; -#elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HIP_GPU) -using ActiveExecutionMemorySpace KOKKOS_DEPRECATED = - Kokkos::Experimental::HIPSpace; -#elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) -using ActiveExecutionMemorySpace KOKKOS_DEPRECATED = Kokkos::HostSpace; -#else -using ActiveExecutionMemorySpace KOKKOS_DEPRECATED = void; -#endif - -template -struct MemorySpaceAccess; - -template ::accessible> -struct verify_space { - KOKKOS_DEPRECATED KOKKOS_FUNCTION static void check() {} -}; - -template -struct verify_space { - KOKKOS_DEPRECATED KOKKOS_FUNCTION static void check() { - Kokkos::abort( - "Kokkos::View ERROR: attempt to access inaccessible memory space"); - }; -}; -#endif - } // namespace Impl namespace Experimental { @@ -286,16 +265,6 @@ class LogicalMemorySpace; } // namespace Kokkos -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 -#define KOKKOS_RESTRICT_EXECUTION_TO_DATA(DATA_SPACE, DATA_PTR) \ - Kokkos::Impl::verify_space::check(); - -#define KOKKOS_RESTRICT_EXECUTION_TO_(DATA_SPACE) \ - Kokkos::Impl::verify_space::check(); -#endif - //---------------------------------------------------------------------------- namespace Kokkos { diff --git a/lib/kokkos/core/src/Kokkos_Crs.hpp b/lib/kokkos/core/src/Kokkos_Crs.hpp index 9c0d1f6821..92931b5849 100644 --- a/lib/kokkos/core/src/Kokkos_Crs.hpp +++ b/lib/kokkos/core/src/Kokkos_Crs.hpp @@ -1,55 +1,23 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_CRS_HPP #define KOKKOS_CRS_HPP @@ -336,11 +304,11 @@ struct CountAndFillBase { Functor m_functor; counts_type m_counts; struct Count {}; - inline void operator()(Count, size_type i) const { + KOKKOS_FUNCTION void operator()(Count, size_type i) const { m_counts(i) = m_functor(i, nullptr); } struct Fill {}; - inline void operator()(Fill, size_type i) const { + KOKKOS_FUNCTION void operator()(Fill, size_type i) const { auto j = m_crs.row_map(i); /* we don't want to access entries(entries.size()), even if its just to get its address and never use it. this can happen when row (i) is empty and @@ -355,42 +323,6 @@ struct CountAndFillBase { CountAndFillBase(CrsType& crs, Functor const& f) : m_crs(crs), m_functor(f) {} }; -#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP) -#if defined(KOKKOS_ENABLE_CUDA) -#define EXEC_SPACE Kokkos::Cuda -#elif defined(KOKKOS_ENABLE_HIP) -#define EXEC_SPACE Kokkos::Experimental::HIP -#endif -template -struct CountAndFillBase { - using data_type = typename CrsType::data_type; - using size_type = typename CrsType::size_type; - using row_map_type = typename CrsType::row_map_type; - using counts_type = row_map_type; - CrsType m_crs; - Functor m_functor; - counts_type m_counts; - struct Count {}; - __device__ inline void operator()(Count, size_type i) const { - m_counts(i) = m_functor(i, nullptr); - } - struct Fill {}; - __device__ inline void operator()(Fill, size_type i) const { - auto j = m_crs.row_map(i); - /* we don't want to access entries(entries.size()), even if its just to get - its address and never use it. this can happen when row (i) is empty and - all rows after it are also empty. 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(m_crs.entries.extent(0))) - ? nullptr - : (&(m_crs.entries(j))); - m_functor(i, fill); - } - CountAndFillBase(CrsType& crs, Functor const& f) : m_crs(crs), m_functor(f) {} -}; -#endif - template struct CountAndFill : public CountAndFillBase { using base_type = CountAndFillBase; diff --git a/lib/kokkos/core/src/Kokkos_Cuda.hpp b/lib/kokkos/core/src/Kokkos_Cuda.hpp index 72a00f41b7..fce7351b32 100644 --- a/lib/kokkos/core/src/Kokkos_Cuda.hpp +++ b/lib/kokkos/core/src/Kokkos_Cuda.hpp @@ -1,55 +1,23 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_CUDA_HPP #define KOKKOS_CUDA_HPP @@ -198,7 +166,11 @@ class Cuda { "Kokkos::Cuda::fence(): Unnamed Instance Fence") const; /** \brief Return the maximum amount of concurrency. */ +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4 static int concurrency(); +#else + int concurrency() const; +#endif //! Print configuration information to the given output stream. void print_configuration(std::ostream& os, bool verbose = false) const; @@ -249,6 +221,13 @@ class Cuda { uint32_t impl_instance_id() const noexcept; private: + friend bool operator==(Cuda const& lhs, Cuda const& rhs) { + return lhs.impl_internal_space_instance() == + rhs.impl_internal_space_instance(); + } + friend bool operator!=(Cuda const& lhs, Cuda const& rhs) { + return !(lhs == rhs); + } Kokkos::Impl::HostSharedPtr m_space_instance; }; diff --git a/lib/kokkos/core/src/Kokkos_CudaSpace.hpp b/lib/kokkos/core/src/Kokkos_CudaSpace.hpp index 7ec78c0211..eec9999f61 100644 --- a/lib/kokkos/core/src/Kokkos_CudaSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_CudaSpace.hpp @@ -1,55 +1,23 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_IMPL_PUBLIC_INCLUDE #include -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE_3 static_assert(false, "Including non-public Kokkos header files is not allowed."); -#else -KOKKOS_IMPL_WARNING("Including non-public Kokkos header files is not allowed.") -#endif #endif #ifndef KOKKOS_CUDASPACE_HPP #define KOKKOS_CUDASPACE_HPP @@ -143,13 +111,6 @@ class CudaSpace { /**\brief Return Name of the MemorySpace */ static constexpr const char* name() { return m_name; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - /*--------------------------------*/ - /** \brief Error reporting for HostSpace attempt to access CudaSpace */ - KOKKOS_DEPRECATED static void access_error(); - KOKKOS_DEPRECATED static void access_error(const void* const); -#endif - private: int m_device; ///< Which Cuda device @@ -178,13 +139,9 @@ class CudaUVMSpace { using device_type = Kokkos::Device; using size_type = unsigned int; +#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4 /** \brief If UVM capability is available */ - static bool available(); - -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_3 - /*--------------------------------*/ - /** \brief CudaUVMSpace specific routine */ - KOKKOS_DEPRECATED static int number_of_allocations(); + KOKKOS_DEPRECATED static bool available(); #endif /*--------------------------------*/ diff --git a/lib/kokkos/core/src/Kokkos_DetectionIdiom.hpp b/lib/kokkos/core/src/Kokkos_DetectionIdiom.hpp index d456938191..ae28805a42 100644 --- a/lib/kokkos/core/src/Kokkos_DetectionIdiom.hpp +++ b/lib/kokkos/core/src/Kokkos_DetectionIdiom.hpp @@ -1,46 +1,18 @@ -/* //@HEADER // ************************************************************************ // -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // 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: +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// 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 NTESS "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 NTESS 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_DETECTION_IDIOM_HPP #define KOKKOS_DETECTION_IDIOM_HPP #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE @@ -48,7 +20,9 @@ #define KOKKOS_IMPL_PUBLIC_INCLUDE_NOTDEFINED_DETECTIONIDIOM #endif -#include // void_t +#include // FIXME doesn't actually need it if it wasn't + // for the header self-containment test + #include // NOTE This header implements the detection idiom from Version 2 of the C++ @@ -73,7 +47,7 @@ struct detector { // specialization recognizes and handles only types supporting Op template class Op, class... Args> -struct detector>, Op, Args...> { +struct detector>, Op, Args...> { using value_t = std::true_type; using type = Op; }; @@ -102,7 +76,6 @@ template class Op, class... Args> using is_detected_convertible = std::is_convertible, To>; -#ifdef KOKKOS_ENABLE_CXX17 template